Ok, still above 100 compile errors, but progress...

This commit is contained in:
grimmauld 2020-09-22 23:18:13 +02:00
parent a142cfdb85
commit 2f2a5674f3
62 changed files with 191 additions and 176 deletions

View file

@ -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<T extends IRecipe<?>> implements IRecipeCategory<T> {
@ -45,7 +46,7 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
}
@Override
public String getTitle() {
public ITextComponent getTitle() {
return Lang.translate("recipe." + name);
}

View file

@ -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

View file

@ -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();
}
}

View file

@ -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);

View file

@ -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<String> tooltip, boolean isPlayerSneaking) {
public boolean addToGoggleTooltip(List<ITextComponent> 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;
}

View file

@ -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<String> cutString = TooltipHelper.cutString(spacing + hint, GRAY, TextFormatting.WHITE);
List<String> 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<String> cutString = TooltipHelper.cutString(spacing + hint, GRAY, TextFormatting.WHITE);
List<String> 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;

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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

View file

@ -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;

View file

@ -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();

View file

@ -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");

View file

@ -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());
}

View file

@ -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() {

View file

@ -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

View file

@ -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),

View file

@ -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");
}

View file

@ -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;

View file

@ -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;

View file

@ -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;

View file

@ -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

View file

@ -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

View file

@ -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")

View file

@ -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) {

View file

@ -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");

View file

@ -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;

View file

@ -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"))

View file

@ -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);
}
/**

View file

@ -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<String> getOptions() {
List<String> options = new ArrayList<>();
static List<ITextComponent> getOptions() {
List<ITextComponent> options = new ArrayList<>();
for (InstructionSpeedModifiers entry : values())
options.add(Lang.translate(entry.translationKey));
return options;

View file

@ -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

View file

@ -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<String> getOptions() {
List<String> options = new ArrayList<>();
static List<ITextComponent> getOptions() {
List<ITextComponent> 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) {

View file

@ -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;

View file

@ -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() {

View file

@ -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

View file

@ -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<String> getMirrors() {
public static List<ITextComponent> getMirrors() {
return ImmutableList.of(Lang.translate("symmetry.mirror.plane"), Lang.translate("symmetry.mirror.doublePlane"),
Lang.translate("symmetry.mirror.triplePlane"));
}

View file

@ -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);

View file

@ -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<ItemStack>(ActionResultType.FAIL, item);
}
@ -192,11 +192,11 @@ public abstract class ZapperItem extends Item {
return new ActionResult<ItemStack>(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,

View file

@ -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,

View file

@ -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");

View file

@ -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);
}
}

View file

@ -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<Direction> 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;

View file

@ -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;

View file

@ -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)

View file

@ -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

View file

@ -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)

View file

@ -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");

View file

@ -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

View file

@ -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");

View file

@ -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

View file

@ -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");

View file

@ -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

View file

@ -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) {

View file

@ -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<String, ModelFile> map = new HashMap<>();
for (boolean powered : Iterate.trueAndFalse) {
for (boolean belt : Iterate.trueAndFalse) {
@ -311,14 +311,14 @@ public class BlockStateGen {
Vector<ModelFile> 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<Pair<String, Axis>, 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<String, Axis> 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()

View file

@ -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);
}

View file

@ -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);
}

View file

@ -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);

View file

@ -32,7 +32,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
Consumer<Integer> callback;
Consumer<Integer> clientCallback;
Function<Integer, String> formatter;
Function<Integer, String> unit;
Function<Integer, ITextComponent> unit;
Function<StepContext, Integer> step;
boolean needsWrench;
@ -119,7 +119,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
return this;
}
public ScrollValueBehaviour withUnit(Function<Integer, String> unit) {
public ScrollValueBehaviour withUnit(Function<Integer, ITextComponent> unit) {
this.unit = unit;
return this;
}

View file

@ -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_);

View file

@ -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) {