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