From 6741267532518f5226a84bcf2b6f8079ab3f735f Mon Sep 17 00:00:00 2001 From: kalucky0 Date: Sat, 11 Jan 2025 13:22:29 +0100 Subject: [PATCH] Partially update to 1.19.3 --- build.gradle | 2 +- gradle.properties | 37 +- gradle/wrapper/gradle-wrapper.properties | 2 +- .../cr24/primeval/block/CollapsibleBlock.java | 2 +- .../cr24/primeval/block/GrassySoilBlock.java | 6 +- .../primeval/block/PrimevalBlockTags.java | 6 +- .../cr24/primeval/block/PrimevalBlocks.java | 34 +- .../primeval/block/PrimevalDoorBlock.java | 3 +- .../primeval/block/PrimevalFarmlandBlock.java | 2 +- .../primeval/block/PrimevalTrapdoorBlock.java | 3 +- .../entity/LayingItemBlockEntityRenderer.java | 11 +- .../PrimevalCampfireBlockEntityRenderer.java | 6 +- .../entity/QuernBlockEntityRenderer.java | 8 +- .../block/functional/LogPileBlock.java | 2 +- .../functional/SuspendedLadderBlock.java | 2 +- .../block/functional/TimedTorchBlock.java | 4 +- .../cr24/primeval/block/plant/LeafBlock.java | 2 +- .../block/plant/PrimevalWaterPlantBlock.java | 4 +- .../cr24/primeval/block/plant/ReedsBlock.java | 2 +- .../cr24/primeval/block/plant/TrunkBlock.java | 2 +- .../entity/CollapsingBlockEntity.java | 3 +- .../cr24/primeval/fluid/PrimevalFluids.java | 7 +- .../cr24/primeval/item/PrimevalItemTags.java | 6 +- .../net/cr24/primeval/item/PrimevalItems.java | 333 +++++++++--------- .../cr24/primeval/item/tool/EmptyJugItem.java | 2 +- .../primeval/item/tool/WoodenBucketItem.java | 2 +- .../cr24/primeval/recipe/AlloyingRecipe.java | 7 +- .../recipe/ClayMoldCastingRecipe.java | 25 +- .../primeval/recipe/ItemDamagingRecipe.java | 17 +- .../cr24/primeval/recipe/MeltingRecipe.java | 5 +- .../cr24/primeval/recipe/PrimevalRecipes.java | 27 +- .../screen/Primeval3x5ContainerScreen.java | 2 +- .../PrimevalContainerScreenHandler.java | 2 +- .../primeval/util/PrimevalSoundEvents.java | 5 +- .../net/cr24/primeval/util/PrimevalUtil.java | 2 +- .../cr24/primeval/world/PrimevalWorld.java | 10 +- .../world/gen/feature/OreClusterFeature.java | 4 +- .../world/gen/feature/PrimevalFeatures.java | 11 +- .../world/gen/feature/TrunkedTreeFeature.java | 2 +- .../gen/structure/OreFieldGenerator.java | 42 +-- .../gen/structure/PrimevalStructures.java | 14 +- src/main/resources/fabric.mod.json | 3 +- 42 files changed, 351 insertions(+), 320 deletions(-) diff --git a/build.gradle b/build.gradle index b213130..cec6ea6 100644 --- a/build.gradle +++ b/build.gradle @@ -1,5 +1,5 @@ plugins { - id 'fabric-loom' version '0.12-SNAPSHOT' + id 'fabric-loom' version '1.9-SNAPSHOT' id 'maven-publish' } diff --git a/gradle.properties b/gradle.properties index eb537b8..6e73650 100644 --- a/gradle.properties +++ b/gradle.properties @@ -1,27 +1,26 @@ # Done to increase the memory available to gradle. -org.gradle.jvmargs=-Xmx2G +org.gradle.jvmargs=-Xmx4G # Fabric Properties - # check these on https://fabricmc.net/develop/ - minecraft_version=1.19.2 - yarn_mappings=1.19.2+build.3 - loader_version=0.14.11 +# check these on https://fabricmc.net/develop/ +minecraft_version=1.19.3 +yarn_mappings=1.19.3+build.5 +loader_version=0.16.10 - #Fabric api - fabric_version=0.59.0+1.19.2 +#Fabric api +fabric_version=0.76.1+1.19.3 # Dependency Properties - architectury_version=6.2.43 - rei_version=9.1.526 - incubus_version=1.9.4 - trinkets_version=3.4.0 - cc_version=5.0.1 - satin_version=1.9.0 - reach_version=2.3.0 - modmenu_version=4.0.6 - +architectury_version=6.6.92 +rei_version=9.2.784 +incubus_version=1.9.4 +trinkets_version=3.4.1 +cc_version=5.0.2 +satin_version=1.9.1 +reach_version=2.3.0 +modmenu_version=4.1.2 # Mod Properties - mod_version = 0.0.3-dev - maven_group = net.cr24 - archives_base_name = primeval +mod_version=0.0.3-dev +maven_group=net.cr24 +archives_base_name=primeval diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 54e9a60..348fbf3 100644 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.3-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.12-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists \ No newline at end of file diff --git a/src/main/java/net/cr24/primeval/block/CollapsibleBlock.java b/src/main/java/net/cr24/primeval/block/CollapsibleBlock.java index 58bbf52..cb8b88d 100644 --- a/src/main/java/net/cr24/primeval/block/CollapsibleBlock.java +++ b/src/main/java/net/cr24/primeval/block/CollapsibleBlock.java @@ -31,7 +31,7 @@ public CollapsibleBlock(Settings settings) { @Override public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { if (!(neighborState.getBlock() instanceof FluidBlock)) { - world.createAndScheduleBlockTick(pos, this, this.getFallDelay()); + world.scheduleBlockTick(pos, this, this.getFallDelay()); } return state; } diff --git a/src/main/java/net/cr24/primeval/block/GrassySoilBlock.java b/src/main/java/net/cr24/primeval/block/GrassySoilBlock.java index 9fde7e0..49da8e8 100644 --- a/src/main/java/net/cr24/primeval/block/GrassySoilBlock.java +++ b/src/main/java/net/cr24/primeval/block/GrassySoilBlock.java @@ -2,12 +2,12 @@ import net.minecraft.block.*; import net.minecraft.item.ItemPlacementContext; +import net.minecraft.registry.tag.BlockTags; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager; import net.minecraft.state.property.BooleanProperty; import net.minecraft.state.property.Properties; -import net.minecraft.tag.BlockTags; -import net.minecraft.tag.FluidTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; @@ -55,7 +55,7 @@ public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random if (world.getLightLevel(pos.up()) >= 9) { BlockState blockState = this.getDefaultState(); - for(int i = 0; i < 4; ++i) { + for (int i = 0; i < 4; ++i) { BlockPos blockPos = pos.add(random.nextInt(3) - 1, random.nextInt(5) - 3, random.nextInt(3) - 1); Block block = world.getBlockState(blockPos).getBlock(); if (grass_spreadable.containsKey(block) && canSpread(blockState, world, blockPos)) { diff --git a/src/main/java/net/cr24/primeval/block/PrimevalBlockTags.java b/src/main/java/net/cr24/primeval/block/PrimevalBlockTags.java index bc7befe..ab36f9a 100644 --- a/src/main/java/net/cr24/primeval/block/PrimevalBlockTags.java +++ b/src/main/java/net/cr24/primeval/block/PrimevalBlockTags.java @@ -2,8 +2,8 @@ import net.cr24.primeval.PrimevalMain; import net.minecraft.block.Block; -import net.minecraft.tag.TagKey; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; public class PrimevalBlockTags { @@ -33,6 +33,6 @@ public class PrimevalBlockTags { public static final TagKey MINEABLE_CHISEL = register("mineable/chisel"); private static TagKey register(String id) { - return TagKey.of(Registry.BLOCK_KEY, PrimevalMain.getId(id)); + return TagKey.of(RegistryKeys.BLOCK, PrimevalMain.getId(id)); } } diff --git a/src/main/java/net/cr24/primeval/block/PrimevalBlocks.java b/src/main/java/net/cr24/primeval/block/PrimevalBlocks.java index 44abb40..e558958 100644 --- a/src/main/java/net/cr24/primeval/block/PrimevalBlocks.java +++ b/src/main/java/net/cr24/primeval/block/PrimevalBlocks.java @@ -30,9 +30,11 @@ import net.minecraft.fluid.FlowableFluid; import net.minecraft.item.Item; import net.minecraft.item.ItemGroup; +import net.minecraft.registry.Registries; import net.minecraft.screen.ScreenHandlerType; import net.minecraft.sound.BlockSoundGroup; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; +import net.minecraft.sound.SoundEvents; import org.jetbrains.annotations.NotNull; import java.util.Arrays; @@ -192,7 +194,7 @@ public class PrimevalBlocks { public static final Block PIT_KILN = registerBlockWithoutItem("pit_kiln", new PitKilnBlock(FabricBlockSettings.of(Material.PLANT).strength(1.0F).sounds(BlockSoundGroup.GRASS).nonOpaque())); public static final Block CRUDE_CRAFTING_BENCH = registerBlock("crude_crafting_bench", new PrimevalCraftingTableBlock(SETTINGS_REFINED_WOOD()), Weight.HEAVY, Size.LARGE, PRIMEVAL_BLOCKS); public static final Block CRUDE_TORCH = registerBlock("crude_torch", new TimedTorchBlock(FabricBlockSettings.of((new Material.Builder(MapColor.OAK_TAN)).allowsMovement().notSolid().build()).sounds(BlockSoundGroup.WOOD).breakInstantly().noCollision().luminance(TimedTorchBlock::getLuminanceFromState).ticksRandomly()), Weight.LIGHT, Size.SMALL, PRIMEVAL_BLOCKS); //todo - public static final Item LIT_CRUDE_TORCH = Registry.register(Registry.ITEM, PrimevalMain.getId("crude_torch_lit"), new WeightedBlockItem(CRUDE_TORCH, new FabricItemSettings().maxCount(Size.SMALL.getStackSize()), Weight.LIGHT, Size.SMALL)); + public static final Item LIT_CRUDE_TORCH = Registry.register(Registries.ITEM, PrimevalMain.getId("crude_torch_lit"), new WeightedBlockItem(CRUDE_TORCH, new FabricItemSettings().maxCount(Size.SMALL.getStackSize()), Weight.LIGHT, Size.SMALL)); public static final Block CAMPFIRE = registerBlock("campfire", new PrimevalCampfireBlock(SETTINGS_STONE().luminance(PrimevalCampfireBlock::getLuminanceFromState).nonOpaque()), Weight.HEAVY, Size.LARGE, null); public static final Block QUERN = registerBlock("quern", new QuernBlock(SETTINGS_STONE().nonOpaque()), Weight.HEAVY, Size.LARGE, PRIMEVAL_BLOCKS); @@ -209,15 +211,15 @@ public class PrimevalBlocks { // Block entities - public static final BlockEntityType PIT_KILN_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("pit_kiln_block_entity"), FabricBlockEntityTypeBuilder.create(PitKilnBlockEntity::new, PIT_KILN).build()); - public static final BlockEntityType ASH_PILE_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("ash_pile_block_entity"), FabricBlockEntityTypeBuilder.create(AshPileBlockEntity::new, ASH_PILE).build()); - public static final BlockEntityType LAYING_ITEM_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("laying_item_block_entity"), FabricBlockEntityTypeBuilder.create(LayingItemBlockEntity::new, LAYING_ITEM).build()); - public static final BlockEntityType LOG_PILE_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("log_pile_block_entity"), FabricBlockEntityTypeBuilder.create(LogPileBlockEntity::new, OAK_LOG_PILE, BIRCH_LOG_PILE, SPRUCE_LOG_PILE).build()); - public static final BlockEntityType CRATE_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("crate_block_entity"), FabricBlockEntityTypeBuilder.create(CrateBlockEntity::new, OAK_CRATE, BIRCH_CRATE, SPRUCE_CRATE).build()); - public static final BlockEntityType LARGE_POT_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("large_pot_block_entity"), FabricBlockEntityTypeBuilder.create(StoragePotBlockEntity::new, LARGE_FIRED_CLAY_POT).build()); - public static final BlockEntityType WICKER_BASKET_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("wicker_basket_block_entity"), FabricBlockEntityTypeBuilder.create(WickerBasketBlockEntity::new, WICKER_BASKET).build()); - public static final BlockEntityType CAMPFIRE_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("campfire_block_entity"), FabricBlockEntityTypeBuilder.create(PrimevalCampfireBlockEntity::new, CAMPFIRE).build()); - public static final BlockEntityType QUERN_BLOCK_ENTITY = Registry.register(Registry.BLOCK_ENTITY_TYPE, PrimevalMain.getId("quern_block_entity"), FabricBlockEntityTypeBuilder.create(QuernBlockEntity::new, QUERN).build()); + public static final BlockEntityType PIT_KILN_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("pit_kiln_block_entity"), FabricBlockEntityTypeBuilder.create(PitKilnBlockEntity::new, PIT_KILN).build()); + public static final BlockEntityType ASH_PILE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("ash_pile_block_entity"), FabricBlockEntityTypeBuilder.create(AshPileBlockEntity::new, ASH_PILE).build()); + public static final BlockEntityType LAYING_ITEM_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("laying_item_block_entity"), FabricBlockEntityTypeBuilder.create(LayingItemBlockEntity::new, LAYING_ITEM).build()); + public static final BlockEntityType LOG_PILE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("log_pile_block_entity"), FabricBlockEntityTypeBuilder.create(LogPileBlockEntity::new, OAK_LOG_PILE, BIRCH_LOG_PILE, SPRUCE_LOG_PILE).build()); + public static final BlockEntityType CRATE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("crate_block_entity"), FabricBlockEntityTypeBuilder.create(CrateBlockEntity::new, OAK_CRATE, BIRCH_CRATE, SPRUCE_CRATE).build()); + public static final BlockEntityType LARGE_POT_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("large_pot_block_entity"), FabricBlockEntityTypeBuilder.create(StoragePotBlockEntity::new, LARGE_FIRED_CLAY_POT).build()); + public static final BlockEntityType WICKER_BASKET_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("wicker_basket_block_entity"), FabricBlockEntityTypeBuilder.create(WickerBasketBlockEntity::new, WICKER_BASKET).build()); + public static final BlockEntityType CAMPFIRE_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("campfire_block_entity"), FabricBlockEntityTypeBuilder.create(PrimevalCampfireBlockEntity::new, CAMPFIRE).build()); + public static final BlockEntityType QUERN_BLOCK_ENTITY = Registry.register(Registries.BLOCK_ENTITY_TYPE, PrimevalMain.getId("quern_block_entity"), FabricBlockEntityTypeBuilder.create(QuernBlockEntity::new, QUERN).build()); // Screen Handlers public static final ScreenHandlerType CRATE_SCREEN_HANDLER = ScreenHandlerRegistry.registerSimple(PrimevalMain.getId("crate_screen_handler"), PrimevalContainerScreenHandler::new); @@ -355,17 +357,17 @@ private static void registerHoeables() { } private static Block registerBlockWithoutItem(String id, Block block) { - return Registry.register(Registry.BLOCK, PrimevalMain.getId(id), block); + return Registry.register(Registries.BLOCK, PrimevalMain.getId(id), block); } private static V registerBlock(String id, V block, Weight weight, Size size, ItemGroup itemgroup) { if (itemgroup == null) { - Registry.register(Registry.ITEM, PrimevalMain.getId(id), new WeightedBlockItem(block, new FabricItemSettings().maxCount(size.getStackSize()), weight, size)); + Registry.register(Registries.ITEM, PrimevalMain.getId(id), new WeightedBlockItem(block, new FabricItemSettings().maxCount(size.getStackSize()), weight, size)); } else { - Registry.register(Registry.ITEM, PrimevalMain.getId(id), new WeightedBlockItem(block, new FabricItemSettings().group(itemgroup).maxCount(size.getStackSize()), weight, size)); + Registry.register(Registries.ITEM, PrimevalMain.getId(id), new WeightedBlockItem(block, new FabricItemSettings().group(itemgroup).maxCount(size.getStackSize()), weight, size)); } - return Registry.register(Registry.BLOCK, PrimevalMain.getId(id), block); + return Registry.register(Registries.BLOCK, PrimevalMain.getId(id), block); } private static Block registerMoltenFluid(String id, FlowableFluid fluid) { @@ -438,7 +440,7 @@ private static WoodBlockSet registerWoodBlockSet(String block_id, String stairs_ registerBlock(panel_id, new Block(settings), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS), registerBlock(fence_id, new FenceBlock(settings), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS), registerBlock(log_fence_id, new FenceBlock(settings), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS), - registerBlock(fence_gate_id, new FenceGateBlock(settings), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS), + registerBlock(fence_gate_id, new FenceGateBlock(settings, SoundEvents.BLOCK_FENCE_GATE_CLOSE, SoundEvents.BLOCK_FENCE_GATE_OPEN), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS), registerBlock(door_id, new PrimevalDoorBlock(settings.nonOpaque()), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS), registerBlock(trapdoor_id, new PrimevalTrapdoorBlock(settings.nonOpaque()), Weight.LIGHT, Size.MEDIUM, PRIMEVAL_BLOCKS) ); diff --git a/src/main/java/net/cr24/primeval/block/PrimevalDoorBlock.java b/src/main/java/net/cr24/primeval/block/PrimevalDoorBlock.java index 6f9b927..f4e8ad3 100644 --- a/src/main/java/net/cr24/primeval/block/PrimevalDoorBlock.java +++ b/src/main/java/net/cr24/primeval/block/PrimevalDoorBlock.java @@ -1,9 +1,10 @@ package net.cr24.primeval.block; import net.minecraft.block.DoorBlock; +import net.minecraft.sound.SoundEvents; public class PrimevalDoorBlock extends DoorBlock { protected PrimevalDoorBlock(Settings settings) { - super(settings); + super(settings, SoundEvents.BLOCK_WOODEN_DOOR_CLOSE, SoundEvents.BLOCK_WOODEN_DOOR_CLOSE); } } diff --git a/src/main/java/net/cr24/primeval/block/PrimevalFarmlandBlock.java b/src/main/java/net/cr24/primeval/block/PrimevalFarmlandBlock.java index 3e2d2e1..d414947 100644 --- a/src/main/java/net/cr24/primeval/block/PrimevalFarmlandBlock.java +++ b/src/main/java/net/cr24/primeval/block/PrimevalFarmlandBlock.java @@ -2,11 +2,11 @@ import net.cr24.primeval.item.tool.PrimevalHoeItem; import net.minecraft.block.*; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.server.world.ServerWorld; import net.minecraft.state.StateManager; import net.minecraft.state.property.EnumProperty; import net.minecraft.state.property.IntProperty; -import net.minecraft.tag.FluidTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.math.random.Random; diff --git a/src/main/java/net/cr24/primeval/block/PrimevalTrapdoorBlock.java b/src/main/java/net/cr24/primeval/block/PrimevalTrapdoorBlock.java index 86409d6..ef7d26b 100644 --- a/src/main/java/net/cr24/primeval/block/PrimevalTrapdoorBlock.java +++ b/src/main/java/net/cr24/primeval/block/PrimevalTrapdoorBlock.java @@ -1,9 +1,10 @@ package net.cr24.primeval.block; import net.minecraft.block.TrapdoorBlock; +import net.minecraft.sound.SoundEvents; public class PrimevalTrapdoorBlock extends TrapdoorBlock { public PrimevalTrapdoorBlock(Settings settings) { - super(settings); + super(settings, SoundEvents.BLOCK_WOODEN_TRAPDOOR_OPEN, SoundEvents.BLOCK_WOODEN_TRAPDOOR_CLOSE); } } diff --git a/src/main/java/net/cr24/primeval/block/entity/LayingItemBlockEntityRenderer.java b/src/main/java/net/cr24/primeval/block/entity/LayingItemBlockEntityRenderer.java index a758ca8..52943b5 100644 --- a/src/main/java/net/cr24/primeval/block/entity/LayingItemBlockEntityRenderer.java +++ b/src/main/java/net/cr24/primeval/block/entity/LayingItemBlockEntityRenderer.java @@ -7,11 +7,14 @@ import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; -import net.minecraft.util.math.Vec3f; +import org.joml.Quaternionf; public class LayingItemBlockEntityRenderer implements BlockEntityRenderer { + public final static Quaternionf NEGATIVE_X = new Quaternionf(-1.0f, 0.0f, 0.0f, 0.0f); + public final static Quaternionf POSITIVE_Z = new Quaternionf(0.0f, 0.0f, 0.0f, 1.0f); - public LayingItemBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {} + public LayingItemBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) { + } @Override public void render(LayingItemBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { @@ -19,8 +22,8 @@ public void render(LayingItemBlockEntity entity, float tickDelta, MatrixStack ma int randomInt = entity.getRandomInt(); matrices.translate(0.5, 0.0, 0.5); matrices.scale(1.2f, 1.2f, 1.2f); - matrices.multiply(Vec3f.NEGATIVE_X.getDegreesQuaternion(90)); - matrices.multiply(Vec3f.POSITIVE_Z.getDegreesQuaternion(90*randomInt)); + matrices.multiply(NEGATIVE_X.rotateX(90)); + matrices.multiply(POSITIVE_Z.rotateZ(90 * randomInt)); matrices.translate(0.0, -0.1, -0.0); MinecraftClient.getInstance().getItemRenderer().renderItem(item, ModelTransformation.Mode.GROUND, light, overlay, matrices, vertexConsumers, 0); } diff --git a/src/main/java/net/cr24/primeval/block/entity/PrimevalCampfireBlockEntityRenderer.java b/src/main/java/net/cr24/primeval/block/entity/PrimevalCampfireBlockEntityRenderer.java index 520dbe7..4eb6749 100644 --- a/src/main/java/net/cr24/primeval/block/entity/PrimevalCampfireBlockEntityRenderer.java +++ b/src/main/java/net/cr24/primeval/block/entity/PrimevalCampfireBlockEntityRenderer.java @@ -8,9 +8,11 @@ import net.minecraft.client.util.math.MatrixStack; import net.minecraft.item.ItemStack; import net.minecraft.util.collection.DefaultedList; -import net.minecraft.util.math.Vec3f; +import org.joml.Quaternionf; +import org.joml.Vector3f; public class PrimevalCampfireBlockEntityRenderer implements BlockEntityRenderer { + public final static Quaternionf NEGATIVE_X = new Quaternionf(-1.0f, 0.0f, 0.0f, 0.0f); public PrimevalCampfireBlockEntityRenderer(BlockEntityRendererFactory.Context ctx) {} @@ -18,7 +20,7 @@ public PrimevalCampfireBlockEntityRenderer(BlockEntityRendererFactory.Context ct public void render(PrimevalCampfireBlockEntity entity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, int light, int overlay) { DefaultedList items = entity.getItemsBeingCooked(); matrices.scale(0.6f, 0.5f, 0.6f); - matrices.multiply(Vec3f.NEGATIVE_X.getDegreesQuaternion(90)); + matrices.multiply(NEGATIVE_X.rotateX(90)); matrices.translate(0.25, -0.37, 0.4); MinecraftClient.getInstance().getItemRenderer().renderItem(items.get(0), ModelTransformation.Mode.GROUND, light, overlay, matrices, vertexConsumers, 0); matrices.translate(1.15, 0, 0); diff --git a/src/main/java/net/cr24/primeval/block/entity/QuernBlockEntityRenderer.java b/src/main/java/net/cr24/primeval/block/entity/QuernBlockEntityRenderer.java index f3dfc64..6248802 100644 --- a/src/main/java/net/cr24/primeval/block/entity/QuernBlockEntityRenderer.java +++ b/src/main/java/net/cr24/primeval/block/entity/QuernBlockEntityRenderer.java @@ -9,8 +9,8 @@ import net.minecraft.client.render.block.entity.BlockEntityRendererFactory; import net.minecraft.client.render.model.json.ModelTransformation; import net.minecraft.client.util.math.MatrixStack; -import net.minecraft.util.math.Quaternion; -import net.minecraft.util.math.Vec3f; +import org.joml.Quaternionf; +import org.joml.Vector3f; import net.minecraft.util.math.random.Random; public class QuernBlockEntityRenderer implements BlockEntityRenderer { @@ -25,7 +25,9 @@ public void render(QuernBlockEntity entity, float tickDelta, MatrixStack matrice matrices.translate(0, -sinkProgress, 0); if (entity.wheelDamage == -1) return; - matrices.multiply(new Quaternion(Vec3f.POSITIVE_Y, entity.currentAngle, true)); + // TODO: Test if this is correct + Quaternionf rotation = new Quaternionf(0.0f, 1.0f, 0.0f, 0.0f).rotateY(entity.currentAngle); + matrices.multiply(rotation); MinecraftClient.getInstance().getBlockRenderManager().renderBlock(PrimevalBlocks.QUERN.getDefaultState().with(QuernBlock.WHEELED, true), entity.getPos(), entity.getWorld(), matrices, vertexConsumers.getBuffer(RenderLayer.getCutout()), false, Random.create()); } } diff --git a/src/main/java/net/cr24/primeval/block/functional/LogPileBlock.java b/src/main/java/net/cr24/primeval/block/functional/LogPileBlock.java index fcaccaa..e67736e 100644 --- a/src/main/java/net/cr24/primeval/block/functional/LogPileBlock.java +++ b/src/main/java/net/cr24/primeval/block/functional/LogPileBlock.java @@ -74,7 +74,7 @@ public FluidState getFluidState(BlockState state) { public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { if (state.get(WATERLOGGED)) { - world.createAndScheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); } return state; } diff --git a/src/main/java/net/cr24/primeval/block/functional/SuspendedLadderBlock.java b/src/main/java/net/cr24/primeval/block/functional/SuspendedLadderBlock.java index 6d31ecd..bf8cfed 100644 --- a/src/main/java/net/cr24/primeval/block/functional/SuspendedLadderBlock.java +++ b/src/main/java/net/cr24/primeval/block/functional/SuspendedLadderBlock.java @@ -34,7 +34,7 @@ public BlockState getStateForNeighborUpdate(BlockState state, Direction directio return Blocks.AIR.getDefaultState(); } if (state.get(WATERLOGGED)) { - world.createAndScheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); } return super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); } diff --git a/src/main/java/net/cr24/primeval/block/functional/TimedTorchBlock.java b/src/main/java/net/cr24/primeval/block/functional/TimedTorchBlock.java index d0dacff..17c93b7 100644 --- a/src/main/java/net/cr24/primeval/block/functional/TimedTorchBlock.java +++ b/src/main/java/net/cr24/primeval/block/functional/TimedTorchBlock.java @@ -50,7 +50,7 @@ public VoxelShape getOutlineShape(BlockState state, BlockView world, BlockPos po public void onBlockAdded(BlockState state, World world, BlockPos pos, BlockState oldState, boolean notify) { int stage = state.get(BURNOUT_STAGE); if (stage == 1) { - world.createAndScheduleBlockTick(pos, this, TICKS*stage); + world.scheduleBlockTick(pos, this, TICKS*stage); } } @@ -59,7 +59,7 @@ public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Ran int stage = state.get(BURNOUT_STAGE); world.setBlockState(pos, state.with(BURNOUT_STAGE, Math.min(stage+1, 5))); if (stage < 4) { - world.createAndScheduleBlockTick(pos, PrimevalBlocks.CRUDE_TORCH, TICKS*stage); + world.scheduleBlockTick(pos, PrimevalBlocks.CRUDE_TORCH, TICKS*stage); } } diff --git a/src/main/java/net/cr24/primeval/block/plant/LeafBlock.java b/src/main/java/net/cr24/primeval/block/plant/LeafBlock.java index 590e22f..000c43d 100644 --- a/src/main/java/net/cr24/primeval/block/plant/LeafBlock.java +++ b/src/main/java/net/cr24/primeval/block/plant/LeafBlock.java @@ -35,6 +35,6 @@ public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Ran @Override public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { - world.createAndScheduleBlockTick(pos, this, 2); + world.scheduleBlockTick(pos, this, 2); } } diff --git a/src/main/java/net/cr24/primeval/block/plant/PrimevalWaterPlantBlock.java b/src/main/java/net/cr24/primeval/block/plant/PrimevalWaterPlantBlock.java index a24dc01..35a0629 100644 --- a/src/main/java/net/cr24/primeval/block/plant/PrimevalWaterPlantBlock.java +++ b/src/main/java/net/cr24/primeval/block/plant/PrimevalWaterPlantBlock.java @@ -7,7 +7,7 @@ import net.minecraft.fluid.FluidState; import net.minecraft.fluid.Fluids; import net.minecraft.item.ItemPlacementContext; -import net.minecraft.tag.FluidTags; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Direction; import net.minecraft.util.shape.VoxelShape; @@ -42,7 +42,7 @@ public BlockState getPlacementState(ItemPlacementContext ctx) { public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { BlockState blockState = super.getStateForNeighborUpdate(state, direction, neighborState, world, pos, neighborPos); if (!blockState.isAir()) { - world.createAndScheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); } return blockState; diff --git a/src/main/java/net/cr24/primeval/block/plant/ReedsBlock.java b/src/main/java/net/cr24/primeval/block/plant/ReedsBlock.java index b5ceabd..8293311 100644 --- a/src/main/java/net/cr24/primeval/block/plant/ReedsBlock.java +++ b/src/main/java/net/cr24/primeval/block/plant/ReedsBlock.java @@ -81,7 +81,7 @@ public PistonBehavior getPistonBehavior(BlockState state) { public BlockState getStateForNeighborUpdate(BlockState state, Direction direction, BlockState neighborState, WorldAccess world, BlockPos pos, BlockPos neighborPos) { if (state.get(WATERLOGGED)) { - world.createAndScheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); + world.scheduleFluidTick(pos, Fluids.WATER, Fluids.WATER.getTickRate(world)); } if (canPlaceAt(state, world, pos)) { return getStateFor(world, pos); diff --git a/src/main/java/net/cr24/primeval/block/plant/TrunkBlock.java b/src/main/java/net/cr24/primeval/block/plant/TrunkBlock.java index 46f8ee3..5b661db 100644 --- a/src/main/java/net/cr24/primeval/block/plant/TrunkBlock.java +++ b/src/main/java/net/cr24/primeval/block/plant/TrunkBlock.java @@ -64,7 +64,7 @@ public void scheduledTick(BlockState state, ServerWorld world, BlockPos pos, Ran @Override public void neighborUpdate(BlockState state, World world, BlockPos pos, Block block, BlockPos fromPos, boolean notify) { - world.createAndScheduleBlockTick(pos, this, 2); + world.scheduleBlockTick(pos, this, 2); } public void randomTick(BlockState state, ServerWorld world, BlockPos pos, Random random) { diff --git a/src/main/java/net/cr24/primeval/entity/CollapsingBlockEntity.java b/src/main/java/net/cr24/primeval/entity/CollapsingBlockEntity.java index 46c64bf..e30cd92 100644 --- a/src/main/java/net/cr24/primeval/entity/CollapsingBlockEntity.java +++ b/src/main/java/net/cr24/primeval/entity/CollapsingBlockEntity.java @@ -11,9 +11,8 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.fluid.Fluids; import net.minecraft.nbt.NbtCompound; -import net.minecraft.nbt.NbtElement; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.state.property.Properties; -import net.minecraft.tag.FluidTags; import net.minecraft.util.hit.BlockHitResult; import net.minecraft.util.hit.HitResult; import net.minecraft.util.math.BlockPos; diff --git a/src/main/java/net/cr24/primeval/fluid/PrimevalFluids.java b/src/main/java/net/cr24/primeval/fluid/PrimevalFluids.java index 78f67f9..e5471f1 100644 --- a/src/main/java/net/cr24/primeval/fluid/PrimevalFluids.java +++ b/src/main/java/net/cr24/primeval/fluid/PrimevalFluids.java @@ -16,11 +16,12 @@ import net.minecraft.fluid.FlowableFluid; import net.minecraft.fluid.Fluid; import net.minecraft.fluid.FluidState; +import net.minecraft.registry.Registries; import net.minecraft.resource.ResourceManager; import net.minecraft.resource.ResourceType; import net.minecraft.util.Identifier; import net.minecraft.util.math.BlockPos; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import net.minecraft.world.BlockRenderView; import java.util.function.Function; @@ -68,7 +69,7 @@ public static void clientInit() { } private static FlowableFluid registerFluid(String id, Fluid fluid) { - return (FlowableFluid)Registry.register(Registry.FLUID, PrimevalMain.getId(id), fluid); + return (FlowableFluid)Registry.register(Registries.FLUID, PrimevalMain.getId(id), fluid); } /* @@ -86,7 +87,7 @@ private static void setupFluidRendering(final Fluid still, final Fluid flowing, registry.register(flowingSpriteId); }); - final Identifier fluidId = Registry.FLUID.getId(still); + final Identifier fluidId = Registries.FLUID.getId(still); final Identifier listenerId = new Identifier(fluidId.getNamespace(), fluidId.getPath() + "_reload_listener"); final Sprite[] fluidSprites = { null, null }; diff --git a/src/main/java/net/cr24/primeval/item/PrimevalItemTags.java b/src/main/java/net/cr24/primeval/item/PrimevalItemTags.java index 392060c..aeb0961 100644 --- a/src/main/java/net/cr24/primeval/item/PrimevalItemTags.java +++ b/src/main/java/net/cr24/primeval/item/PrimevalItemTags.java @@ -2,8 +2,8 @@ import net.cr24.primeval.PrimevalMain; import net.minecraft.item.Item; -import net.minecraft.tag.TagKey; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.tag.TagKey; public class PrimevalItemTags { @@ -24,6 +24,6 @@ public class PrimevalItemTags { public static final TagKey CRATES = register("crates"); private static TagKey register(String id) { - return TagKey.of(Registry.ITEM_KEY, PrimevalMain.getId(id)); + return TagKey.of(RegistryKeys.ITEM, PrimevalMain.getId(id)); } } diff --git a/src/main/java/net/cr24/primeval/item/PrimevalItems.java b/src/main/java/net/cr24/primeval/item/PrimevalItems.java index 3b7aea5..738fbc8 100644 --- a/src/main/java/net/cr24/primeval/item/PrimevalItems.java +++ b/src/main/java/net/cr24/primeval/item/PrimevalItems.java @@ -13,8 +13,9 @@ import net.id.incubus_core.item_predicates.IncubusItemPredicates; import net.minecraft.item.*; import net.minecraft.nbt.NbtCompound; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import java.util.ArrayList; import java.util.List; @@ -25,198 +26,190 @@ public class PrimevalItems { /* Item Groups */ - public static final ItemGroup PRIMEVAL_ITEMS = FabricItemGroupBuilder.build(PrimevalMain.getId("items"), () -> new ItemStack(PrimevalItems.STRAW)); - public static final ItemGroup PRIMEVAL_BLOCKS = FabricItemGroupBuilder.build(PrimevalMain.getId("blocks"), () -> new ItemStack(PrimevalBlocks.DIRT)); - public static final ItemGroup PRIMEVAL_TOOLS = FabricItemGroupBuilder.create( - PrimevalMain.getId("tools")) + public static final ItemGroup PRIMEVAL_ITEMS = FabricItemGroupBuilder.create(PrimevalMain.getId("items")) + .icon(() -> new ItemStack(PrimevalItems.STRAW)) + .build(); + public static final ItemGroup PRIMEVAL_BLOCKS = FabricItemGroupBuilder.create(PrimevalMain.getId("blocks")) + .icon(() -> new ItemStack(PrimevalBlocks.DIRT)) + .build(); + public static final ItemGroup PRIMEVAL_TOOLS = FabricItemGroupBuilder.create(PrimevalMain.getId("tools")) .icon(() -> new ItemStack(PrimevalItems.FLINT_AXE)) - .appendItems((stacks, itemGroup) -> { - stacks.add(new ItemStack(Items.LEAD)); - for (Item item : Registry.ITEM) { - if (item.getGroup() == itemGroup) { - stacks.add(new ItemStack(item)); - } - } - }) .build(); - public static final ItemGroup PRIMEVAL_FOODS = FabricItemGroupBuilder.build(PrimevalMain.getId("foods"), () -> new ItemStack(PrimevalItems.COOKED_PORKCHOP)); - - private static Item.Settings GROUP_ITEMS() { return new Item.Settings().group(PRIMEVAL_ITEMS);} - private static Item.Settings GROUP_TOOLS() { return new Item.Settings().group(PRIMEVAL_TOOLS);} - private static Item.Settings GROUP_BLOCKS() { return new Item.Settings().group(PRIMEVAL_BLOCKS);} - + public static final ItemGroup PRIMEVAL_FOODS = FabricItemGroupBuilder.create(PrimevalMain.getId("foods")) + .icon(() -> new ItemStack(PrimevalItems.COOKED_PORKCHOP)) + .build(); /* Items */ // Crafting materials - public static final Item STRAW = registerItem("straw", new WeightedBlockItem(STRAW_PILE, GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item STICK = registerItem("stick", new FirestarterItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item STRING = registerItem("string", new FirestarterItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item FLINT = registerItem("flint", new FlintItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item ROCK = registerItem("rock", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item STONE_BRICK = registerItem("stone_brick", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item ASHES = registerItem("ashes", new WeightedItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item CRUSHED_TERRACOTTA = registerItem("crushed_terracotta", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CEMENT_MIX = registerItem("cement_mix", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CEMENT = registerItem("cement", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item BONE = registerItem("bone", new WeightedItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item BONEMEAL = registerItem("bonemeal", new FertilizerItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL, 4, PrimevalFarmlandBlockFertilizerType.BONEMEAL)); - public static final Item ANIMAL_FAT = registerItem("animal_fat", new WeightedItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item GUNPOWDER = registerItem("gunpowder", new WeightedItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - public static final Item CHARRED_BONE = registerItem("charred_bone", new WeightedItem(GROUP_ITEMS(), Weight.VERY_LIGHT, Size.SMALL)); - - public static final Item SANDY_CLAY_BALL = registerItem("sandy_clay_ball", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item SANDY_CLAY_BRICK = registerItem("sandy_clay_brick", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item DRIED_BRICK = registerItem("dried_brick", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - - public static final Item MUD_BALL = registerItem("mud_ball", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item MUD_BRICK = registerItem("mud_brick", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CLAY_BALL = registerItem("clay_ball", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CLAY_BRICK = registerItem("clay_brick", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item FIRED_CLAY_BRICK = registerItem("fired_clay_brick", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CLAY_BOWL = registerItem("clay_bowl", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item FIRED_CLAY_BOWL = registerItem("fired_clay_bowl", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CLAY_TILE = registerItem("clay_tile", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item FIRED_CLAY_TILE = registerItem("fired_clay_tile", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item CLAY_JUG = registerItem("clay_jug", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_VESSEL = registerItem("clay_vessel", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); + public static final Item STRAW = registerItem("straw", new WeightedBlockItem(STRAW_PILE, new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item STICK = registerItem("stick", new FirestarterItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item STRING = registerItem("string", new FirestarterItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item FLINT = registerItem("flint", new FlintItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item ROCK = registerItem("rock", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item STONE_BRICK = registerItem("stone_brick", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item ASHES = registerItem("ashes", new WeightedItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CRUSHED_TERRACOTTA = registerItem("crushed_terracotta", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CEMENT_MIX = registerItem("cement_mix", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CEMENT = registerItem("cement", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BONE = registerItem("bone", new WeightedItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BONEMEAL = registerItem("bonemeal", new FertilizerItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL, 4, PrimevalFarmlandBlockFertilizerType.BONEMEAL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item ANIMAL_FAT = registerItem("animal_fat", new WeightedItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item GUNPOWDER = registerItem("gunpowder", new WeightedItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CHARRED_BONE = registerItem("charred_bone", new WeightedItem(new Item.Settings(), Weight.VERY_LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + + public static final Item SANDY_CLAY_BALL = registerItem("sandy_clay_ball", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item SANDY_CLAY_BRICK = registerItem("sandy_clay_brick", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item DRIED_BRICK = registerItem("dried_brick", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + + public static final Item MUD_BALL = registerItem("mud_ball", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item MUD_BRICK = registerItem("mud_brick", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_BALL = registerItem("clay_ball", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_BRICK = registerItem("clay_brick", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item FIRED_CLAY_BRICK = registerItem("fired_clay_brick", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_BOWL = registerItem("clay_bowl", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item FIRED_CLAY_BOWL = registerItem("fired_clay_bowl", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_TILE = registerItem("clay_tile", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item FIRED_CLAY_TILE = registerItem("fired_clay_tile", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_JUG = registerItem("clay_jug", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_VESSEL = registerItem("clay_vessel", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); // Logs - public static final Item OAK_LOG = registerItem("oak_log", new LogItem(PrimevalBlocks.OAK_LOG, OAK_LOG_PILE, GROUP_BLOCKS(), Weight.HEAVY, Size.LARGE)); - public static final Item BIRCH_LOG = registerItem("birch_log", new LogItem(PrimevalBlocks.BIRCH_LOG, BIRCH_LOG_PILE, GROUP_BLOCKS(), Weight.HEAVY, Size.LARGE)); - public static final Item SPRUCE_LOG = registerItem("spruce_log", new LogItem(PrimevalBlocks.SPRUCE_LOG, SPRUCE_LOG_PILE, GROUP_BLOCKS(), Weight.HEAVY, Size.LARGE)); + public static final Item OAK_LOG = registerItem("oak_log", new LogItem(PrimevalBlocks.OAK_LOG, OAK_LOG_PILE, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_FOODS); + public static final Item BIRCH_LOG = registerItem("birch_log", new LogItem(PrimevalBlocks.BIRCH_LOG, BIRCH_LOG_PILE, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_FOODS); + public static final Item SPRUCE_LOG = registerItem("spruce_log", new LogItem(PrimevalBlocks.SPRUCE_LOG, SPRUCE_LOG_PILE, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_FOODS); // Edible Items - public static final Item PORKCHOP = registerItem("porkchop", new WeightedItem(new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.PORKCHOP), Weight.NORMAL, Size.MEDIUM)); - public static final Item COOKED_PORKCHOP = registerItem("cooked_porkchop", new WeightedItem(new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.COOKED_PORKCHOP), Weight.NORMAL, Size.MEDIUM)); - public static final Item ROTTEN_FLESH = registerItem("rotten_flesh", new WeightedItem(new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.ROTTEN_FLESH), Weight.NORMAL, Size.MEDIUM)); - public static final Item SPIDER_EYE = registerItem("spider_eye", new WeightedItem(new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.SPIDER_EYE), Weight.LIGHT, Size.SMALL)); - - public static final Item CARROT = registerItem("carrot", new WeightedBlockItem(CARROT_CROP, new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.CARROT), Weight.LIGHT, Size.SMALL)); - public static final Item WHEAT = registerItem("wheat", new WeightedItem(new Item.Settings().group(PRIMEVAL_FOODS), Weight.LIGHT, Size.SMALL)); - public static final Item CABBAGE = registerItem("cabbage", new WeightedItem(new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.CABBAGE), Weight.LIGHT, Size.SMALL)); - public static final Item BEANS = registerItem("beans", new WeightedBlockItem(BEANS_CROP, new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.BEANS), Weight.LIGHT, Size.SMALL)); - public static final Item POTATO = registerItem("potato", new WeightedBlockItem(POTATO_CROP, new Item.Settings().group(PRIMEVAL_FOODS).food(PrimevalFoodComponents.POTATO), Weight.LIGHT, Size.SMALL)); + public static final Item PORKCHOP = registerItem("porkchop", new WeightedItem(new Item.Settings().food(PrimevalFoodComponents.PORKCHOP), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_FOODS); + public static final Item COOKED_PORKCHOP = registerItem("cooked_porkchop", new WeightedItem(new Item.Settings().food(PrimevalFoodComponents.COOKED_PORKCHOP), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_FOODS); + public static final Item ROTTEN_FLESH = registerItem("rotten_flesh", new WeightedItem(new Item.Settings().food(PrimevalFoodComponents.ROTTEN_FLESH), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_FOODS); + public static final Item SPIDER_EYE = registerItem("spider_eye", new WeightedItem(new Item.Settings().food(PrimevalFoodComponents.SPIDER_EYE), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); + + public static final Item CARROT = registerItem("carrot", new WeightedBlockItem(CARROT_CROP, new Item.Settings().food(PrimevalFoodComponents.CARROT), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); + public static final Item WHEAT = registerItem("wheat", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); + public static final Item CABBAGE = registerItem("cabbage", new WeightedItem(new Item.Settings().food(PrimevalFoodComponents.CABBAGE), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); + public static final Item BEANS = registerItem("beans", new WeightedBlockItem(BEANS_CROP, new Item.Settings().food(PrimevalFoodComponents.BEANS), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); + public static final Item POTATO = registerItem("potato", new WeightedBlockItem(POTATO_CROP, new Item.Settings().food(PrimevalFoodComponents.POTATO), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); // Seeds - public static final Item WHEAT_SEEDS = registerItem("wheat_seeds", new WeightedBlockItem(WHEAT_CROP, new Item.Settings().group(PRIMEVAL_FOODS), Weight.LIGHT, Size.SMALL)); - public static final Item CABBAGE_SEEDS = registerItem("cabbage_seeds", new WeightedBlockItem(CABBAGE_CROP, new Item.Settings().group(PRIMEVAL_FOODS), Weight.LIGHT, Size.SMALL)); + public static final Item WHEAT_SEEDS = registerItem("wheat_seeds", new WeightedBlockItem(WHEAT_CROP, new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); + public static final Item CABBAGE_SEEDS = registerItem("cabbage_seeds", new WeightedBlockItem(CABBAGE_CROP, new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_FOODS); // Ore Items - public static final Item RAW_COPPER_MALACHITE_SMALL = registerItem("raw_copper_malachite_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_COPPER_MALACHITE_MEDIUM = registerItem("raw_copper_malachite_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_COPPER_MALACHITE_LARGE = registerItem("raw_copper_malachite_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_COPPER_MALACHITE_SMALL = registerItem("raw_copper_malachite_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_COPPER_MALACHITE_MEDIUM = registerItem("raw_copper_malachite_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_COPPER_MALACHITE_LARGE = registerItem("raw_copper_malachite_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); - public static final Item RAW_COPPER_NATIVE_SMALL = registerItem("raw_copper_native_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_COPPER_NATIVE_MEDIUM = registerItem("raw_copper_native_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_COPPER_NATIVE_LARGE = registerItem("raw_copper_native_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_COPPER_NATIVE_SMALL = registerItem("raw_copper_native_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_COPPER_NATIVE_MEDIUM = registerItem("raw_copper_native_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_COPPER_NATIVE_LARGE = registerItem("raw_copper_native_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); - public static final Item RAW_TIN_CASSITERITE_SMALL = registerItem("raw_tin_cassiterite_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_TIN_CASSITERITE_MEDIUM = registerItem("raw_tin_cassiterite_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_TIN_CASSITERITE_LARGE = registerItem("raw_tin_cassiterite_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_TIN_CASSITERITE_SMALL = registerItem("raw_tin_cassiterite_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_TIN_CASSITERITE_MEDIUM = registerItem("raw_tin_cassiterite_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_TIN_CASSITERITE_LARGE = registerItem("raw_tin_cassiterite_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); - public static final Item RAW_ZINC_SPHALERITE_SMALL = registerItem("raw_zinc_sphalerite_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_ZINC_SPHALERITE_MEDIUM = registerItem("raw_zinc_sphalerite_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_ZINC_SPHALERITE_LARGE = registerItem("raw_zinc_sphalerite_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_ZINC_SPHALERITE_SMALL = registerItem("raw_zinc_sphalerite_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_ZINC_SPHALERITE_MEDIUM = registerItem("raw_zinc_sphalerite_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_ZINC_SPHALERITE_LARGE = registerItem("raw_zinc_sphalerite_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); - public static final Item RAW_GOLD_NATIVE_SMALL = registerItem("raw_gold_native_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_GOLD_NATIVE_MEDIUM = registerItem("raw_gold_native_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_GOLD_NATIVE_LARGE = registerItem("raw_gold_native_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_GOLD_NATIVE_SMALL = registerItem("raw_gold_native_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_GOLD_NATIVE_MEDIUM = registerItem("raw_gold_native_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_GOLD_NATIVE_LARGE = registerItem("raw_gold_native_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); - public static final Item RAW_IRON_HEMATITE_SMALL = registerItem("raw_iron_hematite_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_IRON_HEMATITE_MEDIUM = registerItem("raw_iron_hematite_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_IRON_HEMATITE_LARGE = registerItem("raw_iron_hematite_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_IRON_HEMATITE_SMALL = registerItem("raw_iron_hematite_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_IRON_HEMATITE_MEDIUM = registerItem("raw_iron_hematite_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_IRON_HEMATITE_LARGE = registerItem("raw_iron_hematite_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); - public static final Item RAW_LAZURITE_SMALL = registerItem("raw_lazurite_small", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item RAW_LAZURITE_MEDIUM = registerItem("raw_lazurite_medium", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item RAW_LAZURITE_LARGE = registerItem("raw_lazurite_large", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.LARGE)); + public static final Item RAW_LAZURITE_SMALL = registerItem("raw_lazurite_small", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_LAZURITE_MEDIUM = registerItem("raw_lazurite_medium", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RAW_LAZURITE_LARGE = registerItem("raw_lazurite_large", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_ITEMS); // Tools - public static final Item FLINT_AXE = registerItem("flint_axe", new PrimevalAxeItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage(), -3.0f, GROUP_TOOLS(), Weight.HEAVY, Size.LARGE)); - public static final Item FLINT_KNIFE = registerItem("flint_knife", new PrimevalKnifeItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage()*PrimevalToolMaterials.KNIFE_DAMAGE_MULTIPLIER, -3.0f, GROUP_TOOLS(), Weight.HEAVY, Size.LARGE)); - public static final Item FLINT_SHOVEL = registerItem("flint_shovel", new PrimevalShovelItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage()*PrimevalToolMaterials.BLUNT_DAMAGE_MULTIPLIER, -3.0f, GROUP_TOOLS(), Weight.HEAVY, Size.LARGE)); - public static final Item FLINT_SPEAR = registerItem("flint_spear", new PrimevalSpearItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage()*PrimevalToolMaterials.SPEAR_DAMAGE_MULTIPLIER, -3.5f, GROUP_TOOLS(), Weight.HEAVY, Size.LARGE)); - public static final Item[] COPPER_TOOLS = registerToolSet("copper", PrimevalToolMaterials.COPPER, GROUP_TOOLS(), Weight.HEAVY, Size.LARGE); - public static final Item[] BRONZE_TOOLS = registerToolSet("bronze", PrimevalToolMaterials.BRONZE, GROUP_TOOLS(), Weight.HEAVY, Size.LARGE); + public static final Item FLINT_AXE = registerItem("flint_axe", new PrimevalAxeItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage(), -3.0f, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item FLINT_KNIFE = registerItem("flint_knife", new PrimevalKnifeItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage() * PrimevalToolMaterials.KNIFE_DAMAGE_MULTIPLIER, -3.0f, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item FLINT_SHOVEL = registerItem("flint_shovel", new PrimevalShovelItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage() * PrimevalToolMaterials.BLUNT_DAMAGE_MULTIPLIER, -3.0f, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item FLINT_SPEAR = registerItem("flint_spear", new PrimevalSpearItem(PrimevalToolMaterials.FLINT, PrimevalToolMaterials.FLINT.getAttackDamage() * PrimevalToolMaterials.SPEAR_DAMAGE_MULTIPLIER, -3.5f, new Item.Settings(), Weight.HEAVY, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item[] COPPER_TOOLS = registerToolSet("copper", PrimevalToolMaterials.COPPER, new Item.Settings(), Weight.HEAVY, Size.LARGE); + public static final Item[] BRONZE_TOOLS = registerToolSet("bronze", PrimevalToolMaterials.BRONZE, new Item.Settings(), Weight.HEAVY, Size.LARGE); // Tool Parts - public static final Item[] COPPER_TOOL_PARTS = registerToolPartSet("copper", GROUP_TOOLS(), Weight.NORMAL, Size.MEDIUM); - public static final Item[] BRONZE_TOOL_PARTS = registerToolPartSet("bronze", GROUP_TOOLS(), Weight.NORMAL, Size.MEDIUM); + public static final Item[] COPPER_TOOL_PARTS = registerToolPartSet("copper", new Item.Settings(), Weight.NORMAL, Size.MEDIUM); + public static final Item[] BRONZE_TOOL_PARTS = registerToolPartSet("bronze", new Item.Settings(), Weight.NORMAL, Size.MEDIUM); // Other - public static final Item WOODEN_BUCKET = registerItem("wooden_bucket", new WoodenBucketItem(GROUP_TOOLS(), Weight.NORMAL, Size.MEDIUM, 4)); - public static final Item WATER_WOODEN_BUCKET = registerItem("water_wooden_bucket", new WaterWoodenBucketItem(GROUP_TOOLS().recipeRemainder(WOODEN_BUCKET), Weight.HEAVY, Size.MEDIUM)); - public static final Item FIRED_CLAY_JUG = registerItem("fired_clay_jug", new EmptyJugItem(GROUP_TOOLS(), Weight.NORMAL, Size.LARGE)); - public static final Item FIRED_CLAY_WATER_JUG = registerItem("fired_clay_jug_filled", new JugItem(GROUP_TOOLS(), Weight.NORMAL, Size.LARGE)); - public static final Item FIRED_CLAY_VESSEL = registerItem("fired_clay_vessel", new VesselItem(GROUP_TOOLS().maxCount(1), Weight.NORMAL, Size.LARGE)); - public static final Item QUERN_WHEEL = registerItem("quern_wheel", new WeightedItem(GROUP_TOOLS().maxDamage(99), Weight.HEAVY, Size.MEDIUM, true)); + public static final Item WOODEN_BUCKET = registerItem("wooden_bucket", new WoodenBucketItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 4), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item WATER_WOODEN_BUCKET = registerItem("water_wooden_bucket", new WaterWoodenBucketItem(new Item.Settings().recipeRemainder(WOODEN_BUCKET), Weight.HEAVY, Size.MEDIUM), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item FIRED_CLAY_JUG = registerItem("fired_clay_jug", new EmptyJugItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item FIRED_CLAY_WATER_JUG = registerItem("fired_clay_jug_filled", new JugItem(new Item.Settings(), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item FIRED_CLAY_VESSEL = registerItem("fired_clay_vessel", new VesselItem(new Item.Settings().maxCount(1), Weight.NORMAL, Size.LARGE), PrimevalItems.PRIMEVAL_TOOLS); + public static final Item QUERN_WHEEL = registerItem("quern_wheel", new WeightedItem(new Item.Settings().maxDamage(99), Weight.HEAVY, Size.MEDIUM, true), PrimevalItems.PRIMEVAL_TOOLS); // Metal Items // Primary - public static final Item COPPER_INGOT = registerItem("copper_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item COPPER_CHUNK = registerItem("copper_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item TIN_INGOT = registerItem("tin_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item TIN_CHUNK = registerItem("tin_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item ZINC_INGOT = registerItem("zinc_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item ZINC_CHUNK = registerItem("zinc_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); + public static final Item COPPER_INGOT = registerItem("copper_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item COPPER_CHUNK = registerItem("copper_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item TIN_INGOT = registerItem("tin_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item TIN_CHUNK = registerItem("tin_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item ZINC_INGOT = registerItem("zinc_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item ZINC_CHUNK = registerItem("zinc_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); // Alloys - public static final Item BRONZE_INGOT = registerItem("bronze_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item BRONZE_CHUNK = registerItem("bronze_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item BRASS_INGOT = registerItem("brass_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item BRASS_CHUNK = registerItem("brass_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item PEWTER_INGOT = registerItem("pewter_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item PEWTER_CHUNK = registerItem("pewter_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item GOLD_INGOT = registerItem("gold_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item GOLD_CHUNK = registerItem("gold_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item BOTCHED_ALLOY_INGOT = registerItem("botched_alloy_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item BOTCHED_ALLOY_CHUNK = registerItem("botched_alloy_chunk", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); + public static final Item BRONZE_INGOT = registerItem("bronze_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BRONZE_CHUNK = registerItem("bronze_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BRASS_INGOT = registerItem("brass_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BRASS_CHUNK = registerItem("brass_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item PEWTER_INGOT = registerItem("pewter_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item PEWTER_CHUNK = registerItem("pewter_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item GOLD_INGOT = registerItem("gold_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item GOLD_CHUNK = registerItem("gold_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BOTCHED_ALLOY_INGOT = registerItem("botched_alloy_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BOTCHED_ALLOY_CHUNK = registerItem("botched_alloy_chunk", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); // Currency - public static final Item COPPER_COIN = registerItem("copper_coin", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); - public static final Item GOLD_COIN = registerItem("gold_coin", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.SMALL)); + public static final Item COPPER_COIN = registerItem("copper_coin", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item GOLD_COIN = registerItem("gold_coin", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); // Pigments - public static final Item WHITE_DYE = registerItem("dye_white", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item ORANGE_DYE = registerItem("dye_orange", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item MAGENTA_DYE = registerItem("dye_magenta", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item LIGHT_BLUE_DYE = registerItem("dye_light_blue", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item YELLOW_DYE = registerItem("dye_yellow", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item LIME_DYE = registerItem("dye_lime", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item PINK_DYE = registerItem("dye_pink", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item DARK_GRAY_DYE = registerItem("dye_dark_gray", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item LIGHT_GRAY_DYE = registerItem("dye_light_gray", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item CYAN_DYE = registerItem("dye_cyan", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item PURPLE_DYE = registerItem("dye_purple", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item BLUE_DYE = registerItem("dye_blue", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item BROWN_DYE = registerItem("dye_brown", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item GREEN_DYE = registerItem("dye_green", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item RED_DYE = registerItem("dye_red", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); - public static final Item BLACK_DYE = registerItem("dye_black", new WeightedItem(GROUP_ITEMS(), Weight.LIGHT, Size.SMALL)); + public static final Item WHITE_DYE = registerItem("dye_white", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item ORANGE_DYE = registerItem("dye_orange", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item MAGENTA_DYE = registerItem("dye_magenta", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item LIGHT_BLUE_DYE = registerItem("dye_light_blue", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item YELLOW_DYE = registerItem("dye_yellow", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item LIME_DYE = registerItem("dye_lime", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item PINK_DYE = registerItem("dye_pink", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item DARK_GRAY_DYE = registerItem("dye_dark_gray", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item LIGHT_GRAY_DYE = registerItem("dye_light_gray", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CYAN_DYE = registerItem("dye_cyan", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item PURPLE_DYE = registerItem("dye_purple", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BLUE_DYE = registerItem("dye_blue", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BROWN_DYE = registerItem("dye_brown", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item GREEN_DYE = registerItem("dye_green", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item RED_DYE = registerItem("dye_red", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item BLACK_DYE = registerItem("dye_black", new WeightedItem(new Item.Settings(), Weight.LIGHT, Size.SMALL), PrimevalItems.PRIMEVAL_ITEMS); // Molds - public static final Item CLAY_INGOT_MOLD = registerItem("clay_mold_ingot", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_AXE_HEAD_MOLD = registerItem("clay_mold_axe_head", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_CHISEL_HEAD_MOLD = registerItem("clay_mold_chisel_head", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_KNIFE_BLADE_MOLD = registerItem("clay_mold_knife_blade", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_PICKAXE_HEAD_MOLD = registerItem("clay_mold_pickaxe_head", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_SHOVEL_HEAD_MOLD = registerItem("clay_mold_shovel_head", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_SWORD_BLADE_MOLD = registerItem("clay_mold_sword_blade", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); - public static final Item CLAY_HOE_HEAD_MOLD = registerItem("clay_mold_hoe_head", new WeightedItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM)); + public static final Item CLAY_INGOT_MOLD = registerItem("clay_mold_ingot", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_AXE_HEAD_MOLD = registerItem("clay_mold_axe_head", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_CHISEL_HEAD_MOLD = registerItem("clay_mold_chisel_head", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_KNIFE_BLADE_MOLD = registerItem("clay_mold_knife_blade", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_PICKAXE_HEAD_MOLD = registerItem("clay_mold_pickaxe_head", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_SHOVEL_HEAD_MOLD = registerItem("clay_mold_shovel_head", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_SWORD_BLADE_MOLD = registerItem("clay_mold_sword_blade", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); + public static final Item CLAY_HOE_HEAD_MOLD = registerItem("clay_mold_hoe_head", new WeightedItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM), PrimevalItems.PRIMEVAL_ITEMS); public static final List FIRED_MOLDS = new ArrayList<>(); - public static final Item FIRED_CLAY_INGOT_MOLD = registerMoldItem("fired_clay_mold_ingot", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000)); - public static final Item FIRED_CLAY_AXE_HEAD_MOLD = registerMoldItem("fired_clay_mold_axe_head", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000*3)); - public static final Item FIRED_CLAY_CHISEL_HEAD_MOLD = registerMoldItem("fired_clay_mold_chisel_head", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000*2)); - public static final Item FIRED_CLAY_KNIFE_BLADE_MOLD = registerMoldItem("fired_clay_mold_knife_blade", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000*2)); - public static final Item FIRED_CLAY_PICKAXE_HEAD_MOLD = registerMoldItem("fired_clay_mold_pickaxe_head", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000*3)); - public static final Item FIRED_CLAY_SHOVEL_HEAD_MOLD = registerMoldItem("fired_clay_mold_shovel_head", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000)); - public static final Item FIRED_CLAY_SWORD_BLADE_MOLD = registerMoldItem("fired_clay_mold_sword_blade", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000*2)); - public static final Item FIRED_CLAY_HOE_HEAD_MOLD = registerMoldItem("fired_clay_mold_hoe_head", new ClayMoldItem(GROUP_ITEMS(), Weight.NORMAL, Size.MEDIUM, 9000*2)); - - private static Item registerItem(String id, Item item) { - return Registry.register(Registry.ITEM, PrimevalMain.getId(id), item); + public static final Item FIRED_CLAY_INGOT_MOLD = registerMoldItem("fired_clay_mold_ingot", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000)); + public static final Item FIRED_CLAY_AXE_HEAD_MOLD = registerMoldItem("fired_clay_mold_axe_head", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000 * 3)); + public static final Item FIRED_CLAY_CHISEL_HEAD_MOLD = registerMoldItem("fired_clay_mold_chisel_head", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000 * 2)); + public static final Item FIRED_CLAY_KNIFE_BLADE_MOLD = registerMoldItem("fired_clay_mold_knife_blade", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000 * 2)); + public static final Item FIRED_CLAY_PICKAXE_HEAD_MOLD = registerMoldItem("fired_clay_mold_pickaxe_head", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000 * 3)); + public static final Item FIRED_CLAY_SHOVEL_HEAD_MOLD = registerMoldItem("fired_clay_mold_shovel_head", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000)); + public static final Item FIRED_CLAY_SWORD_BLADE_MOLD = registerMoldItem("fired_clay_mold_sword_blade", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000 * 2)); + public static final Item FIRED_CLAY_HOE_HEAD_MOLD = registerMoldItem("fired_clay_mold_hoe_head", new ClayMoldItem(new Item.Settings(), Weight.NORMAL, Size.MEDIUM, 9000 * 2)); + + private static Item registerItem(String id, Item item, ItemGroup group) { + return Registry.register(Registries.ITEM, PrimevalMain.getId(id), item); } private static Item registerMoldItem(String id, Item item) { - Item registered = registerItem(id, item); + Item registered = registerItem(id, item, PrimevalItems.PRIMEVAL_ITEMS); FIRED_MOLDS.add(registered); return registered; } @@ -234,7 +227,7 @@ public static void initClient() { NbtCompound nbt = itemStack.getOrCreateNbt(); NbtCompound fluidNbt = nbt.getCompound("Fluid"); int fluidAmount = fluidNbt.getInt("Amount"); - if (fluidAmount == ((ClayMoldItem)itemStack.getItem()).getCapacity()) { + if (fluidAmount == ((ClayMoldItem) itemStack.getItem()).getCapacity()) { FluidVariant variant = FluidVariant.fromNbt(fluidNbt); return PrimevalFluidUtil.fluidToIntegerId(variant.getFluid()); } @@ -245,26 +238,26 @@ public static void initClient() { private static Item[] registerToolPartSet(String material_id, Item.Settings group, Weight weight, Size size) { Item[] items = new Item[7]; - items[0] = registerItem(material_id+"_axe_head", new WeightedItem(group, weight, size)); - items[1] = registerItem(material_id+"_chisel_head", new WeightedItem(group, weight, size)); - items[2] = registerItem(material_id+"_knife_blade", new WeightedItem(group, weight, size)); - items[3] = registerItem(material_id+"_pickaxe_head", new WeightedItem(group, weight, size)); - items[4] = registerItem(material_id+"_shovel_head", new WeightedItem(group, weight, size)); - items[5] = registerItem(material_id+"_sword_blade", new WeightedItem(group, weight, size)); - items[6] = registerItem(material_id+"_hoe_head", new WeightedItem(group, weight, size)); + items[0] = registerItem(material_id + "_axe_head", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[1] = registerItem(material_id + "_chisel_head", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[2] = registerItem(material_id + "_knife_blade", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[3] = registerItem(material_id + "_pickaxe_head", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[4] = registerItem(material_id + "_shovel_head", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[5] = registerItem(material_id + "_sword_blade", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[6] = registerItem(material_id + "_hoe_head", new WeightedItem(group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); return items; } private static Item[] registerToolSet(String material_id, ToolMaterial material, Item.Settings group, Weight weight, Size size) { Item[] items = new Item[8]; - items[0] = registerItem(material_id+"_axe", new PrimevalAxeItem(material, material.getAttackDamage(), -3.0f, group, weight, size)); - items[1] = registerItem(material_id+"_chisel", new ChiselItem(material, material.getAttackDamage()*PrimevalToolMaterials.BLUNT_DAMAGE_MULTIPLIER, -3.0f, group, weight, size)); - items[2] = registerItem(material_id+"_knife", new PrimevalKnifeItem(material, material.getAttackDamage()*PrimevalToolMaterials.KNIFE_DAMAGE_MULTIPLIER, -1.5f, group, weight, size)); - items[3] = registerItem(material_id+"_pickaxe", new PrimevalPickaxeItem(material, material.getAttackDamage(), -3.0f, group, weight, size)); - items[4] = registerItem(material_id+"_shovel", new PrimevalShovelItem(material, material.getAttackDamage()*PrimevalToolMaterials.BLUNT_DAMAGE_MULTIPLIER, -3.0f, group, weight, size)); - items[5] = registerItem(material_id+"_sword", new PrimevalSwordItem(material, material.getAttackDamage()*PrimevalToolMaterials.SWORD_DAMAGE_MULTIPLIER, -2.5f, group, weight, size)); - items[6] = registerItem(material_id+"_hoe", new PrimevalHoeItem(material, group, weight, size)); - items[7] = registerItem(material_id+"_spear", new PrimevalSpearItem(material, material.getAttackDamage()*PrimevalToolMaterials.SPEAR_DAMAGE_MULTIPLIER, -3.5f, group, weight, size)); + items[0] = registerItem(material_id + "_axe", new PrimevalAxeItem(material, material.getAttackDamage(), -3.0f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[1] = registerItem(material_id + "_chisel", new ChiselItem(material, material.getAttackDamage() * PrimevalToolMaterials.BLUNT_DAMAGE_MULTIPLIER, -3.0f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[2] = registerItem(material_id + "_knife", new PrimevalKnifeItem(material, material.getAttackDamage() * PrimevalToolMaterials.KNIFE_DAMAGE_MULTIPLIER, -1.5f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[3] = registerItem(material_id + "_pickaxe", new PrimevalPickaxeItem(material, material.getAttackDamage(), -3.0f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[4] = registerItem(material_id + "_shovel", new PrimevalShovelItem(material, material.getAttackDamage() * PrimevalToolMaterials.BLUNT_DAMAGE_MULTIPLIER, -3.0f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[5] = registerItem(material_id + "_sword", new PrimevalSwordItem(material, material.getAttackDamage() * PrimevalToolMaterials.SWORD_DAMAGE_MULTIPLIER, -2.5f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[6] = registerItem(material_id + "_hoe", new PrimevalHoeItem(material, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); + items[7] = registerItem(material_id + "_spear", new PrimevalSpearItem(material, material.getAttackDamage() * PrimevalToolMaterials.SPEAR_DAMAGE_MULTIPLIER, -3.5f, group, weight, size), PrimevalItems.PRIMEVAL_TOOLS); IncubusItemPredicates.registerInWorldItemPredicate(items[7]); return items; } diff --git a/src/main/java/net/cr24/primeval/item/tool/EmptyJugItem.java b/src/main/java/net/cr24/primeval/item/tool/EmptyJugItem.java index 80f22f8..1ea3373 100644 --- a/src/main/java/net/cr24/primeval/item/tool/EmptyJugItem.java +++ b/src/main/java/net/cr24/primeval/item/tool/EmptyJugItem.java @@ -9,10 +9,10 @@ import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.item.ItemUsage; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.stat.Stats; -import net.minecraft.tag.FluidTags; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.util.hit.BlockHitResult; diff --git a/src/main/java/net/cr24/primeval/item/tool/WoodenBucketItem.java b/src/main/java/net/cr24/primeval/item/tool/WoodenBucketItem.java index 83d0d86..46e87bf 100644 --- a/src/main/java/net/cr24/primeval/item/tool/WoodenBucketItem.java +++ b/src/main/java/net/cr24/primeval/item/tool/WoodenBucketItem.java @@ -6,10 +6,10 @@ import net.cr24.primeval.item.WeightedItem; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.item.*; +import net.minecraft.registry.tag.FluidTags; import net.minecraft.sound.SoundCategory; import net.minecraft.sound.SoundEvents; import net.minecraft.stat.Stats; -import net.minecraft.tag.FluidTags; import net.minecraft.util.Hand; import net.minecraft.util.TypedActionResult; import net.minecraft.util.hit.BlockHitResult; diff --git a/src/main/java/net/cr24/primeval/recipe/AlloyingRecipe.java b/src/main/java/net/cr24/primeval/recipe/AlloyingRecipe.java index 3517d1a..5990ea0 100644 --- a/src/main/java/net/cr24/primeval/recipe/AlloyingRecipe.java +++ b/src/main/java/net/cr24/primeval/recipe/AlloyingRecipe.java @@ -10,9 +10,10 @@ import net.minecraft.recipe.Recipe; import net.minecraft.recipe.RecipeSerializer; import net.minecraft.recipe.RecipeType; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import net.minecraft.world.World; import java.util.HashMap; @@ -102,13 +103,13 @@ public AlloyingRecipe read(Identifier identifier, JsonObject jsonObject) { HashMap ingredientFluids = new HashMap<>(); for (int i = 0; i < inputFluids.size(); i++) { JsonObject item = inputFluids.get(i).getAsJsonObject(); - FluidVariant fluid = FluidVariant.of(Registry.FLUID.get(new Identifier(item.get("fluid").getAsString()))); + FluidVariant fluid = FluidVariant.of(Registries.FLUID.get(new Identifier(item.get("fluid").getAsString()))); double min = item.get("min").getAsDouble(); double max = item.get("max").getAsDouble(); ingredientFluids.put(fluid, new RangedValue(max, min)); } JsonObject result = JsonHelper.getObject(jsonObject, "result"); - FluidVariant outputFluid = FluidVariant.of(Registry.FLUID.get(new Identifier(result.get("fluid").getAsString()))); + FluidVariant outputFluid = FluidVariant.of(Registries.FLUID.get(new Identifier(result.get("fluid").getAsString()))); return new AlloyingRecipe(identifier, ingredientFluids, outputFluid); } diff --git a/src/main/java/net/cr24/primeval/recipe/ClayMoldCastingRecipe.java b/src/main/java/net/cr24/primeval/recipe/ClayMoldCastingRecipe.java index 3e46995..08d8eb4 100644 --- a/src/main/java/net/cr24/primeval/recipe/ClayMoldCastingRecipe.java +++ b/src/main/java/net/cr24/primeval/recipe/ClayMoldCastingRecipe.java @@ -11,20 +11,21 @@ import net.minecraft.nbt.NbtCompound; import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.*; +import net.minecraft.recipe.book.CraftingRecipeCategory; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; import net.minecraft.util.Pair; import net.minecraft.util.collection.DefaultedList; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import net.minecraft.world.World; public class ClayMoldCastingRecipe implements CraftingRecipe { - private final Identifier id; - final Item mold; - final FluidVariant fluid; - final ItemStack result; + private final Item mold; + private final FluidVariant fluid; + private final ItemStack result; public ClayMoldCastingRecipe(Identifier id, Item mold, FluidVariant fluid, ItemStack result) { this.id = id; @@ -128,14 +129,24 @@ public RecipeSerializer getSerializer() { return PrimevalRecipes.CLAY_MOLD_CASTING_SERIALIZER; } + @Override + public RecipeType getType() { + return CraftingRecipe.super.getType(); + } + + @Override + public CraftingRecipeCategory getCategory() { + return CraftingRecipeCategory.MISC; + } + public static class Serializer implements RecipeSerializer { public Serializer() { } public ClayMoldCastingRecipe read(Identifier identifier, JsonObject jsonObject) { JsonObject inputJson = JsonHelper.getObject(jsonObject, "input"); - Item inputMold = Registry.ITEM.get(new Identifier(JsonHelper.getString(inputJson, "mold"))); - FluidVariant inputFluid = FluidVariant.of(Registry.FLUID.get(new Identifier(JsonHelper.getString(inputJson, "fluid")))); + Item inputMold = Registries.ITEM.get(new Identifier(JsonHelper.getString(inputJson, "mold"))); + FluidVariant inputFluid = FluidVariant.of(Registries.FLUID.get(new Identifier(JsonHelper.getString(inputJson, "fluid")))); ItemStack result = ShapedRecipe.outputFromJson(JsonHelper.getObject(jsonObject, "result")); return new ClayMoldCastingRecipe(identifier, inputMold, inputFluid, result); } diff --git a/src/main/java/net/cr24/primeval/recipe/ItemDamagingRecipe.java b/src/main/java/net/cr24/primeval/recipe/ItemDamagingRecipe.java index ddf95df..6e74136 100644 --- a/src/main/java/net/cr24/primeval/recipe/ItemDamagingRecipe.java +++ b/src/main/java/net/cr24/primeval/recipe/ItemDamagingRecipe.java @@ -6,6 +6,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.*; +import net.minecraft.recipe.book.CraftingRecipeCategory; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; import net.minecraft.util.collection.DefaultedList; @@ -13,9 +14,9 @@ public class ItemDamagingRecipe implements CraftingRecipe { private final Identifier id; - final String group; - final ItemStack output; - final DefaultedList input; + private final String group; + private final ItemStack output; + private final DefaultedList input; public ItemDamagingRecipe(Identifier id, String group, ItemStack output, DefaultedList input) { this.id = id; @@ -85,6 +86,16 @@ public RecipeSerializer getSerializer() { return PrimevalRecipes.ITEM_DAMAGING_SERIALIZER; } + @Override + public RecipeType getType() { + return CraftingRecipe.super.getType(); + } + + @Override + public CraftingRecipeCategory getCategory() { + return CraftingRecipeCategory.MISC; + } + public static class Serializer implements RecipeSerializer { public Serializer() {} diff --git a/src/main/java/net/cr24/primeval/recipe/MeltingRecipe.java b/src/main/java/net/cr24/primeval/recipe/MeltingRecipe.java index 709e020..1d13160 100644 --- a/src/main/java/net/cr24/primeval/recipe/MeltingRecipe.java +++ b/src/main/java/net/cr24/primeval/recipe/MeltingRecipe.java @@ -6,11 +6,12 @@ import net.minecraft.item.ItemStack; import net.minecraft.network.PacketByteBuf; import net.minecraft.recipe.*; +import net.minecraft.registry.Registries; import net.minecraft.util.Identifier; import net.minecraft.util.JsonHelper; import net.minecraft.util.Pair; import net.minecraft.util.collection.DefaultedList; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import net.minecraft.world.World; public class MeltingRecipe implements Recipe { @@ -83,7 +84,7 @@ public Serializer() { public MeltingRecipe read(Identifier identifier, JsonObject jsonObject) { Ingredient in = Ingredient.fromJson(JsonHelper.getObject(jsonObject, "input")); JsonObject result = JsonHelper.getObject(jsonObject, "result"); - FluidVariant fluid = FluidVariant.of(Registry.FLUID.get(new Identifier(result.get("fluid").getAsString()))); + FluidVariant fluid = FluidVariant.of(Registries.FLUID.get(new Identifier(result.get("fluid").getAsString()))); int amount = result.get("amount").getAsInt(); Pair fluidOut = new Pair<>(fluid, amount); return new MeltingRecipe(identifier, in, fluidOut); diff --git a/src/main/java/net/cr24/primeval/recipe/PrimevalRecipes.java b/src/main/java/net/cr24/primeval/recipe/PrimevalRecipes.java index 84815fb..2551afd 100644 --- a/src/main/java/net/cr24/primeval/recipe/PrimevalRecipes.java +++ b/src/main/java/net/cr24/primeval/recipe/PrimevalRecipes.java @@ -2,7 +2,8 @@ import net.cr24.primeval.PrimevalMain; import net.minecraft.recipe.*; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registries; +import net.minecraft.registry.Registry; public class PrimevalRecipes { public static final RecipeType PIT_KILN_FIRING; @@ -23,39 +24,39 @@ public class PrimevalRecipes { static { - PIT_KILN_FIRING = Registry.register(Registry.RECIPE_TYPE, PrimevalMain.getId("pit_kiln_firing"), new RecipeType() { + PIT_KILN_FIRING = Registry.register(Registries.RECIPE_TYPE, PrimevalMain.getId("pit_kiln_firing"), new RecipeType() { @Override public String toString() {return "primeval:pit_kiln_firing";} }); - PIT_KILN_FIRING_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("pit_kiln_firing"), new PitKilnFiringRecipe.Serializer()); + PIT_KILN_FIRING_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("pit_kiln_firing"), new PitKilnFiringRecipe.Serializer()); - OPEN_FIRE = Registry.register(Registry.RECIPE_TYPE, PrimevalMain.getId("open_fire"), new RecipeType() { + OPEN_FIRE = Registry.register(Registries.RECIPE_TYPE, PrimevalMain.getId("open_fire"), new RecipeType() { @Override public String toString() {return "primeval:open_fire";} }); - OPEN_FIRE_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("open_fire"), new OpenFireRecipe.Serializer()); + OPEN_FIRE_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("open_fire"), new OpenFireRecipe.Serializer()); - MELTING = Registry.register(Registry.RECIPE_TYPE, PrimevalMain.getId("melting"), new RecipeType() { + MELTING = Registry.register(Registries.RECIPE_TYPE, PrimevalMain.getId("melting"), new RecipeType() { @Override public String toString() {return "primeval:melting";} }); - MELTING_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("melting"), new MeltingRecipe.Serializer()); + MELTING_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("melting"), new MeltingRecipe.Serializer()); - ALLOYING = Registry.register(Registry.RECIPE_TYPE, PrimevalMain.getId("alloying"), new RecipeType() { + ALLOYING = Registry.register(Registries.RECIPE_TYPE, PrimevalMain.getId("alloying"), new RecipeType() { @Override public String toString() {return "primeval:alloying";} }); - ALLOYING_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("alloying"), new AlloyingRecipe.Serializer()); + ALLOYING_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("alloying"), new AlloyingRecipe.Serializer()); - QUERN_GRINDING = Registry.register(Registry.RECIPE_TYPE, PrimevalMain.getId("quern_grinding"), new RecipeType() { + QUERN_GRINDING = Registry.register(Registries.RECIPE_TYPE, PrimevalMain.getId("quern_grinding"), new RecipeType() { @Override public String toString() {return "primeval:quern_grinding";} }); - QUERN_GRINDING_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("quern_grinding"), new QuernRecipe.Serializer()); + QUERN_GRINDING_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("quern_grinding"), new QuernRecipe.Serializer()); - CLAY_MOLD_CASTING_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("clay_mold_casting"), new ClayMoldCastingRecipe.Serializer()); + CLAY_MOLD_CASTING_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("clay_mold_casting"), new ClayMoldCastingRecipe.Serializer()); - ITEM_DAMAGING_SERIALIZER = Registry.register(Registry.RECIPE_SERIALIZER, PrimevalMain.getId("item_damaging"), new ItemDamagingRecipe.Serializer()); + ITEM_DAMAGING_SERIALIZER = Registry.register(Registries.RECIPE_SERIALIZER, PrimevalMain.getId("item_damaging"), new ItemDamagingRecipe.Serializer()); } public static void init() {} diff --git a/src/main/java/net/cr24/primeval/screen/Primeval3x5ContainerScreen.java b/src/main/java/net/cr24/primeval/screen/Primeval3x5ContainerScreen.java index e0df36f..1d579d1 100644 --- a/src/main/java/net/cr24/primeval/screen/Primeval3x5ContainerScreen.java +++ b/src/main/java/net/cr24/primeval/screen/Primeval3x5ContainerScreen.java @@ -18,7 +18,7 @@ public Primeval3x5ContainerScreen(PrimevalContainerScreenHandler handler, Player @Override protected void drawBackground(MatrixStack matrices, float delta, int mouseX, int mouseY) { - RenderSystem.setShader(GameRenderer::getPositionTexShader); + RenderSystem.setShader(GameRenderer::getPositionTexProgram); RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F); RenderSystem.setShaderTexture(0, TEXTURE); int x = (width - backgroundWidth) / 2; diff --git a/src/main/java/net/cr24/primeval/screen/PrimevalContainerScreenHandler.java b/src/main/java/net/cr24/primeval/screen/PrimevalContainerScreenHandler.java index 2849c1a..df0ba28 100644 --- a/src/main/java/net/cr24/primeval/screen/PrimevalContainerScreenHandler.java +++ b/src/main/java/net/cr24/primeval/screen/PrimevalContainerScreenHandler.java @@ -46,7 +46,7 @@ public boolean canUse(PlayerEntity player) { } @Override - public ItemStack transferSlot(PlayerEntity player, int index) { + public ItemStack quickMove(PlayerEntity player, int index) { ItemStack newStack = ItemStack.EMPTY; Slot slot = this.slots.get(index); if (slot != null && slot.hasStack()) { diff --git a/src/main/java/net/cr24/primeval/util/PrimevalSoundEvents.java b/src/main/java/net/cr24/primeval/util/PrimevalSoundEvents.java index 4a1055e..3f9bcb2 100644 --- a/src/main/java/net/cr24/primeval/util/PrimevalSoundEvents.java +++ b/src/main/java/net/cr24/primeval/util/PrimevalSoundEvents.java @@ -1,9 +1,10 @@ package net.cr24.primeval.util; import net.cr24.primeval.PrimevalMain; +import net.minecraft.registry.Registries; import net.minecraft.sound.SoundEvent; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; public class PrimevalSoundEvents { @@ -15,6 +16,6 @@ public static void init() {} private static SoundEvent registerSound(String id) { Identifier located = PrimevalMain.getId(id); - return Registry.register(Registry.SOUND_EVENT, located, new SoundEvent(located)); + return Registry.register(Registries.SOUND_EVENT, located, SoundEvent.of(located)); } } diff --git a/src/main/java/net/cr24/primeval/util/PrimevalUtil.java b/src/main/java/net/cr24/primeval/util/PrimevalUtil.java index 18d1648..5c55f06 100644 --- a/src/main/java/net/cr24/primeval/util/PrimevalUtil.java +++ b/src/main/java/net/cr24/primeval/util/PrimevalUtil.java @@ -5,7 +5,7 @@ import net.minecraft.entity.damage.DamageSource; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; -import net.minecraft.tag.TagKey; +import net.minecraft.registry.tag.TagKey; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.Box; import net.minecraft.util.math.Vec3d; diff --git a/src/main/java/net/cr24/primeval/world/PrimevalWorld.java b/src/main/java/net/cr24/primeval/world/PrimevalWorld.java index 3ee8c77..25cdcf5 100644 --- a/src/main/java/net/cr24/primeval/world/PrimevalWorld.java +++ b/src/main/java/net/cr24/primeval/world/PrimevalWorld.java @@ -3,10 +3,10 @@ import net.cr24.primeval.PrimevalMain; import net.minecraft.entity.EntityType; import net.minecraft.entity.SpawnGroup; -import net.minecraft.util.registry.BuiltinRegistries; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryEntry; -import net.minecraft.util.registry.RegistryKey; +import net.minecraft.registry.Registry; +import net.minecraft.registry.RegistryKey; +import net.minecraft.registry.RegistryKeys; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.world.biome.*; import net.minecraft.world.gen.GenerationStep; import net.minecraft.world.gen.feature.PlacedFeature; @@ -153,7 +153,7 @@ private static Biome createBiome(GenerationSettings g) { } private static RegistryKey getBiomeKey(String id) { - return RegistryKey.of(Registry.BIOME_KEY, PrimevalMain.getId(id)); + return RegistryKey.of(RegistryKeys.BIOME, PrimevalMain.getId(id)); } private static RegistryEntry registerBiome(RegistryKey key, Biome b) { diff --git a/src/main/java/net/cr24/primeval/world/gen/feature/OreClusterFeature.java b/src/main/java/net/cr24/primeval/world/gen/feature/OreClusterFeature.java index d376c8e..f55165e 100644 --- a/src/main/java/net/cr24/primeval/world/gen/feature/OreClusterFeature.java +++ b/src/main/java/net/cr24/primeval/world/gen/feature/OreClusterFeature.java @@ -3,7 +3,7 @@ import com.mojang.serialization.Codec; import net.cr24.primeval.util.IntPoint2D; import net.cr24.primeval.util.ShapesUtil; -import net.minecraft.tag.BlockTags; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.random.Random; import net.minecraft.world.StructureWorldAccess; @@ -55,7 +55,7 @@ public boolean generate(FeatureContext context) { private boolean setBlockIfAble(StructureWorldAccess structureWorldAccess, BlockPos blockPos, BlockStateProvider stateProvider, Random random) { if (structureWorldAccess.getBlockState(blockPos).isIn(BlockTags.BASE_STONE_OVERWORLD)) { - structureWorldAccess.setBlockState(blockPos, stateProvider.getBlockState(random, blockPos), 4); + structureWorldAccess.setBlockState(blockPos, stateProvider.get(random, blockPos), 4); return true; } else { return false; diff --git a/src/main/java/net/cr24/primeval/world/gen/feature/PrimevalFeatures.java b/src/main/java/net/cr24/primeval/world/gen/feature/PrimevalFeatures.java index e6c1fe9..d482648 100644 --- a/src/main/java/net/cr24/primeval/world/gen/feature/PrimevalFeatures.java +++ b/src/main/java/net/cr24/primeval/world/gen/feature/PrimevalFeatures.java @@ -9,6 +9,8 @@ import net.minecraft.block.BlockState; import net.minecraft.block.MultifaceGrowthBlock; import net.minecraft.item.ItemStack; +import net.minecraft.registry.Registries; +import net.minecraft.registry.entry.RegistryEntryList; import net.minecraft.structure.rule.TagMatchRuleTest; import net.minecraft.util.Identifier; import net.minecraft.util.collection.DataPool; @@ -18,10 +20,9 @@ import net.minecraft.util.math.intprovider.IntProvider; import net.minecraft.util.math.intprovider.UniformIntProvider; import net.minecraft.util.math.intprovider.WeightedListIntProvider; -import net.minecraft.util.registry.BuiltinRegistries; -import net.minecraft.util.registry.Registry; -import net.minecraft.util.registry.RegistryEntry; -import net.minecraft.util.registry.RegistryEntryList; +import net.minecraft.registry.BuiltinRegistries; +import net.minecraft.registry.Registry; +import net.minecraft.registry.entry.RegistryEntry; import net.minecraft.world.Heightmap; import net.minecraft.world.gen.YOffset; import net.minecraft.world.gen.blockpredicate.BlockPredicate; @@ -44,7 +45,7 @@ public class PrimevalFeatures { public static final WaterReedsFeature WATER_REEDS_FEATURE = registerFeature(PrimevalMain.getId("water_reed"), new WaterReedsFeature(DefaultFeatureConfig.CODEC)); private static > F registerFeature(Identifier id, F f) { - return Registry.register(Registry.FEATURE, id, f); + return Registry.register(Registries.FEATURE, id, f); } /* CONFIGURED FEATURES */ diff --git a/src/main/java/net/cr24/primeval/world/gen/feature/TrunkedTreeFeature.java b/src/main/java/net/cr24/primeval/world/gen/feature/TrunkedTreeFeature.java index 9de511b..10c3d49 100644 --- a/src/main/java/net/cr24/primeval/world/gen/feature/TrunkedTreeFeature.java +++ b/src/main/java/net/cr24/primeval/world/gen/feature/TrunkedTreeFeature.java @@ -26,7 +26,7 @@ public boolean generate(FeatureContext context) { Random random = context.getRandom(); TrunkedTreeFeatureConfig config = context.getConfig(); - BlockState saplingState = config.saplingState().getBlockState(random, blockPos); + BlockState saplingState = config.saplingState().get(random, blockPos); int tries = config.tickTries().get(random); GrowingSaplingBlock saplingBlock = (GrowingSaplingBlock) saplingState.getBlock(); diff --git a/src/main/java/net/cr24/primeval/world/gen/structure/OreFieldGenerator.java b/src/main/java/net/cr24/primeval/world/gen/structure/OreFieldGenerator.java index c8e3339..3d438d5 100644 --- a/src/main/java/net/cr24/primeval/world/gen/structure/OreFieldGenerator.java +++ b/src/main/java/net/cr24/primeval/world/gen/structure/OreFieldGenerator.java @@ -1,11 +1,11 @@ package net.cr24.primeval.world.gen.structure; -import net.cr24.primeval.block.PrimevalBlocks; import net.minecraft.block.BlockState; import net.minecraft.nbt.NbtCompound; import net.minecraft.nbt.NbtHelper; +import net.minecraft.registry.Registries; import net.minecraft.structure.*; -import net.minecraft.tag.BlockTags; +import net.minecraft.registry.tag.BlockTags; import net.minecraft.util.math.BlockBox; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.ChunkPos; @@ -34,13 +34,13 @@ public Blob(Random random, int x, int z, int height, int size, int ballCount, in super(PrimevalStructures.ORE_FIELD_PIECE, x, height, z, size, 20, size, Direction.NORTH); this.height = height; this.size = size; - int[] params = new int[ballCount*4]; - for (int i = 0; i < ballCount*4; i += 4) { + int[] params = new int[ballCount * 4]; + for (int i = 0; i < ballCount * 4; i += 4) { int ballSize = random.nextBetween(ballSizeMin, ballSizeMax); - params[i] = ballSize-2; - params[i+1] = random.nextBetween(ballSize, size-ballSize); - params[i+2] = random.nextBetween(0, 6); - params[i+3] = random.nextBetween(ballSize, size-ballSize); + params[i] = ballSize - 2; + params[i + 1] = random.nextBetween(ballSize, size - ballSize); + params[i + 2] = random.nextBetween(0, 6); + params[i + 3] = random.nextBetween(ballSize, size - ballSize); } this.ballParams = params; this.richness = richness; @@ -56,10 +56,10 @@ public Blob(NbtCompound nbt) { this.size = nbt.getInt("Size"); this.ballParams = nbt.getIntArray("BallParams"); this.richness = nbt.getFloat("Richness"); - this.largeState = NbtHelper.toBlockState(nbt.getCompound("LargeState")); - this.mediumState = NbtHelper.toBlockState(nbt.getCompound("MediumState")); - this.smallState = NbtHelper.toBlockState(nbt.getCompound("SmallState")); - this.extraState = NbtHelper.toBlockState(nbt.getCompound("ExtraState")); + this.largeState = NbtHelper.toBlockState(Registries.BLOCK.getReadOnlyWrapper(), nbt.getCompound("LargeState")); + this.mediumState = NbtHelper.toBlockState(Registries.BLOCK.getReadOnlyWrapper(), nbt.getCompound("MediumState")); + this.smallState = NbtHelper.toBlockState(Registries.BLOCK.getReadOnlyWrapper(), nbt.getCompound("SmallState")); + this.extraState = NbtHelper.toBlockState(Registries.BLOCK.getReadOnlyWrapper(), nbt.getCompound("ExtraState")); } @@ -126,17 +126,17 @@ public Ball(int size, int xOffset, int yOffset, int zOffset, float richness, Blo public void generate(Blob blob, StructureWorldAccess world, BlockBox chunkBox, Random random) { for (int i = -size; i < size; i++) { for (int j = -size; j < size; j++) { - for (int k = -size/2; k <= size/2; k++) { - if (center.distance(i, j) < size-Math.abs(k/2) && blob.validBlock(world, xOffset+i, yOffset+k, zOffset+j, chunkBox)) { + for (int k = -size / 2; k <= size / 2; k++) { + if (center.distance(i, j) < size - Math.abs(k / 2) && blob.validBlock(world, xOffset + i, yOffset + k, zOffset + j, chunkBox)) { float threshold = random.nextFloat(); if (threshold > richness) { - blob.pAddBlock(world, largeState, xOffset+i, yOffset+k, zOffset+j, chunkBox); - } else if (threshold > richness/2) { - blob.pAddBlock(world, mediumState, xOffset+i, yOffset+k, zOffset+j, chunkBox); - } else if (threshold > richness/4) { - blob.pAddBlock(world, smallState, xOffset+i, yOffset+k, zOffset+j, chunkBox); - } else if (threshold > richness/8) { - blob.pAddBlock(world, extraState, xOffset+i, yOffset+k, zOffset+j, chunkBox); + blob.pAddBlock(world, largeState, xOffset + i, yOffset + k, zOffset + j, chunkBox); + } else if (threshold > richness / 2) { + blob.pAddBlock(world, mediumState, xOffset + i, yOffset + k, zOffset + j, chunkBox); + } else if (threshold > richness / 4) { + blob.pAddBlock(world, smallState, xOffset + i, yOffset + k, zOffset + j, chunkBox); + } else if (threshold > richness / 8) { + blob.pAddBlock(world, extraState, xOffset + i, yOffset + k, zOffset + j, chunkBox); } } } diff --git a/src/main/java/net/cr24/primeval/world/gen/structure/PrimevalStructures.java b/src/main/java/net/cr24/primeval/world/gen/structure/PrimevalStructures.java index 1721796..a9f954c 100644 --- a/src/main/java/net/cr24/primeval/world/gen/structure/PrimevalStructures.java +++ b/src/main/java/net/cr24/primeval/world/gen/structure/PrimevalStructures.java @@ -1,10 +1,12 @@ package net.cr24.primeval.world.gen.structure; import net.cr24.primeval.PrimevalMain; +import net.minecraft.registry.Registries; import net.minecraft.structure.StructurePieceType; -import net.minecraft.tag.TagKey; +import net.minecraft.registry.tag.TagKey; +import net.minecraft.registry.RegistryKeys; import net.minecraft.util.Identifier; -import net.minecraft.util.registry.Registry; +import net.minecraft.registry.Registry; import net.minecraft.world.biome.Biome; import net.minecraft.world.gen.structure.Structure; import net.minecraft.world.gen.structure.StructureType; @@ -15,7 +17,7 @@ public class PrimevalStructures { public static final TagKey HAS_NATIVE_COPPER = tagkey("has_copper"); private static TagKey tagkey(String id) { - return TagKey.of(Registry.BIOME_KEY, new Identifier(id)); + return TagKey.of(RegistryKeys.BIOME, new Identifier(id)); } /* STRUCTURES */ @@ -35,7 +37,7 @@ private static TagKey tagkey(String id) { public static final StructurePieceType ORE_FIELD_PIECE = OreFieldGenerator.Blob::new; private static TagKey tagKey(String name) { - return TagKey.of(Registry.STRUCTURE_KEY, PrimevalMain.getId(name)); + return TagKey.of(RegistryKeys.STRUCTURE, PrimevalMain.getId(name)); } public static void init() { @@ -50,9 +52,9 @@ public static void init() { private static void register(TagKey name, StructureType type) { var id = name.id(); - Registry.register(Registry.STRUCTURE_TYPE, id, type); + Registry.register(Registries.STRUCTURE_TYPE, id, type); } private static void register(Identifier id, StructurePieceType pieceType) { - Registry.register(Registry.STRUCTURE_PIECE, id, pieceType); + Registry.register(Registries.STRUCTURE_PIECE, id, pieceType); } } diff --git a/src/main/resources/fabric.mod.json b/src/main/resources/fabric.mod.json index 3e19ec5..23873b6 100644 --- a/src/main/resources/fabric.mod.json +++ b/src/main/resources/fabric.mod.json @@ -30,10 +30,9 @@ "mixins": [ "primeval.mixins.json" ], - "depends": { "fabricloader": ">=0.14.9", - "fabric": "*", + "fabric-api": "*", "minecraft": "1.19.2", "java": ">=17" }