1.16 port

This commit is contained in:
yueh
2020-07-22 16:44:42 +02:00
parent 662dbca3e1
commit 56ecda5173
225 changed files with 1214 additions and 969 deletions
@@ -25,7 +25,6 @@ import net.minecraft.block.Block;
import net.minecraft.client.util.ITooltipFlag;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.CompoundNBT;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.TranslationTextComponent;
import net.minecraft.world.World;
@@ -45,12 +44,12 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
public AEBaseBlockItemChargeable(Block id, Properties props) {
super(id, props);
addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
/*addPropertyOverride(new ResourceLocation("appliedenergistics2:fill_level"), (is, world, entity) -> {
double curPower = getAECurrentPower(is);
double maxPower = getAEMaxPower(is);
return (int) Math.round(100 * curPower / maxPower);
});
});*/
}
@Override
@@ -68,10 +67,10 @@ public class AEBaseBlockItemChargeable extends AEBaseBlockItem implements IAEIte
final double percent = internalCurrentPower / internalMaxPower;
lines.add(GuiText.StoredEnergy.textComponent()
.appendText(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
.appendSibling(new TranslationTextComponent(PowerUnits.AE.unlocalizedName))
.appendText(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
lines.add(GuiText.StoredEnergy.textComponent().deepCopy()
.func_240702_b_(':' + MessageFormat.format(" {0,number,#} ", internalCurrentPower))
.func_230529_a_(new TranslationTextComponent(PowerUnits.AE.unlocalizedName))
.func_240702_b_(" - " + MessageFormat.format("{0,number,#.##%}", percent)));
}
}
@@ -29,8 +29,6 @@ import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.block.BlockState;
import net.minecraft.block.material.Material;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.TransformationMatrix;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
import net.minecraft.entity.player.PlayerEntity;
@@ -44,6 +42,8 @@ import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.math.vector.TransformationMatrix;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
@@ -80,8 +80,8 @@ public class QuartzFixtureBlock extends AEBaseBlock implements IOrientableBlock
public static final BooleanProperty ODD = BooleanProperty.create("odd");
public QuartzFixtureBlock() {
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0).lightValue(14)
.sound(SoundType.GLASS).notSolid());
super(defaultProps(Material.MISCELLANEOUS).doesNotBlockMovement().hardnessAndResistance(0)
.setLightLevel((b) -> 14).sound(SoundType.GLASS).notSolid());
this.setDefaultState(getDefaultState().with(FACING, Direction.UP).with(ODD, false));
}
@@ -33,7 +33,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.entity.Entity;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.fluid.IFluidState;
import net.minecraft.fluid.FluidState;
import net.minecraft.item.BlockItemUseContext;
import net.minecraft.item.DyeColor;
import net.minecraft.item.ItemGroup;
@@ -47,10 +47,10 @@ import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.BlockRayTraceResult;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.RayTraceResult.Type;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.shapes.ISelectionContext;
import net.minecraft.util.math.shapes.VoxelShape;
import net.minecraft.util.math.shapes.VoxelShapes;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.IWorld;
import net.minecraft.world.IWorldReader;
@@ -146,7 +146,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
@Override
public boolean removedByPlayer(BlockState state, World world, BlockPos pos, PlayerEntity player,
boolean willHarvest, IFluidState fluid) {
boolean willHarvest, FluidState fluid) {
if (player.abilities.isCreativeMode) {
final AEBaseTileEntity tile = this.getTileEntity(world, pos);
if (tile != null) {
@@ -171,7 +171,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
@Override
public ItemStack getPickBlock(BlockState state, RayTraceResult target, IBlockReader world, BlockPos pos,
PlayerEntity player) {
final Vec3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
final Vector3d v3 = target.getHitVec().subtract(pos.getX(), pos.getY(), pos.getZ());
final SelectedPart sp = this.cb(world, pos).selectPart(v3);
if (sp.part != null) {
@@ -223,7 +223,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
// FIXME: Check how this looks, probably like shit, maybe provide parts the
// ability to supply particle textures???
effectRenderer
.addEffect(new CableBusBreakingParticle(world, x, y, z, texture).multiplyParticleScaleBy(0.8F));
.addEffect(new CableBusBreakingParticle(world, x, y, z, texture).multipleParticleScaleBy(0.8F));
}
return true;
@@ -313,7 +313,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
if (rtr instanceof BlockRayTraceResult) {
BlockRayTraceResult brtr = (BlockRayTraceResult) rtr;
if (brtr.getPos().equals(pos)) {
final Vec3d hitVec = rtr.getHitVec().subtract(new Vec3d(pos));
final Vector3d hitVec = rtr.getHitVec().subtract(new Vector3d(pos.getX(), pos.getY(), pos.getZ()));
if (this.cb(worldIn, pos).clicked(player, Hand.MAIN_HAND, hitVec)) {
NetworkHandler.instance().sendToServer(new ClickPacket(pos, brtr.getFace(), (float) hitVec.x,
@@ -324,7 +324,7 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
}
}
public void onBlockClickPacket(World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, Vec3d hitVec) {
public void onBlockClickPacket(World worldIn, BlockPos pos, PlayerEntity playerIn, Hand hand, Vector3d hitVec) {
this.cb(worldIn, pos).clicked(playerIn, hand, hitVec);
}
@@ -332,8 +332,8 @@ public class CableBusBlock extends AEBaseTileBlock<CableBusTileEntity> implement
public ActionResultType onActivated(final World w, final BlockPos pos, final PlayerEntity player, final Hand hand,
final @Nullable ItemStack heldItem, final BlockRayTraceResult hit) {
// Transform from world into block space
Vec3d hitVec = hit.getHitVec();
Vec3d hitInBlock = new Vec3d(hitVec.x - pos.getX(), hitVec.y - pos.getY(), hitVec.z - pos.getZ());
Vector3d hitVec = hit.getHitVec();
Vector3d hitInBlock = new Vector3d(hitVec.x - pos.getX(), hitVec.y - pos.getY(), hitVec.z - pos.getZ());
return this.cb(w, pos).activate(player, hand, hitInBlock) ? ActionResultType.SUCCESS : ActionResultType.PASS;
}
@@ -24,7 +24,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -40,7 +40,7 @@ import appeng.tile.networking.CableBusTileEntity;
public class CableBusColor implements IBlockColor {
@Override
public int getColor(BlockState state, @Nullable ILightReader worldIn, @Nullable BlockPos pos, int color) {
public int getColor(BlockState state, @Nullable IBlockDisplayReader worldIn, @Nullable BlockPos pos, int color) {
AEColor busColor = AEColor.TRANSPARENT;
@@ -38,7 +38,7 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerTileEntity> {
offline, online, conflicted;
@Override
public String getName() {
public String getString() {
return this.name();
}
@@ -54,7 +54,7 @@ public class ControllerBlock extends AEBaseTileBlock<ControllerTileEntity> {
block, column_x, column_y, column_z, inside_a, inside_b;
@Override
public String getName() {
public String getString() {
return this.name();
}
@@ -50,7 +50,7 @@ public class WirelessBlock extends AEBaseTileBlock<WirelessTileEntity> {
OFF, ON, HAS_CHANNEL;
@Override
public String getName() {
public String getString() {
return this.name().toLowerCase();
}
}
@@ -15,7 +15,7 @@ import com.google.common.collect.ImmutableList;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction;
@@ -35,16 +35,16 @@ import appeng.tile.misc.PaintSplotchesTileEntity;
*/
class PaintSplotchesBakedModel implements IDynamicBakedModel {
private static final Material TEXTURE_PAINT1 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_PAINT1 = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/paint1"));
private static final Material TEXTURE_PAINT2 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_PAINT2 = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/paint2"));
private static final Material TEXTURE_PAINT3 = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_PAINT3 = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/paint3"));
private final TextureAtlasSprite[] textures;
PaintSplotchesBakedModel(Function<Material, TextureAtlasSprite> bakedTextureGetter) {
PaintSplotchesBakedModel(Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter) {
this.textures = new TextureAtlasSprite[] { bakedTextureGetter.apply(TEXTURE_PAINT1),
bakedTextureGetter.apply(TEXTURE_PAINT2), bakedTextureGetter.apply(TEXTURE_PAINT3) };
}
@@ -171,7 +171,7 @@ class PaintSplotchesBakedModel implements IDynamicBakedModel {
return false;
}
static List<Material> getRequiredTextures() {
static List<RenderMaterial> getRequiredTextures() {
return ImmutableList.of(TEXTURE_PAINT1, TEXTURE_PAINT2, TEXTURE_PAINT3);
}
}
@@ -11,8 +11,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -22,13 +22,13 @@ public class PaintSplotchesModel implements IModelGeometry<PaintSplotchesModel>
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
return new PaintSplotchesBakedModel(spriteGetter);
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return PaintSplotchesBakedModel.getRequiredTextures();
}
@@ -17,7 +17,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction;
@@ -32,17 +32,17 @@ import appeng.tile.qnb.QuantumBridgeTileEntity;
class QnbFormedBakedModel implements IDynamicBakedModel {
private static final Material TEXTURE_LINK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_LINK = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_link"));
private static final Material TEXTURE_RING = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_RING = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring"));
private static final Material TEXTURE_RING_LIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_RING_LIGHT = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring_light"));
private static final Material TEXTURE_RING_LIGHT_CORNER = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_RING_LIGHT_CORNER = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/quantum_ring_light_corner"));
private static final Material TEXTURE_CABLE_GLASS = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_CABLE_GLASS = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "part/cable/glass/transparent"));
private static final Material TEXTURE_COVERED_CABLE = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_COVERED_CABLE = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "part/cable/covered/transparent"));
private static final float DEFAULT_RENDER_MIN = 2.0f;
@@ -65,7 +65,7 @@ class QnbFormedBakedModel implements IDynamicBakedModel {
private final TextureAtlasSprite lightTexture;
private final TextureAtlasSprite lightCornerTexture;
public QnbFormedBakedModel(IBakedModel baseModel, Function<Material, TextureAtlasSprite> bakedTextureGetter) {
public QnbFormedBakedModel(IBakedModel baseModel, Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter) {
this.baseModel = baseModel;
this.linkTexture = bakedTextureGetter.apply(TEXTURE_LINK);
this.ringTexture = bakedTextureGetter.apply(TEXTURE_RING);
@@ -220,7 +220,7 @@ class QnbFormedBakedModel implements IDynamicBakedModel {
return this.baseModel.getOverrides();
}
public static List<Material> getRequiredTextures() {
public static List<RenderMaterial> getRequiredTextures() {
return ImmutableList.of(TEXTURE_LINK, TEXTURE_RING, TEXTURE_CABLE_GLASS, TEXTURE_COVERED_CABLE,
TEXTURE_RING_LIGHT, TEXTURE_RING_LIGHT_CORNER);
}
@@ -11,8 +11,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -26,14 +26,14 @@ public class QnbFormedModel implements IModelGeometry<QnbFormedModel> {
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
IBakedModel ringModel = bakery.getBakedModel(MODEL_RING, modelTransform, spriteGetter);
return new QnbFormedBakedModel(ringModel, spriteGetter);
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return QnbFormedBakedModel.getRequiredTextures();
}
@@ -46,7 +46,7 @@ import appeng.block.AEBaseBlock;
*/
public class MatrixFrameBlock extends AEBaseBlock {
private static final Material MATERIAL = new Material(MaterialColor.AIR, false, true, true, false, false, false,
private static final Material MATERIAL = new Material(MaterialColor.AIR, false, true, true, false, false,
false, PushReaction.PUSH_ONLY);
public MatrixFrameBlock() {
@@ -81,7 +81,7 @@ public class ChestBlock extends AEBaseTileBlock<ChestTileEntity> {
if (hit.getFace() == tg.getUp()) {
if (!tg.openGui(p)) {
p.sendMessage(PlayerMessages.ChestCannotReadStorageCell.get());
p.sendMessage(PlayerMessages.ChestCannotReadStorageCell.get(), p.getUniqueID());
}
} else {
ContainerOpener.openContainer(ChestContainer.TYPE, p,
@@ -53,7 +53,7 @@ public enum DriveSlotState implements IStringSerializable {
}
@Override
public String getName() {
public String getString() {
return this.name;
}
@@ -30,7 +30,7 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Hand;
import net.minecraft.util.math.RayTraceResult;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.World;
import net.minecraftforge.client.event.InputEvent;
import net.minecraftforge.client.event.RenderLivingEvent;
@@ -107,7 +107,7 @@ public class ClientHelper extends ServerHelper {
this.spawnLightning(world, posX, posY, posZ);
return;
case LightningArc:
this.spawnLightningArc(world, posX, posY, posZ, (Vec3d) o);
this.spawnLightningArc(world, posX, posY, posZ, (Vector3d) o);
return;
default:
}
@@ -206,7 +206,7 @@ public class ClientHelper extends ServerHelper {
}
private void spawnLightningArc(final World world, final double posX, final double posY, final double posZ,
final Vec3d second) {
final Vector3d second) {
final LightningFX fx = new LightningArcFX(world, posX, posY, posZ, second.x, second.y, second.z, 0.0f, 0.0f,
0.0f);
Minecraft.getInstance().particles.addEffect(fx);
@@ -22,10 +22,13 @@ import java.text.NumberFormat;
import java.util.List;
import java.util.Locale;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import appeng.api.storage.data.IAEItemStack;
@@ -41,14 +44,14 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
}
@Override
protected void renderTooltip(final ItemStack stack, final int x, final int y) {
protected void renderTooltip(MatrixStack matrixStack, final ItemStack stack, final int x, final int y) {
final Slot s = this.getSlot(x, y);
if (s instanceof SlotME && !stack.isEmpty()) {
final int bigNumber = AEConfig.instance().isUseLargeFonts() ? 999 : 9999;
IAEItemStack myStack = null;
final List<String> currentToolTip = this.getTooltipFromItem(stack);
final List<ITextComponent> currentToolTip = this.getTooltipFromItem(stack);
try {
final SlotME theSlotField = (SlotME) s;
@@ -63,7 +66,7 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
.format(myStack.getStackSize());
final String format = String.format(local, formattedAmount);
currentToolTip.add(TextFormatting.GRAY + format);
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
}
if (myStack.getCountRequestable() > 0) {
@@ -72,9 +75,9 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
.format(myStack.getCountRequestable());
final String format = String.format(local, formattedAmount);
currentToolTip.add(format);
currentToolTip.add(new StringTextComponent(format));
}
this.renderTooltip(currentToolTip, x, y, this.font);
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
return;
} else if (stack.getCount() > bigNumber) {
@@ -82,14 +85,14 @@ public abstract class AEBaseMEScreen<T extends AEBaseContainer> extends AEBaseSc
final String formattedAmount = NumberFormat.getNumberInstance(Locale.US).format(stack.getCount());
final String format = String.format(local, formattedAmount);
currentToolTip.add(TextFormatting.GRAY + format);
currentToolTip.add(new StringTextComponent(TextFormatting.GRAY + format));
this.renderTooltip(currentToolTip, x, y, this.font);
this.renderToolTip(matrixStack, currentToolTip, x, y, this.font);
return;
}
}
super.renderTooltip(stack, x, y);
super.renderTooltip(matrixStack, stack, x, y);
}
}
@@ -28,6 +28,7 @@ import java.util.concurrent.TimeUnit;
import com.google.common.base.Preconditions;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import org.lwjgl.glfw.GLFW;
@@ -54,6 +55,7 @@ import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraft.util.text.TextFormatting;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -126,51 +128,52 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
}
@Override
public void render(final int mouseX, final int mouseY, final float partialTicks) {
super.renderBackground();
super.render(mouseX, mouseY, partialTicks);
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float partialTicks) {
super.renderBackground(matrixStack);
super.render(matrixStack, mouseX, mouseY, partialTicks);
RenderSystem.pushMatrix();
RenderSystem.translatef(this.guiLeft, this.guiTop, 0.0F);
RenderSystem.enableDepthTest();
for (final CustomSlotWidget c : this.guiSlots) {
this.drawGuiSlot(c, mouseX, mouseY, partialTicks);
this.drawGuiSlot(matrixStack, c, mouseX, mouseY, partialTicks);
}
RenderSystem.disableDepthTest();
for (final CustomSlotWidget c : this.guiSlots) {
this.drawTooltip(c, mouseX - this.guiLeft, mouseY - this.guiTop);
this.drawTooltip(matrixStack, c, mouseX - this.guiLeft, mouseY - this.guiTop);
}
RenderSystem.popMatrix();
RenderSystem.enableDepthTest();
this.renderHoveredToolTip(mouseX, mouseY);
this.renderHoveredToolTip(matrixStack, mouseX, mouseY);
for (final Object c : this.buttons) {
if (c instanceof ITooltip) {
this.drawTooltip((ITooltip) c, mouseX, mouseY);
this.drawTooltip(matrixStack, (ITooltip) c, mouseX, mouseY);
}
}
}
protected void drawGuiSlot(CustomSlotWidget slot, int mouseX, int mouseY, float partialTicks) {
protected void drawGuiSlot(MatrixStack matrixStack, CustomSlotWidget slot, int mouseX, int mouseY,
float partialTicks) {
if (slot.isSlotEnabled()) {
final int left = slot.xPos();
final int top = slot.yPos();
final int right = left + slot.getWidth();
final int bottom = top + slot.getHeight();
slot.drawContent(getMinecraft(), mouseX, mouseY, partialTicks);
slot.drawContent(matrixStack, getMinecraft(), mouseX, mouseY, partialTicks);
if (this.isPointInRegion(left, top, slot.getWidth(), slot.getHeight(), mouseX, mouseY)
&& slot.canClick(getPlayer())) {
RenderSystem.colorMask(true, true, true, false);
this.fillGradient(left, top, right, bottom, -2130706433, -2130706433);
this.fillGradient(matrixStack, left, top, right, bottom, -2130706433, -2130706433);
RenderSystem.colorMask(true, true, true, true);
}
}
}
private void drawTooltip(ITooltip tooltip, int mouseX, int mouseY) {
private void drawTooltip(MatrixStack matrixStack, ITooltip tooltip, int mouseX, int mouseY) {
final int x = tooltip.xPos(); // ((GuiImgButton) c).x;
int y = tooltip.yPos(); // ((GuiImgButton) c).y;
@@ -180,20 +183,18 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
y = 15;
}
final String msg = tooltip.getMessage();
if (msg != null && !msg.isEmpty()) {
this.drawTooltip(x + 11, y + 4, msg);
}
final ITextComponent msg = tooltip.getMessage();
this.drawTooltip(matrixStack, x + 11, y + 4, msg);
}
}
}
protected void drawTooltip(int x, int y, String message) {
protected void drawTooltip(MatrixStack matrixStack, int x, int y, ITextComponent message) {
String[] lines = message.split("\n");
this.drawTooltip(x, y, Arrays.asList(lines));
this.drawTooltip(matrixStack, x, y, Arrays.asList(lines));
}
protected void drawTooltip(int x, int y, List<String> lines) {
protected void drawTooltip(MatrixStack matrixStack, int x, int y, List<String> lines) {
if (lines.isEmpty()) {
return;
}
@@ -210,11 +211,11 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
lines.set(i, TextFormatting.GRAY + lines.get(i));
}
this.renderTooltip(lines, x, y, this.font);
this.renderTooltip(matrixStack, lines, x, y, this.font);
}
@Override
protected final void drawGuiContainerForegroundLayer(final int x, final int y) {
protected final void drawGuiContainerForegroundLayer(MatrixStack matrixStack, final int x, final int y) {
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
@@ -223,17 +224,18 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
this.getScrollBar().draw(this);
}
this.drawFG(ox, oy, x, y);
this.drawFG(matrixStack, ox, oy, x, y);
}
public abstract void drawFG(int offsetX, int offsetY, int mouseX, int mouseY);
public abstract void drawFG(MatrixStack matrixStack, int offsetX, int offsetY, int mouseX, int mouseY);
@Override
protected final void drawGuiContainerBackgroundLayer(final float f, final int x, final int y) {
protected final void drawGuiContainerBackgroundLayer(MatrixStack matrixStack, final float f, final int x,
final int y) {
final int ox = this.guiLeft; // (width - xSize) / 2;
final int oy = this.guiTop; // (height - ySize) / 2;
RenderSystem.color4f(1.0F, 1.0F, 1.0F, 1.0F);
this.drawBG(ox, oy, x, y, f);
this.drawBG(matrixStack, ox, oy, x, y, f);
final List<Slot> slots = this.getInventorySlots();
for (final Slot slot : slots) {
@@ -556,7 +558,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
return null;
}
public abstract void drawBG(int offsetX, int offsetY, int mouseX, int mouseY, float partialTicks);
public abstract void drawBG(MatrixStack matrixStack, int offsetX, int offsetY, int mouseX, int mouseY,
float partialTicks);
@Override
public boolean mouseScrolled(double x, double y, double wheelDelta) {
@@ -607,8 +610,8 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
this.itemRenderer.zLevel = 0.0F;
}
protected String getGuiDisplayName(final String in) {
return this.hasCustomInventoryName() ? this.getInventoryName() : in;
protected ITextComponent getGuiDisplayName(final ITextComponent in) {
return this.hasCustomInventoryName() ? new StringTextComponent(this.getInventoryName()) : in;
}
private boolean hasCustomInventoryName() {
@@ -624,12 +627,12 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
* hackery...
*/
@Override
public void drawSlot(Slot s) {
public void drawSlot(MatrixStack matrixStack, Slot s) {
if (s instanceof SlotME) {
try {
if (!this.isPowered()) {
fill(s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
// Annoying but easier than trying to splice into render item
@@ -662,12 +665,13 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
float blue = (fluidAttributes.getColor() & 255) / 255.0F;
RenderSystem.color3f(red, green, blue);
blit(s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16, sprite);
blit(matrixStack, s.xPos, s.yPos, 0 /* FIXME: Validate this was previous the controls zindex */, 16, 16,
sprite);
RenderSystem.enableBlend();
this.fluidStackSizeRenderer.renderStackSize(this.font, fs, s.xPos, s.yPos);
} else if (!this.isPowered()) {
fill(s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66111111);
}
return;
@@ -739,7 +743,7 @@ public abstract class AEBaseScreen<T extends AEBaseContainer> extends ContainerS
setBlitOffset(100);
this.itemRenderer.zLevel = 100.0F;
fill(s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
fill(matrixStack, s.xPos, s.yPos, 16 + s.xPos, 16 + s.yPos, 0x66ff6666);
setBlitOffset(0);
this.itemRenderer.zLevel = 0.0F;
@@ -796,4 +800,10 @@ 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
}
}
@@ -7,6 +7,7 @@ import javax.annotation.Nullable;
import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.inventory.container.ContainerType;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import appeng.api.definitions.IDefinitions;
import appeng.api.definitions.IParts;
@@ -92,10 +93,11 @@ final class AESubScreen {
return addBackButton(buttonAdder, x, y, null);
}
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y, @Nullable String label) {
public final TabButton addBackButton(Consumer<TabButton> buttonAdder, int x, int y,
@Nullable ITextComponent label) {
if (this.previousContainerType != null && !previousContainerIcon.isEmpty()) {
if (label == null) {
label = previousContainerIcon.getDisplayName().getString();
label = previousContainerIcon.getDisplayName();
}
ItemRenderer itemRenderer = gui.getMinecraft().getItemRenderer();
TabButton button = new TabButton(gui.getGuiLeft() + x, gui.getGuiTop() + y, previousContainerIcon, label,
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
@@ -60,7 +62,7 @@ public class CellWorkbenchScreen extends UpgradeableScreen<CellWorkbenchContaine
}
@Override
public void drawBG(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.handleButtonVisibility();
this.bindTexture(this.getBackground());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -41,7 +43,7 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriority()));
}
@@ -50,13 +52,13 @@ public class ChestScreen extends AEBaseScreen<ChestContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Chest.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Chest.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(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.bindTexture("guis/chest.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -49,21 +51,21 @@ public class CondenserScreen extends AEBaseScreen<CondenserContainer> {
this.container.getOutput());
this.addButton(new ProgressBar(this.container, "guis/condenser.png", 120 + this.guiLeft, 25 + this.guiTop, 178,
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.getLocal()));
25, 6, 18, Direction.VERTICAL, GuiText.StoredEnergy.textComponent()));
this.addButton(this.mode);
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Condenser.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Condenser.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.mode.set(this.container.getOutput());
this.mode.setFillVar(String.valueOf(this.container.getOutput().requiredPower));
}
@Override
public void drawBG(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.bindTexture("guis/condenser.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -54,7 +56,7 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
this.amountToCraft.addButtons(children::add, this::addButton);
this.next = this.addButton(
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.getLocal(), this::confirm));
new Button(this.guiLeft + 128, this.guiTop + 51, 38, 20, GuiText.Next.textComponent(), this::confirm));
subGui.addBackButton(this::addButton, 154, 0);
}
@@ -65,20 +67,20 @@ public class CraftAmountScreen extends AEBaseScreen<CraftAmountContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.SelectAmount.getLocal(), 8, 6, 4210752);
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);
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
this.next.setMessage(hasShiftDown() ? GuiText.Start.getLocal() : GuiText.Next.getLocal());
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.bindTexture("guis/craft_amt.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
this.next.active = this.amountToCraft.getValue() > 0;
this.amountToCraft.render(offsetX, offsetY, partialTicks);
this.amountToCraft.render(matrixStack, offsetX, offsetY, partialTicks);
}
@Override
@@ -24,6 +24,7 @@ import java.util.Iterator;
import java.util.List;
import com.google.common.base.Joiner;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.widget.button.Button;
@@ -31,6 +32,7 @@ import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.storage.channels.IItemStorageChannel;
@@ -82,22 +84,23 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
public void init() {
super.init();
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20, GuiText.Start.getLocal(),
btn -> start());
this.start = new Button(this.guiLeft + 162, this.guiTop + this.ySize - 25, 50, 20,
GuiText.Start.textComponent(), btn -> start());
this.start.active = false;
this.addButton(this.start);
this.selectCPU = new Button(this.guiLeft + (219 - 180) / 2, this.guiTop + this.ySize - 68, 180, 20,
GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic, btn -> selectNextCpu());
new StringTextComponent(GuiText.CraftingCPU.getLocal() + ": " + GuiText.Automatic),
btn -> selectNextCpu());
this.selectCPU.active = false;
this.addButton(this.selectCPU);
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.getLocal(),
addButton(new Button(this.guiLeft + 6, this.guiTop + this.ySize - 25, 50, 20, GuiText.Cancel.textComponent(),
btn -> subGui.goBack()));
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
this.updateCPUButtonText();
this.start.active = !(this.container.hasNoCPU() || this.isSimulation());
@@ -130,7 +133,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
}
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
private void updateCPUButtonText() {
@@ -149,7 +152,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
btnTextText = GuiText.NoCraftingCPUs.getLocal();
}
this.selectCPU.setMessage(btnTextText);
this.selectCPU.setMessage(new StringTextComponent(btnTextText));
}
private boolean isSimulation() {
@@ -157,12 +160,13 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
@Override
public void drawFG(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) {
final long BytesUsed = this.container.getUsedBytes();
final String byteUsed = NumberFormat.getInstance().format(BytesUsed);
final String Add = BytesUsed > 0 ? (byteUsed + ' ' + GuiText.BytesUsed.getLocal())
: GuiText.CalculatingWait.getLocal();
this.font.drawString(GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752);
this.font.drawString(matrixStack, GuiText.CraftingPlan.getLocal() + " - " + Add, 8, 7, 4210752);
String dsp = null;
@@ -176,7 +180,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
final int offset = (219 - this.font.getStringWidth(dsp)) / 2;
this.font.drawString(dsp, offset, 165, 4210752);
this.font.drawString(matrixStack, dsp, offset, 165, 4210752);
final int sectionLength = 67;
@@ -230,7 +234,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = GuiText.FromStorage.getLocal() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * offY + yo + 6 - negY + downY) * 2, 4210752);
@@ -251,9 +255,9 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = Long.toString(missingStack.getStackSize() / 1000000) + 'm';
}
str = GuiText.Missing.getLocal() + ": " + str;
str = GuiText.Missing.textComponent().getString() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * offY + yo + 6 - negY + downY) * 2, 4210752);
@@ -276,7 +280,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
str = GuiText.ToCraft.getLocal() + ": " + str;
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + sectionLength) + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * offY + yo + 6 - negY + downY) * 2, 4210752);
@@ -292,7 +296,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
final ItemStack is = refStack.asItemStackRepresentation();
if (this.tooltip == z - viewStart) {
dspToolTip = Platform.getItemDisplayName(refStack).getFormattedText();
dspToolTip = Platform.getItemDisplayName(refStack).getString();
if (lineList.size() > 0) {
dspToolTip = dspToolTip + '\n' + Joiner.on("\n").join(lineList);
@@ -307,7 +311,7 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
if (red) {
final int startX = x * (1 + sectionLength) + xo;
final int startY = posY - 4;
fill(startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000);
fill(matrixStack, startX, startY, startX + sectionLength, startY + offY, 0x1AFF0000);
}
x++;
@@ -320,12 +324,13 @@ public class CraftConfirmScreen extends AEBaseScreen<CraftConfirmContainer> {
}
if (this.tooltip >= 0 && !dspToolTip.isEmpty()) {
this.drawTooltip(toolPosX, toolPosY + 10, dspToolTip);
this.drawTooltip(matrixStack, toolPosX, toolPosY + 10, new StringTextComponent(dspToolTip));
}
}
@Override
public void drawBG(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.setScrollBar();
this.bindTexture("guis/craftingreport.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -24,6 +24,7 @@ import java.util.List;
import java.util.concurrent.TimeUnit;
import com.google.common.base.Joiner;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import org.apache.commons.lang3.time.DurationFormatUtils;
@@ -32,6 +33,7 @@ import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.config.SortDir;
@@ -115,7 +117,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
super.init();
this.setScrollBar();
this.cancel = new Button(this.guiLeft + CANCEL_LEFT_OFFSET, this.guiTop + this.ySize - CANCEL_TOP_OFFSET,
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.getLocal(), btn -> cancel());
CANCEL_WIDTH, CANCEL_HEIGHT, GuiText.Cancel.textComponent(), btn -> cancel());
this.addButton(this.cancel);
}
@@ -127,7 +129,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
this.cancel.active = !this.visual.isEmpty();
final int gx = (this.width - this.xSize) / 2;
@@ -157,12 +159,13 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
}
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
String title = this.getGuiDisplayName(GuiText.CraftingStatus.getLocal());
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
String title = this.getGuiDisplayName(GuiText.CraftingStatus.textComponent()).getString();
if (this.container.getEstimatedTime() > 0 && !this.visual.isEmpty()) {
final long etaInMilliseconds = TimeUnit.MILLISECONDS.convert(this.container.getEstimatedTime(),
@@ -172,7 +175,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
title += " - " + etaTimeText;
}
this.font.drawString(title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR);
this.font.drawString(matrixStack, title, TITLE_LEFT_OFFSET, TITLE_TOP_OFFSET, TEXT_COLOR);
int x = 0;
int y = 0;
@@ -218,7 +221,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
| BACKGROUND_ALPHA;
final int startX = (x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET) * 2;
final int startY = ((y * offY + ITEMSTACK_TOP_OFFSET) - 3) * 2;
fill(startX, startY, startX + (SECTION_LENGTH * 2), startY + (offY * 2) - 2, bgColor);
fill(matrixStack, startX, startY, startX + (SECTION_LENGTH * 2), startY + (offY * 2) - 2, bgColor);
}
final int negY = ((lines - 1) * 5) / 2;
@@ -228,7 +231,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
final String str = GuiText.Stored.getLocal() + ": "
+ converter.toWideReadableForm(stored.getStackSize());
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - (w * 0.5))
* 2),
(y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY) * 2, TEXT_COLOR);
@@ -245,7 +248,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
+ converter.toWideReadableForm(activeStack.getStackSize());
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - (w * 0.5))
* 2),
(y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY) * 2, TEXT_COLOR);
@@ -262,7 +265,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
+ converter.toWideReadableForm(pendingStack.getStackSize());
final int w = 4 + this.font.getStringWidth(str);
this.font.drawString(str,
this.font.drawString(matrixStack, str,
(int) ((x * (1 + SECTION_LENGTH) + ITEMSTACK_LEFT_OFFSET + SECTION_LENGTH - 19 - (w * 0.5))
* 2),
(y * offY + ITEMSTACK_TOP_OFFSET + 6 - negY + downY) * 2, TEXT_COLOR);
@@ -279,7 +282,7 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
final ItemStack is = refStack.asItemStackRepresentation();
if (this.tooltip == z - viewStart) {
dspToolTip = Platform.getItemDisplayName(refStack).getFormattedText();
dspToolTip = Platform.getItemDisplayName(refStack).getString();
if (lineList.size() > 0) {
dspToolTip = dspToolTip + '\n' + Joiner.on("\n").join(lineList);
@@ -301,12 +304,13 @@ public class CraftingCPUScreen<T extends CraftingCPUContainer> extends AEBaseScr
}
if (this.tooltip >= 0 && !dspToolTip.isEmpty()) {
this.drawTooltip(toolPosX, toolPosY + 10, dspToolTip);
this.drawTooltip(matrixStack, toolPosX, toolPosY + 10, new StringTextComponent(dspToolTip));
}
}
@Override
public void drawBG(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.bindTexture("guis/craftingcpu.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -22,9 +22,12 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import appeng.container.implementations.CraftingStatusContainer;
import appeng.core.localization.GuiText;
@@ -48,7 +51,8 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
super.init();
this.selectCPU = new Button(this.guiLeft + 8, this.guiTop + this.ySize - 25, 150, 20,
GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs, btn -> selectNextCpu());
new StringTextComponent(GuiText.CraftingCPU.getLocal() + ": " + GuiText.NoCraftingCPUs),
btn -> selectNextCpu());
this.addButton(this.selectCPU);
subGui.addBackButton(btn -> {
@@ -58,9 +62,9 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
this.updateCPUButtonText();
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
private void updateCPUButtonText() {
@@ -80,11 +84,11 @@ public class CraftingStatusScreen extends CraftingCPUScreen<CraftingStatusContai
btnTextText = GuiText.NoCraftingJobs.getLocal();
}
this.selectCPU.setMessage(btnTextText);
this.selectCPU.setMessage(new StringTextComponent(btnTextText));
}
@Override
protected String getGuiDisplayName(final String in) {
protected ITextComponent getGuiDisplayName(final ITextComponent in) {
return in; // the cup name is on the button
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.util.text.ITextComponent;
@@ -61,10 +63,11 @@ public class CraftingTermScreen extends MEMonitorableScreen<CraftingTermContaine
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.CraftingTerminal.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(),
4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
this.font.drawString(matrixStack, GuiText.CraftingTerminal.getLocal(), 8,
this.ySize - 96 + 1 - this.getReservedSpace(), 4210752);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -41,7 +43,7 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
public void init() {
super.init();
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
}
@@ -50,13 +52,17 @@ public class DriveScreen extends AEBaseScreen<DriveContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Drive.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Drive.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3,
4210752);
}
@Override
public void drawBG(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.bindTexture("guis/drive.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -50,7 +52,7 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 48, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.placeMode);
@@ -58,9 +60,9 @@ public class FormationPlaneScreen extends UpgradeableScreen<FormationPlaneContai
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.FormationPlane.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
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, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
this.fuzzyMode.set(this.cvb.getFuzzyMode());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -34,13 +36,13 @@ public class GrinderScreen extends AEBaseScreen<GrinderContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.GrindStone.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.GrindStone.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(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.bindTexture("guis/grinder.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -57,9 +59,11 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.IOPort.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.IOPort.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.redstoneMode != null) {
this.redstoneMode.set(this.cvb.getRedStoneMode());
@@ -75,8 +79,9 @@ public class IOPortScreen extends UpgradeableScreen<IOPortContainer> {
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
super.drawBG(offsetX, offsetY, mouseX, mouseY, partialTicks);
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
super.drawBG(matrixStack, offsetX, offsetY, mouseX, mouseY, partialTicks);
final IDefinitions definitions = Api.instance().definitions();
@@ -18,8 +18,11 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.gui.AEBaseScreen;
@@ -51,15 +54,18 @@ public class InscriberScreen extends AEBaseScreen<InscriberContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.pb.setFullMsg(this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%");
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.pb.setFullMsg(new StringTextComponent(
this.container.getCurrentProgress() * 100 / this.container.getMaxProgress() + "%"));
this.font.drawString(this.getGuiDisplayName(GuiText.Inscriber.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Inscriber.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(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.bindTexture("guis/inscriber.png");
this.pb.x = 135 + this.guiLeft;
this.pb.y = 39 + this.guiTop;
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -46,7 +48,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
@Override
protected void addButtons() {
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
this.blockMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 8, Settings.BLOCK, YesNo.NO);
@@ -59,7 +61,7 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
}
@Override
public void drawFG(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) {
if (this.blockMode != null) {
this.blockMode.set(((InterfaceContainer) this.cvb).getBlockingMode());
}
@@ -68,13 +70,13 @@ public class InterfaceScreen extends UpgradeableScreen<InterfaceContainer> {
this.interfaceMode.setState(((InterfaceContainer) this.cvb).getInterfaceTerminalMode() == YesNo.YES);
}
this.font.drawString(this.getGuiDisplayName(GuiText.Interface.getLocal()), 8, 6, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.Interface.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(GuiText.Config.getLocal(), 8, 6 + 11 + 7, 4210752);
this.font.drawString(GuiText.StoredItems.getLocal(), 8, 6 + 60 + 7, 4210752);
this.font.drawString(GuiText.Patterns.getLocal(), 8, 6 + 73 + 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.Patterns.getLocal(), 8, 6 + 73 + 7, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
@@ -28,6 +28,7 @@ import java.util.Set;
import java.util.WeakHashMap;
import com.google.common.collect.HashMultimap;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import org.lwjgl.glfw.GLFW;
@@ -93,9 +94,9 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.InterfaceTerminal.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.InterfaceTerminal.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
final int ex = this.getScrollBar().getCurrentScroll();
@@ -120,7 +121,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
name = name.substring(0, name.length() - 1);
}
this.font.drawString(name, 10, 6 + offset, 4210752);
this.font.drawString(matrixStack, name, 10, 6 + offset, 4210752);
}
offset += 18;
}
@@ -140,7 +141,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
@Override
public void drawBG(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.bindTexture("guis/interfaceterminal.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
@@ -160,7 +161,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
}
if (this.searchField != null) {
this.searchField.render(mouseX, mouseY, partialTicks);
this.searchField.render(matrixStack, mouseX, mouseY, partialTicks);
}
}
@@ -217,7 +218,7 @@ public class InterfaceTerminalScreen extends AEBaseScreen<InterfaceTerminalConta
try {
final long id = Long.parseLong(key.substring(1), Character.MAX_RADIX);
final CompoundNBT invData = in.getCompound(key);
ITextComponent un = ITextComponent.Serializer.fromJson(invData.getString("un"));
ITextComponent un = ITextComponent.Serializer.func_240643_a_(invData.getString("un"));
final ClientDCInternalInv current = this.getById(id, invData.getLong("sortBy"), un);
for (int x = 0; x < current.getInventory().getSlots(); x++) {
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -77,7 +79,8 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
}
@Override
public void drawFG(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) {
final boolean notCraftingMode = this.bc.getInstalledUpgrades(Upgrades.CRAFTING) == 0;
// configure enabled status...
@@ -85,7 +88,7 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
this.levelMode.active = notCraftingMode;
this.redstoneMode.active = notCraftingMode;
super.drawFG(offsetX, offsetY, mouseX, mouseY);
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
if (this.craftingMode != null) {
this.craftingMode.set(this.cvb.getCraftingMode());
@@ -97,16 +100,18 @@ public class LevelEmitterScreen extends UpgradeableScreen<LevelEmitterContainer>
if (notCraftingMode) {
if (currentLevelMode == LevelType.ENERGY_LEVEL) {
this.font.drawString(PowerUnits.AE.textComponent().getString(), 110, 44, COLOR_DARK_GRAY);
this.font.drawString(matrixStack, PowerUnits.AE.textComponent().getString(), 110, 44,
COLOR_DARK_GRAY);
}
}
}
}
@Override
public void drawBG(final int offsetX, final int offsetY, final int mouseX, final int mouseY, float partialTicks) {
super.drawBG(offsetX, offsetY, mouseX, mouseY, partialTicks);
this.level.render(mouseX, mouseY, partialTicks);
public void drawBG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY, float partialTicks) {
super.drawBG(matrixStack, offsetX, offsetY, mouseX, mouseY, partialTicks);
this.level.render(matrixStack, mouseX, mouseY, partialTicks);
}
@Override
@@ -20,6 +20,8 @@ package appeng.client.gui.implementations;
import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.util.InputMappings;
@@ -234,7 +236,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
if (this.viewCell || this instanceof WirelessTermScreen) {
this.craftingStatusBtn = this.addButton(new TabButton(this.guiLeft + 170, this.guiTop - 4, 2 + 11 * 16,
GuiText.CraftingStatus.getLocal(), this.itemRenderer, btn -> showCraftingStatus()));
GuiText.CraftingStatus.textComponent(), this.itemRenderer, btn -> showCraftingStatus()));
this.craftingStatusBtn.setHideEdge(13);
}
@@ -284,9 +286,9 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(this.myName.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(this.myName.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.textComponent().getString(), 8, this.ySize - 96 + 3, 4210752);
this.currentMouseX = mouseX;
this.currentMouseY = mouseY;
@@ -318,21 +320,21 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
@Override
public void drawBG(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.bindTexture(this.getBackground());
final int x_width = 197;
blit(offsetX, offsetY, 0, 0, x_width, 18);
blit(matrixStack, offsetX, offsetY, 0, 0, x_width, 18);
if (this.viewCell || (this instanceof SecurityStationScreen)) {
blit(offsetX + x_width, offsetY, x_width, 0, 46, 128);
blit(matrixStack, offsetX + x_width, offsetY, x_width, 0, 46, 128);
}
for (int x = 0; x < this.rows; x++) {
blit(offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18);
blit(matrixStack, offsetX, offsetY + 18 + x * 18, 0, 18, x_width, 18);
}
blit(offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
blit(matrixStack, offsetX, offsetY + 16 + this.rows * 18 + this.lowerTextureOffset, 0, 106 - 18 - 18, x_width,
99 + this.reservedSpace - this.lowerTextureOffset);
if (this.viewCell) {
@@ -351,7 +353,7 @@ public class MEMonitorableScreen<T extends MEMonitorableContainer> extends AEBas
}
if (this.searchField != null) {
this.searchField.render(mouseX, mouseY, partialTicks);
this.searchField.render(matrixStack, mouseX, mouseY, partialTicks);
}
}
@@ -18,8 +18,11 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import appeng.api.config.RedstoneMode;
import appeng.api.config.Settings;
@@ -56,16 +59,18 @@ public class MolecularAssemblerScreen extends UpgradeableScreen<MolecularAssembl
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.pb.setFullMsg(this.container.getCurrentProgress() + "%");
super.drawFG(offsetX, offsetY, mouseX, mouseY);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.pb.setFullMsg(new StringTextComponent(this.container.getCurrentProgress() + "%"));
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
}
@Override
public void drawBG(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.pb.x = 148 + this.guiLeft;
this.pb.y = 48 + this.guiTop;
super.drawBG(offsetX, offsetY, mouseX, mouseY, partialTicks);
super.drawBG(matrixStack, offsetX, offsetY, mouseX, mouseY, partialTicks);
}
@Override
@@ -20,12 +20,14 @@ package appeng.client.gui.implementations;
import java.util.List;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.inventory.container.Slot;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.api.config.SortDir;
@@ -68,7 +70,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
@Override
public void render(final int mouseX, final int mouseY, final float btn) {
public void render(MatrixStack matrixStack, final int mouseX, final int mouseY, final float btn) {
final int gx = (this.width - this.xSize) / 2;
final int gy = (this.height - this.ySize) / 2;
@@ -96,23 +98,24 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
}
super.render(mouseX, mouseY, btn);
super.render(matrixStack, mouseX, mouseY, btn);
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.NetworkDetails.getLocal(), 8, 6, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, GuiText.NetworkDetails.getLocal(), 8, 6, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.StoredPower.getLocal() + ": " + Platform.formatPowerLong(container.getCurrentPower(), false),
13, 16, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong(container.getMaxPower(), false), 13, 26,
4210752);
this.font.drawString(GuiText.PowerInputRate.getLocal() + ": "
this.font.drawString(matrixStack, GuiText.PowerInputRate.getLocal() + ": "
+ Platform.formatPowerLong(container.getAverageAddition(), true), 13, 143 - 10, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.PowerUsageRate.getLocal() + ": " + Platform.formatPowerLong(container.getPowerUsage(), true),
13, 143 - 20, 4210752);
@@ -141,7 +144,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
final int w = this.font.getStringWidth(str);
this.font.drawString(str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2),
this.font.drawString(matrixStack, str, (int) ((x * sectionLength + xo + sectionLength - 19 - (w * 0.5)) * 2),
(y * 18 + yo + 6) * 2, 4210752);
RenderSystem.popMatrix();
@@ -149,7 +152,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
final int posY = y * 18 + yo;
if (this.tooltip == z - viewStart) {
toolTip = Platform.getItemDisplayName(refStack).getFormattedText();
toolTip = Platform.getItemDisplayName(refStack).getString();
toolTip += ('\n' + GuiText.Installed.getLocal() + ": " + (refStack.getStackSize()));
if (refStack.getCountRequestable() > 0) {
@@ -173,12 +176,13 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
if (this.tooltip >= 0 && toolTip.length() > 0) {
this.drawTooltip(toolPosX, toolPosY + 10, toolTip);
this.drawTooltip(matrixStack, toolPosX, toolPosY + 10, new StringTextComponent(toolTip));
}
}
@Override
public void drawBG(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.bindTexture("guis/networkstatus.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -201,7 +205,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
@Override
protected void renderTooltip(final ItemStack stack, final int x, final int y) {
protected void renderTooltip(MatrixStack matrixStack, final ItemStack stack, final int x, final int y) {
final Slot s = this.getSlot(x, y);
if (s instanceof SlotME && !stack.isEmpty()) {
@@ -214,7 +218,7 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
}
if (myStack != null) {
List<String> currentToolTip = getTooltipFromItem(stack);
List<ITextComponent> currentToolTip = getTooltipFromItem(stack);
while (currentToolTip.size() > 1) {
currentToolTip.remove(1);
@@ -224,11 +228,11 @@ public class NetworkStatusScreen extends AEBaseScreen<NetworkStatusContainer> im
currentToolTip.add(GuiText.EnergyDrain.getLocal() + ": "
+ Platform.formatPowerLong(myStack.getCountRequestable(), true));
this.drawTooltip(x, y, currentToolTip);
this.drawTooltip(matrixStack, x, y, currentToolTip);
}
}
super.renderTooltip(stack, x, y);
super.renderTooltip(matrixStack, stack, x, y);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -54,17 +56,20 @@ public class NetworkToolScreen extends AEBaseScreen<NetworkToolContainer> {
}
@Override
public void drawFG(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) {
if (this.tFacades != null) {
this.tFacades.setState(container.isFacadeMode());
}
this.font.drawString(this.getGuiDisplayName(GuiText.NetworkTool.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.NetworkTool.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(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.bindTexture("guis/toolbox.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -3,9 +3,13 @@ package appeng.client.gui.implementations;
import java.util.function.Consumer;
import java.util.function.LongConsumer;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.IGuiEventListener;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import appeng.client.gui.AEBaseScreen;
import appeng.client.gui.NumberEntryType;
@@ -19,6 +23,9 @@ import appeng.core.AEConfig;
*/
public class NumberEntryWidget implements ITickingWidget {
private static final ITextComponent PLUS = new StringTextComponent("+");
private static final ITextComponent MINUS = new StringTextComponent("+");
private final AEBaseScreen<?> parent;
private final int x;
@@ -86,18 +93,18 @@ public class NumberEntryWidget implements ITickingWidget {
int left = parent.getGuiLeft() + x;
int top = parent.getGuiTop() + y;
addButton.accept(this.plus1 = new Button(left, top, 22, 20, "+" + a, btn -> addQty(a)));
addButton.accept(this.plus10 = new Button(left + 28, top, 28, 20, "+" + b, btn -> addQty(b)));
addButton.accept(this.plus100 = new Button(left + 62, top, 32, 20, "+" + c, btn -> addQty(c)));
addButton.accept(this.plus1000 = new Button(left + 100, top, 38, 20, "+" + d, btn -> addQty(d)));
addButton.accept(this.plus1 = new Button(left, top, 22, 20, PLUS /* + a */, btn -> addQty(a)));
addButton.accept(this.plus10 = new Button(left + 28, top, 28, 20, PLUS /* + b */, btn -> addQty(b)));
addButton.accept(this.plus100 = new Button(left + 62, top, 32, 20, PLUS /* + c */, btn -> addQty(c)));
addButton.accept(this.plus1000 = new Button(left + 100, top, 38, 20, PLUS/* + d */, btn -> addQty(d)));
// Placing this here will give a sensible tab order
addChildren.accept(this.level);
addButton.accept(this.minus1 = new Button(left, top + 42, 22, 20, "-" + a, btn -> addQty(-a)));
addButton.accept(this.minus10 = new Button(left + 28, top + 42, 28, 20, "-" + b, btn -> addQty(-b)));
addButton.accept(this.minus100 = new Button(left + 62, top + 42, 32, 20, "-" + c, btn -> addQty(-c)));
addButton.accept(this.minus1000 = new Button(left + 100, top + 42, 38, 20, "-" + d, btn -> addQty(-d)));
addButton.accept(this.minus1 = new Button(left, top + 42, 22, 20, MINUS /* + a */, btn -> addQty(-a)));
addButton.accept(this.minus10 = new Button(left + 28, top + 42, 28, 20, MINUS /* + b */, btn -> addQty(-b)));
addButton.accept(this.minus100 = new Button(left + 62, top + 42, 32, 20, MINUS /* + c */, btn -> addQty(-c)));
addButton.accept(this.minus1000 = new Button(left + 100, top + 42, 38, 20, MINUS /* + d */, btn -> addQty(-d)));
}
private void addQty(final long i) {
@@ -106,8 +113,8 @@ public class NumberEntryWidget implements ITickingWidget {
this.level.setText(String.valueOf(Math.max(minValue, currentValue + i)));
}
public void render(int mouseX, int mouseY, float partialTicks) {
this.level.render(mouseX, mouseY, partialTicks);
public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) {
this.level.render(matrixStack, mouseX, mouseY, partialTicks);
}
public void setValue(long value, boolean skipNotify) {
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.block.Blocks;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.item.ItemStack;
@@ -58,12 +60,12 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
super.init();
this.tabCraftButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.getLocal(), this.itemRenderer,
new ItemStack(Blocks.CRAFTING_TABLE), GuiText.CraftingPattern.textComponent(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_PROCESSING));
this.addButton(this.tabCraftButton);
this.tabProcessButton = new TabButton(this.guiLeft + 173, this.guiTop + this.ySize - 177,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.getLocal(), this.itemRenderer,
new ItemStack(Blocks.FURNACE), GuiText.ProcessingPattern.textComponent(), this.itemRenderer,
btn -> toggleCraftMode(CRAFTMODE_CRFTING));
this.addButton(this.tabProcessButton);
@@ -104,7 +106,8 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
}
@Override
public void drawFG(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) {
if (this.container.isCraftingMode()) {
this.tabCraftButton.visible = true;
this.tabProcessButton.visible = false;
@@ -123,9 +126,9 @@ public class PatternTermScreen extends MEMonitorableScreen<PatternTermContainer>
this.substitutionsDisabledBtn.visible = false;
}
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.PatternTerminal.getLocal(), 8, this.ySize - 96 + 2 - this.getReservedSpace(),
4210752);
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
this.font.drawString(matrixStack, GuiText.PatternTerminal.getLocal(), 8,
this.ySize - 96 + 2 - this.getReservedSpace(), 4210752);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -58,16 +60,18 @@ public class PriorityScreen extends AEBaseScreen<PriorityContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.Priority.getLocal(), 8, 6, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, GuiText.Priority.getLocal(), 8, 6, 4210752);
}
@Override
public void drawBG(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.bindTexture(getBackground());
blit(offsetX, offsetY, 0, 0, this.xSize, this.ySize);
blit(matrixStack, offsetX, offsetY, 0, 0, this.xSize, this.ySize);
this.priority.render(mouseX, mouseY, partialTicks);
this.priority.render(matrixStack, mouseX, mouseY, partialTicks);
}
protected String getBackground() {
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -34,13 +36,16 @@ public class QNBScreen extends AEBaseScreen<QNBContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.QuantumLinkChamber.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack,
this.getGuiDisplayName(GuiText.QuantumLinkChamber.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(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.bindTexture("guis/chest.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,12 +18,15 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import org.lwjgl.glfw.GLFW;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.util.InputMappings;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.ActionKey;
@@ -47,7 +50,8 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
public void init() {
super.init();
this.name = new TextFieldWidget(this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT, "");
this.name = new TextFieldWidget(this.font, this.guiLeft + 24, this.guiTop + 32, 79, this.font.FONT_HEIGHT,
new StringTextComponent(""));
this.name.setEnableBackgroundDrawing(false);
this.name.setMaxStringLength(32);
this.name.setTextColor(0xFFFFFF);
@@ -56,16 +60,19 @@ public class QuartzKnifeScreen extends AEBaseScreen<QuartzKnifeContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.QuartzCuttingKnife.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack,
this.getGuiDisplayName(GuiText.QuartzCuttingKnife.textComponent()).getString(), 8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
}
@Override
public void drawBG(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.bindTexture("guis/quartzknife.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
this.name.render(mouseX, mouseY, partialTicks);
this.name.render(matrixStack, mouseX, mouseY, partialTicks);
}
@Override
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -80,9 +82,9 @@ public class SecurityStationScreen extends MEMonitorableScreen<SecurityStationCo
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(offsetX, offsetY, mouseX, mouseY);
this.font.drawString(GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(),
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
super.drawFG(matrixStack, offsetX, offsetY, mouseX, mouseY);
this.font.drawString(matrixStack, GuiText.SecurityCardEditor.getLocal(), 8, this.ySize - 96 + 1 - this.getReservedSpace(),
4210752);
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
@@ -38,13 +40,16 @@ public class SkyChestScreen extends AEBaseScreen<SkyChestContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.SkyChest.getLocal()), 8, 8, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SkyChest.textComponent()).getString(), 8, 8,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 2, 4210752);
}
@Override
public void drawBG(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) {
bindTexture(TEXTURE);
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, 0);
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -43,33 +45,37 @@ public class SpatialIOPortScreen extends AEBaseScreen<SpatialIOPortContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(GuiText.StoredPower.getLocal() + ": "
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, GuiText.StoredPower.getLocal() + ": "
+ Platform.formatPowerLong(this.container.getCurrentPower(), false), 13, 21, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.MaxPower.getLocal() + ": " + Platform.formatPowerLong(this.container.getMaxPower(), false), 13,
31, 4210752);
this.font.drawString(GuiText.RequiredPower.getLocal() + ": "
this.font.drawString(matrixStack, GuiText.RequiredPower.getLocal() + ": "
+ Platform.formatPowerLong(this.container.getRequiredPower(), false), 13, 73, 4210752);
this.font.drawString(
this.font.drawString(matrixStack,
GuiText.Efficiency.getLocal() + ": " + (((float) this.container.getEfficency()) / 100) + '%', 13, 83,
4210752);
this.font.drawString(this.getGuiDisplayName(GuiText.SpatialIOPort.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.SpatialIOPort.textComponent()).getString(), 8,
6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96, 4210752);
if (this.container.xSize != 0 && this.container.ySize != 0 && this.container.zSize != 0) {
final String text = GuiText.SCSSize.getLocal() + ": " + this.container.xSize + "x" + this.container.ySize
+ "x" + this.container.zSize;
this.font.drawString(text, 13, 93, 4210752);
this.font.drawString(matrixStack, text, 13, 93, 4210752);
} else {
this.font.drawString(GuiText.SCSSize.getLocal() + ": " + GuiText.SCSInvalid.getLocal(), 13, 93, 4210752);
this.font.drawString(matrixStack, GuiText.SCSSize.getLocal() + ": " + GuiText.SCSInvalid.getLocal(), 13, 93,
4210752);
}
}
@Override
public void drawBG(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.bindTexture("guis/spatialio.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
@@ -58,7 +60,7 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
this.fuzzyMode = new ServerSettingToggleButton<>(this.guiLeft - 18, this.guiTop + 88, Settings.FUZZY_MODE,
FuzzyMode.IGNORE_ALL);
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.getLocal(),
this.addButton(new TabButton(this.guiLeft + 154, this.guiTop, 2 + 4 * 16, GuiText.Priority.textComponent(),
this.itemRenderer, btn -> openPriorityGui()));
this.addButton(this.storageFilter);
@@ -67,9 +69,11 @@ public class StorageBusScreen extends UpgradeableScreen<StorageBusContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.StorageBus.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.StorageBus.textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.fuzzyMode != null) {
this.fuzzyMode.set(this.cvb.getFuzzyMode());
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -82,9 +84,11 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(this.getName().getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(this.getName().textComponent()).getString(), 8, 6,
4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (this.redstoneMode != null) {
this.redstoneMode.set(this.cvb.getRedStoneMode());
@@ -104,7 +108,8 @@ public class UpgradeableScreen<T extends UpgradeableContainer> extends AEBaseScr
}
@Override
public void drawBG(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.handleButtonVisibility();
this.bindTexture(this.getBackground());
@@ -18,10 +18,12 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.client.gui.AEBaseScreen;
@@ -50,12 +52,14 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.VibrationChamber.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
public void drawFG(MatrixStack matrixStack, final int offsetX, final int offsetY, final int mouseX,
final int mouseY) {
this.font.drawString(matrixStack, this.getGuiDisplayName(GuiText.VibrationChamber.textComponent()).getString(),
8, 6, 4210752);
this.font.drawString(matrixStack, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
this.pb.setFullMsg(VibrationChamberTileEntity.POWER_PER_TICK * this.container.getCurrentProgress()
/ VibrationChamberTileEntity.DILATION_SCALING + " AE/t");
this.pb.setFullMsg(new StringTextComponent(VibrationChamberTileEntity.POWER_PER_TICK
* this.container.getCurrentProgress() / VibrationChamberTileEntity.DILATION_SCALING + " AE/t"));
if (this.container.getRemainingBurnTime() > 0) {
final int i1 = this.container.getRemainingBurnTime() * 12 / 100;
@@ -68,7 +72,8 @@ public class VibrationChamberScreen extends AEBaseScreen<VibrationChamberContain
}
@Override
public void drawBG(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.bindTexture("guis/vibchamber.png");
this.pb.x = 99 + this.guiLeft;
this.pb.y = 36 + this.guiTop;
@@ -18,6 +18,8 @@
package appeng.client.gui.implementations;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.util.text.ITextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
@@ -43,9 +45,9 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
}
@Override
public void drawFG(final int offsetX, final int offsetY, final int mouseX, final int mouseY) {
this.font.drawString(this.getGuiDisplayName(GuiText.Wireless.getLocal()), 8, 6, 4210752);
this.font.drawString(GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
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, GuiText.inventory.getLocal(), 8, this.ySize - 96 + 3, 4210752);
if (container.getRange() > 0) {
final String firstMessage = GuiText.Range.getLocal() + ": " + (container.getRange() / 10.0) + " m";
@@ -55,13 +57,13 @@ public class WirelessScreen extends AEBaseScreen<WirelessContainer> {
final int strWidth = Math.max(this.font.getStringWidth(firstMessage),
this.font.getStringWidth(secondMessage));
final int cOffset = (this.xSize / 2) - (strWidth / 2);
this.font.drawString(firstMessage, cOffset, 20, 4210752);
this.font.drawString(secondMessage, cOffset, 20 + 12, 4210752);
this.font.drawString(matrixStack, firstMessage, cOffset, 20, 4210752);
this.font.drawString(matrixStack, secondMessage, cOffset, 20 + 12, 4210752);
}
}
@Override
public void drawBG(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.bindTexture("guis/wireless.png");
GuiUtils.drawTexturedModalRect(offsetX, offsetY, 0, 0, this.xSize, this.ySize, getBlitOffset());
}
@@ -18,6 +18,7 @@
package appeng.client.gui.widgets;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.platform.GlStateManager;
import com.mojang.blaze3d.systems.RenderSystem;
@@ -26,6 +27,7 @@ import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.text.StringTextComponent;
/**
* A modified version of the Minecraft text field. You can initialize it over
@@ -52,10 +54,11 @@ public class AETextField extends TextFieldWidget {
*/
public AETextField(final FontRenderer fontRenderer, final int xPos, final int yPos, final int width,
final int height) {
super(fontRenderer, xPos + PADDING, yPos + PADDING, width - 2 * PADDING - (int) fontRenderer.getCharWidth('_'),
height - 2 * PADDING, "");
super(fontRenderer, xPos + PADDING, yPos + PADDING,
width - 2 * PADDING - (int) fontRenderer.getStringWidth("_"), height - 2 * PADDING,
new StringTextComponent(""));
this._fontPad = (int) fontRenderer.getCharWidth('_');
this._fontPad = (int) fontRenderer.getStringWidth("_");
}
public void selectAll() {
@@ -68,16 +71,18 @@ public class AETextField extends TextFieldWidget {
}
@Override
public void renderButton(int mouseX, int mouseY, float partial) {
public void renderButton(MatrixStack matrixStack, int mouseX, int mouseY, float partial) {
if (this.getVisible()) {
if (this.isFocused()) {
fill(this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1,
this.y + this.height + PADDING - 1, 0xFF606060);
fill(matrixStack, this.x - PADDING + 1, this.y - PADDING + 1,
this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
0xFF606060);
} else {
fill(this.x - PADDING + 1, this.y - PADDING + 1, this.x + this.width + this._fontPad + PADDING - 1,
this.y + this.height + PADDING - 1, 0xFFA8A8A8);
fill(matrixStack, this.x - PADDING + 1, this.y - PADDING + 1,
this.x + this.width + this._fontPad + PADDING - 1, this.y + this.height + PADDING - 1,
0xFFA8A8A8);
}
super.renderButton(mouseX, mouseY, partial);
super.renderButton(matrixStack, mouseX, mouseY, partial);
}
}
@@ -1,10 +1,13 @@
package appeng.client.gui.widgets;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.AbstractGui;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.text.ITextComponent;
public abstract class CustomSlotWidget extends AbstractGui implements ITooltip {
private final int x;
@@ -28,13 +31,13 @@ public abstract class CustomSlotWidget extends AbstractGui implements ITooltip {
public void slotClicked(final ItemStack clickStack, final int mouseButton) {
}
public abstract void drawContent(final Minecraft mc, final int mouseX, final int mouseY, final float partialTicks);
public abstract void drawContent(MatrixStack matrixStack, final Minecraft mc, final int mouseX, final int mouseY, final float partialTicks);
public void drawBackground(int guileft, int guitop, int currentZIndex) {
}
@Override
public String getMessage() {
public ITextComponent getMessage() {
return null;
}
@@ -18,6 +18,8 @@
package appeng.client.gui.widgets;
import net.minecraft.util.text.ITextComponent;
/**
* AEBaseGui controlled Tooltip Interface.
*/
@@ -28,7 +30,7 @@ public interface ITooltip {
*
* @return tooltip message
*/
String getMessage();
ITextComponent getMessage();
/**
* x Location for the object that triggers the tooltip.
@@ -18,12 +18,14 @@
package appeng.client.gui.widgets;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.renderer.texture.TextureManager;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
public abstract class IconButton extends Button implements ITooltip {
@@ -33,7 +35,7 @@ public abstract class IconButton extends Button implements ITooltip {
private boolean halfSize = false;
public IconButton(final int x, final int y, IPressable onPress) {
super(x, y, 16, 16, "", onPress);
super(x, y, 16, 16, new StringTextComponent(""), onPress);
}
public void setVisibility(final boolean vis) {
@@ -42,7 +44,7 @@ public abstract class IconButton extends Button implements ITooltip {
}
@Override
public void renderButton(final int mouseX, final int mouseY, float partial) {
public void renderButton(MatrixStack matrixStack, final int mouseX, final int mouseY, float partial) {
Minecraft minecraft = Minecraft.getInstance();
@@ -22,6 +22,7 @@ import java.util.function.LongConsumer;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.widget.TextFieldWidget;
import net.minecraft.util.text.StringTextComponent;
public class NumberBox extends TextFieldWidget {
@@ -35,7 +36,7 @@ public class NumberBox extends TextFieldWidget {
public NumberBox(final FontRenderer fontRenderer, final int x, final int y, final int width, final int height,
final Class<?> type, LongConsumer changeListener) {
super(fontRenderer, x, y, width, height, "0");
super(fontRenderer, x, y, width, height, new StringTextComponent("0"));
this.setText("0");
setResponder(this::handleTextChanged);
this.lastValue = 0;
@@ -18,9 +18,13 @@
package appeng.client.gui.widgets;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.Widget;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
import appeng.container.interfaces.IProgressProvider;
@@ -33,8 +37,8 @@ public class ProgressBar extends Widget implements ITooltip {
private final int fill_u;
private final int fill_v;
private final Direction layout;
private final String titleName;
private String fullMsg;
private final ITextComponent titleName;
private ITextComponent fullMsg;
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
final int u, final int y, final int width, final int height, final Direction dir) {
@@ -42,8 +46,9 @@ public class ProgressBar extends Widget implements ITooltip {
}
public ProgressBar(final IProgressProvider source, final String texture, final int posX, final int posY,
final int u, final int y, final int width, final int height, final Direction dir, final String title) {
super(posX, posY, width, height, "");
final int u, final int y, final int width, final int height, final Direction dir,
final ITextComponent title) {
super(posX, posY, width, height, new StringTextComponent(""));
this.source = source;
this.texture = new ResourceLocation("appliedenergistics2", "textures/" + texture);
this.fill_u = u;
@@ -53,7 +58,7 @@ public class ProgressBar extends Widget implements ITooltip {
}
@Override
public void renderButton(final int par2, final int par3, final float partial) {
public void renderButton(MatrixStack matrixStack, final int par2, final int par3, final float partial) {
if (this.visible) {
Minecraft.getInstance().getTextureManager().bindTexture(this.texture);
final int max = this.source.getMaxProgress();
@@ -71,18 +76,20 @@ public class ProgressBar extends Widget implements ITooltip {
}
}
public void setFullMsg(final String msg) {
public void setFullMsg(final ITextComponent msg) {
this.fullMsg = msg;
}
@Override
public String getMessage() {
public ITextComponent getMessage() {
if (this.fullMsg != null) {
return this.fullMsg;
}
ITextComponent result = this.titleName != null ? this.titleName : new StringTextComponent("");
return (this.titleName != null ? this.titleName : "") + '\n' + this.source.getCurrentProgress() + ' '
+ GuiText.Of.getLocal() + ' ' + this.source.getMaxProgress();
return result.deepCopy().func_240702_b_("\n").func_240702_b_(this.source.getCurrentProgress() + " ")
.func_230529_a_(
GuiText.Of.textComponent().deepCopy().func_240702_b_(" " + this.source.getMaxProgress()));
}
@Override
@@ -18,6 +18,7 @@
package appeng.client.gui.widgets;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
@@ -26,6 +27,7 @@ import net.minecraft.client.renderer.ItemRenderer;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
public class TabButton extends Button implements ITooltip {
public static final ResourceLocation TEXTURE_STATES = new ResourceLocation("appliedenergistics2",
@@ -35,7 +37,7 @@ public class TabButton extends Button implements ITooltip {
private int myIcon = -1;
private ItemStack myItem;
public TabButton(final int x, final int y, final int ico, final String message, final ItemRenderer ir,
public TabButton(final int x, final int y, final int ico, final ITextComponent message, final ItemRenderer ir,
IPressable onPress) {
super(x, y, 22, 22, message, onPress);
@@ -52,7 +54,7 @@ public class TabButton extends Button implements ITooltip {
* @param message mouse over message
* @param ir renderer
*/
public TabButton(final int x, final int y, final ItemStack ico, final String message, final ItemRenderer ir,
public TabButton(final int x, final int y, final ItemStack ico, final ITextComponent message, final ItemRenderer ir,
IPressable onPress) {
super(x, y, 22, 22, message, onPress);
this.myItem = ico;
@@ -60,7 +62,7 @@ public class TabButton extends Button implements ITooltip {
}
@Override
public void renderButton(final int x, final int y, float partial) {
public void renderButton(MatrixStack matrixStack, final int x, final int y, float partial) {
final Minecraft minecraft = Minecraft.getInstance();
if (this.visible) {
@@ -73,13 +75,13 @@ public class TabButton extends Button implements ITooltip {
final int offsetX = this.hideEdge > 0 ? 1 : 0;
blit(this.x, this.y, uv_x * 16, 0, 25, 22);
blit(matrixStack, this.x, this.y, uv_x * 16, 0, 25, 22);
if (this.myIcon >= 0) {
final int uv_y = this.myIcon / 16;
uv_x = this.myIcon - uv_y * 16;
blit(offsetX + this.x + 3, this.y + 3, uv_x * 16, uv_y * 16, 16, 16);
blit(matrixStack, offsetX + this.x + 3, this.y + 3, uv_x * 16, uv_y * 16, 16, 16);
}
RenderSystem.disableAlphaTest();
@@ -20,12 +20,15 @@ package appeng.client.gui.widgets;
import java.util.regex.Pattern;
import com.mojang.blaze3d.matrix.MatrixStack;
import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.widget.button.Button;
import net.minecraft.client.resources.I18n;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.ITextComponent;
import net.minecraft.util.text.StringTextComponent;
import net.minecraftforge.fml.client.gui.GuiUtils;
public class ToggleButton extends Button implements ITooltip {
@@ -42,7 +45,7 @@ public class ToggleButton extends Button implements ITooltip {
public ToggleButton(final int x, final int y, final int on, final int off, final String displayName,
final String displayHint, IPressable onPress) {
super(x, y, 16, 16, "", onPress);
super(x, y, 16, 16, new StringTextComponent(""), onPress);
this.iconIdxOn = on;
this.iconIdxOff = off;
this.displayName = displayName;
@@ -54,7 +57,7 @@ public class ToggleButton extends Button implements ITooltip {
}
@Override
public void renderButton(final int mouseX, final int mouseY, final float partial) {
public void renderButton(MatrixStack matrixStack, final int mouseX, final int mouseY, final float partial) {
if (this.visible) {
final int iconIndex = this.getIconIndex();
@@ -74,7 +77,7 @@ public class ToggleButton extends Button implements ITooltip {
}
@Override
public String getMessage() {
public ITextComponent getMessage() {
if (this.displayName != null) {
String name = I18n.format(this.displayName);
String value = I18n.format(this.displayHint);
@@ -97,9 +100,9 @@ public class ToggleButton extends Button implements ITooltip {
sb.replace(i, i + 1, "\n");
}
return name + '\n' + sb;
return new StringTextComponent(name + '\n' + sb);
}
return "";
return new StringTextComponent("");
}
@Override
@@ -24,7 +24,7 @@ import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import appeng.api.implementations.tiles.IColorableTile;
import appeng.api.util.AEColor;
@@ -37,7 +37,7 @@ public class ColorableTileBlockColor implements IBlockColor {
public static final ColorableTileBlockColor INSTANCE = new ColorableTileBlockColor();
@Override
public int getColor(BlockState state, @Nullable ILightReader worldIn, @Nullable BlockPos pos, int tintIndex) {
public int getColor(BlockState state, @Nullable IBlockDisplayReader worldIn, @Nullable BlockPos pos, int tintIndex) {
AEColor color = AEColor.TRANSPARENT; // Default to a neutral color
if (worldIn != null && pos != null) {
@@ -28,19 +28,19 @@ import javax.annotation.Nullable;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.TransformationMatrix;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.LivingEntity;
import net.minecraft.fluid.Fluids;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.util.math.vector.TransformationMatrix;
import net.minecraftforge.client.model.ItemLayerModel;
import net.minecraftforge.fluids.FluidAttributes;
import net.minecraftforge.fluids.FluidStack;
@@ -53,10 +53,10 @@ import appeng.fluids.items.FluidDummyItem;
* Override List is used to accomplish this.
*/
public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
private final Function<Material, TextureAtlasSprite> bakedTextureGetter;
private final Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter;
public DummyFluidDispatcherBakedModel(IBakedModel baseModel,
Function<Material, TextureAtlasSprite> bakedTextureGetter) {
Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter) {
super(baseModel);
this.bakedTextureGetter = bakedTextureGetter;
}
@@ -86,7 +86,7 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
public ItemOverrideList getOverrides() {
return new ItemOverrideList() {
@Override
public IBakedModel getModelWithOverrides(IBakedModel originalModel, ItemStack stack, World world,
public IBakedModel func_239290_a_(IBakedModel originalModel, ItemStack stack, ClientWorld world,
LivingEntity entity) {
if (!(stack.getItem() instanceof FluidDummyItem)) {
return originalModel;
@@ -101,7 +101,7 @@ public class DummyFluidDispatcherBakedModel extends DelegateBakedModel {
FluidAttributes attributes = fluidStack.getFluid().getAttributes();
ResourceLocation stillTexture = attributes.getStillTexture(fluidStack);
Material stillMaterial = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, stillTexture);
RenderMaterial stillMaterial = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, stillTexture);
TextureAtlasSprite sprite = DummyFluidDispatcherBakedModel.this.bakedTextureGetter.apply(stillMaterial);
if (sprite == null) {
return new DummyFluidBakedModel(ImmutableList.of());
@@ -29,8 +29,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -49,7 +49,7 @@ public class DummyFluidItemModel implements IModelGeometry<DummyFluidItemModel>
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
IBakedModel bakedBaseModel = bakery.getBakedModel(MODEL_BASE, modelTransform, spriteGetter);
@@ -57,7 +57,7 @@ public class DummyFluidItemModel implements IModelGeometry<DummyFluidItemModel>
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.emptyList();
}
@@ -28,8 +28,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -49,7 +49,7 @@ public class FacadeItemModel implements IModelGeometry<FacadeItemModel> {
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
IBakedModel bakedBaseModel = bakery.getBakedModel(MODEL_BASE, modelTransform, spriteGetter);
FacadeBuilder facadeBuilder = new FacadeBuilder();
@@ -58,7 +58,7 @@ public class FacadeItemModel implements IModelGeometry<FacadeItemModel> {
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return modelGetter.apply(MODEL_BASE).getTextures(modelGetter, missingTextureErrors);
}
@@ -20,13 +20,13 @@ package appeng.client.render;
import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.Vector4f;
import net.minecraft.util.Direction;
import net.minecraft.util.IStringSerializable;
import net.minecraft.util.math.Vec3i;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraft.util.math.vector.Vector3i;
import net.minecraft.util.math.vector.Vector4f;
/**
* TODO: Removed useless stuff.
@@ -90,7 +90,7 @@ public enum FacingToRotation implements IStringSerializable {
}
public Direction rotate(Direction facing) {
Vec3i dir = facing.getDirectionVec();
Vector3i dir = facing.getDirectionVec();
Vector4f vec = new Vector4f(dir.getX(), dir.getY(), dir.getZ(), 1);
vec.transform(mat);
return Direction.getFacingFromVector(vec.getX(), vec.getY(), vec.getZ());
@@ -27,11 +27,11 @@ import org.lwjgl.opengl.GL11;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.BufferBuilder;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraftforge.client.IRenderHandler;
import net.minecraftforge.client.SkyRenderHandler;
@@ -23,8 +23,8 @@ import com.mojang.blaze3d.systems.RenderSystem;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.client.renderer.TransformationMatrix;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.util.math.vector.TransformationMatrix;
import net.minecraft.util.math.vector.Vector3f;
import appeng.api.storage.data.IAEItemStack;
import appeng.core.AEConfig;
@@ -23,7 +23,7 @@ import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.color.IBlockColor;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import appeng.api.util.AEColor;
@@ -39,7 +39,7 @@ public class StaticBlockColor implements IBlockColor {
}
@Override
public int getColor(BlockState state, @Nullable ILightReader worldIn, @Nullable BlockPos pos, int tintIndex) {
public int getColor(BlockState state, @Nullable IBlockDisplayReader worldIn, @Nullable BlockPos pos, int tintIndex) {
return this.color.getVariantByTintIndex(tintIndex);
}
@@ -23,11 +23,11 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.renderer.IRenderTypeBuffer;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.math.vector.Vector3f;
import appeng.api.storage.data.IAEItemStack;
import appeng.util.IWideReadableNumberConverter;
@@ -25,8 +25,9 @@ import java.util.EnumSet;
import java.util.List;
import java.util.function.Function;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.Direction;
@@ -49,7 +50,7 @@ class CableBuilder {
private final SmartCableTextures smartCableTextures;
CableBuilder(Function<Material, TextureAtlasSprite> bakedTextureGetter) {
CableBuilder(Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter) {
this.coreTextures = new EnumMap<>(CableCoreType.class);
for (CableCoreType type : CableCoreType.values()) {
@@ -77,7 +78,7 @@ class CableBuilder {
this.smartCableTextures = new SmartCableTextures(bakedTextureGetter);
}
static Material getConnectionTexture(AECableType cableType, AEColor color) {
static RenderMaterial getConnectionTexture(AECableType cableType, AEColor color) {
String textureFolder;
switch (cableType) {
case GLASS:
@@ -99,7 +100,7 @@ class CableBuilder {
throw new IllegalStateException("Cable type " + cableType + " does not support connections.");
}
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
return new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, textureFolder + color.name().toLowerCase()));
}
@@ -701,8 +702,8 @@ class CableBuilder {
}
// Get all textures needed for building the actual cable quads
public static List<Material> getTextures() {
List<Material> locations = new ArrayList<>();
public static List<RenderMaterial> getTextures() {
List<RenderMaterial> locations = new ArrayList<>();
for (CableCoreType coreType : CableCoreType.values()) {
for (AEColor color : AEColor.values()) {
@@ -3,7 +3,7 @@ package appeng.client.render.cablebus;
import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.world.World;
import net.minecraft.client.world.ClientWorld;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -15,7 +15,7 @@ public class CableBusBreakingParticle extends SpriteTexturedParticle {
private final float field_217571_C;
private final float field_217572_F;
public CableBusBreakingParticle(World world, double x, double y, double z, double speedX, double speedY,
public CableBusBreakingParticle(ClientWorld world, double x, double y, double z, double speedX, double speedY,
double speedZ, TextureAtlasSprite sprite) {
super(world, x, y, z, speedX, speedY, speedZ);
this.setSprite(sprite);
@@ -25,7 +25,7 @@ public class CableBusBreakingParticle extends SpriteTexturedParticle {
this.field_217572_F = this.rand.nextFloat() * 3.0F;
}
public CableBusBreakingParticle(World world, double x, double y, double z, TextureAtlasSprite sprite) {
public CableBusBreakingParticle(ClientWorld world, double x, double y, double z, TextureAtlasSprite sprite) {
this(world, x, y, z, 0, 0, 0, sprite);
}
@@ -31,8 +31,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -55,7 +55,7 @@ public class CableBusModel implements IModelGeometry<CableBusModel> {
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
Map<ResourceLocation, IBakedModel> partModels = this.loadPartModels(bakery, spriteGetter, modelTransform);
@@ -71,13 +71,13 @@ public class CableBusModel implements IModelGeometry<CableBusModel> {
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.unmodifiableList(CableBuilder.getTextures());
}
private Map<ResourceLocation, IBakedModel> loadPartModels(ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetterIn, IModelTransform transformIn) {
Function<RenderMaterial, TextureAtlasSprite> spriteGetterIn, IModelTransform transformIn) {
ImmutableMap.Builder<ResourceLocation, IBakedModel> result = ImmutableMap.builder();
for (ResourceLocation location : this.partModels.getModels()) {
@@ -28,7 +28,7 @@ import java.util.Objects;
import net.minecraft.util.Direction;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelProperty;
@@ -80,7 +80,7 @@ public class CableBusRenderState {
private EnumMap<Direction, FacadeRenderState> facades = new EnumMap<>(Direction.class);
// Used for Facades.
private WeakReference<ILightReader> world;
private WeakReference<IBlockDisplayReader> world;
private BlockPos pos;
// Contains the bounding boxes of all parts on the cable bus to allow facades to
@@ -152,11 +152,11 @@ public class CableBusRenderState {
return this.facades;
}
public ILightReader getWorld() {
public IBlockDisplayReader getWorld() {
return this.world.get();
}
public void setWorld(ILightReader world) {
public void setWorld(IBlockDisplayReader world) {
this.world = new WeakReference<>(world);
}
@@ -23,7 +23,7 @@ import java.util.Map;
import com.google.common.collect.ImmutableMap;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.util.ResourceLocation;
@@ -72,8 +72,8 @@ public enum CableCoreType {
return cableMapping.get(cableType);
}
public Material getTexture(AEColor color) {
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
public RenderMaterial getTexture(AEColor color) {
return new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, this.textureFolder + "/" + color.name().toLowerCase()));
}
@@ -25,12 +25,12 @@ import java.util.List;
import com.google.common.base.Preconditions;
import net.minecraft.client.renderer.Vector4f;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
/**
@@ -21,11 +21,11 @@ package appeng.client.render.cablebus;
import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.fluid.IFluidState;
import net.minecraft.fluid.FluidState;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraft.world.level.ColorResolver;
import net.minecraft.world.lighting.WorldLightManager;
@@ -35,14 +35,14 @@ import net.minecraft.world.lighting.WorldLightManager;
*
* @author covers1624
*/
public class FacadeBlockAccess implements ILightReader {
public class FacadeBlockAccess implements IBlockDisplayReader {
private final ILightReader world;
private final IBlockDisplayReader world;
private final BlockPos pos;
private final Direction side;
private final BlockState state;
public FacadeBlockAccess(ILightReader world, BlockPos pos, Direction side, BlockState state) {
public FacadeBlockAccess(IBlockDisplayReader world, BlockPos pos, Direction side, BlockState state) {
this.world = world;
this.pos = pos;
this.side = side;
@@ -64,7 +64,7 @@ public class FacadeBlockAccess implements ILightReader {
}
@Override
public IFluidState getFluidState(BlockPos pos) {
public FluidState getFluidState(BlockPos pos) {
return world.getFluidState(pos);
}
@@ -44,7 +44,7 @@ import net.minecraft.util.Direction.Axis;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.AxisAlignedBB;
import net.minecraft.util.math.BlockPos;
import net.minecraft.world.ILightReader;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.client.model.data.IModelData;
@@ -112,7 +112,7 @@ public class FacadeBuilder {
Map<Direction, FacadeRenderState> facadeStates = renderState.getFacades();
List<AxisAlignedBB> partBoxes = renderState.getBoundingBoxes();
Set<Direction> sidesWithParts = renderState.getAttachments().keySet();
ILightReader parentWorld = renderState.getWorld();
IBlockDisplayReader parentWorld = renderState.getWorld();
BlockPos pos = renderState.getPos();
BlockColors blockColors = Minecraft.getInstance().getBlockColors();
boolean thinFacades = isUseThinFacades(partBoxes);
@@ -189,7 +189,7 @@ public class FacadeBuilder {
AEAxisAlignedBB cutOutBox = getCutOutBox(facadeBox, partBoxes);
List<AxisAlignedBB> holeStrips = getBoxes(facadeBox, cutOutBox, side.getAxis());
ILightReader facadeAccess = new FacadeBlockAccess(parentWorld, pos, side, blockState);
IBlockDisplayReader facadeAccess = new FacadeBlockAccess(parentWorld, pos, side, blockState);
BlockRendererDispatcher dispatcher = Minecraft.getInstance().getBlockRendererDispatcher();
IBakedModel model = dispatcher.getModelForState(blockState);
@@ -11,8 +11,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
@@ -22,12 +22,12 @@ import net.minecraftforge.client.model.geometry.IModelGeometry;
import appeng.core.AppEng;
public class P2PTunnelFrequencyModel implements IModelGeometry<P2PTunnelFrequencyModel> {
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, "part/p2p_tunnel_frequency"));
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
try {
final TextureAtlasSprite texture = spriteGetter.apply(TEXTURE);
@@ -38,7 +38,7 @@ public class P2PTunnelFrequencyModel implements IModelGeometry<P2PTunnelFrequenc
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.singleton(TEXTURE);
}
@@ -21,11 +21,11 @@ package appeng.client.render.cablebus;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
import net.minecraft.util.Direction;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Vector3f;
import appeng.client.render.FacingToRotation;
import appeng.thirdparty.codechicken.lib.model.CachedFormat;
@@ -21,7 +21,7 @@ package appeng.client.render.cablebus;
import java.util.Arrays;
import java.util.function.Function;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
@@ -33,7 +33,7 @@ import appeng.core.AppEng;
*/
public class SmartCableTextures {
public static final Material[] SMART_CHANNELS_TEXTURES = Arrays
public static final RenderMaterial[] SMART_CHANNELS_TEXTURES = Arrays
.stream(new ResourceLocation[] { new ResourceLocation(AppEng.MOD_ID, "part/cable/smart/channels_00"), //
new ResourceLocation(AppEng.MOD_ID, "part/cable/smart/channels_01"), //
new ResourceLocation(AppEng.MOD_ID, "part/cable/smart/channels_02"), //
@@ -44,14 +44,14 @@ public class SmartCableTextures {
new ResourceLocation(AppEng.MOD_ID, "part/cable/smart/channels_12"), //
new ResourceLocation(AppEng.MOD_ID, "part/cable/smart/channels_13"), //
new ResourceLocation(AppEng.MOD_ID, "part/cable/smart/channels_14")//
}).map(e -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, e)).toArray(Material[]::new);
}).map(e -> new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, e)).toArray(RenderMaterial[]::new);
// Textures used to display channels on smart cables. There's two sets of 5
// textures each, and
// one of each set are composed together to get even/odd colored channels
private final TextureAtlasSprite[] textures;
public SmartCableTextures(Function<Material, TextureAtlasSprite> bakedTextureGetter) {
public SmartCableTextures(Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter) {
this.textures = Arrays.stream(SMART_CHANNELS_TEXTURES)//
.map(bakedTextureGetter)//
.toArray(TextureAtlasSprite[]::new);
@@ -29,8 +29,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
@@ -45,20 +45,20 @@ import appeng.core.AppEng;
*/
class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
private final static Material RING_CORNER = texture("ring_corner");
private final static Material RING_SIDE_HOR = texture("ring_side_hor");
private final static Material RING_SIDE_VER = texture("ring_side_ver");
private final static Material UNIT_BASE = texture("unit_base");
private final static Material LIGHT_BASE = texture("light_base");
private final static Material ACCELERATOR_LIGHT = texture("accelerator_light");
private final static Material STORAGE_1K_LIGHT = texture("1k_storage_light");
private final static Material STORAGE_4K_LIGHT = texture("4k_storage_light");
private final static Material STORAGE_16K_LIGHT = texture("16k_storage_light");
private final static Material STORAGE_64K_LIGHT = texture("64k_storage_light");
private final static Material MONITOR_BASE = texture("monitor_base");
private final static Material MONITOR_LIGHT_DARK = texture("monitor_light_dark");
private final static Material MONITOR_LIGHT_MEDIUM = texture("monitor_light_medium");
private final static Material MONITOR_LIGHT_BRIGHT = texture("monitor_light_bright");
private final static RenderMaterial RING_CORNER = texture("ring_corner");
private final static RenderMaterial RING_SIDE_HOR = texture("ring_side_hor");
private final static RenderMaterial RING_SIDE_VER = texture("ring_side_ver");
private final static RenderMaterial UNIT_BASE = texture("unit_base");
private final static RenderMaterial LIGHT_BASE = texture("light_base");
private final static RenderMaterial ACCELERATOR_LIGHT = texture("accelerator_light");
private final static RenderMaterial STORAGE_1K_LIGHT = texture("1k_storage_light");
private final static RenderMaterial STORAGE_4K_LIGHT = texture("4k_storage_light");
private final static RenderMaterial STORAGE_16K_LIGHT = texture("16k_storage_light");
private final static RenderMaterial STORAGE_64K_LIGHT = texture("64k_storage_light");
private final static RenderMaterial MONITOR_BASE = texture("monitor_base");
private final static RenderMaterial MONITOR_LIGHT_DARK = texture("monitor_light_dark");
private final static RenderMaterial MONITOR_LIGHT_MEDIUM = texture("monitor_light_medium");
private final static RenderMaterial MONITOR_LIGHT_BRIGHT = texture("monitor_light_bright");
private final AbstractCraftingUnitBlock.CraftingUnitType type;
@@ -67,7 +67,7 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return ImmutableList.of(RING_CORNER, RING_SIDE_HOR, RING_SIDE_VER, UNIT_BASE, LIGHT_BASE, ACCELERATOR_LIGHT,
STORAGE_1K_LIGHT, STORAGE_4K_LIGHT, STORAGE_16K_LIGHT, STORAGE_64K_LIGHT, MONITOR_BASE,
@@ -75,9 +75,7 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
}
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) {
// Retrieve our textures and pass them on to the baked model
TextureAtlasSprite ringCorner = spriteGetter.apply(RING_CORNER);
TextureAtlasSprite ringSideHor = spriteGetter.apply(RING_SIDE_HOR);
@@ -102,7 +100,7 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
}
}
private static TextureAtlasSprite getLightTexture(Function<Material, TextureAtlasSprite> textureGetter,
private static TextureAtlasSprite getLightTexture(Function<RenderMaterial, TextureAtlasSprite> textureGetter,
AbstractCraftingUnitBlock.CraftingUnitType type) {
switch (type) {
case ACCELERATOR:
@@ -120,8 +118,8 @@ class CraftingCubeModel implements IModelGeometry<CraftingCubeModel> {
}
}
private static Material texture(String name) {
return new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static RenderMaterial texture(String name) {
return new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "block/crafting/" + name));
}
}
@@ -7,12 +7,12 @@ import com.mojang.blaze3d.matrix.MatrixStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screen.Screen;
import net.minecraft.client.renderer.TransformationMatrix;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.entity.LivingEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.math.vector.TransformationMatrix;
import net.minecraft.world.World;
import net.minecraftforge.client.model.PerspectiveMapWrapper;
@@ -10,8 +10,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -29,14 +29,14 @@ public class EncodedPatternModel implements IModelGeometry<EncodedPatternModel>
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return modelGetter.apply(baseModel).getTextures(modelGetter, missingTextureErrors);
}
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
IBakedModel baseModel = bakery.getBakedModel(this.baseModel, modelTransform, spriteGetter);
return new EncodedPatternBakedModel(baseModel);
@@ -26,10 +26,11 @@ import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -43,7 +44,7 @@ public class CraftingFx extends SpriteTexturedParticle {
private final float offsetY;
private final float offsetZ;
public CraftingFx(final World par1World, final double x, final double y, final double z,
public CraftingFx(final ClientWorld par1World, final double x, final double y, final double z,
final IAnimatedSprite sprite) {
super(par1World, x, y, z);
@@ -78,10 +79,10 @@ public class CraftingFx extends SpriteTexturedParticle {
// I believe this particle is same as breaking particle, but should not exit the
// original block it was
// spawned in (which is encased in glass)
Vec3d vec3d = renderInfo.getProjectedView();
offX -= vec3d.x;
offY -= vec3d.y;
offZ -= vec3d.z;
Vector3d Vector3d = renderInfo.getProjectedView();
offX -= Vector3d.x;
offY -= Vector3d.y;
offZ -= Vector3d.z;
Vector3f[] avector3f = new Vector3f[] { new Vector3f(-1.0F, -1.0F, 0.0F), new Vector3f(-1.0F, 1.0F, 0.0F),
new Vector3f(1.0F, 1.0F, 0.0F), new Vector3f(1.0F, -1.0F, 0.0F) };
@@ -26,8 +26,8 @@ import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.util.math.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -38,7 +38,7 @@ public class EnergyFx extends SpriteTexturedParticle {
private final int startBlkY;
private final int startBlkZ;
public EnergyFx(final World par1World, final double par2, final double par4, final double par6,
public EnergyFx(final ClientWorld par1World, final double par2, final double par4, final double par6,
final IAnimatedSprite sprite) {
super(par1World, par2, par4, par6);
this.particleGravity = 0;
@@ -109,7 +109,7 @@ public class EnergyFx extends SpriteTexturedParticle {
}
@Override
public Particle makeParticle(EnergyParticleData data, World worldIn, double x, double y, double z,
public Particle makeParticle(EnergyParticleData data, ClientWorld worldIn, double x, double y, double z,
double xSpeed, double ySpeed, double zSpeed) {
EnergyFx result = new EnergyFx(worldIn, x, y, z, spriteSet);
result.setMotionX((float) xSpeed);
@@ -8,7 +8,7 @@ import com.mojang.brigadier.exceptions.CommandSyntaxException;
import net.minecraft.network.PacketBuffer;
import net.minecraft.particles.IParticleData;
import net.minecraft.particles.ParticleType;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
/**
* Contains the target point of the lightning arc (the source point is infered
@@ -16,9 +16,9 @@ import net.minecraft.util.math.Vec3d;
*/
public class LightningArcParticleData implements IParticleData {
public final Vec3d target;
public final Vector3d target;
public LightningArcParticleData(Vec3d target) {
public LightningArcParticleData(Vector3d target) {
this.target = target;
}
@@ -32,7 +32,7 @@ public class LightningArcParticleData implements IParticleData {
float y = reader.readFloat();
reader.expect(' ');
float z = reader.readFloat();
return new LightningArcParticleData(new Vec3d(x, y, z));
return new LightningArcParticleData(new Vector3d(x, y, z));
}
@Override
@@ -41,7 +41,7 @@ public class LightningArcParticleData implements IParticleData {
float x = buffer.readFloat();
float y = buffer.readFloat();
float z = buffer.readFloat();
return new LightningArcParticleData(new Vec3d(x, y, z));
return new LightningArcParticleData(new Vector3d(x, y, z));
}
};
@@ -29,11 +29,11 @@ import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.renderer.ActiveRenderInfo;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.world.World;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -49,14 +49,14 @@ public class LightningFX extends SpriteTexturedParticle {
private final double[] verticesWithUV = new double[3];
private boolean hasData = false;
private LightningFX(final World w, final double x, final double y, final double z, final double r, final double g,
final double b) {
private LightningFX(final ClientWorld w, final double x, final double y, final double z, final double r,
final double g, final double b) {
this(w, x, y, z, r, g, b, 6);
this.regen();
}
protected LightningFX(final World w, final double x, final double y, final double z, final double r, final double g,
final double b, final int maxAge) {
protected LightningFX(final ClientWorld w, final double x, final double y, final double z, final double r,
final double g, final double b, final int maxAge) {
super(w, x, y, z, r, g, b);
this.precomputedSteps = new double[LightningFX.STEPS][3];
this.motionX = 0;
@@ -108,10 +108,10 @@ public class LightningFX extends SpriteTexturedParticle {
@Override
public void renderParticle(IVertexBuilder buffer, ActiveRenderInfo renderInfo, float partialTicks) {
Vec3d vec3d = renderInfo.getProjectedView();
float centerX = (float) (MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - vec3d.getX());
float centerY = (float) (MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - vec3d.getY());
float centerZ = (float) (MathHelper.lerp(partialTicks, this.prevPosZ, this.posZ) - vec3d.getZ());
Vector3d Vector3d = renderInfo.getProjectedView();
float centerX = (float) (MathHelper.lerp(partialTicks, this.prevPosX, this.posX) - Vector3d.getX());
float centerY = (float) (MathHelper.lerp(partialTicks, this.prevPosY, this.posY) - Vector3d.getY());
float centerZ = (float) (MathHelper.lerp(partialTicks, this.prevPosZ, this.posZ) - Vector3d.getZ());
final float j = 1.0f;
float red = this.particleRed * j * 0.9f;
@@ -253,7 +253,7 @@ public class LightningFX extends SpriteTexturedParticle {
}
@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) {
LightningFX lightningFX = new LightningFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed);
lightningFX.selectSpriteRandomly(this.spriteSet);
@@ -23,8 +23,8 @@ import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@@ -32,7 +32,7 @@ import appeng.api.util.AEPartLocation;
public class MatterCannonFX extends SpriteTexturedParticle {
public MatterCannonFX(final World par1World, final double x, final double y, final double z,
public MatterCannonFX(final ClientWorld par1World, final double x, final double y, final double z,
IAnimatedSprite sprite) {
super(par1World, x, y, z);
this.particleGravity = 0;
@@ -85,7 +85,7 @@ public class MatterCannonFX extends SpriteTexturedParticle {
}
@Override
public Particle makeParticle(BasicParticleType data, World world, double x, double y, double z, double xSpeed,
public Particle makeParticle(BasicParticleType data, ClientWorld world, double x, double y, double z, double xSpeed,
double ySpeed, double zSpeed) {
return new MatterCannonFX(world, x, y, z, spriteSet);
}
@@ -23,15 +23,15 @@ import net.minecraft.client.particle.IParticleFactory;
import net.minecraft.client.particle.IParticleRenderType;
import net.minecraft.client.particle.Particle;
import net.minecraft.client.particle.SpriteTexturedParticle;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particles.BasicParticleType;
import net.minecraft.world.World;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
@OnlyIn(Dist.CLIENT)
public class VibrantFX extends SpriteTexturedParticle {
public VibrantFX(final World par1World, final double x, final double y, final double z, final double par8,
public VibrantFX(final ClientWorld par1World, final double x, final double y, final double z, final double par8,
final double par10, final double par12, IAnimatedSprite sprite) {
super(par1World, x, y, z, par8, par10, par12);
final float f = this.rand.nextFloat() * 0.1F + 0.8F;
@@ -88,7 +88,7 @@ public class VibrantFX extends SpriteTexturedParticle {
}
@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) {
return new VibrantFX(worldIn, x, y, z, xSpeed, ySpeed, zSpeed, spriteSet);
}
@@ -32,7 +32,6 @@ import com.google.common.cache.LoadingCache;
import com.google.common.collect.ImmutableList;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.Vector4f;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
@@ -42,8 +41,9 @@ import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Vec3i;
import net.minecraft.world.ILightReader;
import net.minecraft.util.math.vector.Vector3i;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraftforge.client.model.data.EmptyModelData;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
@@ -174,7 +174,7 @@ public class AutoRotatingBakedModel implements IBakedModel {
@Nonnull
@Override
public IModelData getModelData(@Nonnull ILightReader world, @Nonnull BlockPos pos, @Nonnull BlockState state,
public IModelData getModelData(@Nonnull IBlockDisplayReader world, @Nonnull BlockPos pos, @Nonnull BlockState state,
@Nonnull IModelData tileData) {
return this.parent.getModelData(world, pos, state, tileData);
}
@@ -262,11 +262,11 @@ public class AutoRotatingBakedModel implements IBakedModel {
} else {
switch (fs.length) {
case 3:
Vec3i vec = this.f2r.rotate(this.face).getDirectionVec();
Vector3i vec = this.f2r.rotate(this.face).getDirectionVec();
return new float[] { vec.getX(), vec.getY(), vec.getZ() };
case 4:
Vector4f veccc = new Vector4f(fs[0], fs[1], fs[2], fs[3]);
Vec3i vecc = this.f2r.rotate(this.face).getDirectionVec();
Vector3i vecc = this.f2r.rotate(this.face).getDirectionVec();
return new float[] { vecc.getX(), vecc.getY(), vecc.getZ(), veccc.getW() };
default:
@@ -13,8 +13,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
@@ -30,11 +30,11 @@ import appeng.core.AppEng;
public class BiometricCardModel implements IModelGeometry<BiometricCardModel> {
public static final ResourceLocation MODEL_BASE = new ResourceLocation(AppEng.MOD_ID, "item/biometric_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/biometric_card_hash"));
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.singleton(TEXTURE);
}
@@ -42,7 +42,7 @@ public class BiometricCardModel implements IModelGeometry<BiometricCardModel> {
@Nullable
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform transformIn,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform transformIn,
ItemOverrideList overrides, ResourceLocation locationIn) {
TextureAtlasSprite texture = spriteGetter.apply(TEXTURE);
@@ -11,8 +11,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
@@ -30,22 +30,22 @@ public class ColorApplicatorModel implements IModelGeometry<ColorApplicatorModel
private static final ResourceLocation MODEL_BASE = new ResourceLocation(AppEng.MOD_ID,
"item/color_applicator_colored");
private static final Material TEXTURE_DARK = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_DARK = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "item/color_applicator_tip_dark"));
private static final Material TEXTURE_MEDIUM = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_MEDIUM = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "item/color_applicator_tip_medium"));
private static final Material TEXTURE_BRIGHT = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
private static final RenderMaterial TEXTURE_BRIGHT = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation(AppEng.MOD_ID, "item/color_applicator_tip_bright"));
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Arrays.asList(TEXTURE_DARK, TEXTURE_MEDIUM, TEXTURE_DARK);
}
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
IBakedModel baseModel = bakery.getBakedModel(MODEL_BASE, modelTransform, spriteGetter);
@@ -27,13 +27,13 @@ import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
import net.minecraft.util.Direction;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Vector3f;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
@@ -32,8 +32,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.item.Item;
import net.minecraft.item.Items;
@@ -53,7 +53,7 @@ public class DriveModel implements IModelGeometry<DriveModel> {
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
final ICellModelRegistry cellRegistry = Api.instance().client().cells();
final Map<Item, IBakedModel> cellModels = new IdentityHashMap<>();
@@ -73,7 +73,7 @@ public class DriveModel implements IModelGeometry<DriveModel> {
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.emptyList();
}
@@ -34,7 +34,7 @@ import com.google.common.base.Strings;
import net.minecraft.block.BlockState;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
@@ -43,9 +43,9 @@ import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.MathHelper;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
import net.minecraft.world.IBlockDisplayReader;
import net.minecraft.world.IBlockReader;
import net.minecraft.world.ILightReader;
import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData;
import net.minecraftforge.client.model.data.ModelDataMap;
@@ -64,30 +64,30 @@ class GlassBakedModel implements IDynamicBakedModel {
private static final byte[][][] OFFSETS = generateOffsets();
// Alternating textures based on position
static final Material TEXTURE_A = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final RenderMaterial TEXTURE_A = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation("appliedenergistics2:block/glass/quartz_glass_a"));
static final Material TEXTURE_B = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final RenderMaterial TEXTURE_B = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation("appliedenergistics2:block/glass/quartz_glass_b"));
static final Material TEXTURE_C = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final RenderMaterial TEXTURE_C = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation("appliedenergistics2:block/glass/quartz_glass_c"));
static final Material TEXTURE_D = new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
static final RenderMaterial TEXTURE_D = new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE,
new ResourceLocation("appliedenergistics2:block/glass/quartz_glass_d"));
// Frame texture
static final Material[] TEXTURES_FRAME = generateTexturesFrame();
static final RenderMaterial[] TEXTURES_FRAME = generateTexturesFrame();
// Generates the required textures for the frame
private static Material[] generateTexturesFrame() {
private static RenderMaterial[] generateTexturesFrame() {
return IntStream.range(1, 16).mapToObj(Integer::toBinaryString).map(s -> Strings.padStart(s, 4, '0'))
.map(s -> new ResourceLocation("appliedenergistics2:block/glass/quartz_glass_frame" + s))
.map(rl -> new Material(AtlasTexture.LOCATION_BLOCKS_TEXTURE, rl)).toArray(Material[]::new);
.map(rl -> new RenderMaterial(AtlasTexture.LOCATION_BLOCKS_TEXTURE, rl)).toArray(RenderMaterial[]::new);
}
private final TextureAtlasSprite[] glassTextures;
private final TextureAtlasSprite[] frameTextures;
public GlassBakedModel(Function<Material, TextureAtlasSprite> bakedTextureGetter) {
public GlassBakedModel(Function<RenderMaterial, TextureAtlasSprite> bakedTextureGetter) {
this.glassTextures = new TextureAtlasSprite[] { bakedTextureGetter.apply(TEXTURE_A),
bakedTextureGetter.apply(TEXTURE_B), bakedTextureGetter.apply(TEXTURE_C),
bakedTextureGetter.apply(TEXTURE_D) };
@@ -133,7 +133,7 @@ class GlassBakedModel implements IDynamicBakedModel {
// Render the glass side
final List<BakedQuad> quads = new ArrayList<>(5); // At most 5
final List<Vec3d> corners = RenderHelper.getFaceCorners(side);
final List<Vector3d> corners = RenderHelper.getFaceCorners(side);
quads.add(this.createQuad(side, corners, glassTexture, u, v));
/*
@@ -204,15 +204,16 @@ class GlassBakedModel implements IDynamicBakedModel {
return bitmask;
}
private BakedQuad createQuad(Direction side, List<Vec3d> corners, TextureAtlasSprite sprite, float uOffset,
private BakedQuad createQuad(Direction side, List<Vector3d> corners, TextureAtlasSprite sprite, float uOffset,
float vOffset) {
return this.createQuad(side, corners.get(0), corners.get(1), corners.get(2), corners.get(3), sprite, uOffset,
vOffset);
}
private BakedQuad createQuad(Direction side, Vec3d c1, Vec3d c2, Vec3d c3, Vec3d c4, TextureAtlasSprite sprite,
float uOffset, float vOffset) {
Vec3d normal = new Vec3d(side.getDirectionVec());
private BakedQuad createQuad(Direction side, Vector3d c1, Vector3d c2, Vector3d c3, Vector3d c4,
TextureAtlasSprite sprite, float uOffset, float vOffset) {
Vector3d normal = new Vector3d(side.getDirectionVec().getX(), side.getDirectionVec().getY(),
side.getDirectionVec().getZ());
// Apply the u,v shift.
// This mirrors the logic from OffsetIcon from 1.7
@@ -235,7 +236,7 @@ class GlassBakedModel implements IDynamicBakedModel {
* data into the vertexbuffer actually has to be precisely the order in which
* the vertex elements had been declared in the vertex format.
*/
private void putVertex(BakedQuadBuilder builder, Vec3d normal, double x, double y, double z,
private void putVertex(BakedQuadBuilder builder, Vector3d normal, double x, double y, double z,
TextureAtlasSprite sprite, float u, float v) {
VertexFormat vertexFormat = builder.getVertexFormat();
for (int e = 0; e < vertexFormat.getElements().size(); e++) {
@@ -305,7 +306,7 @@ class GlassBakedModel implements IDynamicBakedModel {
@Nonnull
@Override
public IModelData getModelData(@Nonnull ILightReader world, @Nonnull BlockPos pos, @Nonnull BlockState state,
public IModelData getModelData(@Nonnull IBlockDisplayReader world, @Nonnull BlockPos pos, @Nonnull BlockState state,
@Nonnull IModelData tileData) {
EnumSet<Direction> flushWith = EnumSet.noneOf(Direction.class);
@@ -29,8 +29,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -43,16 +43,16 @@ public class GlassModel implements IModelGeometry<GlassModel> {
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
return new GlassBakedModel(spriteGetter);
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return ImmutableSet
.<Material>builder().add(GlassBakedModel.TEXTURE_A, GlassBakedModel.TEXTURE_B,
.<RenderMaterial>builder().add(GlassBakedModel.TEXTURE_A, GlassBakedModel.TEXTURE_B,
GlassBakedModel.TEXTURE_C, GlassBakedModel.TEXTURE_D)
.add(GlassBakedModel.TEXTURES_FRAME).build();
}
@@ -20,12 +20,12 @@ package appeng.client.render.model;
import java.util.List;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Vector4f;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.renderer.vertex.VertexFormatElement;
import net.minecraft.util.Direction;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Vector4f;
import net.minecraftforge.client.model.pipeline.QuadGatheringTransformer;
/**
@@ -9,12 +9,13 @@ import javax.annotation.Nullable;
import com.mojang.datafixers.util.Pair;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.AtlasTexture;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
@@ -41,9 +42,7 @@ public class MemoryCardModel implements IModelGeometry<MemoryCardModel> {
@Nullable
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery, Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform, ItemOverrideList overrides, ResourceLocation modelLocation) {
TextureAtlasSprite texture = spriteGetter.apply(TEXTURE);
IBakedModel baseModel = bakery.getBakedModel(MODEL_BASE, modelTransform, spriteGetter);
@@ -25,42 +25,42 @@ import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import net.minecraft.util.Direction;
import net.minecraft.util.math.Vec3d;
import net.minecraft.util.math.vector.Vector3d;
// TODO: Investigate use of CubeBuilder instead
final class RenderHelper {
private static EnumMap<Direction, List<Vec3d>> cornersForFacing = generateCornersForFacings();
private static EnumMap<Direction, List<Vector3d>> cornersForFacing = generateCornersForFacings();
private RenderHelper() {
}
static List<Vec3d> getFaceCorners(Direction side) {
static List<Vector3d> getFaceCorners(Direction side) {
return cornersForFacing.get(side);
}
private static EnumMap<Direction, List<Vec3d>> generateCornersForFacings() {
EnumMap<Direction, List<Vec3d>> result = new EnumMap<>(Direction.class);
private static EnumMap<Direction, List<Vector3d>> generateCornersForFacings() {
EnumMap<Direction, List<Vector3d>> result = new EnumMap<>(Direction.class);
for (Direction facing : Direction.values()) {
List<Vec3d> corners;
List<Vector3d> corners;
float offset = (facing.getAxisDirection() == Direction.AxisDirection.NEGATIVE) ? 0 : 1;
switch (facing.getAxis()) {
default:
case X:
corners = Lists.newArrayList(new Vec3d(offset, 1, 1), new Vec3d(offset, 0, 1),
new Vec3d(offset, 0, 0), new Vec3d(offset, 1, 0));
corners = Lists.newArrayList(new Vector3d(offset, 1, 1), new Vector3d(offset, 0, 1),
new Vector3d(offset, 0, 0), new Vector3d(offset, 1, 0));
break;
case Y:
corners = Lists.newArrayList(new Vec3d(1, offset, 1), new Vec3d(1, offset, 0),
new Vec3d(0, offset, 0), new Vec3d(0, offset, 1));
corners = Lists.newArrayList(new Vector3d(1, offset, 1), new Vector3d(1, offset, 0),
new Vector3d(0, offset, 0), new Vector3d(0, offset, 1));
break;
case Z:
corners = Lists.newArrayList(new Vec3d(0, 1, offset), new Vec3d(0, 0, offset),
new Vec3d(1, 0, offset), new Vec3d(1, 1, offset));
corners = Lists.newArrayList(new Vector3d(0, 1, offset), new Vector3d(0, 0, offset),
new Vector3d(1, 0, offset), new Vector3d(1, 1, offset));
break;
}
@@ -74,15 +74,15 @@ final class RenderHelper {
return result;
}
private static Vec3d adjust(Vec3d vec, Direction.Axis axis, double delta) {
private static Vector3d adjust(Vector3d vec, Direction.Axis axis, double delta) {
switch (axis) {
default:
case X:
return new Vec3d(vec.x + delta, vec.y, vec.z);
return new Vector3d(vec.x + delta, vec.y, vec.z);
case Y:
return new Vec3d(vec.x, vec.y + delta, vec.z);
return new Vector3d(vec.x, vec.y + delta, vec.z);
case Z:
return new Vec3d(vec.x, vec.y, vec.z + delta);
return new Vector3d(vec.x, vec.y, vec.z + delta);
}
}
}
@@ -26,8 +26,6 @@ import javax.annotation.Nullable;
import net.minecraft.block.BlockState;
import net.minecraft.client.entity.player.ClientPlayerEntity;
import net.minecraft.client.renderer.Matrix4f;
import net.minecraft.client.renderer.Quaternion;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
@@ -38,6 +36,8 @@ import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.item.ItemStack;
import net.minecraft.util.Direction;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.vector.Matrix4f;
import net.minecraft.util.math.vector.Quaternion;
import net.minecraft.world.World;
import net.minecraftforge.client.model.data.IDynamicBakedModel;
import net.minecraftforge.client.model.data.IModelData;
@@ -31,8 +31,8 @@ import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.IModelTransform;
import net.minecraft.client.renderer.model.IUnbakedModel;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.IModelConfiguration;
@@ -54,7 +54,7 @@ public class SkyCompassModel implements IModelGeometry<SkyCompassModel> {
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
IBakedModel baseModel = bakery.getBakedModel(MODEL_BASE, modelTransform, spriteGetter);
IBakedModel pointerModel = bakery.getBakedModel(MODEL_POINTER, modelTransform, spriteGetter);
@@ -62,7 +62,7 @@ public class SkyCompassModel implements IModelGeometry<SkyCompassModel> {
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter, Set<Pair<String, String>> missingTextureErrors) {
return Collections.emptyList();
}
@@ -37,7 +37,6 @@ import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.TransformationMatrix;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.BlockFaceUV;
import net.minecraft.client.renderer.model.BlockModel;
@@ -50,13 +49,14 @@ import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverride;
import net.minecraft.client.renderer.model.ItemOverrideList;
import net.minecraft.client.renderer.model.ItemTransformVec3f;
import net.minecraft.client.renderer.model.Material;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.model.RenderMaterial;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.resources.IResourceManager;
import net.minecraft.util.Direction;
import net.minecraft.util.JSONUtils;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.vector.TransformationMatrix;
import net.minecraftforge.client.model.IModelBuilder;
import net.minecraftforge.client.model.IModelConfiguration;
import net.minecraftforge.client.model.IModelLoader;
@@ -143,7 +143,7 @@ public class UVLModelLoader implements IModelLoader<UVLModelLoader.UVLModelWrapp
@Override
public IBakedModel bake(IModelConfiguration owner, ModelBakery bakery,
Function<Material, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
Function<RenderMaterial, TextureAtlasSprite> spriteGetter, IModelTransform modelTransform,
ItemOverrideList overrides, ResourceLocation modelLocation) {
TextureAtlasSprite particle = spriteGetter.apply(owner.resolveTexture("particle"));
@@ -199,7 +199,7 @@ public class UVLModelLoader implements IModelLoader<UVLModelLoader.UVLModelWrapp
}
@Override
public Collection<Material> getTextures(IModelConfiguration owner,
public Collection<RenderMaterial> getTextures(IModelConfiguration owner,
Function<ResourceLocation, IUnbakedModel> modelGetter,
Set<com.mojang.datafixers.util.Pair<String, String>> missingTextureErrors) {
return parent.getTextures(modelGetter, missingTextureErrors);

Some files were not shown because too many files have changed in this diff Show More