Merge conflict 1
This commit is contained in:
parent
6b1b1646a3
commit
09c81a117a
20
src/main/java/tech/nevets/vplus/items/VPFuels.java
Normal file
20
src/main/java/tech/nevets/vplus/items/VPFuels.java
Normal file
@ -0,0 +1,20 @@
|
||||
package tech.nevets.vplus.items;
|
||||
|
||||
import net.fabricmc.fabric.api.registry.FuelRegistry;
|
||||
import net.minecraft.item.ItemConvertible;
|
||||
import tech.nevets.vplus.blocks.VPBlocks;
|
||||
|
||||
public class VPFuels {
|
||||
|
||||
public VPFuels() {}
|
||||
|
||||
static {
|
||||
register(VPBlocks.SATURATED_LAVA_SPONGE_BLOCK, 20000);
|
||||
}
|
||||
|
||||
private static void register(ItemConvertible fuel, int duration) {
|
||||
FuelRegistry.INSTANCE.add(fuel, duration);
|
||||
}
|
||||
|
||||
public static void init() {}
|
||||
}
|
@ -1,10 +1,14 @@
|
||||
package tech.nevets.vplus.items;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ToolItem;
|
||||
import net.minecraft.item.ToolMaterial;
|
||||
import net.minecraft.util.Identifier;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import tech.nevets.vplus.items.tools.*;
|
||||
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
|
||||
public class VPTools {
|
||||
|
||||
public VPTools() {}
|
||||
@ -25,5 +29,23 @@ public class VPTools {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", material.getName() + "_sword"), new SwordBase(material, new Item.Settings()));
|
||||
}
|
||||
|
||||
private static void register(VPMaterials material, Class<? extends ToolItem> T, String toolName) {
|
||||
try {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", material.getName() + "_" + toolName), T.getConstructor(ToolMaterial.class, Item.Settings.class).newInstance(material, new Item.Settings().group(VPItemGroups.TOOLS)));
|
||||
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
private static void registerAll(VPMaterials[] materials, Class<? extends ToolItem> T, String toolName) {
|
||||
for (VPMaterials material : materials) {
|
||||
try {
|
||||
Registry.register(Registry.ITEM, new Identifier("vplus", material.getName() + "_" + toolName), T.getConstructor(ToolMaterial.class, Item.Settings.class).newInstance(material, new Item.Settings().group(VPItemGroups.TOOLS)));
|
||||
} catch (InvocationTargetException | InstantiationException | IllegalAccessException | NoSuchMethodException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void init() {}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user