mirror of
https://github.com/Creators-of-Create/Create.git
synced 2024-12-16 08:03:42 +01:00
Ok, still above 100 compile errors, but progress...
This commit is contained in:
parent
a142cfdb85
commit
2f2a5674f3
62 changed files with 191 additions and 176 deletions
|
@ -18,6 +18,7 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.item.crafting.IRecipe;
|
import net.minecraft.item.crafting.IRecipe;
|
||||||
import net.minecraft.util.IItemProvider;
|
import net.minecraft.util.IItemProvider;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
|
|
||||||
public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRecipeCategory<T> {
|
public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRecipeCategory<T> {
|
||||||
|
@ -45,7 +46,7 @@ public abstract class CreateRecipeCategory<T extends IRecipe<?>> implements IRec
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getTitle() {
|
public ITextComponent getTitle() {
|
||||||
return Lang.translate("recipe." + name);
|
return Lang.translate("recipe." + name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.compat.jei.category.animations;
|
package com.simibubi.create.compat.jei.category.animations;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.simibubi.create.AllBlockPartials;
|
import com.simibubi.create.AllBlockPartials;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
@ -17,9 +18,9 @@ public class AnimatedBlazeBurner implements IDrawable {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void draw(int xOffset, int yOffset) {
|
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
|
||||||
RenderSystem.pushMatrix();
|
matrixStack.push();
|
||||||
RenderSystem.translatef(xOffset, yOffset, 200);
|
matrixStack.translate(xOffset, yOffset, 200);
|
||||||
RenderSystem.rotatef(-15.5f, 1, 0, 0);
|
RenderSystem.rotatef(-15.5f, 1, 0, 0);
|
||||||
RenderSystem.rotatef(22.5f, 0, 1, 0);
|
RenderSystem.rotatef(22.5f, 0, 1, 0);
|
||||||
int scale = 23;
|
int scale = 23;
|
||||||
|
@ -36,7 +37,7 @@ public class AnimatedBlazeBurner implements IDrawable {
|
||||||
.scale(scale)
|
.scale(scale)
|
||||||
.render();
|
.render();
|
||||||
|
|
||||||
RenderSystem.popMatrix();
|
matrixStack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.compat.jei.category.animations;
|
package com.simibubi.create.compat.jei.category.animations;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||||
|
@ -8,14 +9,14 @@ import com.simibubi.create.foundation.gui.GuiGameElement;
|
||||||
public class AnimatedCrafter extends AnimatedKinetics {
|
public class AnimatedCrafter extends AnimatedKinetics {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(int xOffset, int yOffset) {
|
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
|
||||||
RenderSystem.pushMatrix();
|
matrixStack.push();
|
||||||
RenderSystem.translatef(xOffset, yOffset, 0);
|
matrixStack.translate(xOffset, yOffset, 0);
|
||||||
AllGuiTextures.JEI_SHADOW.draw(-16, 13);
|
AllGuiTextures.JEI_SHADOW.draw(matrixStack, -16, 13);
|
||||||
|
|
||||||
RenderSystem.translatef(3, 16, 0);
|
matrixStack.translate(3, 16, 0);
|
||||||
RenderSystem.rotatef(-12.5f, 1, 0, 0);
|
// RenderSystem.rotatef(-12.5f, 1, 0, 0);
|
||||||
RenderSystem.rotatef(-22.5f, 0, 1, 0);
|
// RenderSystem.rotatef(-22.5f, 0, 1, 0);
|
||||||
int scale = 22;
|
int scale = 22;
|
||||||
|
|
||||||
GuiGameElement.of(cogwheel())
|
GuiGameElement.of(cogwheel())
|
||||||
|
@ -28,7 +29,7 @@ public class AnimatedCrafter extends AnimatedKinetics {
|
||||||
.scale(scale)
|
.scale(scale)
|
||||||
.render();
|
.render();
|
||||||
|
|
||||||
RenderSystem.popMatrix();
|
matrixStack.pop();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.compat.jei.category.animations;
|
package com.simibubi.create.compat.jei.category.animations;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.mojang.blaze3d.systems.RenderSystem;
|
import com.mojang.blaze3d.systems.RenderSystem;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.contraptions.components.saw.SawBlock;
|
import com.simibubi.create.content.contraptions.components.saw.SawBlock;
|
||||||
|
@ -12,10 +13,10 @@ import net.minecraft.util.Direction.Axis;
|
||||||
public class AnimatedSaw extends AnimatedKinetics {
|
public class AnimatedSaw extends AnimatedKinetics {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void draw(int xOffset, int yOffset) {
|
public void draw(MatrixStack matrixStack, int xOffset, int yOffset) {
|
||||||
RenderSystem.pushMatrix();
|
RenderSystem.pushMatrix();
|
||||||
RenderSystem.translatef(xOffset, yOffset, 0);
|
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(0, 0, 200);
|
||||||
RenderSystem.translatef(-6, 19, 0);
|
RenderSystem.translatef(-6, 19, 0);
|
||||||
|
|
|
@ -10,6 +10,8 @@ import com.simibubi.create.foundation.utility.Lang;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.BlockPos;
|
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.util.text.TextFormatting;
|
||||||
|
|
||||||
public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
||||||
|
@ -52,13 +54,13 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean addToGoggleTooltip(List<String> tooltip, boolean isPlayerSneaking) {
|
public boolean addToGoggleTooltip(List<ITextComponent> tooltip, boolean isPlayerSneaking) {
|
||||||
boolean added = super.addToGoggleTooltip(tooltip, isPlayerSneaking);
|
boolean added = super.addToGoggleTooltip(tooltip, isPlayerSneaking);
|
||||||
|
|
||||||
float stressBase = calculateAddedStressCapacity();
|
float stressBase = calculateAddedStressCapacity();
|
||||||
if (stressBase != 0 && IRotate.StressImpact.isEnabled()) {
|
if (stressBase != 0 && IRotate.StressImpact.isEnabled()) {
|
||||||
tooltip.add(spacing + Lang.translate("gui.goggles.generator_stats"));
|
tooltip.add(new StringTextComponent(spacing).append(Lang.translate("gui.goggles.generator_stats")));
|
||||||
tooltip.add(spacing + TextFormatting.GRAY + Lang.translate("tooltip.capacityProvided"));
|
tooltip.add(new StringTextComponent(spacing).append(Lang.translate("tooltip.capacityProvided").formatted(TextFormatting.GRAY)));
|
||||||
|
|
||||||
float speed = getTheoreticalSpeed();
|
float speed = getTheoreticalSpeed();
|
||||||
if (speed != getGeneratedSpeed() && speed != 0)
|
if (speed != getGeneratedSpeed() && speed != 0)
|
||||||
|
@ -68,8 +70,8 @@ public abstract class GeneratingKineticTileEntity extends KineticTileEntity {
|
||||||
float stressTotal = stressBase * speed;
|
float stressTotal = stressBase * speed;
|
||||||
|
|
||||||
String stressString = spacing + "%s%s" + Lang.translate("generic.unit.stress") + " " + TextFormatting.DARK_GRAY + "%s";
|
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, 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")));
|
tooltip.add(String.format(stressString, TextFormatting.GRAY, IHaveGoggleInformation.format(stressTotal), Lang.translate("gui.goggles.at_current_speed").getUnformattedComponentText()));
|
||||||
|
|
||||||
added = true;
|
added = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,7 @@ import net.minecraft.util.Direction;
|
||||||
import net.minecraft.util.Direction.AxisDirection;
|
import net.minecraft.util.Direction.AxisDirection;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
import net.minecraft.util.text.StringTextComponent;
|
||||||
import net.minecraft.util.text.TextFormatting;
|
import net.minecraft.util.text.TextFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
@ -211,13 +212,13 @@ public abstract class KineticTileEntity extends SmartTileEntity
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
boolean overStressedBefore = overStressed;
|
boolean overStressedBefore = overStressed;
|
||||||
clearKineticInformation();
|
clearKineticInformation();
|
||||||
|
|
||||||
// DO NOT READ kinetic information when placed after movement
|
// DO NOT READ kinetic information when placed after movement
|
||||||
if (wasMoved) {
|
if (wasMoved) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -237,7 +238,7 @@ public abstract class KineticTileEntity extends SmartTileEntity
|
||||||
overStressed = capacity < stress && StressImpact.isEnabled();
|
overStressed = capacity < stress && StressImpact.isEnabled();
|
||||||
}
|
}
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (clientPacket && overStressedBefore != overStressed && speed != 0)
|
if (clientPacket && overStressedBefore != overStressed && speed != 0)
|
||||||
effects.triggerOverStressedEffect();
|
effects.triggerOverStressedEffect();
|
||||||
|
@ -377,9 +378,9 @@ public abstract class KineticTileEntity extends SmartTileEntity
|
||||||
|
|
||||||
if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) {
|
if (overStressed && AllConfigs.CLIENT.enableOverstressedTooltip.get()) {
|
||||||
tooltip.add(ITextComponent.of(spacing + GOLD + Lang.translate("gui.stressometer.overstressed")));
|
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()));
|
.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++)
|
for (int i = 0; i < cutString.size(); i++)
|
||||||
tooltip.add(ITextComponent.of((i == 0 ? "" : spacing) + cutString.get(i)));
|
tooltip.add(ITextComponent.of((i == 0 ? "" : spacing) + cutString.get(i)));
|
||||||
return true;
|
return true;
|
||||||
|
@ -387,9 +388,9 @@ public abstract class KineticTileEntity extends SmartTileEntity
|
||||||
|
|
||||||
if (notFastEnough) {
|
if (notFastEnough) {
|
||||||
tooltip.add(ITextComponent.of(spacing + GOLD + Lang.translate("tooltip.speedRequirement")));
|
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()));
|
.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++)
|
for (int i = 0; i < cutString.size(); i++)
|
||||||
tooltip.add(ITextComponent.of((i == 0 ? "" : spacing) + cutString.get(i)));
|
tooltip.add(ITextComponent.of((i == 0 ? "" : spacing) + cutString.get(i)));
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -67,12 +67,12 @@ public abstract class BlockBreakingKineticTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
destroyProgress = compound.getInt("Progress");
|
destroyProgress = compound.getInt("Progress");
|
||||||
ticksUntilNextProgress = compound.getInt("NextTick");
|
ticksUntilNextProgress = compound.getInt("NextTick");
|
||||||
if (compound.contains("Breaking"))
|
if (compound.contains("Breaking"))
|
||||||
breakingPos = NBTUtil.readBlockPos(compound.getCompound("Breaking"));
|
breakingPos = NBTUtil.readBlockPos(compound.getCompound("Breaking"));
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -11,6 +11,7 @@ import com.simibubi.create.foundation.utility.AnimationTickHolder;
|
||||||
import com.simibubi.create.foundation.utility.NBTHelper;
|
import com.simibubi.create.foundation.utility.NBTHelper;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.particles.ParticleTypes;
|
import net.minecraft.particles.ParticleTypes;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
@ -41,8 +42,8 @@ public class CuckooClockTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
if (clientPacket && compound.contains("Animation")) {
|
if (clientPacket && compound.contains("Animation")) {
|
||||||
animationType = NBTHelper.readEnum(compound, "Animation", Animation.class);
|
animationType = NBTHelper.readEnum(compound, "Animation", Animation.class);
|
||||||
animationProgress.lastValue = 0;
|
animationProgress.lastValue = 0;
|
||||||
|
|
|
@ -122,11 +122,6 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity {
|
||||||
return MechanicalCrafterBlock.getTargetDirection(getBlockState());
|
return MechanicalCrafterBlock.getTargetDirection(getBlockState());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasFastRenderer() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void write(CompoundNBT compound, boolean clientPacket) {
|
public void write(CompoundNBT compound, boolean clientPacket) {
|
||||||
compound.put("Inventory", inventory.serializeNBT());
|
compound.put("Inventory", inventory.serializeNBT());
|
||||||
|
@ -152,7 +147,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
Phase phaseBefore = phase;
|
Phase phaseBefore = phase;
|
||||||
GroupedItems before = this.groupedItems;
|
GroupedItems before = this.groupedItems;
|
||||||
|
|
||||||
|
@ -167,7 +162,7 @@ public class MechanicalCrafterTileEntity extends KineticTileEntity {
|
||||||
this.phase = phase;
|
this.phase = phase;
|
||||||
countDown = compound.getInt("CountDown");
|
countDown = compound.getInt("CountDown");
|
||||||
covered = compound.getBoolean("Cover");
|
covered = compound.getBoolean("Cover");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.crank;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
|
||||||
|
@ -44,9 +45,9 @@ public class HandCrankTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
inUse = compound.getInt("InUse");
|
inUse = compound.getInt("InUse");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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.tileEntity.behaviour.belt.DirectBeltInputBehaviour;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.item.BlockItem;
|
import net.minecraft.item.BlockItem;
|
||||||
|
@ -224,8 +225,8 @@ public class CrushingWheelControllerTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
if (compound.contains("Entity") && !isFrozen() && !isOccupied()) {
|
if (compound.contains("Entity") && !isFrozen() && !isOccupied()) {
|
||||||
entityUUID = NBTUtil.readUniqueId(compound.getCompound("Entity"));
|
entityUUID = NBTUtil.readUniqueId(compound.getCompound("Entity"));
|
||||||
this.searchForEntity = true;
|
this.searchForEntity = true;
|
||||||
|
|
|
@ -64,7 +64,7 @@ public class DeployerFakePlayer extends FakePlayer {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ITextComponent getDisplayName() {
|
public ITextComponent getDisplayName() {
|
||||||
return new StringTextComponent(Lang.translate("block.deployer.damage_source_name"));
|
return Lang.translate("block.deployer.damage_source_name");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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.NBTHelper;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
|
@ -255,7 +256,7 @@ public class DeployerTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) {
|
||||||
state = NBTHelper.readEnum(compound, "State", State.class);
|
state = NBTHelper.readEnum(compound, "State", State.class);
|
||||||
mode = NBTHelper.readEnum(compound, "Mode", Mode.class);
|
mode = NBTHelper.readEnum(compound, "Mode", Mode.class);
|
||||||
timer = compound.getInt("Timer");
|
timer = compound.getInt("Timer");
|
||||||
|
@ -263,7 +264,7 @@ public class DeployerTileEntity extends KineticTileEntity {
|
||||||
overflowItems = NBTHelper.readItemList(compound.getList("Overflow", NBT.TAG_COMPOUND));
|
overflowItems = NBTHelper.readItemList(compound.getList("Overflow", NBT.TAG_COMPOUND));
|
||||||
if (compound.contains("HeldItem"))
|
if (compound.contains("HeldItem"))
|
||||||
heldItem = ItemStack.read(compound.getCompound("HeldItem"));
|
heldItem = ItemStack.read(compound.getCompound("HeldItem"));
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(blockState, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
@ -308,11 +309,6 @@ public class DeployerTileEntity extends KineticTileEntity {
|
||||||
return new DeployerItemHandler(this);
|
return new DeployerItemHandler(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasFastRenderer() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public AllBlockPartials getHandPose() {
|
public AllBlockPartials getHandPose() {
|
||||||
return mode == Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING
|
return mode == Mode.PUNCH ? AllBlockPartials.DEPLOYER_HAND_PUNCHING
|
||||||
: heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING;
|
: heldItem.isEmpty() ? AllBlockPartials.DEPLOYER_HAND_POINTING : AllBlockPartials.DEPLOYER_HAND_HOLDING;
|
||||||
|
|
|
@ -32,8 +32,8 @@ public class EncasedFanTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
isGenerator = compound.getBoolean("Generating");
|
isGenerator = compound.getBoolean("Generating");
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
airCurrent.rebuild();
|
airCurrent.rebuild();
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -50,8 +51,8 @@ public class NozzleTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
range = compound.getFloat("Range");
|
range = compound.getFloat("Range");
|
||||||
|
|
|
@ -3,6 +3,7 @@ package com.simibubi.create.content.contraptions.components.flywheel;
|
||||||
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
||||||
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
|
import com.simibubi.create.foundation.gui.widgets.InterpolatedChasingValue;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.AxisAlignedBB;
|
import net.minecraft.util.math.AxisAlignedBB;
|
||||||
|
@ -61,11 +62,11 @@ public class FlywheelTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
generatedSpeed = compound.getFloat("GeneratedSpeed");
|
generatedSpeed = compound.getFloat("GeneratedSpeed");
|
||||||
generatedCapacity = compound.getFloat("GeneratedCapacity");
|
generatedCapacity = compound.getFloat("GeneratedCapacity");
|
||||||
stoppingCooldown = compound.getInt("Cooldown");
|
stoppingCooldown = compound.getInt("Cooldown");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
if (clientPacket)
|
if (clientPacket)
|
||||||
visualSpeed.withSpeed(1 / 32f).target(getGeneratedSpeed());
|
visualSpeed.withSpeed(1 / 32f).target(getGeneratedSpeed());
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.simibubi.create.AllRecipeTypes;
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.particles.ItemParticleData;
|
import net.minecraft.particles.ItemParticleData;
|
||||||
|
@ -127,11 +128,11 @@ public class MillstoneTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
timer = compound.getInt("Timer");
|
timer = compound.getInt("Timer");
|
||||||
inputInv.deserializeNBT(compound.getCompound("InputInventory"));
|
inputInv.deserializeNBT(compound.getCompound("InputInventory"));
|
||||||
outputInv.deserializeNBT(compound.getCompound("OutputInventory"));
|
outputInv.deserializeNBT(compound.getCompound("OutputInventory"));
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getProcessingSpeed() {
|
public int getProcessingSpeed() {
|
||||||
|
|
|
@ -89,10 +89,10 @@ public class MechanicalMixerTileEntity extends BasinOperatingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
runningTicks = compound.getInt("Ticks");
|
runningTicks = compound.getInt("Ticks");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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.NBTHelper;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.item.ItemEntity;
|
import net.minecraft.entity.item.ItemEntity;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
|
@ -83,12 +84,12 @@ public class MechanicalPressTileEntity extends BasinOperatingTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
mode = Mode.values()[compound.getInt("Mode")];
|
mode = Mode.values()[compound.getInt("Mode")];
|
||||||
finished = compound.getBoolean("Finished");
|
finished = compound.getBoolean("Finished");
|
||||||
runningTicks = compound.getInt("Ticks");
|
runningTicks = compound.getInt("Ticks");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (clientPacket) {
|
if (clientPacket) {
|
||||||
NBTHelper.iterateCompoundList(compound.getList("ParticleItems", NBT.TAG_COMPOUND),
|
NBTHelper.iterateCompoundList(compound.getList("ParticleItems", NBT.TAG_COMPOUND),
|
||||||
|
|
|
@ -79,11 +79,6 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
behaviours.add(new DirectBeltInputBehaviour(this));
|
behaviours.add(new DirectBeltInputBehaviour(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean hasFastRenderer() {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onSpeedChanged(float prevSpeed) {
|
public void onSpeedChanged(float prevSpeed) {
|
||||||
super.onSpeedChanged(prevSpeed);
|
super.onSpeedChanged(prevSpeed);
|
||||||
|
@ -101,8 +96,8 @@ public class SawTileEntity extends BlockBreakingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
||||||
recipeIndex = compound.getInt("RecipeIndex");
|
recipeIndex = compound.getInt("RecipeIndex");
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
|
package com.simibubi.create.content.contraptions.components.structureMovement.bearing;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import org.apache.commons.lang3.tuple.Pair;
|
import org.apache.commons.lang3.tuple.Pair;
|
||||||
|
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
|
@ -235,14 +236,14 @@ public class ClockworkBearingTileEntity extends KineticTileEntity implements IBe
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
float hourAngleBefore = hourAngle;
|
float hourAngleBefore = hourAngle;
|
||||||
float minuteAngleBefore = minuteAngle;
|
float minuteAngleBefore = minuteAngle;
|
||||||
|
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
hourAngle = compound.getFloat("HourAngle");
|
hourAngle = compound.getFloat("HourAngle");
|
||||||
minuteAngle = compound.getFloat("MinuteAngle");
|
minuteAngle = compound.getFloat("MinuteAngle");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -112,13 +112,13 @@ public class MechanicalBearingTileEntity extends GeneratingKineticTileEntity imp
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
float angleBefore = angle;
|
float angleBefore = angle;
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
isWindmill = compound.getBoolean("Windmill");
|
isWindmill = compound.getBoolean("Windmill");
|
||||||
angle = compound.getFloat("Angle");
|
angle = compound.getFloat("Angle");
|
||||||
lastGeneratedSpeed = compound.getFloat("LastGenerated");
|
lastGeneratedSpeed = compound.getFloat("LastGenerated");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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.Lang;
|
||||||
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
|
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
@ -158,14 +159,14 @@ public abstract class LinearActuatorTileEntity extends KineticTileEntity impleme
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
boolean forceMovement = compound.contains("ForceMovement");
|
boolean forceMovement = compound.contains("ForceMovement");
|
||||||
float offsetBefore = offset;
|
float offsetBefore = offset;
|
||||||
|
|
||||||
running = compound.getBoolean("Running");
|
running = compound.getBoolean("Running");
|
||||||
waitingForSpeedChange = compound.getBoolean("Waiting");
|
waitingForSpeedChange = compound.getBoolean("Waiting");
|
||||||
offset = compound.getFloat("Offset");
|
offset = compound.getFloat("Offset");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -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.tileEntity.behaviour.ValueBoxTransform;
|
||||||
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
|
import com.simibubi.create.foundation.utility.ServerSpeedProvider;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.state.properties.BlockStateProperties;
|
import net.minecraft.state.properties.BlockStateProperties;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
@ -29,9 +30,9 @@ public class MechanicalPistonTileEntity extends LinearActuatorTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
extensionLength = compound.getInt("ExtensionLength");
|
extensionLength = compound.getInt("ExtensionLength");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -170,9 +170,9 @@ public class PulleyTileEntity extends LinearActuatorTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
initialOffset = compound.getInt("InitialOffset");
|
initialOffset = compound.getInt("InitialOffset");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -6,6 +6,7 @@ import java.util.Map;
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.GeneratingKineticTileEntity;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
@ -24,8 +25,8 @@ public class WaterWheelTileEntity extends GeneratingKineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
if (compound.contains("Flows")) {
|
if (compound.contains("Flows")) {
|
||||||
for (Direction d : Direction.values())
|
for (Direction d : Direction.values())
|
||||||
setFlow(d, compound.getCompound("Flows")
|
setFlow(d, compound.getCompound("Flows")
|
||||||
|
|
|
@ -256,10 +256,10 @@ public class PumpTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
reversed = compound.getBoolean("Reversed");
|
reversed = compound.getBoolean("Reversed");
|
||||||
deserializeOpenEnds(compound);
|
deserializeOpenEnds(compound);
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void updatePipesOnSide(Direction side) {
|
public void updatePipesOnSide(Direction side) {
|
||||||
|
|
|
@ -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.Pair;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.particles.BlockParticleData;
|
import net.minecraft.particles.BlockParticleData;
|
||||||
|
@ -168,8 +169,8 @@ public class SpoutTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
tank.readFromNBT(compound.getCompound("TankContent"));
|
tank.readFromNBT(compound.getCompound("TankContent"));
|
||||||
fluidLevel.readNBT(compound.getCompound("Level"), clientPacket);
|
fluidLevel.readNBT(compound.getCompound("Level"), clientPacket);
|
||||||
processingTicks = compound.getInt("ProcessingTicks");
|
processingTicks = compound.getInt("ProcessingTicks");
|
||||||
|
|
|
@ -277,8 +277,8 @@ public class FluidTankTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
BlockPos controllerBefore = controller;
|
BlockPos controllerBefore = controller;
|
||||||
int prevSize = width;
|
int prevSize = width;
|
||||||
|
|
|
@ -61,8 +61,8 @@ public class BasinTileEntity extends SmartTileEntity implements ITickableTileEnt
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
inputInventory.deserializeNBT(compound.getCompound("InputItems"));
|
inputInventory.deserializeNBT(compound.getCompound("InputItems"));
|
||||||
outputInventory.deserializeNBT(compound.getCompound("OutputItems"));
|
outputInventory.deserializeNBT(compound.getCompound("OutputItems"));
|
||||||
if (compound.contains("fluids"))
|
if (compound.contains("fluids"))
|
||||||
|
|
|
@ -12,6 +12,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.utility.ColorHelper;
|
import com.simibubi.create.foundation.utility.ColorHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
|
@ -162,10 +163,10 @@ public class BlazeBurnerTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
activeFuel = FuelType.values()[compound.getInt("fuelLevel")];
|
activeFuel = FuelType.values()[compound.getInt("fuelLevel")];
|
||||||
remainingBurnTime = compound.getInt("burnTimeRemaining");
|
remainingBurnTime = compound.getInt("burnTimeRemaining");
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
public enum InstructionSpeedModifiers {
|
public enum InstructionSpeedModifiers {
|
||||||
|
|
||||||
|
@ -21,8 +22,8 @@ public enum InstructionSpeedModifiers {
|
||||||
value = modifier;
|
value = modifier;
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<String> getOptions() {
|
static List<ITextComponent> getOptions() {
|
||||||
List<String> options = new ArrayList<>();
|
List<ITextComponent> options = new ArrayList<>();
|
||||||
for (InstructionSpeedModifiers entry : values())
|
for (InstructionSpeedModifiers entry : values())
|
||||||
options.add(Lang.translate(entry.translationKey));
|
options.add(Lang.translate(entry.translationKey));
|
||||||
return options;
|
return options;
|
||||||
|
|
|
@ -4,6 +4,7 @@ import java.util.Vector;
|
||||||
|
|
||||||
import com.simibubi.create.content.contraptions.relays.encased.SplitShaftTileEntity;
|
import com.simibubi.create.content.contraptions.relays.encased.SplitShaftTileEntity;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.Direction;
|
import net.minecraft.util.Direction;
|
||||||
|
@ -112,12 +113,12 @@ public class SequencedGearshiftTileEntity extends SplitShaftTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
currentInstruction = compound.getInt("InstructionIndex");
|
currentInstruction = compound.getInt("InstructionIndex");
|
||||||
currentInstructionDuration = compound.getInt("InstructionDuration");
|
currentInstructionDuration = compound.getInt("InstructionDuration");
|
||||||
timer = compound.getInt("Timer");
|
timer = compound.getInt("Timer");
|
||||||
instructions = Instruction.deserializeAll(compound.getList("Instructions", NBT.TAG_COMPOUND));
|
instructions = Instruction.deserializeAll(compound.getList("Instructions", NBT.TAG_COMPOUND));
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -5,6 +5,7 @@ import java.util.List;
|
||||||
|
|
||||||
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
import com.simibubi.create.foundation.gui.AllGuiTextures;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
public enum SequencerInstructions {
|
public enum SequencerInstructions {
|
||||||
|
|
||||||
|
@ -40,8 +41,8 @@ public enum SequencerInstructions {
|
||||||
parameterKey = translationKey + "." + parameterName;
|
parameterKey = translationKey + "." + parameterName;
|
||||||
}
|
}
|
||||||
|
|
||||||
static List<String> getOptions() {
|
static List<ITextComponent> getOptions() {
|
||||||
List<String> options = new ArrayList<>();
|
List<ITextComponent> options = new ArrayList<>();
|
||||||
for (SequencerInstructions entry : values())
|
for (SequencerInstructions entry : values())
|
||||||
options.add(Lang.translate(entry.translationKey));
|
options.add(Lang.translate(entry.translationKey));
|
||||||
return options;
|
return options;
|
||||||
|
@ -49,7 +50,7 @@ public enum SequencerInstructions {
|
||||||
|
|
||||||
String formatValue(int value) {
|
String formatValue(int value) {
|
||||||
if (this == TURN_ANGLE)
|
if (this == TURN_ANGLE)
|
||||||
return value + Lang.translate("generic.unit.degrees");
|
return value + Lang.translate("generic.unit.degrees").getUnformattedComponentText(); // FIXME
|
||||||
if (this == TURN_DISTANCE)
|
if (this == TURN_DISTANCE)
|
||||||
return value + "m";
|
return value + "m";
|
||||||
if (this == WAIT) {
|
if (this == WAIT) {
|
||||||
|
|
|
@ -186,8 +186,8 @@ public class BeltTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (compound.getBoolean("IsController"))
|
if (compound.getBoolean("IsController"))
|
||||||
controller = pos;
|
controller = pos;
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.simibubi.create.content.contraptions.relays.encased;
|
||||||
|
|
||||||
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
|
|
||||||
|
@ -23,9 +24,9 @@ public class AdjustablePulleyTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
signal = compound.getInt("Signal");
|
signal = compound.getInt("Signal");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
public float getModifier() {
|
public float getModifier() {
|
||||||
|
|
|
@ -6,6 +6,7 @@ import com.simibubi.create.content.contraptions.base.KineticTileEntity;
|
||||||
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
import com.simibubi.create.content.contraptions.goggles.IHaveGoggleInformation;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.text.ITextComponent;
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
@ -29,10 +30,10 @@ public class GaugeTileEntity extends KineticTileEntity implements IHaveGoggleInf
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
dialTarget = compound.getFloat("Value");
|
dialTarget = compound.getFloat("Value");
|
||||||
color = compound.getInt("Color");
|
color = compound.getInt("Color");
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.util.Mirror;
|
||||||
import net.minecraft.util.Rotation;
|
import net.minecraft.util.Rotation;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.vector.Vector3d;
|
import net.minecraft.util.math.vector.Vector3d;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
public abstract class SymmetryMirror {
|
public abstract class SymmetryMirror {
|
||||||
|
|
||||||
|
@ -41,7 +42,7 @@ public abstract class SymmetryMirror {
|
||||||
orientationIndex = 0;
|
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"),
|
return ImmutableList.of(Lang.translate("symmetry.mirror.plane"), Lang.translate("symmetry.mirror.doublePlane"),
|
||||||
Lang.translate("symmetry.mirror.triplePlane"));
|
Lang.translate("symmetry.mirror.triplePlane"));
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,7 @@ import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
import net.minecraft.client.entity.player.ClientPlayerEntity;
|
||||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||||
import net.minecraft.client.renderer.ItemRenderer;
|
import net.minecraft.client.renderer.ItemRenderer;
|
||||||
|
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||||
import net.minecraft.util.math.vector.Vector3f;
|
import net.minecraft.util.math.vector.Vector3f;
|
||||||
import net.minecraft.client.renderer.model.IBakedModel;
|
import net.minecraft.client.renderer.model.IBakedModel;
|
||||||
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
|
import net.minecraft.client.renderer.model.ItemCameraTransforms.TransformType;
|
||||||
|
@ -20,7 +21,7 @@ import net.minecraft.util.math.MathHelper;
|
||||||
public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
public class SandPaperItemRenderer extends ItemStackTileEntityRenderer {
|
||||||
|
|
||||||
@Override
|
@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();
|
ItemRenderer itemRenderer = Minecraft.getInstance().getItemRenderer();
|
||||||
ClientPlayerEntity player = Minecraft.getInstance().player;
|
ClientPlayerEntity player = Minecraft.getInstance().player;
|
||||||
SandPaperModel mainModel = (SandPaperModel) itemRenderer.getItemModelWithOverrides(stack, Minecraft.getInstance().world, null);
|
SandPaperModel mainModel = (SandPaperModel) itemRenderer.getItemModelWithOverrides(stack, Minecraft.getInstance().world, null);
|
||||||
|
|
|
@ -60,8 +60,8 @@ public abstract class ZapperItem extends Item {
|
||||||
.getCompound("BlockUsed"))
|
.getCompound("BlockUsed"))
|
||||||
.getBlock()
|
.getBlock()
|
||||||
.getTranslationKey();
|
.getTranslationKey();
|
||||||
ItemDescription.add(tooltip, TextFormatting.DARK_GRAY + Lang.translate("blockzapper.usingBlock",
|
ItemDescription.add(tooltip, Lang.translate("blockzapper.usingBlock",
|
||||||
TextFormatting.GRAY + new TranslationTextComponent(usedblock).getFormattedText()));
|
new TranslationTextComponent(usedblock).formatted(TextFormatting.GRAY)).formatted(TextFormatting.DARK_GRAY));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -137,11 +137,11 @@ public abstract class ZapperItem extends Item {
|
||||||
player.setActiveHand(hand);
|
player.setActiveHand(hand);
|
||||||
|
|
||||||
// Check if can be used
|
// Check if can be used
|
||||||
String msg = validateUsage(item);
|
ITextComponent msg = validateUsage(item);
|
||||||
if (msg != null) {
|
if (msg != null) {
|
||||||
world.playSound(player, player.getBlockPos(), AllSoundEvents.BLOCKZAPPER_DENY.get(), SoundCategory.BLOCKS,
|
world.playSound(player, player.getBlockPos(), AllSoundEvents.BLOCKZAPPER_DENY.get(), SoundCategory.BLOCKS,
|
||||||
1f, 0.5f);
|
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);
|
return new ActionResult<ItemStack>(ActionResultType.FAIL, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -192,11 +192,11 @@ public abstract class ZapperItem extends Item {
|
||||||
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
|
return new ActionResult<ItemStack>(ActionResultType.SUCCESS, item);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String validateUsage(ItemStack item) {
|
public ITextComponent validateUsage(ItemStack item) {
|
||||||
CompoundNBT tag = item.getOrCreateTag();
|
CompoundNBT tag = item.getOrCreateTag();
|
||||||
if (!canActivateWithoutSelectedBlock(item) && !tag.contains("BlockUsed"))
|
if (!canActivateWithoutSelectedBlock(item) && !tag.contains("BlockUsed"))
|
||||||
return Lang.translate("blockzapper.leftClickToSet");
|
return Lang.translate("blockzapper.leftClickToSet");
|
||||||
return null;
|
return StringTextComponent.EMPTY;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected abstract boolean activate(World world, PlayerEntity player, ItemStack item, BlockState stateToUse,
|
protected abstract boolean activate(World world, PlayerEntity player, ItemStack item, BlockState stateToUse,
|
||||||
|
|
|
@ -61,13 +61,13 @@ public class BlockzapperItem extends ZapperItem {
|
||||||
super.addInformation(stack, worldIn, tooltip, flagIn);
|
super.addInformation(stack, worldIn, tooltip, flagIn);
|
||||||
Palette palette = Palette.Purple;
|
Palette palette = Palette.Purple;
|
||||||
if (Screen.hasShiftDown()) {
|
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()) {
|
for (Components c : Components.values()) {
|
||||||
ComponentTier tier = getTier(c, stack);
|
ComponentTier tier = getTier(c, stack);
|
||||||
String componentName =
|
ITextComponent componentName =
|
||||||
TextFormatting.GRAY + Lang.translate("blockzapper.component." + Lang.asId(c.name()));
|
Lang.translate("blockzapper.component." + Lang.asId(c.name())).formatted(TextFormatting.GRAY);
|
||||||
String tierName = tier.color + Lang.translate("blockzapper.componentTier." + Lang.asId(tier.name()));
|
ITextComponent tierName = Lang.translate("blockzapper.componentTier." + Lang.asId(tier.name())).formatted(tier.color);
|
||||||
ItemDescription.add(tooltip, "> " + componentName + ": " + tierName);
|
ItemDescription.add(tooltip, "> " + componentName + ": " + tierName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -110,8 +110,7 @@ public class BlockzapperItem extends ZapperItem {
|
||||||
if (!player.isCreative() && BlockHelper.findAndRemoveInInventory(selectedState, player, 1) == 0) {
|
if (!player.isCreative() && BlockHelper.findAndRemoveInInventory(selectedState, player, 1) == 0) {
|
||||||
player.getCooldownTracker()
|
player.getCooldownTracker()
|
||||||
.setCooldown(stack.getItem(), 20);
|
.setCooldown(stack.getItem(), 20);
|
||||||
player.sendStatusMessage(
|
player.sendStatusMessage( Lang.translate("blockzapper.empty").formatted(TextFormatting.RED), true);
|
||||||
new StringTextComponent(TextFormatting.RED + Lang.translate("blockzapper.empty")), true);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -337,7 +336,7 @@ public class BlockzapperItem extends ZapperItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (getTier(Components.Retriever, item) == ComponentTier.Brass)
|
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)
|
if (getTier(Components.Retriever, item) == ComponentTier.Chromatic)
|
||||||
for (ItemStack stack : Block.getDrops(worldIn.getBlockState(placed), (ServerWorld) worldIn, placed,
|
for (ItemStack stack : Block.getDrops(worldIn.getBlockState(placed), (ServerWorld) worldIn, placed,
|
||||||
|
|
|
@ -16,6 +16,7 @@ import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.nbt.NBTUtil;
|
import net.minecraft.nbt.NBTUtil;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.BlockRayTraceResult;
|
import net.minecraft.util.math.BlockRayTraceResult;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.api.distmarker.Dist;
|
import net.minecraftforge.api.distmarker.Dist;
|
||||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||||
|
@ -43,7 +44,7 @@ public class WorldshaperItem extends ZapperItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String validateUsage(ItemStack item) {
|
public ITextComponent validateUsage(ItemStack item) {
|
||||||
if (!item.getOrCreateTag()
|
if (!item.getOrCreateTag()
|
||||||
.contains("BrushParams"))
|
.contains("BrushParams"))
|
||||||
return Lang.translate("terrainzapper.shiftRightClickToSet");
|
return Lang.translate("terrainzapper.shiftRightClickToSet");
|
||||||
|
|
|
@ -9,6 +9,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
|
import com.simibubi.create.foundation.tileEntity.behaviour.filtering.FilteringBehaviour;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
|
@ -79,9 +80,9 @@ public class BeltObserverTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
turnOffTicks = compound.getInt("TurnOff");
|
turnOffTicks = compound.getInt("TurnOff");
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -77,7 +77,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
Set<Direction> newFlaps = new HashSet<>(6);
|
Set<Direction> newFlaps = new HashSet<>(6);
|
||||||
ListNBT flapsNBT = compound.getList("Flaps", NBT.TAG_INT);
|
ListNBT flapsNBT = compound.getList("Flaps", NBT.TAG_INT);
|
||||||
for (INBT inbt : flapsNBT)
|
for (INBT inbt : flapsNBT)
|
||||||
|
@ -92,7 +92,7 @@ public class BeltTunnelTileEntity extends SmartTileEntity {
|
||||||
.target(0)
|
.target(0)
|
||||||
.withSpeed(.05f));
|
.withSpeed(.05f));
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -459,7 +459,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
boolean wasConnectedLeft = connectedLeft;
|
boolean wasConnectedLeft = connectedLeft;
|
||||||
boolean wasConnectedRight = connectedRight;
|
boolean wasConnectedRight = connectedRight;
|
||||||
|
|
||||||
|
@ -477,7 +477,7 @@ public class BrassTunnelTileEntity extends BeltTunnelTileEntity {
|
||||||
return Pair.of(pos, face);
|
return Pair.of(pos, face);
|
||||||
});
|
});
|
||||||
|
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (!clientPacket)
|
if (!clientPacket)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -469,14 +469,14 @@ public class ChuteTileEntity extends SmartTileEntity implements IHaveGoggleInfor
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
ItemStack previousItem = item;
|
ItemStack previousItem = item;
|
||||||
item = ItemStack.read(compound.getCompound("Item"));
|
item = ItemStack.read(compound.getCompound("Item"));
|
||||||
itemPosition.lastValue = itemPosition.value = compound.getFloat("ItemPosition");
|
itemPosition.lastValue = itemPosition.value = compound.getFloat("ItemPosition");
|
||||||
pull = compound.getFloat("Pull");
|
pull = compound.getFloat("Pull");
|
||||||
push = compound.getFloat("Push");
|
push = compound.getFloat("Push");
|
||||||
bottomPullDistance = compound.getFloat("BottomAirFlowDistance");
|
bottomPullDistance = compound.getFloat("BottomAirFlowDistance");
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
if (hasWorld() && world.isRemote && !previousItem.equals(item, false) && !item.isEmpty()) {
|
if (hasWorld() && world.isRemote && !previousItem.equals(item, false) && !item.isEmpty()) {
|
||||||
if (world.rand.nextInt(3) != 0)
|
if (world.rand.nextInt(3) != 0)
|
||||||
|
|
|
@ -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.tileEntity.behaviour.belt.TransportedItemStackHandlerBehaviour.TransportedResult;
|
||||||
import com.simibubi.create.foundation.utility.VecHelper;
|
import com.simibubi.create.foundation.utility.VecHelper;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
|
@ -105,12 +106,12 @@ public class DepotTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
heldItem = null;
|
heldItem = null;
|
||||||
if (compound.contains("HeldItem"))
|
if (compound.contains("HeldItem"))
|
||||||
heldItem = TransportedItemStack.read(compound.getCompound("HeldItem"));
|
heldItem = TransportedItemStack.read(compound.getCompound("HeldItem"));
|
||||||
processingOutputBuffer.deserializeNBT(compound.getCompound("OutputBuffer"));
|
processingOutputBuffer.deserializeNBT(compound.getCompound("OutputBuffer"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -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.tileEntity.behaviour.scrollvalue.ScrollValueBehaviour.StepContext;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
import net.minecraft.util.text.ITextComponent;
|
||||||
|
|
||||||
public class AdjustableRepeaterTileEntity extends SmartTileEntity {
|
public class AdjustableRepeaterTileEntity extends SmartTileEntity {
|
||||||
|
|
||||||
|
@ -43,10 +45,10 @@ public class AdjustableRepeaterTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) {
|
||||||
state = compound.getInt("State");
|
state = compound.getInt("State");
|
||||||
charging = compound.getBoolean("Charging");
|
charging = compound.getBoolean("Charging");
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(blockState, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -76,7 +78,7 @@ public class AdjustableRepeaterTileEntity extends SmartTileEntity {
|
||||||
return (value / 20 / 60) + "m";
|
return (value / 20 / 60) + "m";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getUnit(int value) {
|
private ITextComponent getUnit(int value) {
|
||||||
if (value < 20)
|
if (value < 20)
|
||||||
return Lang.translate("generic.unit.ticks");
|
return Lang.translate("generic.unit.ticks");
|
||||||
if (value < 20 * 60)
|
if (value < 20 * 60)
|
||||||
|
|
|
@ -240,8 +240,8 @@ public class FunnelTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
extractionCooldown = compound.getInt("TransferCooldown");
|
extractionCooldown = compound.getInt("TransferCooldown");
|
||||||
if (clientPacket && compound.contains("Flap")) {
|
if (clientPacket && compound.contains("Flap")) {
|
||||||
int direction = compound.getInt("Flap");
|
int direction = compound.getInt("Flap");
|
||||||
|
|
|
@ -2,6 +2,7 @@ package com.simibubi.create.content.logistics.block.inventories;
|
||||||
|
|
||||||
import com.simibubi.create.AllBlocks;
|
import com.simibubi.create.AllBlocks;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.entity.player.PlayerEntity;
|
import net.minecraft.entity.player.PlayerEntity;
|
||||||
import net.minecraft.entity.player.PlayerInventory;
|
import net.minecraft.entity.player.PlayerInventory;
|
||||||
import net.minecraft.inventory.InventoryHelper;
|
import net.minecraft.inventory.InventoryHelper;
|
||||||
|
@ -150,10 +151,10 @@ public class AdjustableCrateTileEntity extends CrateTileEntity implements INamed
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
allowedAmount = compound.getInt("AllowedAmount");
|
allowedAmount = compound.getInt("AllowedAmount");
|
||||||
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -372,12 +372,12 @@ public class ArmTileEntity extends KineticTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
int previousIndex = chasedPointIndex;
|
int previousIndex = chasedPointIndex;
|
||||||
Phase previousPhase = phase;
|
Phase previousPhase = phase;
|
||||||
ListNBT interactionPointTagBefore = interactionPointTag;
|
ListNBT interactionPointTagBefore = interactionPointTag;
|
||||||
|
|
||||||
super.read(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
heldItem = ItemStack.read(compound.getCompound("HeldItem"));
|
heldItem = ItemStack.read(compound.getCompound("HeldItem"));
|
||||||
phase = NBTHelper.readEnum(compound, "Phase", Phase.class);
|
phase = NBTHelper.readEnum(compound, "Phase", Phase.class);
|
||||||
chasedPointIndex = compound.getInt("TargetPointIndex");
|
chasedPointIndex = compound.getInt("TargetPointIndex");
|
||||||
|
|
|
@ -8,6 +8,7 @@ import com.simibubi.create.foundation.tileEntity.SmartTileEntity;
|
||||||
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
import com.simibubi.create.foundation.tileEntity.TileEntityBehaviour;
|
||||||
import com.simibubi.create.foundation.utility.Lang;
|
import com.simibubi.create.foundation.utility.Lang;
|
||||||
|
|
||||||
|
import net.minecraft.block.BlockState;
|
||||||
import net.minecraft.nbt.CompoundNBT;
|
import net.minecraft.nbt.CompoundNBT;
|
||||||
import net.minecraft.tileentity.TileEntityType;
|
import net.minecraft.tileentity.TileEntityType;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
|
@ -31,11 +32,11 @@ public class AnalogLeverTileEntity extends SmartTileEntity implements IHaveGoggl
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) {
|
||||||
state = compound.getInt("State");
|
state = compound.getInt("State");
|
||||||
lastChange = compound.getInt("ChangeTimer");
|
lastChange = compound.getInt("ChangeTimer");
|
||||||
clientState.target(state);
|
clientState.target(state);
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(blockState, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -73,9 +73,9 @@ public class RedstoneLinkTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
transmitter = compound.getBoolean("Transmitter");
|
transmitter = compound.getBoolean("Transmitter");
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
|
|
||||||
receivedSignal = compound.getInt("Receive");
|
receivedSignal = compound.getInt("Receive");
|
||||||
receivedSignalChanged = compound.getBoolean("ReceivedChanged");
|
receivedSignalChanged = compound.getBoolean("ReceivedChanged");
|
||||||
|
|
|
@ -36,13 +36,13 @@ public class StockpileSwitchTileEntity extends SmartTileEntity {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState state, CompoundNBT compound, boolean clientPacket) {
|
||||||
onWhenAbove = compound.getFloat("OnAbove");
|
onWhenAbove = compound.getFloat("OnAbove");
|
||||||
offWhenBelow = compound.getFloat("OffBelow");
|
offWhenBelow = compound.getFloat("OffBelow");
|
||||||
currentLevel = compound.getFloat("Current");
|
currentLevel = compound.getFloat("Current");
|
||||||
powered = compound.getBoolean("Powered");
|
powered = compound.getBoolean("Powered");
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(state, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -163,7 +163,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void read(CompoundNBT compound, boolean clientPacket) {
|
protected void fromTag(BlockState blockState, CompoundNBT compound, boolean clientPacket) {
|
||||||
if (!clientPacket) {
|
if (!clientPacket) {
|
||||||
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
inventory.deserializeNBT(compound.getCompound("Inventory"));
|
||||||
if (compound.contains("CurrentPos"))
|
if (compound.contains("CurrentPos"))
|
||||||
|
@ -196,7 +196,7 @@ public class SchematicannonTileEntity extends SmartTileEntity implements INamedC
|
||||||
if (compound.contains("FlyingBlocks"))
|
if (compound.contains("FlyingBlocks"))
|
||||||
readFlyingBlocks(compound);
|
readFlyingBlocks(compound);
|
||||||
|
|
||||||
super.fromTag(compound, clientPacket);
|
super.fromTag(blockState, compound, clientPacket);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void readFlyingBlocks(CompoundNBT compound) {
|
protected void readFlyingBlocks(CompoundNBT compound) {
|
||||||
|
|
|
@ -207,7 +207,7 @@ public class BlockStateGen {
|
||||||
return ConfiguredModel.builder()
|
return ConfiguredModel.builder()
|
||||||
.modelFile(p.models()
|
.modelFile(p.models()
|
||||||
.getExistingFile(p
|
.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)
|
.rotationY(shape == RailShape.EAST_WEST ? 90 : 0)
|
||||||
.build();
|
.build();
|
||||||
});
|
});
|
||||||
|
@ -247,7 +247,7 @@ public class BlockStateGen {
|
||||||
}
|
}
|
||||||
|
|
||||||
for (BeltObserverBlock.Mode mode : BeltObserverBlock.Mode.values()) {
|
for (BeltObserverBlock.Mode mode : BeltObserverBlock.Mode.values()) {
|
||||||
String modeName = mode.getName();
|
String modeName = mode.getString();
|
||||||
HashMap<String, ModelFile> map = new HashMap<>();
|
HashMap<String, ModelFile> map = new HashMap<>();
|
||||||
for (boolean powered : Iterate.trueAndFalse) {
|
for (boolean powered : Iterate.trueAndFalse) {
|
||||||
for (boolean belt : Iterate.trueAndFalse) {
|
for (boolean belt : Iterate.trueAndFalse) {
|
||||||
|
@ -311,14 +311,14 @@ public class BlockStateGen {
|
||||||
Vector<ModelFile> stickyFaces = new Vector<>(3);
|
Vector<ModelFile> stickyFaces = new Vector<>(3);
|
||||||
|
|
||||||
for (Axis axis : Iterate.axes) {
|
for (Axis axis : Iterate.axes) {
|
||||||
String suffix = "side_" + axis.getName();
|
String suffix = "side_" + axis.getString();
|
||||||
faces.add(p.models()
|
faces.add(p.models()
|
||||||
.withExistingParent("block/" + c.getName() + "_" + suffix,
|
.withExistingParent("block/" + c.getName() + "_" + suffix,
|
||||||
p.modLoc(templateModelPath + "/" + suffix))
|
p.modLoc(templateModelPath + "/" + suffix))
|
||||||
.texture("side", side));
|
.texture("side", side));
|
||||||
}
|
}
|
||||||
for (Axis axis : Iterate.axes) {
|
for (Axis axis : Iterate.axes) {
|
||||||
String suffix = "side_" + axis.getName();
|
String suffix = "side_" + axis.getString();
|
||||||
stickyFaces.add(p.models()
|
stickyFaces.add(p.models()
|
||||||
.withExistingParent("block/" + c.getName() + "_" + suffix + "_sticky",
|
.withExistingParent("block/" + c.getName() + "_" + suffix + "_sticky",
|
||||||
p.modLoc(templateModelPath + "/" + suffix))
|
p.modLoc(templateModelPath + "/" + suffix))
|
||||||
|
@ -404,14 +404,14 @@ public class BlockStateGen {
|
||||||
Map<Pair<String, Axis>, ModelFile> coreModels = new HashMap<>();
|
Map<Pair<String, Axis>, ModelFile> coreModels = new HashMap<>();
|
||||||
|
|
||||||
for (Axis axis : Iterate.axes)
|
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");
|
ModelFile end = AssetLookup.partialBaseModel(c, p, "end");
|
||||||
|
|
||||||
for (Axis axis : Iterate.axes) {
|
for (Axis axis : Iterate.axes) {
|
||||||
ResourceLocation parent = coreTemplates.get(axis);
|
ResourceLocation parent = coreTemplates.get(axis);
|
||||||
for (String s : orientations) {
|
for (String s : orientations) {
|
||||||
Pair<String, Axis> key = Pair.of(s, axis);
|
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()
|
coreModels.put(key, p.models()
|
||||||
.withExistingParent(modelName, parent)
|
.withExistingParent(modelName, parent)
|
||||||
.element()
|
.element()
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
package com.simibubi.create.foundation.gui;
|
package com.simibubi.create.foundation.gui;
|
||||||
|
|
||||||
|
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||||
import com.simibubi.create.Create;
|
import com.simibubi.create.Create;
|
||||||
|
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
|
@ -110,14 +111,14 @@ public enum AllGuiTextures {
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void draw(AbstractGui screen, int x, int y) {
|
public void draw(MatrixStack matrixStack, AbstractGui screen, int x, int y) {
|
||||||
bind();
|
bind();
|
||||||
screen.drawTexture(x, y, startX, startY, width, height);
|
screen.drawTexture(matrixStack, x, y, startX, startY, width, height);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void draw(int x, int y) {
|
public void draw(MatrixStack matrixStack, int x, int y) {
|
||||||
draw(new Screen(null) {
|
draw(matrixStack, new Screen(null) {
|
||||||
}, x, y);
|
}, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -128,14 +128,14 @@ public class AllIcons {
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void draw(AbstractGui screen, int x, int y) {
|
public void draw(MatrixStack matrixStack, AbstractGui screen, int x, int y) {
|
||||||
bind();
|
bind();
|
||||||
screen.drawTexture(x, y, iconX, iconY, 16, 16);
|
screen.drawTexture(matrixStack, x, y, iconX, iconY, 16, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
@OnlyIn(Dist.CLIENT)
|
@OnlyIn(Dist.CLIENT)
|
||||||
public void draw(int x, int y) {
|
public void draw(MatrixStack matrixStack, int x, int y) {
|
||||||
draw(new Screen(null) {
|
draw(matrixStack, new Screen(null) {
|
||||||
}, x, y);
|
}, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class ItemDescription {
|
||||||
linesOnCtrl = new ArrayList<>();
|
linesOnCtrl = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ItemDescription withSummary(String summary) {
|
public ItemDescription withSummary(ITextComponent summary) {
|
||||||
add(linesOnShift, cutString(summary, palette.color, palette.hColor));
|
add(linesOnShift, cutString(summary, palette.color, palette.hColor));
|
||||||
add(linesOnShift, "");
|
add(linesOnShift, "");
|
||||||
return this;
|
return this;
|
||||||
|
@ -153,7 +153,7 @@ public class ItemDescription {
|
||||||
level +=
|
level +=
|
||||||
" " + DARK_GRAY + TextFormatting.ITALIC + Lang.translate("tooltip.capacityProvided.asGenerator");
|
" " + 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);
|
add(linesOnShift, level);
|
||||||
|
|
||||||
IFormattableTextComponent genSpeed = generatorSpeed(block, rpmUnit);
|
IFormattableTextComponent genSpeed = generatorSpeed(block, rpmUnit);
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
|
||||||
Consumer<Integer> callback;
|
Consumer<Integer> callback;
|
||||||
Consumer<Integer> clientCallback;
|
Consumer<Integer> clientCallback;
|
||||||
Function<Integer, String> formatter;
|
Function<Integer, String> formatter;
|
||||||
Function<Integer, String> unit;
|
Function<Integer, ITextComponent> unit;
|
||||||
Function<StepContext, Integer> step;
|
Function<StepContext, Integer> step;
|
||||||
boolean needsWrench;
|
boolean needsWrench;
|
||||||
|
|
||||||
|
@ -119,7 +119,7 @@ public class ScrollValueBehaviour extends TileEntityBehaviour {
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public ScrollValueBehaviour withUnit(Function<Integer, String> unit) {
|
public ScrollValueBehaviour withUnit(Function<Integer, ITextComponent> unit) {
|
||||||
this.unit = unit;
|
this.unit = unit;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,11 +11,10 @@ import net.minecraft.entity.player.ServerPlayerEntity;
|
||||||
import net.minecraft.fluid.Fluid;
|
import net.minecraft.fluid.Fluid;
|
||||||
import net.minecraft.item.crafting.RecipeManager;
|
import net.minecraft.item.crafting.RecipeManager;
|
||||||
import net.minecraft.scoreboard.ServerScoreboard;
|
import net.minecraft.scoreboard.ServerScoreboard;
|
||||||
import net.minecraft.tags.NetworkTagManager;
|
import net.minecraft.tags.ITagCollectionSupplier;
|
||||||
import net.minecraft.util.SoundCategory;
|
import net.minecraft.util.SoundCategory;
|
||||||
import net.minecraft.util.SoundEvent;
|
import net.minecraft.util.SoundEvent;
|
||||||
import net.minecraft.util.math.BlockPos;
|
import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.world.World;
|
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.server.ServerTickList;
|
import net.minecraft.world.server.ServerTickList;
|
||||||
import net.minecraft.world.server.ServerWorld;
|
import net.minecraft.world.server.ServerWorld;
|
||||||
|
@ -26,12 +25,12 @@ public class WrappedServerWorld extends ServerWorld {
|
||||||
protected ServerWorld world;
|
protected ServerWorld world;
|
||||||
|
|
||||||
public WrappedServerWorld(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;
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public ServerWorld getWorld() {
|
||||||
return world;
|
return world;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,15 +118,10 @@ public class WrappedServerWorld extends ServerWorld {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public NetworkTagManager getTags() {
|
public ITagCollectionSupplier getTags() {
|
||||||
return world.getTags();
|
return world.getTags();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public int getMaxHeight() {
|
|
||||||
return 256;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Biome getGeneratorStoredBiome(int p_225604_1_, int p_225604_2_, int p_225604_3_) {
|
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_);
|
return world.getGeneratorStoredBiome(p_225604_1_, p_225604_2_, p_225604_3_);
|
||||||
|
|
|
@ -39,10 +39,11 @@ public class WrappedWorld extends World {
|
||||||
this.world = world;
|
this.world = world;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*FIXME
|
||||||
@Override
|
@Override
|
||||||
public World getWorld() {
|
public World getWorld() {
|
||||||
return world;
|
return world;
|
||||||
}
|
}*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public BlockState getBlockState(BlockPos pos) {
|
public BlockState getBlockState(BlockPos pos) {
|
||||||
|
|
Loading…
Reference in a new issue