From 2f2a5674f36b600f7e8ecc051c5d08c3077267b0 Mon Sep 17 00:00:00 2001 From: grimmauld Date: Tue, 22 Sep 2020 23:18:13 +0200 Subject: [PATCH] Ok, still above 100 compile errors, but progress... --- .../jei/category/CreateRecipeCategory.java | 3 ++- .../animations/AnimatedBlazeBurner.java | 9 +++++---- .../category/animations/AnimatedCrafter.java | 17 +++++++++-------- .../jei/category/animations/AnimatedSaw.java | 5 +++-- .../base/GeneratingKineticTileEntity.java | 12 +++++++----- .../contraptions/base/KineticTileEntity.java | 15 ++++++++------- .../actors/BlockBreakingKineticTileEntity.java | 4 ++-- .../components/clock/CuckooClockTileEntity.java | 5 +++-- .../crafter/MechanicalCrafterTileEntity.java | 9 ++------- .../components/crank/HandCrankTileEntity.java | 5 +++-- .../CrushingWheelControllerTileEntity.java | 5 +++-- .../components/deployer/DeployerFakePlayer.java | 2 +- .../components/deployer/DeployerTileEntity.java | 10 +++------- .../components/fan/EncasedFanTileEntity.java | 4 ++-- .../components/fan/NozzleTileEntity.java | 5 +++-- .../components/flywheel/FlywheelTileEntity.java | 5 +++-- .../millstone/MillstoneTileEntity.java | 5 +++-- .../mixer/MechanicalMixerTileEntity.java | 4 ++-- .../press/MechanicalPressTileEntity.java | 5 +++-- .../components/saw/SawTileEntity.java | 9 ++------- .../bearing/ClockworkBearingTileEntity.java | 5 +++-- .../bearing/MechanicalBearingTileEntity.java | 4 ++-- .../piston/LinearActuatorTileEntity.java | 5 +++-- .../piston/MechanicalPistonTileEntity.java | 5 +++-- .../pulley/PulleyTileEntity.java | 4 ++-- .../waterwheel/WaterWheelTileEntity.java | 5 +++-- .../contraptions/fluids/PumpTileEntity.java | 4 ++-- .../fluids/actors/SpoutTileEntity.java | 5 +++-- .../fluids/tank/FluidTankTileEntity.java | 4 ++-- .../processing/BasinTileEntity.java | 4 ++-- .../burner/BlazeBurnerTileEntity.java | 5 +++-- .../sequencer/InstructionSpeedModifiers.java | 5 +++-- .../sequencer/SequencedGearshiftTileEntity.java | 5 +++-- .../sequencer/SequencerInstructions.java | 7 ++++--- .../relays/belt/BeltTileEntity.java | 4 ++-- .../encased/AdjustablePulleyTileEntity.java | 5 +++-- .../relays/gauge/GaugeTileEntity.java | 5 +++-- .../symmetry/mirror/SymmetryMirror.java | 3 ++- .../tools/SandPaperItemRenderer.java | 3 ++- .../content/curiosities/zapper/ZapperItem.java | 12 ++++++------ .../zapper/blockzapper/BlockzapperItem.java | 13 ++++++------- .../zapper/terrainzapper/WorldshaperItem.java | 3 ++- .../belts/observer/BeltObserverTileEntity.java | 5 +++-- .../belts/tunnel/BeltTunnelTileEntity.java | 4 ++-- .../belts/tunnel/BrassTunnelTileEntity.java | 4 ++-- .../logistics/block/chute/ChuteTileEntity.java | 4 ++-- .../logistics/block/depot/DepotTileEntity.java | 5 +++-- .../diodes/AdjustableRepeaterTileEntity.java | 8 +++++--- .../block/funnel/FunnelTileEntity.java | 4 ++-- .../inventories/AdjustableCrateTileEntity.java | 5 +++-- .../block/mechanicalArm/ArmTileEntity.java | 4 ++-- .../block/redstone/AnalogLeverTileEntity.java | 5 +++-- .../block/redstone/RedstoneLinkTileEntity.java | 4 ++-- .../redstone/StockpileSwitchTileEntity.java | 4 ++-- .../block/SchematicannonTileEntity.java | 4 ++-- .../create/foundation/data/BlockStateGen.java | 12 ++++++------ .../create/foundation/gui/AllGuiTextures.java | 9 +++++---- .../create/foundation/gui/AllIcons.java | 8 ++++---- .../create/foundation/item/ItemDescription.java | 4 ++-- .../scrollvalue/ScrollValueBehaviour.java | 4 ++-- .../worldWrappers/WrappedServerWorld.java | 14 ++++---------- .../utility/worldWrappers/WrappedWorld.java | 3 ++- 62 files changed, 191 insertions(+), 176 deletions(-) diff --git a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java index 59e5a866d..8c5c00bb5 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/CreateRecipeCategory.java @@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack; import net.minecraft.item.crafting.IRecipe; import net.minecraft.util.IItemProvider; import net.minecraft.util.ResourceLocation; +import net.minecraft.util.text.ITextComponent; import net.minecraft.util.text.TextFormatting; public abstract class CreateRecipeCategory> implements IRecipeCategory { @@ -45,7 +46,7 @@ public abstract class CreateRecipeCategory> implements IRec } @Override - public String getTitle() { + public ITextComponent getTitle() { return Lang.translate("recipe." + name); } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedBlazeBurner.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedBlazeBurner.java index c0753303b..90fb942b9 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedBlazeBurner.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedBlazeBurner.java @@ -1,5 +1,6 @@ package com.simibubi.create.compat.jei.category.animations; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.AllBlockPartials; import com.simibubi.create.AllBlocks; @@ -17,9 +18,9 @@ public class AnimatedBlazeBurner implements IDrawable { return this; } - public void draw(int xOffset, int yOffset) { - RenderSystem.pushMatrix(); - RenderSystem.translatef(xOffset, yOffset, 200); + public void draw(MatrixStack matrixStack, int xOffset, int yOffset) { + matrixStack.push(); + matrixStack.translate(xOffset, yOffset, 200); RenderSystem.rotatef(-15.5f, 1, 0, 0); RenderSystem.rotatef(22.5f, 0, 1, 0); int scale = 23; @@ -36,7 +37,7 @@ public class AnimatedBlazeBurner implements IDrawable { .scale(scale) .render(); - RenderSystem.popMatrix(); + matrixStack.pop(); } @Override diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java index 54ca7f4f1..9cd1ab3fd 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedCrafter.java @@ -1,5 +1,6 @@ package com.simibubi.create.compat.jei.category.animations; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.AllBlocks; import com.simibubi.create.foundation.gui.AllGuiTextures; @@ -8,14 +9,14 @@ import com.simibubi.create.foundation.gui.GuiGameElement; public class AnimatedCrafter extends AnimatedKinetics { @Override - public void draw(int xOffset, int yOffset) { - RenderSystem.pushMatrix(); - RenderSystem.translatef(xOffset, yOffset, 0); - AllGuiTextures.JEI_SHADOW.draw(-16, 13); + public void draw(MatrixStack matrixStack, int xOffset, int yOffset) { + matrixStack.push(); + matrixStack.translate(xOffset, yOffset, 0); + AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13); - RenderSystem.translatef(3, 16, 0); - RenderSystem.rotatef(-12.5f, 1, 0, 0); - RenderSystem.rotatef(-22.5f, 0, 1, 0); + matrixStack.translate(3, 16, 0); + // RenderSystem.rotatef(-12.5f, 1, 0, 0); + // RenderSystem.rotatef(-22.5f, 0, 1, 0); int scale = 22; GuiGameElement.of(cogwheel()) @@ -28,7 +29,7 @@ public class AnimatedCrafter extends AnimatedKinetics { .scale(scale) .render(); - RenderSystem.popMatrix(); + matrixStack.pop(); } } diff --git a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSaw.java b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSaw.java index be4b7a1f3..14d38761c 100644 --- a/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSaw.java +++ b/src/main/java/com/simibubi/create/compat/jei/category/animations/AnimatedSaw.java @@ -1,5 +1,6 @@ package com.simibubi.create.compat.jei.category.animations; +import com.mojang.blaze3d.matrix.MatrixStack; import com.mojang.blaze3d.systems.RenderSystem; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.components.saw.SawBlock; @@ -12,10 +13,10 @@ import net.minecraft.util.Direction.Axis; public class AnimatedSaw extends AnimatedKinetics { @Override - public void draw(int xOffset, int yOffset) { + public void draw(MatrixStack matrixStack, int xOffset, int yOffset) { RenderSystem.pushMatrix(); RenderSystem.translatef(xOffset, yOffset, 0); - AllGuiTextures.JEI_SHADOW.draw(-16, 13); + AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13); RenderSystem.translatef(0, 0, 200); RenderSystem.translatef(-6, 19, 0); diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java index e04c3f99e..159de3af7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/GeneratingKineticTileEntity.java @@ -10,6 +10,8 @@ import com.simibubi.create.foundation.utility.Lang; import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.BlockPos; +import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; public abstract class GeneratingKineticTileEntity extends KineticTileEntity { @@ -52,13 +54,13 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity { } @Override - public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneaking) { + public boolean addToGoggleTooltip(List tooltip, boolean isPlayerSneaking) { boolean added = super.addToGoggleTooltip(tooltip, isPlayerSneaking); float stressBase = calculateAddedStressCapacity(); if (stressBase != 0 && IRotate.StressImpact.isEnabled()) { - tooltip.add(spacing + Lang.translate("gui.goggles.generator_stats")); - tooltip.add(spacing + TextFormatting.GRAY + Lang.translate("tooltip.capacityProvided")); + tooltip.add(new StringTextComponent(spacing).append(Lang.translate("gui.goggles.generator_stats"))); + tooltip.add(new StringTextComponent(spacing).append(Lang.translate("tooltip.capacityProvided").formatted(TextFormatting.GRAY))); float speed = getTheoreticalSpeed(); if (speed != getGeneratedSpeed() && speed != 0) @@ -68,8 +70,8 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity { float stressTotal = stressBase * speed; String stressString = spacing + "%s%s" + Lang.translate("generic.unit.stress") + " " + TextFormatting.DARK_GRAY + "%s"; - tooltip.add(String.format(stressString, TextFormatting.AQUA, IHaveGoggleInformation.format(stressBase), Lang.translate("gui.goggles.base_value"))); - tooltip.add(String.format(stressString, TextFormatting.GRAY, IHaveGoggleInformation.format(stressTotal), Lang.translate("gui.goggles.at_current_speed"))); + tooltip.add(String.format(stressString, IHaveGoggleInformation.format(stressBase), Lang.translate("gui.goggles.base_value").getUnformattedComponentText())); + tooltip.add(String.format(stressString, TextFormatting.GRAY, IHaveGoggleInformation.format(stressTotal), Lang.translate("gui.goggles.at_current_speed").getUnformattedComponentText())); added = true; } diff --git a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java index 1732f3dcc..762fc5e20 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/base/KineticTileEntity.java @@ -32,6 +32,7 @@ import net.minecraft.util.Direction; import net.minecraft.util.Direction.AxisDirection; import net.minecraft.util.math.BlockPos; import net.minecraft.util.text.ITextComponent; +import net.minecraft.util.text.StringTextComponent; import net.minecraft.util.text.TextFormatting; import net.minecraft.world.World; @@ -211,13 +212,13 @@ public abstract class KineticTileEntity extends SmartTileEntity } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { boolean overStressedBefore = overStressed; clearKineticInformation(); // DO NOT READ kinetic information when placed after movement if (wasMoved) { - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); return; } @@ -237,7 +238,7 @@ public abstract class KineticTileEntity extends SmartTileEntity overStressed = capacity < stress && StressImpact.isEnabled(); } - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (clientPacket && overStressedBefore != overStressed && speed != 0) effects.triggerOverStressedEffect(); @@ -377,9 +378,9 @@ public abstract class KineticTileEntity extends SmartTileEntity if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) { tooltip.add(ITextComponent.of(spacing + GOLD + Lang.translate("gui.stressometer.overstressed"))); - String hint = Lang.translate("gui.contraptions.network_overstressed", I18n.format(getBlockState().getBlock() + ITextComponent hint = Lang.translate("gui.contraptions.network_overstressed", I18n.format(getBlockState().getBlock() .getTranslationKey())); - List cutString = TooltipHelper.cutString(spacing + hint, GRAY, TextFormatting.WHITE); + List cutString = TooltipHelper.cutString(new StringTextComponent(spacing).append(hint), GRAY, TextFormatting.WHITE); for (int i = 0; i < cutString.size(); i++) tooltip.add(ITextComponent.of((i == 0 ? "" : spacing) + cutString.get(i))); return true; @@ -387,9 +388,9 @@ public abstract class KineticTileEntity extends SmartTileEntity if (notFastEnough) { tooltip.add(ITextComponent.of(spacing + GOLD + Lang.translate("tooltip.speedRequirement"))); - String hint = Lang.translate("gui.contraptions.not_fast_enough", I18n.format(getBlockState().getBlock() + ITextComponent hint = Lang.translate("gui.contraptions.not_fast_enough", I18n.format(getBlockState().getBlock() .getTranslationKey())); - List cutString = TooltipHelper.cutString(spacing + hint, GRAY, TextFormatting.WHITE); + List cutString = TooltipHelper.cutString(new StringTextComponent(spacing).append(hint), GRAY, TextFormatting.WHITE); for (int i = 0; i < cutString.size(); i++) tooltip.add(ITextComponent.of((i == 0 ? "" : spacing) + cutString.get(i))); return true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java index c41298383..5b90be56e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/actors/BlockBreakingKineticTileEntity.java @@ -67,12 +67,12 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { destroyProgress = compound.getInt("Progress"); ticksUntilNextProgress = compound.getInt("NextTick"); if (compound.contains("Breaking")) breakingPos = NBTUtil.readBlockPos(compound.getCompound("Breaking")); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java index d8292a4e8..027c3c5a0 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/clock/CuckooClockTileEntity.java @@ -11,6 +11,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder; import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ParticleTypes; import net.minecraft.tileentity.TileEntityType; @@ -41,8 +42,8 @@ public class CuckooClockTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.read(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); if (clientPacket && compound.contains("Animation")) { animationType = NBTHelper.readEnum(compound, "Animation", Animation.class); animationProgress.lastValue = 0; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java index c2b23a85d..a7ab3da56 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crafter/MechanicalCrafterTileEntity.java @@ -122,11 +122,6 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { return MechanicalCrafterBlock.getTargetDirection(getBlockState()); } - @Override - public boolean hasFastRenderer() { - return false; - } - @Override public void write(CompoundNBT compound, boolean clientPacket) { compound.put("Inventory", inventory.serializeNBT()); @@ -152,7 +147,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { Phase phaseBefore = phase; GroupedItems before = this.groupedItems; @@ -167,7 +162,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity { this.phase = phase; countDown = compound.getInt("CountDown"); covered = compound.getBoolean("Cover"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java index 492cc9dcf..9d31550ea 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crank/HandCrankTileEntity.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.crank; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; @@ -44,9 +45,9 @@ public class HandCrankTileEntity extends GeneratingKineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { inUse = compound.getInt("InUse"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java index d19143009..c6d79bada 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/crusher/CrushingWheelControllerTileEntity.java @@ -16,6 +16,7 @@ import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.belt.DirectBeltInputBehaviour; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.item.BlockItem; @@ -224,8 +225,8 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.fromTag(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); if (compound.contains("Entity") && !isFrozen() && !isOccupied()) { entityUUID = NBTUtil.readUniqueId(compound.getCompound("Entity")); this.searchForEntity = true; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java index 1d7a8f9c5..3e14a7b89 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerFakePlayer.java @@ -64,7 +64,7 @@ public class DeployerFakePlayer extends FakePlayer { @Override public ITextComponent getDisplayName() { - return new StringTextComponent(Lang.translate("block.deployer.damage_source_name")); + return Lang.translate("block.deployer.damage_source_name"); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java index 9a3ca5050..aa37cadf9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/deployer/DeployerTileEntity.java @@ -15,6 +15,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBe import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; @@ -255,7 +256,7 @@ public class DeployerTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) { state = NBTHelper.readEnum(compound, "State", State.class); mode = NBTHelper.readEnum(compound, "Mode", Mode.class); timer = compound.getInt("Timer"); @@ -263,7 +264,7 @@ public class DeployerTileEntity extends KineticTileEntity { overflowItems = NBTHelper.readItemList(compound.getList("Overflow", NBT.TAG_COMPOUND)); if (compound.contains("HeldItem")) heldItem = ItemStack.read(compound.getCompound("HeldItem")); - super.read(compound, clientPacket); + super.fromTag(blockState, compound, clientPacket); if (!clientPacket) return; @@ -308,11 +309,6 @@ public class DeployerTileEntity extends KineticTileEntity { return new DeployerItemHandler(this); } - @Override - public boolean hasFastRenderer() { - return false; - } - public AllBlockPartials getHandPose() { return mode == Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING : heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java index 277d08693..ed8b5e1e9 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/EncasedFanTileEntity.java @@ -32,8 +32,8 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.read(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); isGenerator = compound.getBoolean("Generating"); if (clientPacket) airCurrent.rebuild(); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java index 8a82767cd..6923ac8e7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/fan/NozzleTileEntity.java @@ -9,6 +9,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.entity.player.PlayerEntity; @@ -50,8 +51,8 @@ public class NozzleTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.fromTag(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; range = compound.getFloat("Range"); diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java index 6c91f6d7e..c21c73d5b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/flywheel/FlywheelTileEntity.java @@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.flywheel; import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity; import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.AxisAlignedBB; @@ -61,11 +62,11 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { generatedSpeed = compound.getFloat("GeneratedSpeed"); generatedCapacity = compound.getFloat("GeneratedCapacity"); stoppingCooldown = compound.getInt("Cooldown"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (clientPacket) visualSpeed.withSpeed(1 / 32f).target(getGeneratedSpeed()); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java index 56ff13266..e400ed028 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/millstone/MillstoneTileEntity.java @@ -6,6 +6,7 @@ import com.simibubi.create.AllRecipeTypes; import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.ItemParticleData; @@ -127,11 +128,11 @@ public class MillstoneTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { timer = compound.getInt("Timer"); inputInv.deserializeNBT(compound.getCompound("InputInventory")); outputInv.deserializeNBT(compound.getCompound("OutputInventory")); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } public int getProcessingSpeed() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java index df7b8ec2b..444d03391 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/mixer/MechanicalMixerTileEntity.java @@ -89,10 +89,10 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { running = compound.getBoolean("Running"); runningTicks = compound.getInt("Ticks"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java index d546afba8..ba6475164 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/press/MechanicalPressTileEntity.java @@ -17,6 +17,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.belt.BeltProcessingBe import com.simibubi.create.foundation.utility.NBTHelper; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.entity.Entity; import net.minecraft.entity.item.ItemEntity; import net.minecraft.inventory.IInventory; @@ -83,12 +84,12 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { running = compound.getBoolean("Running"); mode = Mode.values()[compound.getInt("Mode")]; finished = compound.getBoolean("Finished"); runningTicks = compound.getInt("Ticks"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (clientPacket) { NBTHelper.iterateCompoundList(compound.getList("ParticleItems", NBT.TAG_COMPOUND), diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java index 4c56a95fa..b10c82535 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/saw/SawTileEntity.java @@ -79,11 +79,6 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { behaviours.add(new DirectBeltInputBehaviour(this)); } - @Override - public boolean hasFastRenderer() { - return false; - } - @Override public void onSpeedChanged(float prevSpeed) { super.onSpeedChanged(prevSpeed); @@ -101,8 +96,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.read(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); inventory.deserializeNBT(compound.getCompound("Inventory")); recipeIndex = compound.getInt("RecipeIndex"); } diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java index e2262c785..c8a0ede48 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/ClockworkBearingTileEntity.java @@ -1,5 +1,6 @@ package com.simibubi.create.content.contraptions.components.structureMovement.bearing; +import net.minecraft.block.BlockState; import org.apache.commons.lang3.tuple.Pair; import com.simibubi.create.content.contraptions.base.KineticTileEntity; @@ -235,14 +236,14 @@ public class ClockworkBearingTileEntity extends KineticTileEntity implements IBe } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { float hourAngleBefore = hourAngle; float minuteAngleBefore = minuteAngle; running = compound.getBoolean("Running"); hourAngle = compound.getFloat("HourAngle"); minuteAngle = compound.getFloat("MinuteAngle"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java index 594c49e0d..ea9a205b5 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/bearing/MechanicalBearingTileEntity.java @@ -112,13 +112,13 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity imp } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { float angleBefore = angle; running = compound.getBoolean("Running"); isWindmill = compound.getBoolean("Windmill"); angle = compound.getFloat("Angle"); lastGeneratedSpeed = compound.getFloat("LastGenerated"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java index 1e794f692..c3a9356b8 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/LinearActuatorTileEntity.java @@ -11,6 +11,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollOpt import com.simibubi.create.foundation.utility.Lang; import com.simibubi.create.foundation.utility.ServerSpeedProvider; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.MathHelper; @@ -158,14 +159,14 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { boolean forceMovement = compound.contains("ForceMovement"); float offsetBefore = offset; running = compound.getBoolean("Running"); waitingForSpeedChange = compound.getBoolean("Waiting"); offset = compound.getFloat("Offset"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java index f449f2e32..d5a0765bc 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/piston/MechanicalPistonTileEntity.java @@ -9,6 +9,7 @@ import com.simibubi.create.content.contraptions.components.structureMovement.pis import com.simibubi.create.foundation.tileEntity.behaviour.ValueBoxTransform; import com.simibubi.create.foundation.utility.ServerSpeedProvider; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.state.properties.BlockStateProperties; import net.minecraft.tileentity.TileEntityType; @@ -29,9 +30,9 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { extensionLength = compound.getInt("ExtensionLength"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java index f036aa32c..18fa2cf35 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/structureMovement/pulley/PulleyTileEntity.java @@ -170,9 +170,9 @@ public class PulleyTileEntity extends LinearActuatorTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { initialOffset = compound.getInt("InitialOffset"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java index 608900266..ad2cf5262 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/components/waterwheel/WaterWheelTileEntity.java @@ -6,6 +6,7 @@ import java.util.Map; import com.simibubi.create.AllBlocks; import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; @@ -24,8 +25,8 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.read(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); if (compound.contains("Flows")) { for (Direction d : Direction.values()) setFlow(d, compound.getCompound("Flows") diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java index b52b87625..938f091c7 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/PumpTileEntity.java @@ -256,10 +256,10 @@ public class PumpTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { reversed = compound.getBoolean("Reversed"); deserializeOpenEnds(compound); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } public void updatePipesOnSide(Direction side) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java index bf0b4b968..adf17c240 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/actors/SpoutTileEntity.java @@ -19,6 +19,7 @@ import com.simibubi.create.foundation.utility.LerpedFloat.Chaser; import com.simibubi.create.foundation.utility.Pair; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; import net.minecraft.particles.BlockParticleData; @@ -168,8 +169,8 @@ public class SpoutTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.fromTag(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); tank.readFromNBT(compound.getCompound("TankContent")); fluidLevel.readNBT(compound.getCompound("Level"), clientPacket); processingTicks = compound.getInt("ProcessingTicks"); diff --git a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java index 864936f7d..af968595e 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/fluids/tank/FluidTankTileEntity.java @@ -277,8 +277,8 @@ public class FluidTankTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.fromTag(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); BlockPos controllerBefore = controller; int prevSize = width; diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java index 3e375230b..838afd50f 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/BasinTileEntity.java @@ -61,8 +61,8 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.fromTag(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); inputInventory.deserializeNBT(compound.getCompound("InputItems")); outputInventory.deserializeNBT(compound.getCompound("OutputItems")); if (compound.contains("fluids")) diff --git a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java index edd73e309..9c3835723 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/processing/burner/BlazeBurnerTileEntity.java @@ -12,6 +12,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.ColorHelper; +import net.minecraft.block.BlockState; import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.entity.player.PlayerEntity; @@ -162,10 +163,10 @@ public class BlazeBurnerTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { activeFuel = FuelType.values()[compound.getInt("fuelLevel")]; remainingBurnTime = compound.getInt("burnTimeRemaining"); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } /** diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/InstructionSpeedModifiers.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/InstructionSpeedModifiers.java index 546404ea9..ad6204f13 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/InstructionSpeedModifiers.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/InstructionSpeedModifiers.java @@ -4,6 +4,7 @@ import java.util.ArrayList; import java.util.List; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.util.text.ITextComponent; public enum InstructionSpeedModifiers { @@ -21,8 +22,8 @@ public enum InstructionSpeedModifiers { value = modifier; } - static List getOptions() { - List options = new ArrayList<>(); + static List getOptions() { + List options = new ArrayList<>(); for (InstructionSpeedModifiers entry : values()) options.add(Lang.translate(entry.translationKey)); return options; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java index b52e47ee2..1e2832d0b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencedGearshiftTileEntity.java @@ -4,6 +4,7 @@ import java.util.Vector; import com.simibubi.create.content.contraptions.relays.encased.SplitShaftTileEntity; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.Direction; @@ -112,12 +113,12 @@ public class SequencedGearshiftTileEntity extends SplitShaftTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { currentInstruction = compound.getInt("InstructionIndex"); currentInstructionDuration = compound.getInt("InstructionDuration"); timer = compound.getInt("Timer"); instructions = Instruction.deserializeAll(compound.getList("Instructions", NBT.TAG_COMPOUND)); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencerInstructions.java b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencerInstructions.java index e4b397bc7..5986b7d89 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencerInstructions.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/advanced/sequencer/SequencerInstructions.java @@ -5,6 +5,7 @@ import java.util.List; import com.simibubi.create.foundation.gui.AllGuiTextures; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.util.text.ITextComponent; public enum SequencerInstructions { @@ -40,8 +41,8 @@ public enum SequencerInstructions { parameterKey = translationKey + "." + parameterName; } - static List getOptions() { - List options = new ArrayList<>(); + static List getOptions() { + List options = new ArrayList<>(); for (SequencerInstructions entry : values()) options.add(Lang.translate(entry.translationKey)); return options; @@ -49,7 +50,7 @@ public enum SequencerInstructions { String formatValue(int value) { if (this == TURN_ANGLE) - return value + Lang.translate("generic.unit.degrees"); + return value + Lang.translate("generic.unit.degrees").getUnformattedComponentText(); // FIXME if (this == TURN_DISTANCE) return value + "m"; if (this == WAIT) { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java index 56e96ac57..35df6b622 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/belt/BeltTileEntity.java @@ -186,8 +186,8 @@ public class BeltTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.read(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); if (compound.getBoolean("IsController")) controller = pos; diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java index 80d831b84..a1b4de97b 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/encased/AdjustablePulleyTileEntity.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.relays.encased; import com.simibubi.create.content.contraptions.base.KineticTileEntity; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; @@ -23,9 +24,9 @@ public class AdjustablePulleyTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { signal = compound.getInt("Signal"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } public float getModifier() { diff --git a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java index d7184659d..932b18b81 100644 --- a/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java +++ b/src/main/java/com/simibubi/create/content/contraptions/relays/gauge/GaugeTileEntity.java @@ -6,6 +6,7 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntity; import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.text.ITextComponent; @@ -29,10 +30,10 @@ public class GaugeTileEntity extends KineticTileEntity implements IHaveGoggleInf } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { dialTarget = compound.getFloat("Value"); color = compound.getInt("Color"); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java index 00e899fa9..d3ac0ebe9 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java +++ b/src/main/java/com/simibubi/create/content/curiosities/symmetry/mirror/SymmetryMirror.java @@ -22,6 +22,7 @@ import net.minecraft.util.Mirror; import net.minecraft.util.Rotation; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.vector.Vector3d; +import net.minecraft.util.text.ITextComponent; public abstract class SymmetryMirror { @@ -41,7 +42,7 @@ public abstract class SymmetryMirror { orientationIndex = 0; } - public static List getMirrors() { + public static List getMirrors() { return ImmutableList.of(Lang.translate("symmetry.mirror.plane"), Lang.translate("symmetry.mirror.doublePlane"), Lang.translate("symmetry.mirror.triplePlane")); } diff --git a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java index 4614b19f7..ed3c9865b 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java +++ b/src/main/java/com/simibubi/create/content/curiosities/tools/SandPaperItemRenderer.java @@ -9,6 +9,7 @@ import net.minecraft.client.Minecraft; import net.minecraft.client.entity.player.ClientPlayerEntity; import net.minecraft.client.renderer.IRenderTypeBuffer; import net.minecraft.client.renderer.ItemRenderer; +import net.minecraft.client.renderer.model.ItemCameraTransforms; import net.minecraft.util.math.vector.Vector3f; import net.minecraft.client.renderer.model.IBakedModel; import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType; @@ -20,7 +21,7 @@ import net.minecraft.util.math.MathHelper; public class SandPaperItemRenderer extends ItemStackTileEntityRenderer { @Override - public void render(ItemStack stack, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { + public void render(ItemStack stack, ItemCameraTransforms.TransformType p_239207_2_, MatrixStack ms, IRenderTypeBuffer buffer, int light, int overlay) { ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer(); ClientPlayerEntity player = Minecraft.getInstance().player; SandPaperModel mainModel = (SandPaperModel) itemRenderer.getItemModelWithOverrides(stack, Minecraft.getInstance().world, null); diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java index a43fb07ae..5bd25476d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/ZapperItem.java @@ -60,8 +60,8 @@ public abstract class ZapperItem extends Item { .getCompound("BlockUsed")) .getBlock() .getTranslationKey(); - ItemDescription.add(tooltip, TextFormatting.DARK_GRAY + Lang.translate("blockzapper.usingBlock", - TextFormatting.GRAY + new TranslationTextComponent(usedblock).getFormattedText())); + ItemDescription.add(tooltip, Lang.translate("blockzapper.usingBlock", + new TranslationTextComponent(usedblock).formatted(TextFormatting.GRAY)).formatted(TextFormatting.DARK_GRAY)); } } @@ -137,11 +137,11 @@ public abstract class ZapperItem extends Item { player.setActiveHand(hand); // Check if can be used - String msg = validateUsage(item); + ITextComponent msg = validateUsage(item); if (msg != null) { world.playSound(player, player.getBlockPos(), AllSoundEvents.BLOCKZAPPER_DENY.get(), SoundCategory.BLOCKS, 1f, 0.5f); - player.sendStatusMessage(new StringTextComponent(TextFormatting.RED + msg), true); + player.sendStatusMessage(msg.copy().formatted(TextFormatting.RED), true); return new ActionResult(ActionResultType.FAIL, item); } @@ -192,11 +192,11 @@ public abstract class ZapperItem extends Item { return new ActionResult(ActionResultType.SUCCESS, item); } - public String validateUsage(ItemStack item) { + public ITextComponent validateUsage(ItemStack item) { CompoundNBT tag = item.getOrCreateTag(); if (!canActivateWithoutSelectedBlock(item) && !tag.contains("BlockUsed")) return Lang.translate("blockzapper.leftClickToSet"); - return null; + return StringTextComponent.EMPTY; } protected abstract boolean activate(World world, PlayerEntity player, ItemStack item, BlockState stateToUse, diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java index c652d0d2e..73bdec220 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/blockzapper/BlockzapperItem.java @@ -61,13 +61,13 @@ public class BlockzapperItem extends ZapperItem { super.addInformation(stack, worldIn, tooltip, flagIn); Palette palette = Palette.Purple; if (Screen.hasShiftDown()) { - ItemDescription.add(tooltip, palette.color + Lang.translate("blockzapper.componentUpgrades")); + ItemDescription.add(tooltip, Lang.translate("blockzapper.componentUpgrades").formatted(palette.color)); for (Components c : Components.values()) { ComponentTier tier = getTier(c, stack); - String componentName = - TextFormatting.GRAY + Lang.translate("blockzapper.component." + Lang.asId(c.name())); - String tierName = tier.color + Lang.translate("blockzapper.componentTier." + Lang.asId(tier.name())); + ITextComponent componentName = + Lang.translate("blockzapper.component." + Lang.asId(c.name())).formatted(TextFormatting.GRAY); + ITextComponent tierName = Lang.translate("blockzapper.componentTier." + Lang.asId(tier.name())).formatted(tier.color); ItemDescription.add(tooltip, "> " + componentName + ": " + tierName); } } @@ -110,8 +110,7 @@ public class BlockzapperItem extends ZapperItem { if (!player.isCreative() && BlockHelper.findAndRemoveInInventory(selectedState, player, 1) == 0) { player.getCooldownTracker() .setCooldown(stack.getItem(), 20); - player.sendStatusMessage( - new StringTextComponent(TextFormatting.RED + Lang.translate("blockzapper.empty")), true); + player.sendStatusMessage( Lang.translate("blockzapper.empty").formatted(TextFormatting.RED), true); return false; } @@ -337,7 +336,7 @@ public class BlockzapperItem extends ZapperItem { } if (getTier(Components.Retriever, item) == ComponentTier.Brass) - Block.spawnDrops(worldIn.getBlockState(placed), worldIn, playerIn.getPosition(), tileentity); + Block.spawnDrops(worldIn.getBlockState(placed), worldIn, playerIn.getBlockPos(), tileentity); if (getTier(Components.Retriever, item) == ComponentTier.Chromatic) for (ItemStack stack : Block.getDrops(worldIn.getBlockState(placed), (ServerWorld) worldIn, placed, diff --git a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java index 5a2117eb0..d3996f34d 100644 --- a/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java +++ b/src/main/java/com/simibubi/create/content/curiosities/zapper/terrainzapper/WorldshaperItem.java @@ -16,6 +16,7 @@ import net.minecraft.nbt.CompoundNBT; import net.minecraft.nbt.NBTUtil; import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockRayTraceResult; +import net.minecraft.util.text.ITextComponent; import net.minecraft.world.World; import net.minecraftforge.api.distmarker.Dist; import net.minecraftforge.api.distmarker.OnlyIn; @@ -43,7 +44,7 @@ public class WorldshaperItem extends ZapperItem { } @Override - public String validateUsage(ItemStack item) { + public ITextComponent validateUsage(ItemStack item) { if (!item.getOrCreateTag() .contains("BrushParams")) return Lang.translate("terrainzapper.shiftRightClickToSet"); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java index 634980423..99c1c84d6 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/observer/BeltObserverTileEntity.java @@ -9,6 +9,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.BlockPos; @@ -79,9 +80,9 @@ public class BeltObserverTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { turnOffTicks = compound.getInt("TurnOff"); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } } diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java index e8f3fd293..cea18798c 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BeltTunnelTileEntity.java @@ -77,7 +77,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { Set newFlaps = new HashSet<>(6); ListNBT flapsNBT = compound.getList("Flaps", NBT.TAG_INT); for (INBT inbt : flapsNBT) @@ -92,7 +92,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity { .target(0) .withSpeed(.05f)); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java index 651b1af68..dd8efec04 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/belts/tunnel/BrassTunnelTileEntity.java @@ -459,7 +459,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { boolean wasConnectedLeft = connectedLeft; boolean wasConnectedRight = connectedRight; @@ -477,7 +477,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity { return Pair.of(pos, face); }); - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (!clientPacket) return; diff --git a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java index 6d98befe5..bad751b12 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/chute/ChuteTileEntity.java @@ -469,14 +469,14 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { ItemStack previousItem = item; item = ItemStack.read(compound.getCompound("Item")); itemPosition.lastValue = itemPosition.value = compound.getFloat("ItemPosition"); pull = compound.getFloat("Pull"); push = compound.getFloat("Push"); bottomPullDistance = compound.getFloat("BottomAirFlowDistance"); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); if (hasWorld() && world.isRemote && !previousItem.equals(item, false) && !item.isEmpty()) { if (world.rand.nextInt(3) != 0) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java index 923c03fa6..79a508bce 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/depot/DepotTileEntity.java @@ -14,6 +14,7 @@ import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemS import com.simibubi.create.foundation.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult; import com.simibubi.create.foundation.utility.VecHelper; +import net.minecraft.block.BlockState; import net.minecraft.inventory.InventoryHelper; import net.minecraft.item.ItemStack; import net.minecraft.nbt.CompoundNBT; @@ -105,12 +106,12 @@ public class DepotTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { heldItem = null; if (compound.contains("HeldItem")) heldItem = TransportedItemStack.read(compound.getCompound("HeldItem")); processingOutputBuffer.deserializeNBT(compound.getCompound("OutputBuffer")); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java index a73d333a4..f10a96462 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/diodes/AdjustableRepeaterTileEntity.java @@ -11,9 +11,11 @@ import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollVal import com.simibubi.create.foundation.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour.StepContext; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.MathHelper; +import net.minecraft.util.text.ITextComponent; public class AdjustableRepeaterTileEntity extends SmartTileEntity { @@ -43,10 +45,10 @@ public class AdjustableRepeaterTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) { state = compound.getInt("State"); charging = compound.getBoolean("Charging"); - super.fromTag(compound, clientPacket); + super.fromTag(blockState, compound, clientPacket); } @Override @@ -76,7 +78,7 @@ public class AdjustableRepeaterTileEntity extends SmartTileEntity { return (value / 20 / 60) + "m"; } - private String getUnit(int value) { + private ITextComponent getUnit(int value) { if (value < 20) return Lang.translate("generic.unit.ticks"); if (value < 20 * 60) diff --git a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java index ea893752e..bbeb2197f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/funnel/FunnelTileEntity.java @@ -240,8 +240,8 @@ public class FunnelTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { - super.fromTag(compound, clientPacket); + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { + super.fromTag(state, compound, clientPacket); extractionCooldown = compound.getInt("TransferCooldown"); if (clientPacket && compound.contains("Flap")) { int direction = compound.getInt("Flap"); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java index 70126cbc8..ec986de25 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/inventories/AdjustableCrateTileEntity.java @@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.inventories; import com.simibubi.create.AllBlocks; +import net.minecraft.block.BlockState; import net.minecraft.entity.player.PlayerEntity; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.inventory.InventoryHelper; @@ -150,10 +151,10 @@ public class AdjustableCrateTileEntity extends CrateTileEntity implements INamed } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { allowedAmount = compound.getInt("AllowedAmount"); inventory.deserializeNBT(compound.getCompound("Inventory")); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java index 04e231001..54683ab2f 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/mechanicalArm/ArmTileEntity.java @@ -372,12 +372,12 @@ public class ArmTileEntity extends KineticTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { int previousIndex = chasedPointIndex; Phase previousPhase = phase; ListNBT interactionPointTagBefore = interactionPointTag; - super.read(compound, clientPacket); + super.fromTag(state, compound, clientPacket); heldItem = ItemStack.read(compound.getCompound("HeldItem")); phase = NBTHelper.readEnum(compound, "Phase", Phase.class); chasedPointIndex = compound.getInt("TargetPointIndex"); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java index dd52d6141..4138f0b0a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/AnalogLeverTileEntity.java @@ -8,6 +8,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity; import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour; import com.simibubi.create.foundation.utility.Lang; +import net.minecraft.block.BlockState; import net.minecraft.nbt.CompoundNBT; import net.minecraft.tileentity.TileEntityType; import net.minecraft.util.math.MathHelper; @@ -31,11 +32,11 @@ public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggl } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) { state = compound.getInt("State"); lastChange = compound.getInt("ChangeTimer"); clientState.target(state); - super.fromTag(compound, clientPacket); + super.fromTag(blockState, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java index 67cddfe50..7d8e9dadb 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/RedstoneLinkTileEntity.java @@ -73,9 +73,9 @@ public class RedstoneLinkTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { transmitter = compound.getBoolean("Transmitter"); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); receivedSignal = compound.getInt("Receive"); receivedSignalChanged = compound.getBoolean("ReceivedChanged"); diff --git a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java index b647f9c41..bfb05e52a 100644 --- a/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java +++ b/src/main/java/com/simibubi/create/content/logistics/block/redstone/StockpileSwitchTileEntity.java @@ -36,13 +36,13 @@ public class StockpileSwitchTileEntity extends SmartTileEntity { } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) { onWhenAbove = compound.getFloat("OnAbove"); offWhenBelow = compound.getFloat("OffBelow"); currentLevel = compound.getFloat("Current"); powered = compound.getBoolean("Powered"); - super.fromTag(compound, clientPacket); + super.fromTag(state, compound, clientPacket); } @Override diff --git a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java index 70afb82e9..336723c09 100644 --- a/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java +++ b/src/main/java/com/simibubi/create/content/schematics/block/SchematicannonTileEntity.java @@ -163,7 +163,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC } @Override - protected void read(CompoundNBT compound, boolean clientPacket) { + protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) { if (!clientPacket) { inventory.deserializeNBT(compound.getCompound("Inventory")); if (compound.contains("CurrentPos")) @@ -196,7 +196,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC if (compound.contains("FlyingBlocks")) readFlyingBlocks(compound); - super.fromTag(compound, clientPacket); + super.fromTag(blockState, compound, clientPacket); } protected void readFlyingBlocks(CompoundNBT compound) { diff --git a/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java b/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java index 6cf438249..89d2125ea 100644 --- a/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java +++ b/src/main/java/com/simibubi/create/foundation/data/BlockStateGen.java @@ -207,7 +207,7 @@ public class BlockStateGen { return ConfiguredModel.builder() .modelFile(p.models() .getExistingFile(p - .modLoc("block/" + c.getName() + "/block_" + type.getName() + (powered ? "_powered" : "")))) + .modLoc("block/" + c.getName() + "/block_" + type.getString() + (powered ? "_powered" : "")))) .rotationY(shape == RailShape.EAST_WEST ? 90 : 0) .build(); }); @@ -247,7 +247,7 @@ public class BlockStateGen { } for (BeltObserverBlock.Mode mode : BeltObserverBlock.Mode.values()) { - String modeName = mode.getName(); + String modeName = mode.getString(); HashMap map = new HashMap<>(); for (boolean powered : Iterate.trueAndFalse) { for (boolean belt : Iterate.trueAndFalse) { @@ -311,14 +311,14 @@ public class BlockStateGen { Vector stickyFaces = new Vector<>(3); for (Axis axis : Iterate.axes) { - String suffix = "side_" + axis.getName(); + String suffix = "side_" + axis.getString(); faces.add(p.models() .withExistingParent("block/" + c.getName() + "_" + suffix, p.modLoc(templateModelPath + "/" + suffix)) .texture("side", side)); } for (Axis axis : Iterate.axes) { - String suffix = "side_" + axis.getName(); + String suffix = "side_" + axis.getString(); stickyFaces.add(p.models() .withExistingParent("block/" + c.getName() + "_" + suffix + "_sticky", p.modLoc(templateModelPath + "/" + suffix)) @@ -404,14 +404,14 @@ public class BlockStateGen { Map, ModelFile> coreModels = new HashMap<>(); for (Axis axis : Iterate.axes) - coreTemplates.put(axis, p.modLoc(path + "/core_" + axis.getName())); + coreTemplates.put(axis, p.modLoc(path + "/core_" + axis.getString())); ModelFile end = AssetLookup.partialBaseModel(c, p, "end"); for (Axis axis : Iterate.axes) { ResourceLocation parent = coreTemplates.get(axis); for (String s : orientations) { Pair key = Pair.of(s, axis); - String modelName = path + "/" + s + "_" + axis.getName(); + String modelName = path + "/" + s + "_" + axis.getString(); coreModels.put(key, p.models() .withExistingParent(modelName, parent) .element() diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java index 111467d6f..0276412c0 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllGuiTextures.java @@ -1,5 +1,6 @@ package com.simibubi.create.foundation.gui; +import com.mojang.blaze3d.matrix.MatrixStack; import com.simibubi.create.Create; import net.minecraft.client.Minecraft; @@ -110,14 +111,14 @@ public enum AllGuiTextures { } @OnlyIn(Dist.CLIENT) - public void draw(AbstractGui screen, int x, int y) { + public void draw(MatrixStack matrixStack, AbstractGui screen, int x, int y) { bind(); - screen.drawTexture(x, y, startX, startY, width, height); + screen.drawTexture(matrixStack, x, y, startX, startY, width, height); } @OnlyIn(Dist.CLIENT) - public void draw(int x, int y) { - draw(new Screen(null) { + public void draw(MatrixStack matrixStack, int x, int y) { + draw(matrixStack, new Screen(null) { }, x, y); } diff --git a/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java b/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java index 857614899..a5a197b1b 100644 --- a/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java +++ b/src/main/java/com/simibubi/create/foundation/gui/AllIcons.java @@ -128,14 +128,14 @@ public class AllIcons { } @OnlyIn(Dist.CLIENT) - public void draw(AbstractGui screen, int x, int y) { + public void draw(MatrixStack matrixStack, AbstractGui screen, int x, int y) { bind(); - screen.drawTexture(x, y, iconX, iconY, 16, 16); + screen.drawTexture(matrixStack, x, y, iconX, iconY, 16, 16); } @OnlyIn(Dist.CLIENT) - public void draw(int x, int y) { - draw(new Screen(null) { + public void draw(MatrixStack matrixStack, int x, int y) { + draw(matrixStack, new Screen(null) { }, x, y); } diff --git a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java index 565594e98..d963b44e2 100644 --- a/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java +++ b/src/main/java/com/simibubi/create/foundation/item/ItemDescription.java @@ -82,7 +82,7 @@ public class ItemDescription { linesOnCtrl = new ArrayList<>(); } - public ItemDescription withSummary(String summary) { + public ItemDescription withSummary(ITextComponent summary) { add(linesOnShift, cutString(summary, palette.color, palette.hColor)); add(linesOnShift, ""); return this; @@ -153,7 +153,7 @@ public class ItemDescription { level += " " + DARK_GRAY + TextFormatting.ITALIC + Lang.translate("tooltip.capacityProvided.asGenerator"); - add(linesOnShift, GRAY + Lang.translate("tooltip.capacityProvided")); + add(linesOnShift, Lang.translate("tooltip.capacityProvided").formatted(GRAY)); add(linesOnShift, level); IFormattableTextComponent genSpeed = generatorSpeed(block, rpmUnit); diff --git a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java index 9b03595fd..d42e40a92 100644 --- a/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java +++ b/src/main/java/com/simibubi/create/foundation/tileEntity/behaviour/scrollvalue/ScrollValueBehaviour.java @@ -32,7 +32,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour { Consumer callback; Consumer clientCallback; Function formatter; - Function unit; + Function unit; Function step; boolean needsWrench; @@ -119,7 +119,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour { return this; } - public ScrollValueBehaviour withUnit(Function unit) { + public ScrollValueBehaviour withUnit(Function unit) { this.unit = unit; return this; } 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 b38fbbe9e..851b92106 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 @@ -11,11 +11,10 @@ import net.minecraft.entity.player.ServerPlayerEntity; import net.minecraft.fluid.Fluid; import net.minecraft.item.crafting.RecipeManager; import net.minecraft.scoreboard.ServerScoreboard; -import net.minecraft.tags.NetworkTagManager; +import net.minecraft.tags.ITagCollectionSupplier; import net.minecraft.util.SoundCategory; import net.minecraft.util.SoundEvent; import net.minecraft.util.math.BlockPos; -import net.minecraft.world.World; import net.minecraft.world.biome.Biome; import net.minecraft.world.server.ServerTickList; import net.minecraft.world.server.ServerWorld; @@ -26,12 +25,12 @@ public class WrappedServerWorld extends ServerWorld { protected ServerWorld world; public WrappedServerWorld(ServerWorld world) { - super(world.getServer(), world.getServer().getBackgroundExecutor(), world.getSaveHandler(), world.getWorldInfo(), world.getDimension().getType(), world.getProfiler(), null); + super(world.getServer(), world.getServer().getBackgroundExecutor(), world.getSaveHandler(), world.getWorldInfo(), world.getDimension(), world.getProfiler(), null); this.world = world; } @Override - public World getWorld() { + public ServerWorld getWorld() { return world; } @@ -119,15 +118,10 @@ public class WrappedServerWorld extends ServerWorld { } @Override - public NetworkTagManager getTags() { + public ITagCollectionSupplier getTags() { return world.getTags(); } - @Override - public int getMaxHeight() { - return 256; - } - @Override public Biome getGeneratorStoredBiome(int p_225604_1_, int p_225604_2_, int p_225604_3_) { return world.getGeneratorStoredBiome(p_225604_1_, p_225604_2_, p_225604_3_); diff --git a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java index 028e9b3d3..d74f2985f 100644 --- a/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java +++ b/src/main/java/com/simibubi/create/foundation/utility/worldWrappers/WrappedWorld.java @@ -39,10 +39,11 @@ public class WrappedWorld extends World { this.world = world; } + /*FIXME @Override public World getWorld() { return world; - } + }*/ @Override public BlockState getBlockState(BlockPos pos) {