Compiles again.
This commit is contained in:
+1
-1
@@ -11,7 +11,7 @@ artifact_basename=appliedenergistics2
|
||||
minecraft_release=1.16
|
||||
minecraft_version=1.16.1
|
||||
mcp_mappings=20200707-1.16.1
|
||||
forge_version=32.0.71
|
||||
forge_version=32.0.75
|
||||
|
||||
#########################################################
|
||||
# Provided APIs #
|
||||
|
||||
@@ -119,7 +119,7 @@ public enum Upgrades {
|
||||
if (namesAdded.add(name)) {
|
||||
// append the supported count only if its > 1
|
||||
if (supported.maxCount > 1) {
|
||||
name = name.deepCopy().appendText(" (" + supported.maxCount + ")");
|
||||
name = name.deepCopy().func_240702_b_(" (" + supported.maxCount + ")");
|
||||
}
|
||||
supportedTooltipLines.add(name);
|
||||
}
|
||||
|
||||
@@ -26,16 +26,15 @@ package appeng.api.features;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.Dimension;
|
||||
import net.minecraft.world.IWorld;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
public interface IWorldGen {
|
||||
|
||||
void disableWorldGenForProviderID(WorldGenType type, Class<? extends Dimension> provider);
|
||||
|
||||
void enableWorldGenForDimension(WorldGenType type, ResourceLocation dimID);
|
||||
|
||||
void disableWorldGenForDimension(WorldGenType type, ResourceLocation dimID);
|
||||
|
||||
boolean isWorldGenEnabled(WorldGenType type, IWorld w);
|
||||
boolean isWorldGenEnabled(WorldGenType type, ServerWorld w);
|
||||
|
||||
enum WorldGenType {
|
||||
CERTUS_QUARTZ, CHARGED_CERTUS_QUARTZ, METEORITES
|
||||
|
||||
@@ -25,11 +25,13 @@ package appeng.api.implementations.items;
|
||||
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import appeng.api.implementations.TransitionResult;
|
||||
import appeng.api.util.WorldCoord;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
/**
|
||||
* Implemented on a {@link Item}
|
||||
@@ -57,7 +59,7 @@ public interface ISpatialStorageCell {
|
||||
*
|
||||
* @return dimension id or -1
|
||||
*/
|
||||
DimensionType getStoredDimension(ItemStack is);
|
||||
RegistryKey<World> getStoredDimension(ItemStack is);
|
||||
|
||||
/**
|
||||
* Perform a spatial swap with the contents of the cell, and the world.
|
||||
@@ -70,5 +72,5 @@ public interface ISpatialStorageCell {
|
||||
*
|
||||
* @return result of transition
|
||||
*/
|
||||
TransitionResult doSpatialTransition(ItemStack is, World w, WorldCoord min, WorldCoord max, int playerId);
|
||||
TransitionResult doSpatialTransition(ItemStack is, ServerWorld w, WorldCoord min, WorldCoord max, int playerId);
|
||||
}
|
||||
@@ -22,29 +22,31 @@ import java.util.List;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
public interface ISpatialDimension {
|
||||
ServerWorld getWorld(DimensionType cellDim);
|
||||
ServerWorld getWorld(RegistryKey<World> cellDim);
|
||||
|
||||
@Nullable
|
||||
DimensionType createNewCellDimension(BlockPos capacity);
|
||||
RegistryKey<World> createNewCellDimension(BlockPos capacity);
|
||||
|
||||
void deleteCellDimension(DimensionType cellDim);
|
||||
void deleteCellDimension(RegistryKey<World> cellDim);
|
||||
|
||||
boolean isCellDimension(DimensionType cellDim);
|
||||
boolean isCellDimension(RegistryKey<World> cellDim);
|
||||
|
||||
BlockPos getCellDimensionOrigin(DimensionType cellDim);
|
||||
BlockPos getCellDimensionOrigin(RegistryKey<World> cellDim);
|
||||
|
||||
BlockPos getCellDimensionSize(DimensionType cellDim);
|
||||
BlockPos getCellDimensionSize(RegistryKey<World> cellDim);
|
||||
|
||||
/**
|
||||
* Adds a user-facing tooltip that describes this dimension so that a player can
|
||||
* keep storage cells apart.
|
||||
*/
|
||||
void addCellDimensionTooltip(DimensionType cellDim, List<ITextComponent> lines);
|
||||
void addCellDimensionTooltip(RegistryKey<World> cellDim, List<ITextComponent> lines);
|
||||
|
||||
}
|
||||
|
||||
@@ -23,8 +23,10 @@ import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemModelsProperties;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -44,12 +46,12 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
public AEBaseBlockItemChargeable(Block id, Properties props) {
|
||||
super(id, props);
|
||||
|
||||
/*addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
|
||||
ItemModelsProperties.func_239418_a_(this, new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
|
||||
double curPower = getAECurrentPower(is);
|
||||
double maxPower = getAEMaxPower(is);
|
||||
|
||||
return (int) Math.round(100 * curPower / maxPower);
|
||||
});*/
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,7 +69,7 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
|
||||
|
||||
final double percent = internalCurrentPower / internalMaxPower;
|
||||
|
||||
lines.add(GuiText.StoredEnergy.textComponent().deepCopy()
|
||||
lines.add(GuiText.StoredEnergy.text().deepCopy()
|
||||
.func_240702_b_(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
|
||||
.func_230529_a_(new TranslationTextComponent(PowerUnits.AE.unlocalizedName))
|
||||
.func_240702_b_(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
|
||||
|
||||
@@ -144,26 +144,6 @@ public abstract class AEBaseTileBlock<T extends AEBaseTileEntity> extends AEBase
|
||||
super.onReplaced(state, w, pos, newState, isMoving);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolorBlock(BlockState state, final IWorld world, final BlockPos pos, final Direction side,
|
||||
final DyeColor color) {
|
||||
final TileEntity te = this.getTileEntity(world, pos);
|
||||
|
||||
if (te instanceof IColorableTile) {
|
||||
final IColorableTile ct = (IColorableTile) te;
|
||||
final AEColor c = ct.getColor();
|
||||
final AEColor newColor = AEColor.values()[color.ordinal()];
|
||||
|
||||
if (c != newColor) {
|
||||
ct.recolourBlock(side, newColor, null);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.recolorBlock(state, world, pos, side, color);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getComparatorInputOverride(BlockState state, final World w, final BlockPos pos) {
|
||||
final TileEntity te = this.getTileEntity(w, pos);
|
||||
|
||||
@@ -118,12 +118,10 @@ public class TinyTNTBlock extends AEBaseBlock {
|
||||
LivingEntity igniter = null;
|
||||
// Check if the shooter still exists
|
||||
if (w instanceof ServerWorld) {
|
||||
ServerWorld serverWorld = (ServerWorld) w;
|
||||
Entity shooter = serverWorld.getEntityByUuid(entityarrow.shootingEntity);
|
||||
Entity shooter = entityarrow.func_234616_v_();
|
||||
if (shooter instanceof LivingEntity) {
|
||||
igniter = (LivingEntity) shooter;
|
||||
}
|
||||
|
||||
}
|
||||
this.startFuse(w, pos, igniter);
|
||||
w.removeBlock(pos, false);
|
||||
|
||||
@@ -30,6 +30,7 @@ import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.ParticleManager;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
@@ -223,7 +224,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
// FIXME: Check how this looks, probably like shit, maybe provide parts the
|
||||
// ability to supply particle textures???
|
||||
effectRenderer
|
||||
.addEffect(new CableBusBreakingParticle(world, x, y, z, texture).multipleParticleScaleBy(0.8F));
|
||||
.addEffect(new CableBusBreakingParticle((ClientWorld) world, x, y, z, texture).multipleParticleScaleBy(0.8F));
|
||||
}
|
||||
|
||||
return true;
|
||||
@@ -264,7 +265,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
|
||||
// FIXME: Check how this looks, probably like shit, maybe provide parts the
|
||||
// ability to supply particle textures???
|
||||
Particle effect = new CableBusBreakingParticle(world, x, y, z, x - pos.getX() - 0.5D,
|
||||
Particle effect = new CableBusBreakingParticle((ClientWorld) world, x, y, z, x - pos.getX() - 0.5D,
|
||||
y - pos.getY() - 0.5D, z - pos.getZ() - 0.5D, texture);
|
||||
effectRenderer.addEffect(effect);
|
||||
}
|
||||
@@ -337,11 +338,6 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
|
||||
return this.cb(w, pos).activate(player, hand, hitInBlock) ? ActionResultType.SUCCESS : ActionResultType.PASS;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean recolorBlock(BlockState state, IWorld world, BlockPos pos, Direction side, DyeColor color) {
|
||||
return recolorBlock(world, pos, side, color, null);
|
||||
}
|
||||
|
||||
public boolean recolorBlock(final IBlockReader world, final BlockPos pos, final Direction side,
|
||||
final DyeColor color, final PlayerEntity who) {
|
||||
try {
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.state.BooleanProperty;
|
||||
import net.minecraft.state.StateContainer;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.BlockRayTraceResult;
|
||||
import net.minecraft.world.World;
|
||||
@@ -81,7 +82,7 @@ public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
|
||||
|
||||
if (hit.getFace() == tg.getUp()) {
|
||||
if (!tg.openGui(p)) {
|
||||
p.sendMessage(PlayerMessages.ChestCannotReadStorageCell.get(), p.getUniqueID());
|
||||
p.sendMessage(PlayerMessages.ChestCannotReadStorageCell.get(), Util.DUMMY_UUID);
|
||||
}
|
||||
} else {
|
||||
ContainerOpener.openContainer(ChestContainer.TYPE, p,
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Random;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Hand;
|
||||
@@ -207,7 +208,7 @@ public class ClientHelper extends ServerHelper {
|
||||
|
||||
private void spawnLightningArc(final World world, final double posX, final double posY, final double posZ,
|
||||
final Vector3d second) {
|
||||
final LightningFX fx = new LightningArcFX(world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
|
||||
final LightningFX fx = new LightningArcFX((ClientWorld) world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
|
||||
0.0f);
|
||||
Minecraft.getInstance().particles.addEffect(fx);
|
||||
}
|
||||
|
||||
@@ -61,31 +61,23 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
|
||||
|
||||
if (myStack != null) {
|
||||
if (myStack.getStackSize() > bigNumber || (myStack.getStackSize() > 1 && stack.isDamaged())) {
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
|
||||
.format(myStack.getStackSize());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
|
||||
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).func_240699_a_(TextFormatting.GRAY));
|
||||
}
|
||||
|
||||
if (myStack.getCountRequestable() > 0) {
|
||||
final String local = ButtonToolTips.ItemsRequestable.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US)
|
||||
.format(myStack.getCountRequestable());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add(new StringTextComponent(format));
|
||||
currentToolTip.add(ButtonToolTips.ItemsRequestable.text(formattedAmount));
|
||||
}
|
||||
|
||||
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
|
||||
|
||||
return;
|
||||
} else if (stack.getCount() > bigNumber) {
|
||||
final String local = ButtonToolTips.ItemsStored.getLocal();
|
||||
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
|
||||
final String format = String.format(local, formattedAmount);
|
||||
|
||||
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
|
||||
currentToolTip.add(ButtonToolTips.ItemsStored.text(formattedAmount).func_240699_a_(TextFormatting.GRAY));
|
||||
|
||||
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.google.common.base.Stopwatch;
|
||||
@@ -31,6 +32,7 @@ import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
|
||||
import net.minecraft.util.text.Style;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
@@ -145,7 +147,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
RenderSystem.popMatrix();
|
||||
RenderSystem.enableDepthTest();
|
||||
|
||||
this.renderHoveredToolTip(matrixStack, mouseX, mouseY);
|
||||
this.func_230459_a_(matrixStack, mouseX, mouseY);
|
||||
|
||||
for (final Object c : this.buttons) {
|
||||
if (c instanceof ITooltip) {
|
||||
@@ -189,33 +191,35 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
}
|
||||
}
|
||||
|
||||
protected void drawTooltip(MatrixStack matrixStack, int x, int y, ITextComponent message) {
|
||||
String[] lines = message.split("\n");
|
||||
this.drawTooltip(matrixStack, x, y, Arrays.asList(lines));
|
||||
protected void drawTooltip(MatrixStack matrices, int x, int y, ITextComponent message) {
|
||||
String[] lines = message.getString().split("\n"); // FIXME FABRIC
|
||||
List<ITextComponent> textLines = Arrays.stream(lines).map(StringTextComponent::new).collect(Collectors.toList());
|
||||
this.drawTooltip(matrices, x, y, textLines);
|
||||
}
|
||||
|
||||
protected void drawTooltip(MatrixStack matrixStack, int x, int y, List<String> lines) {
|
||||
// FIXME FABRIC: move out to json (?)
|
||||
private static final Style TOOLTIP_HEADER = Style.EMPTY.applyFormatting(TextFormatting.WHITE);
|
||||
private static final Style TOOLTIP_BODY = Style.EMPTY.applyFormatting(TextFormatting.GRAY);
|
||||
|
||||
protected void drawTooltip(MatrixStack matrices, int x, int y, List<ITextComponent> lines) {
|
||||
if (lines.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
// For an explanation of the formatting codes, see
|
||||
// http://minecraft.gamepedia.com/Formatting_codes
|
||||
lines = Lists.newArrayList(lines); // Make a copy
|
||||
|
||||
// Make the first line white
|
||||
lines.set(0, TextFormatting.WHITE + lines.get(0));
|
||||
|
||||
// All lines after the first are colored gray
|
||||
for (int i = 1; i < lines.size(); i++) {
|
||||
lines.set(i, TextFormatting.GRAY + lines.get(i));
|
||||
List<ITextComponent> styledLines = new ArrayList<>(lines.size());
|
||||
for (int i = 0; i < lines.size(); i++) {
|
||||
Style style = (i == 0) ? TOOLTIP_HEADER : TOOLTIP_BODY;
|
||||
styledLines.add(lines.get(i).deepCopy().func_240700_a_(s -> style));
|
||||
}
|
||||
|
||||
this.renderTooltip(matrixStack, lines, x, y, this.font);
|
||||
this.renderTooltip(matrices, styledLines, x, y);
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected final void drawGuiContainerForegroundLayer(MatrixStack matrixStack, final int x, final int y) {
|
||||
protected final void func_230451_b_(MatrixStack matrixStack, final int x, final int y) {
|
||||
final int ox = this.guiLeft; // (width - xSize) / 2;
|
||||
final int oy = this.guiTop; // (height - ySize) / 2;
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
@@ -230,7 +234,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
public abstract void drawFG(MatrixStack matrixStack, int offsetX, int offsetY, int mouseX, int mouseY);
|
||||
|
||||
@Override
|
||||
protected final void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, final float f, final int x,
|
||||
protected final void func_230450_a_(MatrixStack matrixStack, final float f, final int x,
|
||||
final int y) {
|
||||
final int ox = this.guiLeft; // (width - xSize) / 2;
|
||||
final int oy = this.guiTop; // (height - ySize) / 2;
|
||||
@@ -627,16 +631,16 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
* hackery...
|
||||
*/
|
||||
@Override
|
||||
public void drawSlot(MatrixStack matrixStack, Slot s) {
|
||||
public void func_238746_a_(MatrixStack matrices, Slot s) {
|
||||
if (s instanceof SlotME) {
|
||||
|
||||
try {
|
||||
if (!this.isPowered()) {
|
||||
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
|
||||
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
|
||||
}
|
||||
|
||||
// Annoying but easier than trying to splice into render item
|
||||
super.drawSlot(new Size1Slot((SlotME) s));
|
||||
super.func_238746_a_(matrices, new Size1Slot((SlotME) s));
|
||||
|
||||
this.stackSizeRenderer.renderStackSize(this.font, ((SlotME) s).getAEStack(), s.xPos, s.yPos);
|
||||
|
||||
@@ -665,13 +669,13 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
float blue = (fluidAttributes.getColor() & 255) / 255.0F;
|
||||
RenderSystem.color3f(red, green, blue);
|
||||
|
||||
blit(matrixStack, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
|
||||
blit(matrices, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
|
||||
sprite);
|
||||
RenderSystem.enableBlend();
|
||||
|
||||
this.fluidStackSizeRenderer.renderStackSize(this.font, fs, s.xPos, s.yPos);
|
||||
} else if (!this.isPowered()) {
|
||||
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
|
||||
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -743,7 +747,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
setBlitOffset(100);
|
||||
this.itemRenderer.zLevel = 100.0F;
|
||||
|
||||
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
|
||||
fill(matrices, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
|
||||
|
||||
setBlitOffset(0);
|
||||
this.itemRenderer.zLevel = 0.0F;
|
||||
@@ -752,9 +756,9 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
|
||||
if (s instanceof AppEngSlot) {
|
||||
((AppEngSlot) s).setDisplay(true);
|
||||
super.drawSlot(s);
|
||||
super.func_238746_a_(matrices, s);
|
||||
} else {
|
||||
super.drawSlot(s);
|
||||
super.func_238746_a_(matrices, s);
|
||||
}
|
||||
|
||||
return;
|
||||
@@ -763,7 +767,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
}
|
||||
}
|
||||
// do the usual for non-ME Slots.
|
||||
super.drawSlot(s);
|
||||
super.func_238746_a_(matrices, s);
|
||||
}
|
||||
|
||||
protected boolean isPowered() {
|
||||
@@ -800,10 +804,4 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void func_230450_a_(MatrixStack p_230450_1_, float p_230450_2_, int p_230450_3_, int p_230450_4_) {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriority()));
|
||||
}
|
||||
|
||||
@@ -53,8 +53,8 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -51,14 +51,14 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
|
||||
this.container.getOutput());
|
||||
|
||||
this.addButton(new ProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178,
|
||||
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.textComponent()));
|
||||
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.text()));
|
||||
this.addButton(this.mode);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
this.mode.set(this.container.getOutput());
|
||||
this.mode.setFillVar(String.valueOf(this.container.getOutput().requiredPower));
|
||||
|
||||
@@ -56,7 +56,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
|
||||
this.amountToCraft.addButtons(children::add, this::addButton);
|
||||
|
||||
this.next = this.addButton(
|
||||
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.textComponent(), this::confirm));
|
||||
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.text(), this::confirm));
|
||||
|
||||
subGui.addBackButton(this::addButton, 154, 0);
|
||||
}
|
||||
@@ -68,12 +68,12 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, GuiText.SelectAmount.textComponent().getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.SelectAmount.text().getString(), 8, 6, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
|
||||
this.next.setMessage(hasShiftDown() ? GuiText.Start.textComponent() : GuiText.Next.textComponent());
|
||||
this.next.setMessage(hasShiftDown() ? GuiText.Start.text() : GuiText.Next.text());
|
||||
|
||||
this.bindTexture("guis/craft_amt.png");
|
||||
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
|
||||
|
||||
@@ -85,7 +85,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
super.init();
|
||||
|
||||
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20,
|
||||
GuiText.Start.textComponent(), btn -> start());
|
||||
GuiText.Start.text(), btn -> start());
|
||||
this.start.active = false;
|
||||
this.addButton(this.start);
|
||||
|
||||
@@ -95,7 +95,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
this.selectCPU.active = false;
|
||||
this.addButton(this.selectCPU);
|
||||
|
||||
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.textComponent(),
|
||||
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.text(),
|
||||
btn -> subGui.goBack()));
|
||||
}
|
||||
|
||||
@@ -255,7 +255,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
|
||||
str = Long.toString(missingStack.getStackSize() / 1000000) + 'm';
|
||||
}
|
||||
|
||||
str = GuiText.Missing.textComponent().getString() + ": " + str;
|
||||
str = GuiText.Missing.text().getString() + ": " + str;
|
||||
final int w = 4 + this.font.getStringWidth(str);
|
||||
this.font.drawString(matrixStack, str,
|
||||
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
|
||||
|
||||
@@ -117,7 +117,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
|
||||
super.init();
|
||||
this.setScrollBar();
|
||||
this.cancel = new Button(this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET,
|
||||
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.textComponent(), btn -> cancel());
|
||||
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.text(), btn -> cancel());
|
||||
this.addButton(this.cancel);
|
||||
}
|
||||
|
||||
@@ -165,7 +165,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
String title = this.getGuiDisplayName(GuiText.CraftingStatus.textComponent()).getString();
|
||||
String title = this.getGuiDisplayName(GuiText.CraftingStatus.text()).getString();
|
||||
|
||||
if (this.container.getEstimatedTime() > 0 && !this.visual.isEmpty()) {
|
||||
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert(this.container.getEstimatedTime(),
|
||||
|
||||
@@ -43,7 +43,7 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
|
||||
public void init() {
|
||||
super.init();
|
||||
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.textComponent()).getString(), 8, 6,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.text()).getString(), 8, 6,
|
||||
4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3,
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3,
|
||||
4210752);
|
||||
}
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.addButton(this.placeMode);
|
||||
@@ -61,7 +61,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FormationPlane.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FormationPlane.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
if (this.fuzzyMode != null) {
|
||||
|
||||
@@ -37,8 +37,8 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -61,7 +61,7 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.textComponent()).getString(), 8, 6,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.text()).getString(), 8, 6,
|
||||
4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
|
||||
@@ -59,8 +59,8 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
|
||||
this.pb.setFullMsg(new StringTextComponent(
|
||||
this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%"));
|
||||
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,7 +48,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO);
|
||||
@@ -70,7 +70,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
|
||||
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
|
||||
}
|
||||
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.text()).getString(), 8, 6, 4210752);
|
||||
|
||||
this.font.drawString(matrixStack, GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752);
|
||||
|
||||
@@ -95,8 +95,8 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
final int ex = this.getScrollBar().getCurrentScroll();
|
||||
|
||||
|
||||
@@ -236,7 +236,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
||||
|
||||
if (this.viewCell || this instanceof WirelessTermScreen) {
|
||||
this.craftingStatusBtn = this.addButton(new TabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
|
||||
GuiText.CraftingStatus.textComponent(), this.itemRenderer, btn -> showCraftingStatus()));
|
||||
GuiText.CraftingStatus.text(), this.itemRenderer, btn -> showCraftingStatus()));
|
||||
this.craftingStatusBtn.setHideEdge(13);
|
||||
}
|
||||
|
||||
@@ -287,8 +287,8 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
this.currentMouseX = mouseX;
|
||||
this.currentMouseY = mouseY;
|
||||
|
||||
@@ -224,9 +224,9 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
|
||||
currentToolTip.remove(1);
|
||||
}
|
||||
|
||||
currentToolTip.add(GuiText.Installed.getLocal() + ": " + (myStack.getStackSize()));
|
||||
currentToolTip.add(GuiText.EnergyDrain.getLocal() + ": "
|
||||
+ Platform.formatPowerLong(myStack.getCountRequestable(), true));
|
||||
currentToolTip.add(GuiText.Installed.withSuffix(": " + (myStack.getStackSize())));
|
||||
currentToolTip.add(GuiText.EnergyDrain.withSuffix(": "
|
||||
+ Platform.formatPowerLong(myStack.getCountRequestable(), true)));
|
||||
|
||||
this.drawTooltip(matrixStack, x, y, currentToolTip);
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
|
||||
this.tFacades.setState(container.isFacadeMode());
|
||||
}
|
||||
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.textComponent()).getString(), 8, 6,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.text()).getString(), 8, 6,
|
||||
4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
@@ -60,12 +60,12 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
|
||||
super.init();
|
||||
|
||||
this.tabCraftButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.textComponent(), this.itemRenderer,
|
||||
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.text(), this.itemRenderer,
|
||||
btn -> toggleCraftMode(CRAFTMODE_PROCESSING));
|
||||
this.addButton(this.tabCraftButton);
|
||||
|
||||
this.tabProcessButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
|
||||
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.textComponent(), this.itemRenderer,
|
||||
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.text(), this.itemRenderer,
|
||||
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
|
||||
this.addButton(this.tabProcessButton);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack,
|
||||
this.getGuiDisplayName(GuiText.QuantumLinkChamber.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.getGuiDisplayName(GuiText.QuantumLinkChamber.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack,
|
||||
this.getGuiDisplayName(GuiText.QuartzCuttingKnife.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.getGuiDisplayName(GuiText.QuartzCuttingKnife.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
}
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.textComponent()).getString(), 8, 8,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.text()).getString(), 8, 8,
|
||||
4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
|
||||
}
|
||||
|
||||
@@ -58,7 +58,7 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
|
||||
GuiText.Efficiency.getLocal() + ": " + (((float) this.container.getEfficency()) / 100) + '%', 13, 83,
|
||||
4210752);
|
||||
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.textComponent()).getString(), 8,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.text()).getString(), 8,
|
||||
6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
|
||||
this.addButton(this.storageFilter);
|
||||
@@ -71,7 +71,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.textComponent()).getString(), 8, 6,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.text()).getString(), 8, 6,
|
||||
4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
|
||||
@@ -86,7 +86,7 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().textComponent()).getString(), 8, 6,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().text()).getString(), 8, 6,
|
||||
4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
|
||||
@@ -54,7 +54,7 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
|
||||
final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.textComponent()).getString(),
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.text()).getString(),
|
||||
8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Wireless.textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Wireless.text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
if (container.getRange() > 0) {
|
||||
|
||||
@@ -23,6 +23,8 @@ import java.util.regex.Pattern;
|
||||
|
||||
import appeng.api.config.ActionItems;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
|
||||
public class ActionButton extends IconButton implements ITooltip {
|
||||
private static final Pattern PATTERN_NEW_LINE = Pattern.compile("\\n", Pattern.LITERAL);
|
||||
@@ -76,9 +78,9 @@ public class ActionButton extends IconButton implements ITooltip {
|
||||
return iconIndex;
|
||||
}
|
||||
|
||||
private String buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
|
||||
String name = displayName.getTranslationKey().getString();
|
||||
String value = displayValue.getTranslationKey().getString();
|
||||
private ITextComponent buildMessage(ButtonToolTips displayName, ButtonToolTips displayValue) {
|
||||
String name = displayName.text().getString();
|
||||
String value = displayValue.text().getString();
|
||||
|
||||
value = PATTERN_NEW_LINE.matcher(value).replaceAll("\n");
|
||||
final StringBuilder sb = new StringBuilder(value);
|
||||
@@ -91,7 +93,7 @@ public class ActionButton extends IconButton implements ITooltip {
|
||||
sb.replace(i, i + 1, "\n");
|
||||
}
|
||||
|
||||
return name + '\n' + sb;
|
||||
return new StringTextComponent(name + '\n' + sb);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -89,7 +89,7 @@ public class ProgressBar extends Widget implements ITooltip {
|
||||
|
||||
return result.deepCopy().func_240702_b_("\n").func_240702_b_(this.source.getCurrentProgress() + " ")
|
||||
.func_230529_a_(
|
||||
GuiText.Of.textComponent().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
|
||||
GuiText.Of.text().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -48,6 +48,7 @@ import appeng.api.config.ViewItems;
|
||||
import appeng.api.config.YesNo;
|
||||
import appeng.core.localization.ButtonToolTips;
|
||||
import appeng.util.EnumCycler;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
|
||||
public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
private static final Pattern COMPILE = Pattern.compile("%s");
|
||||
@@ -236,7 +237,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
|
||||
final ButtonToolTips title, final ITextComponent hint) {
|
||||
final ButtonAppearance a = new ButtonAppearance();
|
||||
a.displayName = title.getTranslationKey();
|
||||
a.displayName = title.text();
|
||||
a.displayValue = hint;
|
||||
a.index = iconIndex;
|
||||
appearances.put(new EnumPair(setting, val), a);
|
||||
@@ -244,7 +245,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
|
||||
private static void registerApp(final int iconIndex, final Settings setting, final Enum<?> val,
|
||||
final ButtonToolTips title, final ButtonToolTips hint) {
|
||||
registerApp(iconIndex, setting, val, title, hint.getTranslationKey());
|
||||
registerApp(iconIndex, setting, val, title, hint.text());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -278,7 +279,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
public ITextComponent getMessage() {
|
||||
ITextComponent displayName = null;
|
||||
ITextComponent displayValue = null;
|
||||
|
||||
@@ -286,7 +287,7 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
final ButtonAppearance buttonAppearance = appearances
|
||||
.get(new EnumPair(this.buttonSetting, this.currentValue));
|
||||
if (buttonAppearance == null) {
|
||||
return "No Such Message";
|
||||
return new StringTextComponent("No Such Message");
|
||||
}
|
||||
|
||||
displayName = buttonAppearance.displayName;
|
||||
@@ -312,9 +313,9 @@ public class SettingToggleButton<T extends Enum<T>> extends IconButton {
|
||||
sb.replace(i, i + 1, "\n");
|
||||
}
|
||||
|
||||
return name + '\n' + sb;
|
||||
return new StringTextComponent(name + '\n' + sb);
|
||||
}
|
||||
return "";
|
||||
return StringTextComponent.EMPTY;
|
||||
}
|
||||
|
||||
public String getFillVar() {
|
||||
|
||||
@@ -36,7 +36,7 @@ public class ClientDCInternalInv implements Comparable<ClientDCInternalInv> {
|
||||
public ClientDCInternalInv(final int size, final long id, final long sortBy, final ITextComponent name) {
|
||||
this.inventory = new AppEngInternalInventory(null, size);
|
||||
this.searchName = name.getString().toLowerCase();
|
||||
this.formattedName = name.getFormattedText();
|
||||
this.formattedName = name.getString(); // FIXME FABRIC no longer formatted!
|
||||
this.id = id;
|
||||
this.sortBy = sortBy;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.Objects;
|
||||
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
@@ -50,7 +51,7 @@ public class FacadeDispatcherBakedModel extends DelegateBakedModel {
|
||||
public ItemOverrideList getOverrides() {
|
||||
return new ItemOverrideList() {
|
||||
@Override
|
||||
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
|
||||
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
|
||||
LivingEntity entity) {
|
||||
if (!(stack.getItem() instanceof FacadeItem)) {
|
||||
return originalModel;
|
||||
|
||||
@@ -110,7 +110,7 @@ public enum FacingToRotation implements IStringSerializable {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
public String getString() {
|
||||
return name().toLowerCase();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,8 +35,7 @@ import net.minecraft.util.math.vector.Quaternion;
|
||||
import net.minecraftforge.client.IRenderHandler;
|
||||
import net.minecraftforge.client.SkyRenderHandler;
|
||||
|
||||
//TODO https://github.com/MinecraftForge/MinecraftForge/pull/6537
|
||||
public class SpatialSkyRender implements SkyRenderHandler {
|
||||
public class SpatialSkyRender {
|
||||
|
||||
private static final SpatialSkyRender INSTANCE = new SpatialSkyRender();
|
||||
|
||||
@@ -48,7 +47,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
|
||||
this.dspList = GL11.glGenLists(1);
|
||||
}
|
||||
|
||||
public static IRenderHandler getInstance() {
|
||||
public static SpatialSkyRender getInstance() {
|
||||
return INSTANCE;
|
||||
}
|
||||
|
||||
@@ -56,8 +55,7 @@ public class SpatialSkyRender implements SkyRenderHandler {
|
||||
new Quaternion(-90.0F, 0.0F, 0.0F, true), new Quaternion(180.0F, 0.0F, 0.0F, true),
|
||||
new Quaternion(0.0F, 0.0F, 90.0F, true), new Quaternion(0.0F, 0.0F, -90.0F, true), };
|
||||
|
||||
@Override
|
||||
public void render(int ticks, float partialTicks, MatrixStack matrixStack, ClientWorld world, Minecraft mc) {
|
||||
public void render(MatrixStack matrixStack) {
|
||||
final long now = System.currentTimeMillis();
|
||||
if (now - this.cycle > 2000) {
|
||||
this.cycle = now;
|
||||
|
||||
@@ -68,6 +68,12 @@ public class FacadeBlockAccess implements IBlockDisplayReader {
|
||||
return world.getFluidState(pos);
|
||||
}
|
||||
|
||||
// This is for diffuse lighting
|
||||
@Override
|
||||
public float func_230487_a_(Direction p_230487_1_, boolean p_230487_2_) {
|
||||
return world.func_230487_a_(p_230487_1_, p_230487_2_);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WorldLightManager getLightManager() {
|
||||
return world.getLightManager();
|
||||
|
||||
@@ -10,6 +10,7 @@ import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.math.vector.TransformationMatrix;
|
||||
@@ -112,7 +113,7 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world,
|
||||
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
|
||||
@Nullable LivingEntity entity) {
|
||||
boolean shiftHeld = Screen.hasShiftDown();
|
||||
if (shiftHeld) {
|
||||
@@ -122,12 +123,12 @@ public class EncodedPatternBakedModel extends DelegateBakedModel {
|
||||
IBakedModel realModel = Minecraft.getInstance().getItemRenderer().getItemModelMesher()
|
||||
.getItemModel(output);
|
||||
// Give the item model a chance to handle the overrides as well
|
||||
realModel = realModel.getOverrides().getModelWithOverrides(realModel, output, world, entity);
|
||||
realModel = realModel.getOverrides().func_239290_a_(realModel, output, world, entity);
|
||||
return new ShiftHoldingModelWrapper(getBaseModel(), realModel);
|
||||
}
|
||||
}
|
||||
|
||||
return getBaseModel().getOverrides().getModelWithOverrides(originalModel, stack, world, entity);
|
||||
return getBaseModel().getOverrides().func_239290_a_(originalModel, stack, world, entity);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -22,6 +22,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.RedstoneParticle;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particles.RedstoneParticleData;
|
||||
import net.minecraft.world.World;
|
||||
@@ -33,7 +34,7 @@ public class ChargedOreFX extends RedstoneParticle {
|
||||
|
||||
private static final RedstoneParticleData PARTICLE_DATA = new RedstoneParticleData(0.21f, 0.61f, 1.0f, 1.0f);
|
||||
|
||||
private ChargedOreFX(World worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed,
|
||||
private ChargedOreFX(ClientWorld worldIn, double x, double y, double z, double xSpeed, double ySpeed, double zSpeed,
|
||||
IAnimatedSprite spriteSet) {
|
||||
super(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, PARTICLE_DATA, spriteSet);
|
||||
}
|
||||
@@ -58,8 +59,8 @@ public class ChargedOreFX extends RedstoneParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType typeIn, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(BasicParticleType typeIn, ClientWorld worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
return new ChargedOreFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, this.spriteSet);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ public class CraftingFx extends SpriteTexturedParticle {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(BasicParticleType data, World worldIn, double x, double y, double z, double xSpeed,
|
||||
public Particle makeParticle(BasicParticleType data, ClientWorld worldIn, double x, double y, double z, double xSpeed,
|
||||
double ySpeed, double zSpeed) {
|
||||
return new CraftingFx(worldIn, x, y, z, spriteSet);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import net.minecraft.client.particle.IAnimatedSprite;
|
||||
import net.minecraft.client.particle.IParticleFactory;
|
||||
import net.minecraft.client.particle.Particle;
|
||||
import net.minecraft.client.particle.SpriteTexturedParticle;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
@@ -37,7 +38,7 @@ public class LightningArcFX extends LightningFX {
|
||||
private final double ry;
|
||||
private final double rz;
|
||||
|
||||
public LightningArcFX(final World w, final double x, final double y, final double z, final double ex,
|
||||
public LightningArcFX(final ClientWorld w, final double x, final double y, final double z, final double ex,
|
||||
final double ey, final double ez, final double r, final double g, final double b) {
|
||||
super(w, x, y, z, r, g, b, 6);
|
||||
|
||||
@@ -75,8 +76,8 @@ public class LightningArcFX extends LightningFX {
|
||||
}
|
||||
|
||||
@Override
|
||||
public Particle makeParticle(LightningArcParticleData data, World worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
public Particle makeParticle(LightningArcParticleData data, ClientWorld worldIn, double x, double y, double z,
|
||||
double xSpeed, double ySpeed, double zSpeed) {
|
||||
SpriteTexturedParticle lightningFX = new LightningArcFX(worldIn, x, y, z, data.target.x, data.target.y,
|
||||
data.target.z, 0, 0, 0);
|
||||
lightningFX.selectSpriteRandomly(this.spriteSet);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package appeng.client.render.effects;
|
||||
|
||||
import com.mojang.serialization.Codec;
|
||||
import net.minecraft.particles.BasicParticleType;
|
||||
import net.minecraft.particles.ParticleType;
|
||||
|
||||
@@ -12,10 +13,19 @@ public final class ParticleTypes {
|
||||
|
||||
public static final BasicParticleType CHARGED_ORE = new BasicParticleType(false);
|
||||
public static final BasicParticleType CRAFTING = new BasicParticleType(false);
|
||||
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<>(false,
|
||||
EnergyParticleData.DESERIALIZER);
|
||||
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<>(false,
|
||||
LightningArcParticleData.DESERIALIZER);
|
||||
public static final ParticleType<EnergyParticleData> ENERGY = new ParticleType<EnergyParticleData>(false,
|
||||
EnergyParticleData.DESERIALIZER) {
|
||||
public Codec<EnergyParticleData> func_230522_e_() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
public static final ParticleType<LightningArcParticleData> LIGHTNING_ARC = new ParticleType<LightningArcParticleData>(false,
|
||||
LightningArcParticleData.DESERIALIZER) {
|
||||
@Override
|
||||
public Codec<LightningArcParticleData> func_230522_e_() {
|
||||
return null;
|
||||
}
|
||||
};
|
||||
public static final BasicParticleType LIGHTNING = new BasicParticleType(false);
|
||||
public static final BasicParticleType MATTER_CANNON = new BasicParticleType(false);
|
||||
public static final BasicParticleType VIBRANT = new BasicParticleType(false);
|
||||
|
||||
@@ -107,7 +107,7 @@ public class AutoRotatingBakedModel implements IBakedModel {
|
||||
// when piping it
|
||||
// to the AO lighter, thus fixing our problem.
|
||||
BakedQuad packedQuad = new BakedQuad(unpackedQuad.getVertexData(), quad.getTintIndex(),
|
||||
unpackedQuad.getFace(), quad.func_187508_a(), quad.shouldApplyDiffuseLighting());
|
||||
unpackedQuad.getFace(), quad.func_187508_a(), quad.func_239287_f_());
|
||||
rotated.add(packedQuad);
|
||||
}
|
||||
return rotated;
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
@@ -143,7 +144,7 @@ class BiometricCardBakedModel implements IBakedModel {
|
||||
public ItemOverrideList getOverrides() {
|
||||
return new ItemOverrideList() {
|
||||
@Override
|
||||
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
|
||||
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
|
||||
LivingEntity entity) {
|
||||
String username = "";
|
||||
if (stack.getItem() instanceof IBiometricCard) {
|
||||
|
||||
@@ -62,7 +62,7 @@ class ColorApplicatorBakedModel implements IBakedModel {
|
||||
}
|
||||
|
||||
BakedQuad newQuad = new BakedQuad(quad.getVertexData(), tint, quad.getFace(), quad.func_187508_a(),
|
||||
quad.shouldApplyDiffuseLighting());
|
||||
quad.func_239287_f_());
|
||||
result.add(newQuad);
|
||||
}
|
||||
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Direction;
|
||||
@@ -128,7 +129,7 @@ class MemoryCardBakedModel implements IBakedModel {
|
||||
public ItemOverrideList getOverrides() {
|
||||
return new ItemOverrideList() {
|
||||
@Override
|
||||
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
|
||||
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
|
||||
LivingEntity entity) {
|
||||
try {
|
||||
if (stack.getItem() instanceof IMemoryCard) {
|
||||
|
||||
@@ -31,11 +31,11 @@ import appeng.core.AppEng;
|
||||
public class MemoryCardModel implements IModelGeometry<MemoryCardModel> {
|
||||
|
||||
public static final ResourceLocation MODEL_BASE = new ResourceLocation(AppEng.MOD_ID, "item/memory_card_base");
|
||||
private static final Material TEXTURE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
private static final RenderMaterial TEXTURE = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
|
||||
new ResourceLocation(AppEng.MOD_ID, "item/memory_card_hash"));
|
||||
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner,
|
||||
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
|
||||
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
|
||||
return Collections.singleton(TEXTURE);
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import net.minecraft.client.renderer.model.IBakedModel;
|
||||
import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.world.ClientWorld;
|
||||
import net.minecraft.entity.LivingEntity;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@@ -149,7 +150,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
|
||||
*/
|
||||
return new ItemOverrideList() {
|
||||
@Override
|
||||
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, @Nullable World world,
|
||||
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, @Nullable ClientWorld world,
|
||||
@Nullable LivingEntity entity) {
|
||||
// FIXME: This check prevents compasses being held by OTHERS from getting the
|
||||
// rotation, BUT do we actually still need this???
|
||||
@@ -159,7 +160,7 @@ public class SkyCompassBakedModel implements IDynamicBakedModel {
|
||||
float offRads = (float) (player.rotationYaw / 180.0f * (float) Math.PI + Math.PI);
|
||||
|
||||
SkyCompassBakedModel.this.fallbackRotation = offRads
|
||||
+ getAnimatedRotation(player.getPosition(), true);
|
||||
+ getAnimatedRotation(player.func_233580_cy_(), true);
|
||||
} else {
|
||||
SkyCompassBakedModel.this.fallbackRotation = getAnimatedRotation(null, false);
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class ChestTileEntityRenderer extends TileEntityRenderer<ChestTileEntity>
|
||||
for (int i = 0; i < quads.size(); i++) {
|
||||
BakedQuad quad = quads.get(i);
|
||||
quads.set(i, new BakedQuad(quad.getVertexData(), quad.getTintIndex(), r.rotate(quad.getFace()),
|
||||
quad.func_187508_a(), quad.shouldApplyDiffuseLighting()));
|
||||
quad.func_187508_a(), quad.func_239287_f_()));
|
||||
}
|
||||
|
||||
return quads;
|
||||
|
||||
@@ -62,7 +62,7 @@ public class CrankTESR extends TileEntityRenderer<CrankTileEntity> {
|
||||
BlockState blockState = te.getBlockState();
|
||||
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
IBakedModel model = dispatcher.getModelForState(blockState);
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getCutoutBlockType());
|
||||
dispatcher.getBlockModelRenderer().renderModelBrightnessColor(ms.getLast(), buffer, null, model, 1, 1, 1,
|
||||
combinedLightIn, combinedOverlayIn);
|
||||
ms.pop();
|
||||
|
||||
@@ -55,7 +55,7 @@ public class SkyCompassTESR extends TileEntityRenderer<SkyCompassTileEntity> {
|
||||
blockRenderer = Minecraft.getInstance().getBlockRendererDispatcher();
|
||||
}
|
||||
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getTranslucentBlockType());
|
||||
IVertexBuilder buffer = buffers.getBuffer(Atlases.getCutoutBlockType());
|
||||
|
||||
BlockState blockState = te.getBlockState();
|
||||
IBakedModel model = blockRenderer.getBlockModelShapes().getModel(blockState);
|
||||
|
||||
@@ -29,12 +29,14 @@ import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import appeng.api.parts.IPartHost;
|
||||
import appeng.api.util.AEPartLocation;
|
||||
import appeng.api.util.DimensionalCoord;
|
||||
import appeng.parts.AEBasePart;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Describes how a container the player has opened was originally located. This
|
||||
@@ -62,14 +64,18 @@ public final class ContainerLocator {
|
||||
|
||||
private final Type type;
|
||||
private final int itemIndex;
|
||||
private final int dimensionId;
|
||||
private final ResourceLocation worldId;
|
||||
private final BlockPos blockPos;
|
||||
private final AEPartLocation side;
|
||||
|
||||
private ContainerLocator(Type type, int itemIndex, int dimensionId, BlockPos blockPos, AEPartLocation side) {
|
||||
private ContainerLocator(Type type, int itemIndex, World world, BlockPos blockPos, AEPartLocation side) {
|
||||
this(type, itemIndex, world.func_234923_W_().func_240901_a_(), blockPos, side);
|
||||
}
|
||||
|
||||
private ContainerLocator(Type type, int itemIndex, ResourceLocation worldId, BlockPos blockPos, AEPartLocation side) {
|
||||
this.type = type;
|
||||
this.itemIndex = itemIndex;
|
||||
this.dimensionId = dimensionId;
|
||||
this.worldId = worldId;
|
||||
this.blockPos = blockPos;
|
||||
this.side = side;
|
||||
}
|
||||
@@ -78,16 +84,14 @@ public final class ContainerLocator {
|
||||
if (te.getWorld() == null) {
|
||||
throw new IllegalArgumentException("Cannot open a tile entity that is not in a world");
|
||||
}
|
||||
int dimensionId = te.getWorld().getDimension().getType().getId();
|
||||
return new ContainerLocator(Type.BLOCK, -1, dimensionId, te.getPos(), null);
|
||||
return new ContainerLocator(Type.BLOCK, -1, te.getWorld(), te.getPos(), null);
|
||||
}
|
||||
|
||||
public static ContainerLocator forTileEntitySide(TileEntity te, Direction side) {
|
||||
if (te.getWorld() == null) {
|
||||
throw new IllegalArgumentException("Cannot open a tile entity that is not in a world");
|
||||
}
|
||||
int dimensionId = te.getWorld().getDimension().getType().getId();
|
||||
return new ContainerLocator(Type.PART, -1, dimensionId, te.getPos(), AEPartLocation.fromFacing(side));
|
||||
return new ContainerLocator(Type.PART, -1, te.getWorld(), te.getPos(), AEPartLocation.fromFacing(side));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -100,16 +104,15 @@ public final class ContainerLocator {
|
||||
if (player == null) {
|
||||
throw new IllegalArgumentException("Cannot open a container without a player");
|
||||
}
|
||||
int dimensionId = player.world.getDimension().getType().getId();
|
||||
int slot = getPlayerInventorySlotFromHand(player, context.getHand());
|
||||
AEPartLocation side = AEPartLocation.fromFacing(context.getFace());
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY_WITH_BLOCK_CONTEXT, slot, dimensionId, context.getPos(),
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY_WITH_BLOCK_CONTEXT, slot, player.world, context.getPos(),
|
||||
side);
|
||||
}
|
||||
|
||||
public static ContainerLocator forHand(PlayerEntity player, Hand hand) {
|
||||
int slot = getPlayerInventorySlotFromHand(player, hand);
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY, slot, -1, null, null);
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY, slot, (ResourceLocation) null, null, null);
|
||||
}
|
||||
|
||||
private static int getPlayerInventorySlotFromHand(PlayerEntity player, Hand hand) {
|
||||
@@ -129,7 +132,7 @@ public final class ContainerLocator {
|
||||
public static ContainerLocator forPart(AEBasePart part) {
|
||||
IPartHost host = part.getHost();
|
||||
DimensionalCoord pos = host.getLocation();
|
||||
return new ContainerLocator(Type.PART, -1, pos.getWorld().getDimension().getType().getId(), pos.getBlockPos(),
|
||||
return new ContainerLocator(Type.PART, -1, pos.getWorld().getWorld(), pos.getBlockPos(),
|
||||
part.getSide());
|
||||
}
|
||||
|
||||
@@ -142,8 +145,8 @@ public final class ContainerLocator {
|
||||
return itemIndex;
|
||||
}
|
||||
|
||||
public int getDimensionId() {
|
||||
return dimensionId;
|
||||
public ResourceLocation getWorldId() {
|
||||
return worldId;
|
||||
}
|
||||
|
||||
public boolean hasBlockPos() {
|
||||
@@ -173,18 +176,18 @@ public final class ContainerLocator {
|
||||
case PLAYER_INVENTORY_WITH_BLOCK_CONTEXT:
|
||||
buf.writeByte(1);
|
||||
buf.writeInt(itemIndex);
|
||||
buf.writeInt(dimensionId);
|
||||
buf.writeResourceLocation(worldId);
|
||||
buf.writeBlockPos(blockPos);
|
||||
buf.writeByte(side.ordinal());
|
||||
break;
|
||||
case BLOCK:
|
||||
buf.writeByte(2);
|
||||
buf.writeInt(dimensionId);
|
||||
buf.writeResourceLocation(worldId);
|
||||
buf.writeBlockPos(blockPos);
|
||||
break;
|
||||
case PART:
|
||||
buf.writeByte(3);
|
||||
buf.writeInt(dimensionId);
|
||||
buf.writeResourceLocation(worldId);
|
||||
buf.writeBlockPos(blockPos);
|
||||
buf.writeByte(side.ordinal());
|
||||
break;
|
||||
@@ -197,14 +200,14 @@ public final class ContainerLocator {
|
||||
byte type = buf.readByte();
|
||||
switch (type) {
|
||||
case 0:
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY, buf.readInt(), -1, null, null);
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY, buf.readInt(), (ResourceLocation) null, null, null);
|
||||
case 1:
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY_WITH_BLOCK_CONTEXT, buf.readInt(), buf.readInt(),
|
||||
return new ContainerLocator(Type.PLAYER_INVENTORY_WITH_BLOCK_CONTEXT, buf.readInt(), buf.readResourceLocation(),
|
||||
buf.readBlockPos(), AEPartLocation.values()[buf.readByte()]);
|
||||
case 2:
|
||||
return new ContainerLocator(Type.BLOCK, -1, buf.readInt(), buf.readBlockPos(), null);
|
||||
return new ContainerLocator(Type.BLOCK, -1, buf.readResourceLocation(), buf.readBlockPos(), null);
|
||||
case 3:
|
||||
return new ContainerLocator(Type.PART, -1, buf.readInt(), buf.readBlockPos(),
|
||||
return new ContainerLocator(Type.PART, -1, buf.readResourceLocation(), buf.readBlockPos(),
|
||||
AEPartLocation.values()[buf.readByte()]);
|
||||
default:
|
||||
throw new DecoderException("ContainerLocator type out of range: " + type);
|
||||
@@ -219,7 +222,7 @@ public final class ContainerLocator {
|
||||
result.append("slot=").append(itemIndex).append(',');
|
||||
}
|
||||
if (hasBlockPos()) {
|
||||
result.append("dim=").append(dimensionId).append(',');
|
||||
result.append("dim=").append(worldId).append(',');
|
||||
result.append("pos=").append(blockPos).append(',');
|
||||
}
|
||||
if (hasSide()) {
|
||||
|
||||
@@ -127,7 +127,7 @@ public class SyncData {
|
||||
String json = (String) val;
|
||||
ITextComponent text = null;
|
||||
if (!json.isEmpty()) {
|
||||
text = ITextComponent.Serializer.fromJson((String) val);
|
||||
text = ITextComponent.Serializer.func_240643_a_((String) val);
|
||||
}
|
||||
this.updateTextComponent(text);
|
||||
} else {
|
||||
|
||||
@@ -33,6 +33,7 @@ import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.inventory.container.IContainerListener;
|
||||
import net.minecraft.network.PacketBuffer;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -256,7 +257,7 @@ public class CraftConfirmContainer extends AEBaseContainer {
|
||||
// :P
|
||||
}
|
||||
} catch (final Throwable e) {
|
||||
this.getPlayerInv().player.sendMessage(new StringTextComponent("Error: " + e.toString()));
|
||||
this.getPlayerInv().player.sendMessage(new StringTextComponent("Error: " + e.toString()), Util.DUMMY_UUID);
|
||||
AELog.debug(e);
|
||||
this.setValidContainer(false);
|
||||
this.result = null;
|
||||
|
||||
@@ -28,6 +28,7 @@ import appeng.core.AEConfig;
|
||||
import appeng.core.localization.PlayerMessages;
|
||||
import appeng.helpers.WirelessTerminalGuiObject;
|
||||
import appeng.util.Platform;
|
||||
import net.minecraft.util.Util;
|
||||
|
||||
public class WirelessTermContainer extends MEPortableCellContainer {
|
||||
|
||||
@@ -57,7 +58,7 @@ public class WirelessTermContainer extends MEPortableCellContainer {
|
||||
|
||||
if (!this.wirelessTerminalGUIObject.rangeCheck()) {
|
||||
if (Platform.isServer() && this.isValidContainer()) {
|
||||
this.getPlayerInv().player.sendMessage(PlayerMessages.OutOfRange.get());
|
||||
this.getPlayerInv().player.sendMessage(PlayerMessages.OutOfRange.get(), Util.DUMMY_UUID);
|
||||
}
|
||||
|
||||
this.setValidContainer(false);
|
||||
|
||||
@@ -42,7 +42,6 @@ import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
import net.minecraftforge.client.model.ModelLoaderRegistry;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.ModLoadingContext;
|
||||
@@ -102,6 +101,10 @@ public final class AppEng {
|
||||
|
||||
private static AppEng INSTANCE;
|
||||
|
||||
public static ResourceLocation makeId(String id) {
|
||||
return new ResourceLocation(MOD_ID, id);
|
||||
}
|
||||
|
||||
private final Registration registration;
|
||||
|
||||
public AppEng() {
|
||||
@@ -129,7 +132,6 @@ public final class AppEng {
|
||||
modEventBus.addGenericListener(IRecipeSerializer.class, registration::registerRecipeSerializers);
|
||||
modEventBus.addGenericListener(Feature.class, registration::registerWorldGen);
|
||||
modEventBus.addGenericListener(Biome.class, registration::registerBiomes);
|
||||
modEventBus.addGenericListener(ModDimension.class, registration::registerModDimension);
|
||||
|
||||
modEventBus.addListener(Integrations::enqueueIMC);
|
||||
modEventBus.addListener(this::commonSetup);
|
||||
|
||||
@@ -49,7 +49,6 @@ import net.minecraftforge.client.event.ModelRegistryEvent;
|
||||
import net.minecraftforge.client.event.ParticleFactoryRegisterEvent;
|
||||
import net.minecraftforge.client.event.TextureStitchEvent;
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.ModDimension;
|
||||
import net.minecraftforge.common.extensions.IForgeContainerType;
|
||||
import net.minecraftforge.event.RegistryEvent;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
@@ -204,7 +203,6 @@ import appeng.recipes.handlers.InscriberRecipe;
|
||||
import appeng.recipes.handlers.InscriberRecipeSerializer;
|
||||
import appeng.server.AECommand;
|
||||
import appeng.spatial.StorageCellBiome;
|
||||
import appeng.spatial.StorageCellModDimension;
|
||||
import appeng.tile.AEBaseTileEntity;
|
||||
import appeng.tile.crafting.MolecularAssemblerRenderer;
|
||||
import appeng.worldgen.ChargedQuartzOreConfig;
|
||||
@@ -630,9 +628,6 @@ final class Registration {
|
||||
* world gen
|
||||
*/
|
||||
for (final IWorldGen.WorldGenType type : IWorldGen.WorldGenType.values()) {
|
||||
// FIXME: registries.worldgen().disableWorldGenForProviderID( type,
|
||||
// StorageWorldProvider.class );
|
||||
|
||||
registries.worldgen().disableWorldGenForDimension(type, World.field_234919_h_.getRegistryName());
|
||||
}
|
||||
|
||||
@@ -659,10 +654,6 @@ final class Registration {
|
||||
}
|
||||
|
||||
b.func_235063_a_(MeteoriteStructure.INSTANCE.func_236391_a_(IFeatureConfig.NO_FEATURE_CONFIG));
|
||||
b.addFeature(GenerationStage.Decoration.TOP_LAYER_MODIFICATION,
|
||||
MeteoriteStructure.INSTANCE.func_236391_a_(IFeatureConfig.NO_FEATURE_CONFIG)
|
||||
//.withPlacement(Placement.NOPE.configure(IPlacementConfig.NO_PLACEMENT_CONFIG))
|
||||
);
|
||||
}
|
||||
|
||||
private static void addQuartzWorldGen(Biome b) {
|
||||
@@ -694,8 +685,6 @@ final class Registration {
|
||||
public void registerWorldGen(RegistryEvent.Register<Feature<?>> evt) {
|
||||
IForgeRegistry<Feature<?>> r = evt.getRegistry();
|
||||
|
||||
// r.register(MeteoriteWorldGen.INSTANCE);
|
||||
r.register(MeteoriteStructure.INSTANCE);
|
||||
r.register(ChargedQuartzOreFeature.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -703,10 +692,6 @@ final class Registration {
|
||||
evt.getRegistry().register(StorageCellBiome.INSTANCE);
|
||||
}
|
||||
|
||||
public void registerModDimension(RegistryEvent.Register<ModDimension> evt) {
|
||||
evt.getRegistry().register(StorageCellModDimension.INSTANCE);
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void registerTextures(TextureStitchEvent.Pre event) {
|
||||
SkyChestTESR.registerTextures(event);
|
||||
@@ -714,7 +699,7 @@ final class Registration {
|
||||
}
|
||||
|
||||
public void registerCommands(final FMLServerStartingEvent evt) {
|
||||
new AECommand().register(evt.getCommandDispatcher());
|
||||
new AECommand().register(evt.getServer().getCommandManager().getDispatcher());
|
||||
}
|
||||
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
|
||||
@@ -53,12 +53,12 @@ public class ApiClientHelper implements IClientHelper {
|
||||
|
||||
if (cellInventory != null) {
|
||||
lines.add(new StringTextComponent(cellInventory.getUsedBytes() + " ")
|
||||
.appendSibling(GuiText.Of.textComponent()).appendText(" " + cellInventory.getTotalBytes() + " ")
|
||||
.appendSibling(GuiText.BytesUsed.textComponent()));
|
||||
.func_230529_a_(GuiText.Of.text()).func_240702_b_(" " + cellInventory.getTotalBytes() + " ")
|
||||
.func_230529_a_(GuiText.BytesUsed.text()));
|
||||
|
||||
lines.add(new StringTextComponent(cellInventory.getStoredItemTypes() + " ")
|
||||
.appendSibling(GuiText.Of.textComponent()).appendText(" " + cellInventory.getTotalItemTypes() + " ")
|
||||
.appendSibling(GuiText.Types.textComponent()));
|
||||
.func_230529_a_(GuiText.Of.text()).func_240702_b_(" " + cellInventory.getTotalItemTypes() + " ")
|
||||
.func_230529_a_(GuiText.Types.text()));
|
||||
}
|
||||
|
||||
if (handler.isPreformatted()) {
|
||||
@@ -66,11 +66,11 @@ public class ApiClientHelper implements IClientHelper {
|
||||
: GuiText.Excluded).getLocal();
|
||||
|
||||
if (handler.isFuzzy()) {
|
||||
lines.add(GuiText.Partitioned.textComponent().appendText(" - " + list + " ")
|
||||
.appendSibling(GuiText.Fuzzy.textComponent()));
|
||||
lines.add(GuiText.Partitioned.withSuffix(" - " + list + " ")
|
||||
.func_230529_a_(GuiText.Fuzzy.text()));
|
||||
} else {
|
||||
lines.add(GuiText.Partitioned.textComponent().appendText(" - " + list + " ")
|
||||
.appendSibling(GuiText.Precise.textComponent()));
|
||||
lines.add(GuiText.Partitioned.withSuffix(" - " + list + " ")
|
||||
.func_230529_a_(GuiText.Precise.text()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ public final class ApiBlocks implements IBlocks {
|
||||
}).build();
|
||||
this.quartzVibrantGlass = deco
|
||||
.block("quartz_vibrant_glass",
|
||||
() -> new QuartzLampBlock(defaultProps(Material.GLASS).lightValue(15).notSolid()))
|
||||
() -> new QuartzLampBlock(defaultProps(Material.GLASS).setLightLevel(b -> 15).notSolid()))
|
||||
.addFeatures(AEFeature.DECORATIVE_LIGHTS, AEFeature.QUARTZ_GLASS)
|
||||
.rendering(new BlockRenderingCustomizer() {
|
||||
@Override
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.world.IBlockReader;
|
||||
|
||||
import appeng.api.features.ILocatable;
|
||||
@@ -77,28 +78,28 @@ public final class WirelessRegistry implements IWirelessTermRegistry {
|
||||
}
|
||||
|
||||
if (!this.isWirelessTerminal(item)) {
|
||||
player.sendMessage(PlayerMessages.DeviceNotWirelessTerminal.get());
|
||||
player.sendMessage(PlayerMessages.DeviceNotWirelessTerminal.get(), Util.DUMMY_UUID);
|
||||
return;
|
||||
}
|
||||
|
||||
final IWirelessTermHandler handler = this.getWirelessTerminalHandler(item);
|
||||
final String unparsedKey = handler.getEncryptionKey(item);
|
||||
if (unparsedKey.isEmpty()) {
|
||||
player.sendMessage(PlayerMessages.DeviceNotLinked.get());
|
||||
player.sendMessage(PlayerMessages.DeviceNotLinked.get(), Util.DUMMY_UUID);
|
||||
return;
|
||||
}
|
||||
|
||||
final long parsedKey = Long.parseLong(unparsedKey);
|
||||
final ILocatable securityStation = Api.instance().registries().locatable().getLocatableBy(parsedKey);
|
||||
if (securityStation == null) {
|
||||
player.sendMessage(PlayerMessages.StationCanNotBeLocated.get());
|
||||
player.sendMessage(PlayerMessages.StationCanNotBeLocated.get(), Util.DUMMY_UUID);
|
||||
return;
|
||||
}
|
||||
|
||||
if (handler.hasPower(player, 0.5, item)) {
|
||||
ContainerOpener.openContainer(WirelessTermContainer.TYPE, player, ContainerLocator.forHand(player, hand));
|
||||
} else {
|
||||
player.sendMessage(PlayerMessages.DeviceNotPowered.get());
|
||||
player.sendMessage(PlayerMessages.DeviceNotPowered.get(), Util.DUMMY_UUID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@ import net.minecraft.world.Dimension;
|
||||
import net.minecraft.world.IWorld;
|
||||
|
||||
import appeng.api.features.IWorldGen;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
public final class WorldGenRegistry implements IWorldGen {
|
||||
|
||||
@@ -40,19 +41,6 @@ public final class WorldGenRegistry implements IWorldGen {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void disableWorldGenForProviderID(WorldGenType type, Class<? extends Dimension> provider) {
|
||||
if (type == null) {
|
||||
throw new IllegalArgumentException("Bad Type Passed");
|
||||
}
|
||||
|
||||
if (provider == null) {
|
||||
throw new IllegalArgumentException("Bad Provider Passed");
|
||||
}
|
||||
|
||||
this.types[type.ordinal()].badProviders.add(provider);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void enableWorldGenForDimension(final WorldGenType type, final ResourceLocation dimensionID) {
|
||||
if (type == null) {
|
||||
@@ -72,7 +60,7 @@ public final class WorldGenRegistry implements IWorldGen {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isWorldGenEnabled(final WorldGenType type, final IWorld w) {
|
||||
public boolean isWorldGenEnabled(final WorldGenType type, final ServerWorld w) {
|
||||
if (type == null) {
|
||||
throw new IllegalArgumentException("Bad Type Passed");
|
||||
}
|
||||
@@ -81,12 +69,11 @@ public final class WorldGenRegistry implements IWorldGen {
|
||||
throw new IllegalArgumentException("Bad Provider Passed");
|
||||
}
|
||||
|
||||
ResourceLocation id = w.getDimension().getType().getRegistryName();
|
||||
final boolean isBadProvider = this.types[type.ordinal()].badProviders.contains(w.getDimension().getClass());
|
||||
ResourceLocation id = w.func_234923_W_().func_240901_a_();
|
||||
final boolean isBadDimension = this.types[type.ordinal()].badDimensions.contains(id);
|
||||
final boolean isGoodDimension = this.types[type.ordinal()].enabledDimensions.contains(id);
|
||||
|
||||
if (isBadProvider || isBadDimension) {
|
||||
if (isBadDimension) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -99,7 +86,6 @@ public final class WorldGenRegistry implements IWorldGen {
|
||||
|
||||
private static class TypeSet {
|
||||
|
||||
final HashSet<Class<? extends Dimension>> badProviders = new HashSet<>();
|
||||
final HashSet<ResourceLocation> badDimensions = new HashSet<>();
|
||||
final HashSet<ResourceLocation> enabledDimensions = new HashSet<>();
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.core.localization;
|
||||
|
||||
import net.minecraft.util.text.IFormattableTextComponent;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
|
||||
@@ -70,23 +71,18 @@ public enum ButtonToolTips {
|
||||
|
||||
FilterMode, FilterModeKeep, FilterModeClear;
|
||||
|
||||
private final String root;
|
||||
private final TranslationTextComponent text;
|
||||
|
||||
ButtonToolTips() {
|
||||
this.root = "gui.tooltips.appliedenergistics2";
|
||||
this.text = new TranslationTextComponent("gui.tooltips.appliedenergistics2." + this.name());
|
||||
}
|
||||
|
||||
ButtonToolTips(final String r) {
|
||||
this.root = r;
|
||||
public ITextComponent text() {
|
||||
return text;
|
||||
}
|
||||
|
||||
@Deprecated
|
||||
public String getLocal() {
|
||||
return getTranslationKey().getFormattedText();
|
||||
}
|
||||
|
||||
public ITextComponent getTranslationKey() {
|
||||
return new TranslationTextComponent(this.root + '.' + this.toString());
|
||||
public IFormattableTextComponent text(Object... args) {
|
||||
return new TranslationTextComponent(text.getKey(), args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.core.localization;
|
||||
|
||||
import net.minecraft.util.text.IFormattableTextComponent;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
|
||||
@@ -85,27 +86,39 @@ public enum GuiText {
|
||||
|
||||
private final String root;
|
||||
|
||||
private final ITextComponent text;
|
||||
|
||||
GuiText() {
|
||||
this.root = "gui.appliedenergistics2";
|
||||
this.text = new TranslationTextComponent(getTranslationKey());
|
||||
}
|
||||
|
||||
GuiText(final String r) {
|
||||
this.root = r;
|
||||
this.text = new TranslationTextComponent(getTranslationKey());
|
||||
}
|
||||
|
||||
|
||||
public String getLocal() {
|
||||
return this.textComponent().getString();
|
||||
return text.getString();
|
||||
}
|
||||
|
||||
public String getTranslationKey() {
|
||||
return this.root + '.' + this.toString();
|
||||
}
|
||||
|
||||
public ITextComponent textComponent() {
|
||||
return new TranslationTextComponent(getTranslationKey());
|
||||
public ITextComponent text() {
|
||||
return text;
|
||||
}
|
||||
|
||||
public ITextComponent textComponent(Object... args) {
|
||||
public IFormattableTextComponent withSuffix(String text) {
|
||||
return text().deepCopy().func_240702_b_(text);
|
||||
}
|
||||
|
||||
public IFormattableTextComponent withSuffix(ITextComponent text) {
|
||||
return text().deepCopy().func_230529_a_(text);
|
||||
}
|
||||
|
||||
public IFormattableTextComponent text(Object... args) {
|
||||
return new TranslationTextComponent(getTranslationKey(), args);
|
||||
}
|
||||
|
||||
|
||||
@@ -28,11 +28,14 @@ import java.util.Set;
|
||||
import com.google.gson.JsonDeserializationContext;
|
||||
import com.google.gson.JsonObject;
|
||||
|
||||
import net.minecraft.advancements.ICriterionInstance;
|
||||
import net.minecraft.advancements.ICriterionTrigger;
|
||||
import net.minecraft.advancements.PlayerAdvancements;
|
||||
import net.minecraft.advancements.criterion.CriterionInstance;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.loot.ConditionArrayParser;
|
||||
import net.minecraft.loot.ConditionArraySerializer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import appeng.core.AppEng;
|
||||
@@ -85,7 +88,7 @@ public class AppEngAdvancementTrigger
|
||||
}
|
||||
|
||||
@Override
|
||||
public AppEngAdvancementTrigger.Instance deserializeInstance(JsonObject json, JsonDeserializationContext context) {
|
||||
public Instance func_230307_a_(JsonObject p_230307_1_, ConditionArrayParser p_230307_2_) {
|
||||
return new AppEngAdvancementTrigger.Instance(this.getId());
|
||||
}
|
||||
|
||||
@@ -98,14 +101,26 @@ public class AppEngAdvancementTrigger
|
||||
}
|
||||
}
|
||||
|
||||
public static class Instance extends CriterionInstance {
|
||||
public Instance(ResourceLocation parID) {
|
||||
super(parID);
|
||||
public static class Instance implements ICriterionInstance {
|
||||
private final ResourceLocation id;
|
||||
|
||||
public Instance(ResourceLocation id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public boolean test() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
@Override
|
||||
public JsonObject func_230240_a_(ConditionArraySerializer p_230240_1_) {
|
||||
return new JsonObject();
|
||||
}
|
||||
}
|
||||
|
||||
static class Listeners {
|
||||
|
||||
@@ -25,8 +25,10 @@ import net.minecraft.network.IPacket;
|
||||
import net.minecraft.network.ThreadQuickExitException;
|
||||
import net.minecraft.network.play.ServerPlayNetHandler;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.eventbus.api.SubscribeEvent;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import net.minecraftforge.fml.LogicalSide;
|
||||
@@ -119,15 +121,10 @@ public class NetworkHandler {
|
||||
|
||||
public void sendToAllAround(final BasePacket message, final TargetPoint point) {
|
||||
IPacket<?> pkt = message.toPacket(NetworkDirection.PLAY_TO_CLIENT);
|
||||
getServer().getPlayerList().sendToAllNearExcept(point.excluded, point.x, point.y, point.z, point.r2, point.dim,
|
||||
getServer().getPlayerList().sendToAllNearExcept(point.excluded, point.x, point.y, point.z, point.r2, point.world.func_234923_W_(),
|
||||
pkt);
|
||||
}
|
||||
|
||||
public void sendToDimension(final BasePacket message, final DimensionType dim) {
|
||||
getServer().getPlayerList().sendPacketToAllPlayersInDimension(message.toPacket(NetworkDirection.PLAY_TO_CLIENT),
|
||||
dim);
|
||||
}
|
||||
|
||||
public void sendToServer(final BasePacket message) {
|
||||
Minecraft.getInstance().getConnection().sendPacket(message.toPacket(NetworkDirection.PLAY_TO_SERVER));
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@ package appeng.core.sync.network;
|
||||
|
||||
import net.minecraft.entity.player.ServerPlayerEntity;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* Created by covers1624 on 1/6/20.
|
||||
@@ -13,27 +14,27 @@ public class TargetPoint {
|
||||
public final double y;
|
||||
public final double z;
|
||||
public final double r2;
|
||||
public final DimensionType dim;
|
||||
public final World world;
|
||||
|
||||
public TargetPoint(double x, double y, double z, double r2, DimensionType dim) {
|
||||
this(null, x, y, z, r2, dim);
|
||||
public TargetPoint(double x, double y, double z, double r2, World world) {
|
||||
this(null, x, y, z, r2, world);
|
||||
}
|
||||
|
||||
public TargetPoint(ServerPlayerEntity excluded, double x, double y, double z, double r2, DimensionType dim) {
|
||||
public TargetPoint(ServerPlayerEntity excluded, double x, double y, double z, double r2, World world) {
|
||||
this.excluded = excluded;
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.z = z;
|
||||
this.r2 = r2;
|
||||
this.dim = dim;
|
||||
this.world = world;
|
||||
}
|
||||
|
||||
public static TargetPoint at(double x, double y, double z, double r2, DimensionType dim) {
|
||||
return new TargetPoint(x, y, z, r2, dim);
|
||||
public static TargetPoint at(double x, double y, double z, double r2, World world) {
|
||||
return new TargetPoint(x, y, z, r2, world);
|
||||
}
|
||||
|
||||
public static TargetPoint at(ServerPlayerEntity excluded, double x, double y, double z, double r2,
|
||||
DimensionType dim) {
|
||||
return new TargetPoint(excluded, x, y, z, r2, dim);
|
||||
World world) {
|
||||
return new TargetPoint(excluded, x, y, z, r2, world);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,9 +62,9 @@ public final class WorldData implements IWorldData {
|
||||
Preconditions.checkNotNull(overworld);
|
||||
|
||||
// Attach shared data to the server's overworld dimension
|
||||
if (overworld.getDimension().getType() != DimensionType.OVERWORLD) {
|
||||
if (overworld.func_234923_W_() != ServerWorld.field_234918_g_) {
|
||||
throw new IllegalStateException(
|
||||
"The server doesn't have an Overworld dimension we could store our data on!");
|
||||
"The server doesn't have an overworld we could store our data on!");
|
||||
}
|
||||
|
||||
final PlayerData playerData = overworld.getSavedData().getOrCreate(PlayerData::new, PlayerData.NAME);
|
||||
@@ -96,7 +96,7 @@ public final class WorldData implements IWorldData {
|
||||
throw new IllegalStateException("No server set.");
|
||||
}
|
||||
|
||||
ServerWorld overworld = server.getWorld(DimensionType.OVERWORLD);
|
||||
ServerWorld overworld = server.getWorld(ServerWorld.field_234918_g_);
|
||||
instance = new WorldData(overworld);
|
||||
}
|
||||
return instance;
|
||||
|
||||
@@ -65,7 +65,7 @@ public class ChunkLoaderTileEntity extends AEBaseTileEntity implements ITickable
|
||||
|
||||
if (!serverWorld.getForcedChunks().contains(chunkPos.asLong())) {
|
||||
AELog.debug("Force-loading chunk @ %d,%d in %s", chunkPos.x, chunkPos.z,
|
||||
serverWorld.dimension.getType().getRegistryName());
|
||||
serverWorld.func_234923_W_());
|
||||
serverWorld.forceChunk(chunkPos.x, chunkPos.z, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,7 @@ import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.tileentity.ITickableTileEntity;
|
||||
import net.minecraft.tileentity.TileEntityType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
|
||||
@@ -51,7 +52,7 @@ public class CubeGeneratorTileEntity extends AEBaseTileEntity implements ITickab
|
||||
|
||||
if (this.countdown % 20 == 0) {
|
||||
for (final PlayerEntity e : AppEng.proxy.getPlayers()) {
|
||||
e.sendMessage(new StringTextComponent("Spawning in... " + (this.countdown / 20)));
|
||||
e.sendMessage(new StringTextComponent("Spawning in... " + (this.countdown / 20)), Util.DUMMY_UUID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -102,7 +103,7 @@ public class CubeGeneratorTileEntity extends AEBaseTileEntity implements ITickab
|
||||
this.size = 64;
|
||||
}
|
||||
|
||||
player.sendMessage(new StringTextComponent("Size: " + this.size));
|
||||
player.sendMessage(new StringTextComponent("Size: " + this.size), Util.DUMMY_UUID);
|
||||
} else {
|
||||
this.countdown = 20 * 10;
|
||||
this.is = hand;
|
||||
|
||||
@@ -28,6 +28,7 @@ import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.World;
|
||||
@@ -186,7 +187,7 @@ public class DebugCardItem extends AEBaseItem {
|
||||
}
|
||||
|
||||
private void outputMsg(final Entity player, final String string) {
|
||||
player.sendMessage(new StringTextComponent(string));
|
||||
player.sendMessage(new StringTextComponent(string), Util.DUMMY_UUID);
|
||||
}
|
||||
|
||||
private String timeMeasurement(final long nanos) {
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.item.ItemUseContext;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.vector.Vector3i;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
@@ -49,19 +50,19 @@ public class DebugPartPlacerItem extends AEBaseItem {
|
||||
}
|
||||
|
||||
if (!player.abilities.isCreativeMode) {
|
||||
player.sendMessage(new StringTextComponent("Only usable in creative mode"));
|
||||
player.sendMessage(new StringTextComponent("Only usable in creative mode"), Util.DUMMY_UUID);
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
|
||||
TileEntity te = world.getTileEntity(pos);
|
||||
if (!(te instanceof IPartHost)) {
|
||||
player.sendMessage(new StringTextComponent("Right-click something that will accept parts"));
|
||||
player.sendMessage(new StringTextComponent("Right-click something that will accept parts"), Util.DUMMY_UUID);
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
IPartHost center = (IPartHost) te;
|
||||
IPart cable = center.getPart(AEPartLocation.INTERNAL);
|
||||
if (cable == null) {
|
||||
player.sendMessage(new StringTextComponent("Clicked part host must have an INSIDE part"));
|
||||
player.sendMessage(new StringTextComponent("Clicked part host must have an INSIDE part"), Util.DUMMY_UUID);
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,6 +27,7 @@ import net.minecraft.network.play.server.SChunkDataPacket;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.ChunkPos;
|
||||
import net.minecraft.util.math.MutableBoundingBox;
|
||||
@@ -69,7 +70,7 @@ public class MeteoritePlacerItem extends AEBaseItem {
|
||||
|
||||
CraterType craterType = CraterType.values()[tag.getByte(MODE_TAG)];
|
||||
|
||||
player.sendMessage(new StringTextComponent(craterType.name()));
|
||||
player.sendMessage(new StringTextComponent(craterType.name()), Util.DUMMY_UUID);
|
||||
|
||||
return ActionResult.resultSuccess(itemStack);
|
||||
}
|
||||
@@ -106,7 +107,7 @@ public class MeteoritePlacerItem extends AEBaseItem {
|
||||
pureCrater, false);
|
||||
|
||||
if (spawned == null) {
|
||||
player.sendMessage(new StringTextComponent("Un-suitable Location."));
|
||||
player.sendMessage(new StringTextComponent("Un-suitable Location."), Util.DUMMY_UUID);
|
||||
return ActionResultType.FAIL;
|
||||
}
|
||||
|
||||
@@ -121,14 +122,14 @@ public class MeteoritePlacerItem extends AEBaseItem {
|
||||
placer.place();
|
||||
|
||||
player.sendMessage(new StringTextComponent("Spawned at y=" + spawned.getPos().getY() + " range=" + range
|
||||
+ " biomeCategory=" + world.getBiome(pos).getCategory()));
|
||||
+ " biomeCategory=" + world.getBiome(pos).getCategory()), Util.DUMMY_UUID);
|
||||
|
||||
// The placer will not send chunks to the player since it's used as part
|
||||
// of world-gen normally, so we'll have to do it ourselves. Since this
|
||||
// is a debug tool, we'll not care about being terribly efficient here
|
||||
ChunkPos.getAllInBox(new ChunkPos(spawned.getPos()), 1).forEach(cp -> {
|
||||
Chunk c = world.getChunk(cp.x, cp.z);
|
||||
player.connection.sendPacket(new SChunkDataPacket(c, 65535)); // 65535 == full chunk
|
||||
player.connection.sendPacket(new SChunkDataPacket(c, 65535, false)); // 65535 == full chunk
|
||||
});
|
||||
|
||||
return ActionResultType.SUCCESS;
|
||||
|
||||
@@ -30,8 +30,12 @@ import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
@@ -64,7 +68,7 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
|
||||
tag.putInt("r", replications);
|
||||
|
||||
playerIn.sendMessage(new StringTextComponent((replications + 1) + "³ Replications"));
|
||||
playerIn.sendMessage(new StringTextComponent((replications + 1) + "³ Replications"), Util.DUMMY_UUID);
|
||||
}
|
||||
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
@@ -98,7 +102,7 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
tag.putInt("y", y);
|
||||
tag.putInt("z", z);
|
||||
tag.putInt("side", side.ordinal());
|
||||
tag.putInt("dimid", world.getDimension().getType().getId());
|
||||
tag.putString("w", world.func_234923_W_().func_240901_a_().toString());
|
||||
tag.putInt("r", 0);
|
||||
|
||||
this.outputMsg(player, "Set replicator source");
|
||||
@@ -112,8 +116,9 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
final int src_y = ish.getInt("y");
|
||||
final int src_z = ish.getInt("z");
|
||||
final int src_side = ish.getInt("side");
|
||||
final int dimid = ish.getInt("dimid");
|
||||
final World src_w = world.getServer().getWorld(DimensionType.getById(dimid));
|
||||
final String worldId = ish.getString("w");
|
||||
final World src_w = world.getServer()
|
||||
.getWorld(RegistryKey.func_240903_a_(Registry.WORLD_KEY, new ResourceLocation(worldId)));
|
||||
final int replications = ish.getInt("r") + 1;
|
||||
|
||||
final TileEntity te = src_w.getTileEntity(new BlockPos(src_x, src_y, src_z));
|
||||
@@ -182,7 +187,7 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
final TileEntity nte = blk.createTileEntity(state, world);
|
||||
final CompoundNBT data = new CompoundNBT();
|
||||
ote.write(data);
|
||||
nte.read(data.copy());
|
||||
nte.read(state, data.copy());
|
||||
world.setTileEntity(d, nte);
|
||||
}
|
||||
world.notifyBlockUpdate(d, prev, state, 3);
|
||||
@@ -212,6 +217,6 @@ public class ReplicatorCardItem extends AEBaseItem {
|
||||
}
|
||||
|
||||
private void outputMsg(final Entity player, final String string) {
|
||||
player.sendMessage(new StringTextComponent(string));
|
||||
player.sendMessage(new StringTextComponent(string), Util.DUMMY_UUID);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -67,8 +67,8 @@ public class SkyStoneBlock extends AEBaseBlock {
|
||||
public BlockState updatePostPlacement(BlockState stateIn, Direction facing, BlockState facingState, IWorld worldIn,
|
||||
BlockPos currentPos, BlockPos facingPos) {
|
||||
if (worldIn instanceof ServerWorld) {
|
||||
WorldData.instance().compassData().service().updateArea(worldIn, new ChunkPos(currentPos),
|
||||
currentPos.getY());
|
||||
ServerWorld serverWorld = (ServerWorld) worldIn;
|
||||
WorldData.instance().compassData().service().notifyBlockChange(serverWorld, currentPos);
|
||||
}
|
||||
|
||||
return super.updatePostPlacement(stateIn, facing, facingState, worldIn, currentPos, facingPos);
|
||||
@@ -83,7 +83,8 @@ public class SkyStoneBlock extends AEBaseBlock {
|
||||
super.onReplaced(state, w, pos, newState, isMoving);
|
||||
|
||||
if (w instanceof ServerWorld) {
|
||||
WorldData.instance().compassData().service().updateArea(w, new ChunkPos(pos), pos.getY());
|
||||
ServerWorld serverWorld = (ServerWorld) w;
|
||||
WorldData.instance().compassData().service().notifyBlockChange(serverWorld, pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -87,7 +87,7 @@ public final class TinyTNTPrimedEntity extends TNTEntity implements IEntityAddit
|
||||
*/
|
||||
@Override
|
||||
public void tick() {
|
||||
this.handleWaterMovement();
|
||||
this.func_233566_aG_();
|
||||
|
||||
this.prevPosX = this.getPosX();
|
||||
this.prevPosY = this.getPosY();
|
||||
@@ -168,11 +168,11 @@ public final class TinyTNTPrimedEntity extends TNTEntity implements IEntityAddit
|
||||
+ ((y + 0.5f) - this.getPosY()) * ((y + 0.5f) - this.getPosY())
|
||||
+ ((z + 0.5f) - this.getPosZ()) * ((z + 0.5f) - this.getPosZ())));
|
||||
|
||||
final float resistance = block.getExplosionResistance(state, this.world, point, this, ex);
|
||||
final float resistance = block.getExplosionResistance(state, this.world, point, ex);
|
||||
strength -= (resistance + 0.3F) * 0.11f;
|
||||
|
||||
if (strength > 0.01) {
|
||||
if (block.getRenderMaterial(state) != Material.AIR) {
|
||||
if (state.getMaterial() != Material.AIR) {
|
||||
if (block.canDropFromExplosion(ex)) {
|
||||
block.spawnDrops(state, this.world, point);
|
||||
}
|
||||
|
||||
@@ -45,7 +45,7 @@ public class FluidFormationPlaneScreen extends UpgradeableScreen<FluidFormationP
|
||||
|
||||
@Override
|
||||
protected void addButtons() {
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriorityGui()));
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ public class FluidInterfaceScreen extends UpgradeableScreen<FluidInterfaceContai
|
||||
}
|
||||
|
||||
this.addButton(new TabButton(this.getGuiLeft() + 154, this.getGuiTop(), 2 + 4 * 16,
|
||||
GuiText.Priority.textComponent(), this.itemRenderer, btn -> openPriorityGui()));
|
||||
GuiText.Priority.text(), this.itemRenderer, btn -> openPriorityGui()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -67,7 +67,7 @@ public class FluidInterfaceScreen extends UpgradeableScreen<FluidInterfaceContai
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, int offsetX, int offsetY, int mouseX, int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FluidInterface.textComponent()).getString(), 8,
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.FluidInterface.text()).getString(), 8,
|
||||
6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.Config.getLocal(), 35, 6 + 11 + 7, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.StoredFluids.getLocal(), 35, 6 + 112 + 7, 4210752);
|
||||
|
||||
@@ -90,7 +90,7 @@ public class FluidStorageBusScreen extends UpgradeableScreen<FluidStorageBusCont
|
||||
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
|
||||
FuzzyMode.IGNORE_ALL);
|
||||
|
||||
addButton(this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
|
||||
addButton(this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.text(),
|
||||
this.itemRenderer, btn -> openPriorityGui())));
|
||||
|
||||
this.addButton(this.storageFilter);
|
||||
@@ -100,8 +100,8 @@ public class FluidStorageBusScreen extends UpgradeableScreen<FluidStorageBusCont
|
||||
|
||||
@Override
|
||||
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().textComponent()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().text()).getString(), 8, 6, 4210752);
|
||||
this.font.drawString(matrixStack, GuiText.inventory.text().getString(), 8, this.ySize - 96 + 3, 4210752);
|
||||
|
||||
if (this.fuzzyMode != null) {
|
||||
this.fuzzyMode.set(this.cvb.getFuzzyMode());
|
||||
|
||||
@@ -26,6 +26,7 @@ import java.util.Locale;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
@@ -157,7 +158,7 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderHoveredToolTip(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
protected void func_230459_a_(MatrixStack matrixStack, int mouseX, int mouseY) {
|
||||
final Slot slot = this.getSlot(mouseX, mouseY);
|
||||
|
||||
if (slot instanceof IMEFluidSlot && slot.isEnabled()) {
|
||||
@@ -170,18 +171,17 @@ public class FluidTerminalScreen extends AEBaseMEScreen<FluidTerminalContainer>
|
||||
|
||||
final String modName = Platform.getModName(Platform.getModId(fluidStack));
|
||||
|
||||
final List<String> list = new ArrayList<>();
|
||||
|
||||
list.add(fluidStack.getFluidStack().getDisplayName().getString());
|
||||
list.add(formattedAmount);
|
||||
list.add(modName);
|
||||
final List<ITextComponent> list = new ArrayList<>();
|
||||
list.add(fluidStack.getFluidStack().getDisplayName());
|
||||
list.add(new StringTextComponent(formattedAmount));
|
||||
list.add(new StringTextComponent(modName));
|
||||
|
||||
this.renderTooltip(matrixStack, list, mouseX, mouseY);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
super.renderHoveredToolTip(matrixStack, mouseX, mouseY);
|
||||
super.func_230459_a_(matrixStack, mouseX, mouseY);
|
||||
}
|
||||
|
||||
private <S extends Enum<S>> void toggleServerSetting(SettingToggleButton<S> btn, boolean backwards) {
|
||||
|
||||
@@ -91,10 +91,8 @@ public class FluidTankWidget extends Widget implements ITooltip {
|
||||
public ITextComponent getMessage() {
|
||||
final IAEFluidStack fluid = this.tank.getFluidInSlot(this.slot);
|
||||
if (fluid != null && fluid.getStackSize() > 0) {
|
||||
String desc = fluid.getFluid().getAttributes().getDisplayName(fluid.getFluidStack()).getFormattedText();
|
||||
String amountToText = fluid.getStackSize() + "mB";
|
||||
|
||||
return new StringTextComponent(desc + "\n" + amountToText);
|
||||
return fluid.getFluid().getAttributes().getDisplayName(fluid.getFluidStack()).deepCopy()
|
||||
.func_240702_b_("\n" + (fluid.getStackSize() + "mB"));
|
||||
}
|
||||
return new StringTextComponent("");
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ import java.util.EnumSet;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.block.BlockState;
|
||||
import net.minecraft.inventory.container.ContainerType;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
@@ -102,8 +103,8 @@ public class FluidInterfaceTileEntity extends AENetworkTileEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void read(final CompoundNBT data) {
|
||||
super.read(data);
|
||||
public void read(BlockState state, final CompoundNBT data) {
|
||||
super.read(state, data);
|
||||
this.duality.readFromNBT(data);
|
||||
}
|
||||
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.nbt.ListNBT;
|
||||
import net.minecraft.util.text.IFormattableTextComponent;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -125,10 +126,10 @@ public class InvalidPatternHelper {
|
||||
}
|
||||
|
||||
public ITextComponent getFormattedToolTip() {
|
||||
ITextComponent result = new StringTextComponent(this.getCount() + " ").appendSibling(this.getName());
|
||||
IFormattableTextComponent result = new StringTextComponent(this.getCount() + " ").func_230529_a_(this.getName());
|
||||
|
||||
if (!this.isValid()) {
|
||||
result.applyTextStyle(TextFormatting.RED);
|
||||
result.func_240699_a_(TextFormatting.RED);
|
||||
}
|
||||
|
||||
return result;
|
||||
|
||||
@@ -58,12 +58,12 @@ public class MetaRotation implements IOrientable {
|
||||
public Direction getUp() {
|
||||
final BlockState state = this.w.getBlockState(this.pos);
|
||||
|
||||
if (this.facingProp != null && state.has(this.facingProp)) {
|
||||
if (this.facingProp != null && state.func_235901_b_(this.facingProp) ) {
|
||||
return state.get(this.facingProp);
|
||||
}
|
||||
|
||||
// TODO 1.10.2-R - Temp
|
||||
if (state.has(QuartzPillarBlock.AXIS)) {
|
||||
if (state.func_235901_b_(QuartzPillarBlock.AXIS)) {
|
||||
Axis a = state.get(QuartzPillarBlock.AXIS);
|
||||
switch (a) {
|
||||
case X:
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
package appeng.hooks;
|
||||
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.gen.ChunkGenerator;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
|
||||
public interface DynamicDimensions {
|
||||
|
||||
ServerWorld addWorld(RegistryKey<World> worldId, RegistryKey<DimensionType> dimensionTypeId,
|
||||
ChunkGenerator chunkGenerator);
|
||||
|
||||
}
|
||||
@@ -28,6 +28,7 @@ import com.google.common.base.Splitter;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
|
||||
import jdk.nashorn.internal.objects.annotations.Function;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
@@ -43,7 +44,6 @@ import mezz.jei.api.gui.ingredient.IGuiItemStackGroup;
|
||||
import mezz.jei.api.helpers.IGuiHelper;
|
||||
import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.category.IRecipeCategory;
|
||||
import mezz.jei.gui.HoverChecker;
|
||||
|
||||
import appeng.api.config.CondenserOutput;
|
||||
import appeng.api.definitions.IMaterials;
|
||||
@@ -68,8 +68,6 @@ class CondenserCategory implements IRecipeCategory<CondenserOutput> {
|
||||
|
||||
private final IDrawable icon;
|
||||
|
||||
private final HoverChecker buttonHoverChecker;
|
||||
|
||||
private final Map<CondenserOutput, IDrawable> buttonIcons;
|
||||
|
||||
public CondenserCategory(IGuiHelper guiHelper) {
|
||||
@@ -94,7 +92,6 @@ class CondenserCategory implements IRecipeCategory<CondenserOutput> {
|
||||
guiHelper.drawableBuilder(statesLocation, 16, 112, 14, 14).addPadding(28, 0, 78, 0).build());
|
||||
this.buttonIcons.put(CondenserOutput.SINGULARITY,
|
||||
guiHelper.drawableBuilder(statesLocation, 32, 112, 14, 14).addPadding(28, 0, 78, 0).build());
|
||||
this.buttonHoverChecker = new HoverChecker(28, 28 + 16, 78, 78 + 16);
|
||||
}
|
||||
|
||||
private ItemStack getOutput(CondenserOutput recipe) {
|
||||
@@ -189,7 +186,7 @@ class CondenserCategory implements IRecipeCategory<CondenserOutput> {
|
||||
@Override
|
||||
public List<ITextComponent> getTooltipStrings(CondenserOutput output, double mouseX, double mouseY) {
|
||||
|
||||
if (this.buttonHoverChecker.checkHover((int) mouseX, (int) mouseY)) {
|
||||
if (mouseX >= 28 && mouseX < 28 + 16 && mouseY >= 78 && mouseY < 78 + 16) {
|
||||
String key;
|
||||
|
||||
switch (output) {
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
package appeng.integration.modules.jei;
|
||||
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
@@ -109,7 +110,7 @@ class InscriberRecipeCategory implements IRecipeCategory<InscriberRecipe> {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void draw(InscriberRecipe recipe, double mouseX, double mouseY) {
|
||||
this.progress.draw();
|
||||
public void draw(InscriberRecipe recipe, MatrixStack matrixStack, double mouseX, double mouseY) {
|
||||
this.progress.draw(matrixStack);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,10 +32,6 @@ public enum TheOneProbeText {
|
||||
this.root = "theoneprobe.appliedenergistics2";
|
||||
}
|
||||
|
||||
public String getTranslationString(Object... args) {
|
||||
return getTranslationComponent(args).getFormattedText();
|
||||
}
|
||||
|
||||
public TranslationTextComponent getTranslationComponent(Object... args) {
|
||||
return new TranslationTextComponent(this.getUnlocalized(), args);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.item.ItemGroup;
|
||||
import net.minecraft.item.ItemModelsProperties;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.IItemProvider;
|
||||
@@ -71,7 +72,7 @@ public class CrystalSeedItem extends AEBaseItem implements IGrowableCrystal {
|
||||
super(properties);
|
||||
this.grownItem = Preconditions.checkNotNull(grownItem);
|
||||
// Expose the growth of the seed to the model system
|
||||
addPropertyOverride(new ResourceLocation("appliedenergistics2:growth"),
|
||||
ItemModelsProperties.func_239418_a_(this, new ResourceLocation("appliedenergistics2:growth"),
|
||||
(is, w, p) -> getGrowthTicks(is) / (float) GROWTH_TICKS_REQUIRED);
|
||||
}
|
||||
|
||||
@@ -106,7 +107,7 @@ public class CrystalSeedItem extends AEBaseItem implements IGrowableCrystal {
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
public void addInformation(final ItemStack stack, final World world, final List<ITextComponent> lines,
|
||||
final ITooltipFlag advancedTooltips) {
|
||||
lines.add(ButtonToolTips.DoesntDespawn.getTranslationKey());
|
||||
lines.add(ButtonToolTips.DoesntDespawn.text());
|
||||
lines.add(getGrowthTooltipItem(stack));
|
||||
|
||||
super.addInformation(stack, world, lines, advancedTooltips);
|
||||
|
||||
@@ -116,15 +116,15 @@ public class EncodedPatternItem extends AEBaseItem {
|
||||
return;
|
||||
}
|
||||
|
||||
stack.setDisplayName(GuiText.InvalidPattern.textComponent().deepCopy().func_240701_a_(TextFormatting.RED));
|
||||
stack.setDisplayName(GuiText.InvalidPattern.text().deepCopy().func_240701_a_(TextFormatting.RED));
|
||||
|
||||
InvalidPatternHelper invalid = new InvalidPatternHelper(stack);
|
||||
|
||||
final ITextComponent label = (invalid.isCraftable() ? GuiText.Crafts.textComponent()
|
||||
: GuiText.Creates.textComponent()).deepCopy().func_240702_b_(": ");
|
||||
final ITextComponent label = (invalid.isCraftable() ? GuiText.Crafts.text()
|
||||
: GuiText.Creates.text()).deepCopy().func_240702_b_(": ");
|
||||
final ITextComponent and = new StringTextComponent(" ").deepCopy()
|
||||
.func_230529_a_(GuiText.And.textComponent()).deepCopy().func_240702_b_(" ");
|
||||
final ITextComponent with = GuiText.With.textComponent().deepCopy().func_240702_b_(": ");
|
||||
.func_230529_a_(GuiText.And.text()).deepCopy().func_240702_b_(" ");
|
||||
final ITextComponent with = GuiText.With.text().deepCopy().func_240702_b_(": ");
|
||||
|
||||
boolean first = true;
|
||||
for (final InvalidPatternHelper.PatternIngredient output : invalid.getOutputs()) {
|
||||
@@ -139,10 +139,10 @@ public class EncodedPatternItem extends AEBaseItem {
|
||||
}
|
||||
|
||||
if (invalid.isCraftable()) {
|
||||
final ITextComponent substitutionLabel = GuiText.Substitute.textComponent().deepCopy()
|
||||
final ITextComponent substitutionLabel = GuiText.Substitute.text().deepCopy()
|
||||
.func_240702_b_(" ");
|
||||
final ITextComponent canSubstitute = invalid.canSubstitute() ? GuiText.Yes.textComponent()
|
||||
: GuiText.No.textComponent();
|
||||
final ITextComponent canSubstitute = invalid.canSubstitute() ? GuiText.Yes.text()
|
||||
: GuiText.No.text();
|
||||
|
||||
lines.add(substitutionLabel.deepCopy().func_230529_a_(canSubstitute));
|
||||
}
|
||||
@@ -160,11 +160,11 @@ public class EncodedPatternItem extends AEBaseItem {
|
||||
final Collection<IAEItemStack> in = details.getInputs();
|
||||
final Collection<IAEItemStack> out = details.getOutputs();
|
||||
|
||||
final ITextComponent label = (isCrafting ? GuiText.Crafts.textComponent() : GuiText.Creates.textComponent())
|
||||
final ITextComponent label = (isCrafting ? GuiText.Crafts.text() : GuiText.Creates.text())
|
||||
.deepCopy().func_240702_b_(": ");
|
||||
final ITextComponent and = new StringTextComponent(" ").deepCopy().func_230529_a_(GuiText.And.textComponent())
|
||||
final ITextComponent and = new StringTextComponent(" ").deepCopy().func_230529_a_(GuiText.And.text())
|
||||
.func_240702_b_(" ");
|
||||
final ITextComponent with = GuiText.With.textComponent().deepCopy().func_240702_b_(": ");
|
||||
final ITextComponent with = GuiText.With.text().deepCopy().func_240702_b_(": ");
|
||||
|
||||
boolean first = true;
|
||||
for (final IAEItemStack anOut : out) {
|
||||
@@ -189,8 +189,8 @@ public class EncodedPatternItem extends AEBaseItem {
|
||||
}
|
||||
|
||||
if (isCrafting) {
|
||||
final ITextComponent substitutionLabel = GuiText.Substitute.textComponent().deepCopy().func_240702_b_(" ");
|
||||
final ITextComponent canSubstitute = substitute ? GuiText.Yes.textComponent() : GuiText.No.textComponent();
|
||||
final ITextComponent substitutionLabel = GuiText.Substitute.text().deepCopy().func_240702_b_(" ");
|
||||
final ITextComponent canSubstitute = substitute ? GuiText.Yes.text() : GuiText.No.text();
|
||||
|
||||
lines.add(substitutionLabel.deepCopy().func_230529_a_(canSubstitute));
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ public class FacadeItem extends AEBaseItem implements IFacadeItem, IAlphaPassIte
|
||||
try {
|
||||
final ItemStack in = this.getTextureItem(is);
|
||||
if (!in.isEmpty()) {
|
||||
return super.getDisplayName(is).deepCopy().appendText(" - ").appendSibling(in.getDisplayName());
|
||||
return super.getDisplayName(is).deepCopy().func_240702_b_(" - ").func_230529_a_(in.getDisplayName());
|
||||
}
|
||||
} catch (final Throwable ignored) {
|
||||
|
||||
|
||||
@@ -23,13 +23,16 @@ import java.util.List;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.RegistryKey;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.registry.Registry;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraft.world.DimensionType;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.server.ServerWorld;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.api.distmarker.OnlyIn;
|
||||
|
||||
@@ -57,17 +60,17 @@ public class SpatialStorageCellItem extends AEBaseItem implements ISpatialStorag
|
||||
@Override
|
||||
public void addInformation(final ItemStack stack, final World world, final List<ITextComponent> lines,
|
||||
final ITooltipFlag advancedTooltips) {
|
||||
final DimensionType dimType = this.getStoredDimension(stack);
|
||||
if (dimType == null) {
|
||||
lines.add(GuiText.Unformatted.textComponent().applyTextStyle(TextFormatting.ITALIC));
|
||||
lines.add(GuiText.SpatialCapacity.textComponent(maxRegion, maxRegion, maxRegion));
|
||||
final RegistryKey<World> worldId = this.getStoredDimension(stack);
|
||||
if (worldId == null) {
|
||||
lines.add(GuiText.Unformatted.text().deepCopy().func_240699_a_(TextFormatting.ITALIC));
|
||||
lines.add(GuiText.SpatialCapacity.text(maxRegion, maxRegion, maxRegion));
|
||||
} else {
|
||||
SpatialDimensionManager.INSTANCE.addCellDimensionTooltip(dimType, lines);
|
||||
SpatialDimensionManager.INSTANCE.addCellDimensionTooltip(worldId, lines);
|
||||
}
|
||||
|
||||
if (advancedTooltips.isAdvanced()) {
|
||||
if (dimType != null && dimType.getRegistryName() != null) {
|
||||
lines.add(new StringTextComponent("Dimension: " + dimType.getRegistryName()));
|
||||
if (worldId != null && worldId.func_240901_a_() != null) {
|
||||
lines.add(new StringTextComponent("Dimension: " + worldId.func_240901_a_()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -83,12 +86,12 @@ public class SpatialStorageCellItem extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public DimensionType getStoredDimension(final ItemStack is) {
|
||||
public RegistryKey<World> getStoredDimension(final ItemStack is) {
|
||||
final CompoundNBT c = is.getTag();
|
||||
if (c != null && c.contains(TAG_DIMENSION_ID)) {
|
||||
try {
|
||||
ResourceLocation dimTypeId = new ResourceLocation(c.getString(TAG_DIMENSION_ID));
|
||||
return DimensionType.byName(dimTypeId);
|
||||
ResourceLocation worldId = new ResourceLocation(c.getString(TAG_DIMENSION_ID));
|
||||
return RegistryKey.func_240903_a_(Registry.WORLD_KEY, worldId);
|
||||
} catch (Exception e) {
|
||||
AELog.warn("Failed to retrieve storage cell dimension.", e);
|
||||
}
|
||||
@@ -97,8 +100,8 @@ public class SpatialStorageCellItem extends AEBaseItem implements ISpatialStorag
|
||||
}
|
||||
|
||||
@Override
|
||||
public TransitionResult doSpatialTransition(final ItemStack is, final World w, final WorldCoord min,
|
||||
final WorldCoord max, int playerId) {
|
||||
public TransitionResult doSpatialTransition(final ItemStack is, final ServerWorld w, final WorldCoord min,
|
||||
final WorldCoord max, int playerId) {
|
||||
final int targetX = max.x - min.x - 1;
|
||||
final int targetY = max.y - min.y - 1;
|
||||
final int targetZ = max.z - min.z - 1;
|
||||
@@ -108,27 +111,27 @@ public class SpatialStorageCellItem extends AEBaseItem implements ISpatialStorag
|
||||
|
||||
ISpatialDimension manager = SpatialDimensionManager.INSTANCE;
|
||||
|
||||
DimensionType storedDim = this.getStoredDimension(is);
|
||||
if (storedDim == null) {
|
||||
storedDim = manager.createNewCellDimension(targetSize);
|
||||
RegistryKey<World> worldId = this.getStoredDimension(is);
|
||||
if (worldId == null || manager.getWorld(worldId) == null) {
|
||||
worldId = manager.createNewCellDimension(targetSize);
|
||||
}
|
||||
|
||||
if (storedDim == null) {
|
||||
if (worldId == null) {
|
||||
// Failed to create the dimension
|
||||
return new TransitionResult(false, 0);
|
||||
}
|
||||
|
||||
try {
|
||||
if (manager.isCellDimension(storedDim)) {
|
||||
World cellWorld = manager.getWorld(storedDim);
|
||||
if (manager.isCellDimension(worldId)) {
|
||||
ServerWorld cellWorld = manager.getWorld(worldId);
|
||||
|
||||
BlockPos scale = manager.getCellDimensionSize(storedDim);
|
||||
BlockPos scale = manager.getCellDimensionSize(worldId);
|
||||
|
||||
if (scale.equals(targetSize)) {
|
||||
if (targetX <= maxSize && targetY <= maxSize && targetZ <= maxSize) {
|
||||
BlockPos offset = manager.getCellDimensionOrigin(storedDim);
|
||||
BlockPos offset = manager.getCellDimensionOrigin(worldId);
|
||||
|
||||
this.setStoredDimension(is, storedDim);
|
||||
this.setStoredDimension(is, worldId);
|
||||
StorageHelper.getInstance().swapRegions(w, min.x + 1, min.y + 1, min.z + 1, cellWorld,
|
||||
offset.getX(), offset.getY(), offset.getZ(), targetX - 1, targetY - 1, targetZ - 1);
|
||||
|
||||
@@ -139,14 +142,14 @@ public class SpatialStorageCellItem extends AEBaseItem implements ISpatialStorag
|
||||
return new TransitionResult(false, 0);
|
||||
} finally {
|
||||
// clean up newly created dimensions that failed transfer
|
||||
if (manager.isCellDimension(storedDim) && this.getStoredDimension(is) == null) {
|
||||
manager.deleteCellDimension(storedDim);
|
||||
if (manager.isCellDimension(worldId) && this.getStoredDimension(is) == null) {
|
||||
manager.deleteCellDimension(worldId);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setStoredDimension(final ItemStack is, DimensionType dim) {
|
||||
private void setStoredDimension(final ItemStack is, RegistryKey<World> worldId) {
|
||||
final CompoundNBT c = is.getOrCreateTag();
|
||||
c.putString(TAG_DIMENSION_ID, dim.getRegistryName().toString());
|
||||
c.putString(TAG_DIMENSION_ID, worldId.func_240901_a_().toString());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@ import net.minecraft.nbt.CompoundNBT;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.ActionResultType;
|
||||
import net.minecraft.util.Hand;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
@@ -145,19 +146,19 @@ public class MemoryCardItem extends AEBaseItem implements IMemoryCard {
|
||||
|
||||
switch (msg) {
|
||||
case SETTINGS_CLEARED:
|
||||
player.sendMessage(PlayerMessages.SettingCleared.get(), player.getUniqueID());
|
||||
player.sendMessage(PlayerMessages.SettingCleared.get(), Util.DUMMY_UUID);
|
||||
break;
|
||||
case INVALID_MACHINE:
|
||||
player.sendMessage(PlayerMessages.InvalidMachine.get(), player.getUniqueID());
|
||||
player.sendMessage(PlayerMessages.InvalidMachine.get(), Util.DUMMY_UUID);
|
||||
break;
|
||||
case SETTINGS_LOADED:
|
||||
player.sendMessage(PlayerMessages.LoadedSettings.get(), player.getUniqueID());
|
||||
player.sendMessage(PlayerMessages.LoadedSettings.get(), Util.DUMMY_UUID);
|
||||
break;
|
||||
case SETTINGS_SAVED:
|
||||
player.sendMessage(PlayerMessages.SavedSettings.get(), player.getUniqueID());
|
||||
player.sendMessage(PlayerMessages.SavedSettings.get(), Util.DUMMY_UUID);
|
||||
break;
|
||||
case SETTINGS_RESET:
|
||||
player.sendMessage(PlayerMessages.ResetSettings.get(), player.getUniqueID());
|
||||
player.sendMessage(PlayerMessages.ResetSettings.get(), Util.DUMMY_UUID);
|
||||
break;
|
||||
default:
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user