diff --git a/src/main/java/com/simibubi/create/AllBlocks.java b/src/main/java/com/simibubi/create/AllBlocks.java index 4879f8b46..b34a36e76 100644 --- a/src/main/java/com/simibubi/create/AllBlocks.java +++ b/src/main/java/com/simibubi/create/AllBlocks.java @@ -2139,7 +2139,7 @@ public class AllBlocks { }); public static final BlockEntry ANDESITE_DOOR = - REGISTRATE.block("andesite_door", p -> new SlidingDoorBlock(p, true)) + REGISTRATE.block("andesite_door", p -> SlidingDoorBlock.metal(p, true)) .transform(BuilderTransformers.slidingDoor("andesite")) .properties(p -> p.mapColor(MapColor.STONE) .sound(SoundType.STONE) @@ -2147,7 +2147,7 @@ public class AllBlocks { .register(); public static final BlockEntry BRASS_DOOR = - REGISTRATE.block("brass_door", p -> new SlidingDoorBlock(p, false)) + REGISTRATE.block("brass_door", p -> SlidingDoorBlock.metal(p, false)) .transform(BuilderTransformers.slidingDoor("brass")) .properties(p -> p.mapColor(MapColor.TERRACOTTA_YELLOW) .sound(SoundType.STONE) @@ -2155,7 +2155,7 @@ public class AllBlocks { .register(); public static final BlockEntry COPPER_DOOR = - REGISTRATE.block("copper_door", p -> new SlidingDoorBlock(p, true)) + REGISTRATE.block("copper_door", p -> SlidingDoorBlock.metal(p, true)) .transform(BuilderTransformers.slidingDoor("copper")) .properties(p -> p.mapColor(MapColor.COLOR_ORANGE) .sound(SoundType.STONE) @@ -2163,7 +2163,7 @@ public class AllBlocks { .register(); public static final BlockEntry TRAIN_DOOR = - REGISTRATE.block("train_door", p -> new SlidingDoorBlock(p, false)) + REGISTRATE.block("train_door", p -> SlidingDoorBlock.metal(p, false)) .transform(BuilderTransformers.slidingDoor("train")) .properties(p -> p.mapColor(MapColor.TERRACOTTA_CYAN) .sound(SoundType.NETHERITE_BLOCK) @@ -2179,7 +2179,7 @@ public class AllBlocks { .register(); public static final BlockEntry FRAMED_GLASS_DOOR = - REGISTRATE.block("framed_glass_door", p -> new SlidingDoorBlock(p, false)) + REGISTRATE.block("framed_glass_door", p -> SlidingDoorBlock.glass(p, false)) .transform(BuilderTransformers.slidingDoor("glass")) .properties(p -> p.mapColor(MapColor.NONE) .sound(SoundType.GLASS) diff --git a/src/main/java/com/simibubi/create/AllCreativeModeTabs.java b/src/main/java/com/simibubi/create/AllCreativeModeTabs.java index a6f439d13..a7010f77a 100644 --- a/src/main/java/com/simibubi/create/AllCreativeModeTabs.java +++ b/src/main/java/com/simibubi/create/AllCreativeModeTabs.java @@ -28,58 +28,56 @@ import net.minecraft.client.renderer.entity.ItemRenderer; import net.minecraft.client.resources.model.BakedModel; import net.minecraft.core.registries.Registries; import net.minecraft.network.chat.Component; -import net.minecraft.resources.ResourceLocation; import net.minecraft.world.item.BlockItem; import net.minecraft.world.item.CreativeModeTab; import net.minecraft.world.item.CreativeModeTab.DisplayItemsGenerator; import net.minecraft.world.item.CreativeModeTab.ItemDisplayParameters; import net.minecraft.world.item.CreativeModeTab.Output; import net.minecraft.world.item.CreativeModeTab.TabVisibility; -import net.minecraft.world.item.CreativeModeTabs; import net.minecraft.world.item.DyeColor; import net.minecraft.world.item.Item; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; import net.minecraft.world.level.block.Block; -import net.minecraftforge.event.CreativeModeTabEvent; -import net.minecraftforge.eventbus.api.SubscribeEvent; +import net.minecraftforge.eventbus.api.IEventBus; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; import net.minecraftforge.fml.common.Mod.EventBusSubscriber.Bus; +import net.minecraftforge.registries.DeferredRegister; +import net.minecraftforge.registries.RegistryObject; @EventBusSubscriber(bus = Bus.MOD) public class AllCreativeModeTabs { + + private static final DeferredRegister TAB_REGISTER = + DeferredRegister.create(Registries.CREATIVE_MODE_TAB, Create.ID); + + public static RegistryObject MAIN_TAB = TAB_REGISTER.register("base", + () -> CreativeModeTab.builder() + .title(Component.translatable("itemGroup.create.base")) + .icon(() -> AllBlocks.COGWHEEL.asStack()) + .displayItems(new RegistrateDisplayItemsGenerator(true)) + .build()); + + public static RegistryObject BUILDING_BLOCKS_TAB = TAB_REGISTER.register("palettes", + () -> CreativeModeTab.builder() + .title(Component.translatable("itemGroup.create.palettes")) + .icon(() -> AllPaletteBlocks.ORNATE_IRON_WINDOW.asStack()) + .displayItems(new RegistrateDisplayItemsGenerator(false)) + .build()); - public static final ResourceLocation BASE_TAB_ID = Create.asResource("base"); - public static final ResourceLocation PALETTES_TAB_ID = Create.asResource("palettes"); - - private static CreativeModeTab baseTab; - private static CreativeModeTab palettesTab; - - @SubscribeEvent - public static void onCreativeModeTabRegister(CreativeModeTabEvent.Register event) { - // FIXME: 1.19.3 this used to filter by AllSections.PALETTES - baseTab = event.registerCreativeModeTab(BASE_TAB_ID, List.of(PALETTES_TAB_ID), List.of(CreativeModeTabs.SPAWN_EGGS), builder -> { - builder.title(Component.translatable("itemGroup.create.base")) - .icon(() -> AllBlocks.COGWHEEL.asStack()) - .displayItems(new RegistrateDisplayItemsGenerator(true)); - }); - - palettesTab = event.registerCreativeModeTab(PALETTES_TAB_ID, List.of(), List.of(CreativeModeTabs.SPAWN_EGGS, BASE_TAB_ID), builder -> { - builder.title(Component.translatable("itemGroup.create.palettes")) - .icon(() -> AllPaletteBlocks.ORNATE_IRON_WINDOW.asStack()) - .displayItems(new RegistrateDisplayItemsGenerator(false)); - }); + public static void register(IEventBus modEventBus) { + TAB_REGISTER.register(modEventBus); } public static CreativeModeTab getBaseTab() { - return baseTab; + return MAIN_TAB.get(); } public static CreativeModeTab getPalettesTab() { - return palettesTab; + return BUILDING_BLOCKS_TAB.get(); } - private static class RegistrateDisplayItemsGenerator implements DisplayItemsGenerator { + public static class RegistrateDisplayItemsGenerator implements DisplayItemsGenerator { // private final EnumSet sections; private final boolean addItems; diff --git a/src/main/java/com/simibubi/create/Create.java b/src/main/java/com/simibubi/create/Create.java index ad59a8017..19dcea020 100644 --- a/src/main/java/com/simibubi/create/Create.java +++ b/src/main/java/com/simibubi/create/Create.java @@ -129,6 +129,7 @@ public class Create { AllEntityDataSerializers.register(modEventBus); AllFeatures.register(modEventBus); AllPlacementModifiers.register(modEventBus); + AllCreativeModeTabs.register(modEventBus); BogeySizes.init(); AllBogeyStyles.register(); diff --git a/src/main/java/com/simibubi/create/compat/jei/GhostIngredientHandler.java b/src/main/java/com/simibubi/create/compat/jei/GhostIngredientHandler.java index 9f3db72c9..0424ccf85 100644 --- a/src/main/java/com/simibubi/create/compat/jei/GhostIngredientHandler.java +++ b/src/main/java/com/simibubi/create/compat/jei/GhostIngredientHandler.java @@ -1,6 +1,6 @@ package com.simibubi.create.compat.jei; -import java.util.ArrayList; +import java.util.LinkedList; import java.util.List; import javax.annotation.ParametersAreNonnullByDefault; @@ -11,7 +11,9 @@ import com.simibubi.create.foundation.gui.menu.AbstractSimiContainerScreen; import com.simibubi.create.foundation.gui.menu.GhostItemMenu; import com.simibubi.create.foundation.gui.menu.GhostItemSubmitPacket; +import mezz.jei.api.constants.VanillaTypes; import mezz.jei.api.gui.handlers.IGhostIngredientHandler; +import mezz.jei.api.ingredients.ITypedIngredient; import net.minecraft.MethodsReturnNonnullByDefault; import net.minecraft.client.renderer.Rect2i; import net.minecraft.world.inventory.Slot; @@ -23,23 +25,24 @@ public class GhostIngredientHandler> implements IGhostIngredientHandler> { @Override - public List> getTargets(AbstractSimiContainerScreen gui, I ingredient, boolean doStart) { - List> targets = new ArrayList<>(); + public List> getTargetsTyped(AbstractSimiContainerScreen gui, ITypedIngredient ingredient, + boolean doStart) { boolean isAttributeFilter = gui instanceof AttributeFilterScreen; - - if (ingredient instanceof ItemStack) { + List> targets = new LinkedList<>(); + + if (ingredient.getType() == VanillaTypes.ITEM_STACK) { for (int i = 36; i < gui.getMenu().slots.size(); i++) { if (gui.getMenu().slots.get(i) .isActive()) targets.add(new GhostTarget<>(gui, i - 36, isAttributeFilter)); - + // Only accept items in 1st slot. 2nd is used for functionality, don't wanna // override that one if (isAttributeFilter) break; } } - + return targets; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java index a4bae1db5..3f7c7cb7d 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/harvester/HarvesterMovementBehaviour.java @@ -117,7 +117,7 @@ public class HarvesterMovementBehaviour implements MovementBehaviour { if (state.getBlock() instanceof CropBlock) { CropBlock crop = (CropBlock) state.getBlock(); if (harvestPartial) - return state.getValue(crop.getAgeProperty()) != 0 || !replant; + return state != crop.getStateForAge(0) || !replant; return crop.isMaxAge(state); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/actors/plough/PloughMovementBehaviour.java b/src/main/java/com/simibubi/create/content/contraptions/actors/plough/PloughMovementBehaviour.java index c0d389d54..1016d70b8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/actors/plough/PloughMovementBehaviour.java +++ b/src/main/java/com/simibubi/create/content/contraptions/actors/plough/PloughMovementBehaviour.java @@ -28,7 +28,7 @@ import net.minecraft.world.level.block.FarmBlock; import net.minecraft.world.level.block.LiquidBlock; import net.minecraft.world.level.block.NetherPortalBlock; import net.minecraft.world.level.block.state.BlockState; -import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; @@ -122,11 +122,10 @@ public class PloughMovementBehaviour extends BlockBreakingMovementBehaviour { if (brokenState.getBlock() == Blocks.SNOW && context.world instanceof ServerLevel) { ServerLevel world = (ServerLevel) context.world; - brokenState - .getDrops(new LootContext.Builder(world).withParameter(LootContextParams.BLOCK_STATE, brokenState) - .withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(pos)) - .withParameter(LootContextParams.THIS_ENTITY, getPlayer(context)) - .withParameter(LootContextParams.TOOL, new ItemStack(Items.IRON_SHOVEL))) + brokenState.getDrops(new LootParams.Builder(world).withParameter(LootContextParams.BLOCK_STATE, brokenState) + .withParameter(LootContextParams.ORIGIN, Vec3.atCenterOf(pos)) + .withParameter(LootContextParams.THIS_ENTITY, getPlayer(context)) + .withParameter(LootContextParams.TOOL, new ItemStack(Items.IRON_SHOVEL))) .forEach(s -> dropItem(context, s)); } } diff --git a/src/main/java/com/simibubi/create/content/contraptions/chassis/AbstractChassisBlock.java b/src/main/java/com/simibubi/create/content/contraptions/chassis/AbstractChassisBlock.java index d406b5d13..9ef623254 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/chassis/AbstractChassisBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/chassis/AbstractChassisBlock.java @@ -84,7 +84,6 @@ public abstract class AbstractChassisBlock extends RotatedPillarBlock implements } @Override - @SuppressWarnings("deprecation") public BlockState rotate(BlockState state, Rotation rotation) { if (rotation == Rotation.NONE) return state; diff --git a/src/main/java/com/simibubi/create/content/contraptions/mounted/CartAssemblerBlock.java b/src/main/java/com/simibubi/create/content/contraptions/mounted/CartAssemblerBlock.java index 90c760339..cd968fae8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/mounted/CartAssemblerBlock.java +++ b/src/main/java/com/simibubi/create/content/contraptions/mounted/CartAssemblerBlock.java @@ -50,7 +50,7 @@ import net.minecraft.world.level.block.state.properties.Property; import net.minecraft.world.level.block.state.properties.RailShape; import net.minecraft.world.level.material.PushReaction; import net.minecraft.world.level.pathfinder.PathComputationType; -import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.Vec3; @@ -264,7 +264,7 @@ public class CartAssemblerBlock extends BaseRailBlock @Override @SuppressWarnings("deprecation") @Nonnull - public List getDrops(@Nonnull BlockState state, @Nonnull LootContext.Builder builder) { + public List getDrops(BlockState state, LootParams.Builder builder) { List drops = super.getDrops(state, builder); drops.addAll(getRailBlock(state).getDrops(builder)); return drops; @@ -273,11 +273,11 @@ public class CartAssemblerBlock extends BaseRailBlock @SuppressWarnings("deprecation") public List getDropsNoRail(BlockState state, ServerLevel world, BlockPos pos, @Nullable BlockEntity p_220077_3_, @Nullable Entity p_220077_4_, ItemStack p_220077_5_) { - return super.getDrops(state, (new LootContext.Builder(world)).withRandom(world.random) - .withParameter(LootContextParams.ORIGIN, Vec3.atLowerCornerOf(pos)) - .withParameter(LootContextParams.TOOL, p_220077_5_) - .withOptionalParameter(LootContextParams.THIS_ENTITY, p_220077_4_) - .withOptionalParameter(LootContextParams.BLOCK_ENTITY, p_220077_3_)); + return super.getDrops(state, + (new LootParams.Builder(world)).withParameter(LootContextParams.ORIGIN, Vec3.atLowerCornerOf(pos)) + .withParameter(LootContextParams.TOOL, p_220077_5_) + .withOptionalParameter(LootContextParams.THIS_ENTITY, p_220077_4_) + .withOptionalParameter(LootContextParams.BLOCK_ENTITY, p_220077_3_)); } @Override diff --git a/src/main/java/com/simibubi/create/content/decoration/TrainTrapdoorBlock.java b/src/main/java/com/simibubi/create/content/decoration/TrainTrapdoorBlock.java index 46795c69f..a79b762ce 100644 --- a/src/main/java/com/simibubi/create/content/decoration/TrainTrapdoorBlock.java +++ b/src/main/java/com/simibubi/create/content/decoration/TrainTrapdoorBlock.java @@ -1,11 +1,11 @@ package com.simibubi.create.content.decoration; +import com.simibubi.create.content.decoration.slidingDoor.SlidingDoorBlock; import com.simibubi.create.content.equipment.wrench.IWrenchable; import net.minecraft.core.BlockPos; import net.minecraft.core.Direction; import net.minecraft.core.Direction.Axis; -import net.minecraft.sounds.SoundEvents; import net.minecraft.world.InteractionHand; import net.minecraft.world.InteractionResult; import net.minecraft.world.entity.player.Player; @@ -19,7 +19,7 @@ import net.minecraft.world.phys.BlockHitResult; public class TrainTrapdoorBlock extends TrapDoorBlock implements IWrenchable { public TrainTrapdoorBlock(Properties p_57526_) { - super(p_57526_, SoundEvents.IRON_TRAPDOOR_CLOSE, SoundEvents.IRON_TRAPDOOR_OPEN); + super(p_57526_, SlidingDoorBlock.TRAIN_SET_TYPE.get()); } public InteractionResult use(BlockState pState, Level pLevel, BlockPos pPos, Player pPlayer, InteractionHand pHand, diff --git a/src/main/java/com/simibubi/create/content/decoration/slidingDoor/SlidingDoorBlock.java b/src/main/java/com/simibubi/create/content/decoration/slidingDoor/SlidingDoorBlock.java index 2f52de0dd..93a0e48bf 100644 --- a/src/main/java/com/simibubi/create/content/decoration/slidingDoor/SlidingDoorBlock.java +++ b/src/main/java/com/simibubi/create/content/decoration/slidingDoor/SlidingDoorBlock.java @@ -1,5 +1,7 @@ package com.simibubi.create.content.decoration.slidingDoor; +import java.util.function.Supplier; + import javax.annotation.Nullable; import com.simibubi.create.AllBlockEntityTypes; @@ -24,10 +26,12 @@ import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.DoorBlock; import net.minecraft.world.level.block.RenderShape; +import net.minecraft.world.level.block.SoundType; import net.minecraft.world.level.block.entity.BlockEntity; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.block.state.StateDefinition.Builder; +import net.minecraft.world.level.block.state.properties.BlockSetType; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.block.state.properties.DoorHingeSide; import net.minecraft.world.level.block.state.properties.DoubleBlockHalf; @@ -38,11 +42,31 @@ import net.minecraft.world.phys.shapes.VoxelShape; public class SlidingDoorBlock extends DoorBlock implements IWrenchable, IBE { + public static final Supplier TRAIN_SET_TYPE = + () -> new BlockSetType("train", true, SoundType.NETHERITE_BLOCK, SoundEvents.IRON_DOOR_CLOSE, + SoundEvents.IRON_DOOR_OPEN, SoundEvents.IRON_TRAPDOOR_CLOSE, SoundEvents.IRON_TRAPDOOR_OPEN, + SoundEvents.METAL_PRESSURE_PLATE_CLICK_OFF, SoundEvents.METAL_PRESSURE_PLATE_CLICK_ON, + SoundEvents.STONE_BUTTON_CLICK_OFF, SoundEvents.STONE_BUTTON_CLICK_ON); + + public static final Supplier GLASS_SET_TYPE = + () -> new BlockSetType("train", true, SoundType.NETHERITE_BLOCK, SoundEvents.IRON_DOOR_CLOSE, + SoundEvents.IRON_DOOR_OPEN, SoundEvents.IRON_TRAPDOOR_CLOSE, SoundEvents.IRON_TRAPDOOR_OPEN, + SoundEvents.METAL_PRESSURE_PLATE_CLICK_OFF, SoundEvents.METAL_PRESSURE_PLATE_CLICK_ON, + SoundEvents.STONE_BUTTON_CLICK_OFF, SoundEvents.STONE_BUTTON_CLICK_ON); + public static final BooleanProperty VISIBLE = BooleanProperty.create("visible"); private boolean folds; - public SlidingDoorBlock(Properties p_52737_, boolean folds) { - super(p_52737_, SoundEvents.IRON_DOOR_CLOSE, SoundEvents.IRON_DOOR_OPEN); + public static SlidingDoorBlock metal(Properties p_52737_, boolean folds) { + return new SlidingDoorBlock(p_52737_, TRAIN_SET_TYPE.get(), folds); + } + + public static SlidingDoorBlock glass(Properties p_52737_, boolean folds) { + return new SlidingDoorBlock(p_52737_, GLASS_SET_TYPE.get(), folds); + } + + public SlidingDoorBlock(Properties p_52737_, BlockSetType type, boolean folds) { + super(p_52737_, type); this.folds = folds; } diff --git a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintEntity.java b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintEntity.java index e5aa920fc..ff9eab2de 100644 --- a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintEntity.java +++ b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintEntity.java @@ -47,6 +47,7 @@ import net.minecraft.world.entity.player.Inventory; import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; import net.minecraft.world.item.crafting.RecipeType; @@ -460,7 +461,7 @@ public class BlueprintEntity extends HangingEntity return section; } - static class BlueprintCraftingInventory extends CraftingContainer { + static class BlueprintCraftingInventory extends TransientCraftingContainer { private static final AbstractContainerMenu dummyContainer = new AbstractContainerMenu(null, -1) { public boolean stillValid(Player playerIn) { diff --git a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintMenu.java b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintMenu.java index 9cb003991..5c7f4da7e 100644 --- a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintMenu.java +++ b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintMenu.java @@ -16,6 +16,7 @@ import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; import net.minecraft.world.inventory.CraftingContainer; import net.minecraft.world.inventory.MenuType; +import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.crafting.CraftingRecipe; import net.minecraft.world.item.crafting.RecipeType; @@ -141,7 +142,7 @@ public class BlueprintMenu extends GhostItemMenu { return contentHolder != null && contentHolder.canPlayerUse(player); } - static class BlueprintCraftingInventory extends CraftingContainer { + static class BlueprintCraftingInventory extends TransientCraftingContainer { public BlueprintCraftingInventory(AbstractContainerMenu menu, ItemStackHandler items) { super(menu, 3, 3); diff --git a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintScreen.java b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintScreen.java index 3df927a67..fb500d60c 100644 --- a/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintScreen.java +++ b/src/main/java/com/simibubi/create/content/equipment/blueprint/BlueprintScreen.java @@ -7,7 +7,6 @@ import java.util.LinkedList; import java.util.List; import com.google.common.collect.ImmutableList; -import com.mojang.blaze3d.vertex.PoseStack; import com.simibubi.create.AllPackets; import com.simibubi.create.AllPartialModels; import com.simibubi.create.content.logistics.filter.FilterScreenPacket; @@ -24,7 +23,6 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.Rect2i; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.item.ItemStack; public class BlueprintScreen extends AbstractSimiContainerScreen { @@ -87,20 +85,16 @@ public class BlueprintScreen extends AbstractSimiContainerScreen @Override protected void renderTooltip(GuiGraphics graphics, int x, int y) { if (!menu.getCarried() - .isEmpty() || this.hoveredSlot == null || this.hoveredSlot.hasItem() - || hoveredSlot.container == menu.playerInventory) { + .isEmpty() || this.hoveredSlot == null || hoveredSlot.container == menu.playerInventory) { super.renderTooltip(graphics, x, y); return; } - graphics.renderComponentTooltip(font, addToTooltip(new LinkedList<>(), hoveredSlot.getSlotIndex(), true), x, y); - } - @Override - public List getTooltipFromItem(ItemStack stack) { - List list = super.getTooltipFromItem(stack); - if (hoveredSlot.container == menu.playerInventory) - return list; - return hoveredSlot != null ? addToTooltip(list, hoveredSlot.getSlotIndex(), false) : list; + List list = new LinkedList<>(); + if (hoveredSlot.hasItem()) + list = getTooltipFromContainerItem(hoveredSlot.getItem()); + + graphics.renderComponentTooltip(font, addToTooltip(list, hoveredSlot.getSlotIndex(), true), x, y); } private List addToTooltip(List list, int slot, boolean isEmptySlot) { diff --git a/src/main/java/com/simibubi/create/content/equipment/clipboard/ClipboardBlock.java b/src/main/java/com/simibubi/create/content/equipment/clipboard/ClipboardBlock.java index 24de58e47..1977acb5d 100644 --- a/src/main/java/com/simibubi/create/content/equipment/clipboard/ClipboardBlock.java +++ b/src/main/java/com/simibubi/create/content/equipment/clipboard/ClipboardBlock.java @@ -31,7 +31,7 @@ import net.minecraft.world.level.block.state.StateDefinition.Builder; import net.minecraft.world.level.block.state.properties.AttachFace; import net.minecraft.world.level.block.state.properties.BooleanProperty; import net.minecraft.world.level.material.FluidState; -import net.minecraft.world.level.storage.loot.LootContext; +import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.BlockHitResult; import net.minecraft.world.phys.shapes.CollisionContext; @@ -139,11 +139,10 @@ public class ClipboardBlock extends FaceAttachedHorizontalDirectionalBlock @Override @SuppressWarnings("deprecation") - public List getDrops(BlockState pState, LootContext.Builder pBuilder) { + public List getDrops(BlockState pState, LootParams.Builder pBuilder) { if (!(pBuilder.getOptionalParameter(LootContextParams.BLOCK_ENTITY) instanceof ClipboardBlockEntity cbe)) return super.getDrops(pState, pBuilder); - pBuilder.withDynamicDrop(ShulkerBoxBlock.CONTENTS, - (p_56218_, p_56219_) -> p_56219_.accept(cbe.dataContainer.copy())); + pBuilder.withDynamicDrop(ShulkerBoxBlock.CONTENTS, p_56219_ -> p_56219_.accept(cbe.dataContainer.copy())); return ImmutableList.of(cbe.dataContainer.copy()); } diff --git a/src/main/java/com/simibubi/create/content/equipment/symmetryWand/SymmetryHandler.java b/src/main/java/com/simibubi/create/content/equipment/symmetryWand/SymmetryHandler.java index b0b8b2b57..06e1c2e07 100644 --- a/src/main/java/com/simibubi/create/content/equipment/symmetryWand/SymmetryHandler.java +++ b/src/main/java/com/simibubi/create/content/equipment/symmetryWand/SymmetryHandler.java @@ -30,7 +30,8 @@ import net.minecraft.world.level.block.Blocks; import net.minecraft.world.phys.Vec3; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; -import net.minecraftforge.client.event.RenderLevelLastEvent; +import net.minecraftforge.client.event.RenderLevelStageEvent; +import net.minecraftforge.client.event.RenderLevelStageEvent.Stage; import net.minecraftforge.client.model.data.ModelData; import net.minecraftforge.event.TickEvent.ClientTickEvent; import net.minecraftforge.event.TickEvent.Phase; @@ -84,7 +85,10 @@ public class SymmetryHandler { @OnlyIn(Dist.CLIENT) @SubscribeEvent - public static void render(RenderLevelLastEvent event) { + public static void onRenderWorld(RenderLevelStageEvent event) { + if (event.getStage() != Stage.AFTER_PARTICLES) + return; + Minecraft mc = Minecraft.getInstance(); LocalPlayer player = mc.player; RandomSource random = RandomSource.create(); diff --git a/src/main/java/com/simibubi/create/content/fluids/PipeAttachmentModel.java b/src/main/java/com/simibubi/create/content/fluids/PipeAttachmentModel.java index b2da9549f..c030955dc 100644 --- a/src/main/java/com/simibubi/create/content/fluids/PipeAttachmentModel.java +++ b/src/main/java/com/simibubi/create/content/fluids/PipeAttachmentModel.java @@ -56,7 +56,6 @@ public class PipeAttachmentModel extends BakedModelWrapperWithData { } // TODO: Update once MinecraftForge#9163 is merged - @SuppressWarnings("removal") @Override public ChunkRenderTypeSet getRenderTypes(@NotNull BlockState state, @NotNull RandomSource rand, @NotNull ModelData data) { ChunkRenderTypeSet set = super.getRenderTypes(state, rand, data); diff --git a/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java b/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java index 224988808..bf920494d 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java +++ b/src/main/java/com/simibubi/create/content/kinetics/belt/BeltBlock.java @@ -73,6 +73,7 @@ import net.minecraft.world.level.material.FluidState; import net.minecraft.world.level.material.Fluids; import net.minecraft.world.level.pathfinder.BlockPathTypes; import net.minecraft.world.level.pathfinder.PathComputationType; +import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.level.storage.loot.parameters.LootContextParams; import net.minecraft.world.phys.AABB; import net.minecraft.world.phys.BlockHitResult; @@ -139,8 +140,7 @@ public class BeltBlock extends HorizontalKineticBlock @SuppressWarnings("deprecation") @Override - public List getDrops(BlockState state, - net.minecraft.world.level.storage.loot.LootContext.Builder builder) { + public List getDrops(BlockState state, LootParams.Builder builder) { List drops = super.getDrops(state, builder); BlockEntity blockEntity = builder.getOptionalParameter(LootContextParams.BLOCK_ENTITY); if (blockEntity instanceof BeltBlockEntity && ((BeltBlockEntity) blockEntity).hasPulley()) diff --git a/src/main/java/com/simibubi/create/content/kinetics/crafter/MechanicalCraftingInventory.java b/src/main/java/com/simibubi/create/content/kinetics/crafter/MechanicalCraftingInventory.java index bb9808fce..cd64c6ee0 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/crafter/MechanicalCraftingInventory.java +++ b/src/main/java/com/simibubi/create/content/kinetics/crafter/MechanicalCraftingInventory.java @@ -6,10 +6,10 @@ import com.simibubi.create.content.kinetics.crafter.RecipeGridHandler.GroupedIte import net.minecraft.world.entity.player.Player; import net.minecraft.world.inventory.AbstractContainerMenu; -import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; -public class MechanicalCraftingInventory extends CraftingContainer { +public class MechanicalCraftingInventory extends TransientCraftingContainer { private static final AbstractContainerMenu dummyContainer = new AbstractContainerMenu(null, -1) { public boolean stillValid(Player playerIn) { diff --git a/src/main/java/com/simibubi/create/content/kinetics/deployer/DeployerFakePlayer.java b/src/main/java/com/simibubi/create/content/kinetics/deployer/DeployerFakePlayer.java index 7f0350357..c3a8e079a 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/deployer/DeployerFakePlayer.java +++ b/src/main/java/com/simibubi/create/content/kinetics/deployer/DeployerFakePlayer.java @@ -40,9 +40,9 @@ import net.minecraftforge.api.distmarker.OnlyIn; import net.minecraftforge.common.UsernameCache; import net.minecraftforge.common.util.FakePlayer; import net.minecraftforge.event.entity.EntityEvent; +import net.minecraftforge.event.entity.living.LivingChangeTargetEvent; import net.minecraftforge.event.entity.living.LivingDropsEvent; import net.minecraftforge.event.entity.living.LivingExperienceDropEvent; -import net.minecraftforge.event.entity.living.LivingSetAttackTargetEvent; import net.minecraftforge.eventbus.api.EventPriority; import net.minecraftforge.eventbus.api.SubscribeEvent; import net.minecraftforge.fml.common.Mod.EventBusSubscriber; @@ -149,8 +149,8 @@ public class DeployerFakePlayer extends FakePlayer { } @SubscribeEvent - public static void entitiesDontRetaliate(LivingSetAttackTargetEvent event) { - if (!(event.getTarget() instanceof DeployerFakePlayer)) + public static void entitiesDontRetaliate(LivingChangeTargetEvent event) { + if (!(event.getNewTarget() instanceof DeployerFakePlayer)) return; LivingEntity entityLiving = event.getEntity(); if (!(entityLiving instanceof Mob)) diff --git a/src/main/java/com/simibubi/create/content/kinetics/gearbox/GearboxBlock.java b/src/main/java/com/simibubi/create/content/kinetics/gearbox/GearboxBlock.java index 674deb1b2..5458b8e2d 100644 --- a/src/main/java/com/simibubi/create/content/kinetics/gearbox/GearboxBlock.java +++ b/src/main/java/com/simibubi/create/content/kinetics/gearbox/GearboxBlock.java @@ -19,7 +19,7 @@ import net.minecraft.world.level.LevelReader; import net.minecraft.world.level.block.entity.BlockEntityType; import net.minecraft.world.level.block.state.BlockState; import net.minecraft.world.level.material.PushReaction; -import net.minecraft.world.level.storage.loot.LootContext.Builder; +import net.minecraft.world.level.storage.loot.LootParams; import net.minecraft.world.phys.HitResult; public class GearboxBlock extends RotatedPillarKineticBlock implements IBE { @@ -35,7 +35,7 @@ public class GearboxBlock extends RotatedPillarKineticBlock implements IBE getDrops(BlockState state, Builder builder) { + public List getDrops(BlockState state, LootParams.Builder builder) { if (state.getValue(AXIS).isVertical()) return super.getDrops(state, builder); return Arrays.asList(new ItemStack(AllItems.VERTICAL_GEARBOX.get())); diff --git a/src/main/java/com/simibubi/create/content/redstone/DirectedDirectionalBlock.java b/src/main/java/com/simibubi/create/content/redstone/DirectedDirectionalBlock.java index 5fb2d1c05..50c77a698 100644 --- a/src/main/java/com/simibubi/create/content/redstone/DirectedDirectionalBlock.java +++ b/src/main/java/com/simibubi/create/content/redstone/DirectedDirectionalBlock.java @@ -79,7 +79,6 @@ public class DirectedDirectionalBlock extends HorizontalDirectionalBlock impleme } @Override - @SuppressWarnings("deprecation") public BlockState transform(BlockState state, StructureTransform transform) { if (transform.mirror != null) state = mirror(state, transform.mirror); diff --git a/src/main/java/com/simibubi/create/content/redstone/link/controller/LinkedControllerScreen.java b/src/main/java/com/simibubi/create/content/redstone/link/controller/LinkedControllerScreen.java index 6ef5313c7..916e5ff73 100644 --- a/src/main/java/com/simibubi/create/content/redstone/link/controller/LinkedControllerScreen.java +++ b/src/main/java/com/simibubi/create/content/redstone/link/controller/LinkedControllerScreen.java @@ -20,7 +20,6 @@ import net.minecraft.client.gui.GuiGraphics; import net.minecraft.client.renderer.Rect2i; import net.minecraft.network.chat.Component; import net.minecraft.world.entity.player.Inventory; -import net.minecraft.world.item.ItemStack; public class LinkedControllerScreen extends AbstractSimiContainerScreen { @@ -90,20 +89,16 @@ public class LinkedControllerScreen extends AbstractSimiContainerScreen(), hoveredSlot.getSlotIndex()), x, y); - } - @Override - public List getTooltipFromItem(ItemStack stack) { - List list = super.getTooltipFromItem(stack); - if (hoveredSlot.container == menu.playerInventory) - return list; - return hoveredSlot != null ? addToTooltip(list, hoveredSlot.getSlotIndex()) : list; + List list = new LinkedList<>(); + if (hoveredSlot.hasItem()) + list = getTooltipFromContainerItem(hoveredSlot.getItem()); + + graphics.renderComponentTooltip(font, addToTooltip(list, hoveredSlot.getSlotIndex()), x, y); } private List addToTooltip(List list, int slot) { diff --git a/src/main/java/com/simibubi/create/content/schematics/SchematicChunkSource.java b/src/main/java/com/simibubi/create/content/schematics/SchematicChunkSource.java index 08cac4e01..11aea1308 100644 --- a/src/main/java/com/simibubi/create/content/schematics/SchematicChunkSource.java +++ b/src/main/java/com/simibubi/create/content/schematics/SchematicChunkSource.java @@ -20,7 +20,6 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.entity.player.Player; import net.minecraft.world.flag.FeatureFlagSet; import net.minecraft.world.item.crafting.RecipeManager; -import net.minecraft.world.level.BlockGetter; import net.minecraft.world.level.Level; import net.minecraft.world.level.biome.Biome; import net.minecraft.world.level.block.Block; @@ -97,19 +96,21 @@ public class SchematicChunkSource extends ChunkSource { public static class EmptierChunk extends LevelChunk { private static final class DummyLevel extends Level { - private final RegistryAccess access; - - private DummyLevel(WritableLevelData p_46450_, ResourceKey p_46451_, Holder p_46452_, - Supplier p_46453_, boolean p_46454_, boolean p_46455_, long p_46456_, int p_220359_, - RegistryAccess access) { - super(p_46450_, p_46451_, p_46452_, p_46453_, p_46454_, p_46455_, p_46456_, p_220359_); - this.access = access; + + private DummyLevel(WritableLevelData pLevelData, ResourceKey pDimension, + RegistryAccess pRegistryAccess, Holder pDimensionTypeRegistration, + Supplier pProfiler, boolean pIsClientSide, boolean pIsDebug, long pBiomeZoomSeed, + int pMaxChainedNeighborUpdates) { + super(pLevelData, pDimension, pRegistryAccess, pDimensionTypeRegistration, pProfiler, pIsClientSide, pIsDebug, + pBiomeZoomSeed, pMaxChainedNeighborUpdates); + access = pRegistryAccess; } + private final RegistryAccess access; + private DummyLevel(RegistryAccess access) { - this(null, null, access - .registryOrThrow(Registries.DIMENSION_TYPE) - .getHolderOrThrow(BuiltinDimensionTypes.OVERWORLD), null, false, false, 0, 0, access); + this(null, null, access, access.registryOrThrow(Registries.DIMENSION_TYPE) + .getHolderOrThrow(BuiltinDimensionTypes.OVERWORLD), null, false, false, 0, 0); } @Override diff --git a/src/main/java/com/simibubi/create/foundation/damageTypes/DamageTypeData.java b/src/main/java/com/simibubi/create/foundation/damageTypes/DamageTypeData.java index d5534a0a5..bfd827b4d 100644 --- a/src/main/java/com/simibubi/create/foundation/damageTypes/DamageTypeData.java +++ b/src/main/java/com/simibubi/create/foundation/damageTypes/DamageTypeData.java @@ -177,7 +177,6 @@ public class DamageTypeData { *
  • {@link DeathMessageType#INTENTIONAL_GAME_DESIGN}: "death.attack." + msgId, wrapped in brackets, linking to MCPE-28723
  • * */ - @SuppressWarnings("JavadocReference") public Builder deathMessageType(DeathMessageType type) { this.deathMessageType = type; return this; diff --git a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java index c8108efe4..9c0adcdb0 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java +++ b/src/main/java/com/simibubi/create/foundation/data/BuilderTransformers.java @@ -141,7 +141,7 @@ public class BuilderTransformers { } public static NonNullUnaryOperator> slidingDoor(String type) { - return b -> b.initialProperties(Material.NETHER_WOOD) // for villager AI. FIXME 1.20.1 consider a blocksettype? + return b -> b.initialProperties(() -> Blocks.IRON_DOOR) .properties(p -> p.requiresCorrectToolForDrops() .strength(3.0F, 6.0F)) .blockstate((c, p) -> { diff --git a/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java b/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java index 5368f2013..99178a5dd 100644 --- a/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/recipe/StandardRecipeGen.java @@ -38,8 +38,8 @@ import net.minecraft.data.recipes.RecipeCategory; import net.minecraft.data.recipes.ShapedRecipeBuilder; import net.minecraft.data.recipes.ShapelessRecipeBuilder; import net.minecraft.data.recipes.SimpleCookingRecipeBuilder; +import net.minecraft.data.recipes.SmithingTransformRecipeBuilder; import net.minecraft.data.recipes.SpecialRecipeBuilder; -import net.minecraft.data.recipes.UpgradeRecipeBuilder; import net.minecraft.resources.ResourceLocation; import net.minecraft.tags.ItemTags; import net.minecraft.tags.TagKey; @@ -1111,18 +1111,18 @@ public class StandardRecipeGen extends CreateRecipeProvider { .requires(Items.BONE_MEAL)), NETHERITE_DIVING_HELMET = - create(AllItems.NETHERITE_DIVING_HELMET).viaSmithing(AllItems.COPPER_DIVING_HELMET::get, I::netherite), + create(AllItems.NETHERITE_DIVING_HELMET).viaNetheriteSmithing(AllItems.COPPER_DIVING_HELMET::get, I::netherite), NETHERITE_BACKTANK = - create(AllItems.NETHERITE_BACKTANK).viaSmithing(AllItems.COPPER_BACKTANK::get, I::netherite), + create(AllItems.NETHERITE_BACKTANK).viaNetheriteSmithing(AllItems.COPPER_BACKTANK::get, I::netherite), NETHERITE_DIVING_BOOTS = - create(AllItems.NETHERITE_DIVING_BOOTS).viaSmithing(AllItems.COPPER_DIVING_BOOTS::get, I::netherite), + create(AllItems.NETHERITE_DIVING_BOOTS).viaNetheriteSmithing(AllItems.COPPER_DIVING_BOOTS::get, I::netherite), NETHERITE_DIVING_HELMET_2 = create(AllItems.NETHERITE_DIVING_HELMET).withSuffix("_from_netherite") - .viaSmithing(() -> Items.NETHERITE_HELMET, () -> Ingredient.of(AllItems.COPPER_DIVING_HELMET.get())), + .viaNetheriteSmithing(() -> Items.NETHERITE_HELMET, () -> Ingredient.of(AllItems.COPPER_DIVING_HELMET.get())), NETHERITE_BACKTANK_2 = create(AllItems.NETHERITE_BACKTANK).withSuffix("_from_netherite") - .viaSmithing(() -> Items.NETHERITE_CHESTPLATE, () -> Ingredient.of(AllItems.COPPER_BACKTANK.get())), + .viaNetheriteSmithing(() -> Items.NETHERITE_CHESTPLATE, () -> Ingredient.of(AllItems.COPPER_BACKTANK.get())), NETHERITE_DIVING_BOOTS_2 = create(AllItems.NETHERITE_DIVING_BOOTS).withSuffix("_from_netherite") - .viaSmithing(() -> Items.NETHERITE_BOOTS, () -> Ingredient.of(AllItems.COPPER_DIVING_BOOTS.get())) + .viaNetheriteSmithing(() -> Items.NETHERITE_BOOTS, () -> Ingredient.of(AllItems.COPPER_DIVING_BOOTS.get())) ; @@ -1367,11 +1367,12 @@ public class StandardRecipeGen extends CreateRecipeProvider { }); } - GeneratedRecipe viaSmithing(Supplier base, Supplier upgradeMaterial) { + GeneratedRecipe viaNetheriteSmithing(Supplier base, Supplier upgradeMaterial) { return register(consumer -> { - UpgradeRecipeBuilder b = UpgradeRecipeBuilder.smithing(Ingredient.of(base.get()), upgradeMaterial.get(), - RecipeCategory.COMBAT, result.get() - .asItem()); + SmithingTransformRecipeBuilder b = + SmithingTransformRecipeBuilder.smithing(Ingredient.of(Items.NETHERITE_UPGRADE_SMITHING_TEMPLATE), + Ingredient.of(base.get()), upgradeMaterial.get(), RecipeCategory.COMBAT, result.get() + .asItem()); b.unlocks("has_item", inventoryTrigger(ItemPredicate.Builder.item() .of(base.get()) .build())); diff --git a/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java b/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java index 45f480a03..c22d0c51f 100644 --- a/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java +++ b/src/main/java/com/simibubi/create/foundation/events/ClientEvents.java @@ -85,7 +85,8 @@ import net.minecraftforge.client.event.ClientPlayerNetworkEvent; import net.minecraftforge.client.event.EntityRenderersEvent; import net.minecraftforge.client.event.RegisterClientReloadListenersEvent; import net.minecraftforge.client.event.RegisterGuiOverlaysEvent; -import net.minecraftforge.client.event.RenderLevelLastEvent; +import net.minecraftforge.client.event.RenderLevelStageEvent; +import net.minecraftforge.client.event.RenderLevelStageEvent.Stage; import net.minecraftforge.client.event.RenderTooltipEvent; import net.minecraftforge.client.event.ViewportEvent; import net.minecraftforge.client.gui.overlay.VanillaGuiOverlay; @@ -204,7 +205,10 @@ public class ClientEvents { } @SubscribeEvent - public static void onRenderWorld(RenderLevelLastEvent event) { + public static void onRenderWorld(RenderLevelStageEvent event) { + if (event.getStage() != Stage.AFTER_PARTICLES) + return; + PoseStack ms = event.getPoseStack(); ms.pushPose(); SuperRenderTypeBuffer buffer = SuperRenderTypeBuffer.getInstance(); diff --git a/src/main/java/com/simibubi/create/foundation/recipe/DummyCraftingContainer.java b/src/main/java/com/simibubi/create/foundation/recipe/DummyCraftingContainer.java index b8b70342e..de54ae949 100644 --- a/src/main/java/com/simibubi/create/foundation/recipe/DummyCraftingContainer.java +++ b/src/main/java/com/simibubi/create/foundation/recipe/DummyCraftingContainer.java @@ -4,11 +4,11 @@ import org.jetbrains.annotations.NotNull; import net.minecraft.core.NonNullList; import net.minecraft.world.entity.player.StackedContents; -import net.minecraft.world.inventory.CraftingContainer; +import net.minecraft.world.inventory.TransientCraftingContainer; import net.minecraft.world.item.ItemStack; import net.minecraftforge.items.IItemHandler; -public class DummyCraftingContainer extends CraftingContainer { +public class DummyCraftingContainer extends TransientCraftingContainer { private final NonNullList inv; diff --git a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java index e6a78eec0..31a290806 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java +++ b/src/main/java/com/simibubi/create/foundation/utility/BlockHelper.java @@ -218,7 +218,7 @@ public class BlockHelper { int idx = chunk.getSectionIndex(target.getY()); LevelChunkSection chunksection = chunk.getSection(idx); if (chunksection == null) { - chunksection = new LevelChunkSection(chunk.getSectionYFromSectionIndex(idx), world.registryAccess() + chunksection = new LevelChunkSection(world.registryAccess() .registryOrThrow(Registries.BIOME)); chunk.getSections()[idx] = chunksection; } diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java index ce75d7772..8dc014ec9 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedServerWorld.java @@ -36,7 +36,7 @@ public class WrappedServerWorld extends ServerLevel { (ServerLevelData) world.getLevelData(), world.dimension(), new LevelStem(world.dimensionTypeRegistration(), world.getChunkSource().getGenerator()), new DummyStatusListener(), world.isDebug(), world.getBiomeManager().biomeZoomSeed, - Collections.emptyList(), false); + Collections.emptyList(), false, world.getRandomSequences()); this.world = world; } diff --git a/src/main/resources/META-INF/accesstransformer.cfg b/src/main/resources/META-INF/accesstransformer.cfg index f36cf7300..0b1fdbe6a 100644 --- a/src/main/resources/META-INF/accesstransformer.cfg +++ b/src/main/resources/META-INF/accesstransformer.cfg @@ -14,6 +14,7 @@ public net.minecraft.server.network.ServerGamePacketListenerImpl f_9737_ # above public net.minecraft.server.network.ServerGamePacketListenerImpl f_9739_ # aboveGroundVehicleTickCount public net.minecraft.world.entity.Entity f_146795_ # removalReason +public net.minecraft.world.entity.Entity f_19853_ # level protected net.minecraft.world.entity.Entity m_19956_(Lnet/minecraft/world/entity/Entity;Lnet/minecraft/world/entity/Entity$MoveFunction;)V # positionRider public net.minecraft.world.entity.LivingEntity f_20899_ # jumping