Port to Minecraft 1.15.2
This commit is contained in:
@@ -1,5 +1,8 @@
|
||||
# Refined Storage Changelog
|
||||
|
||||
### 1.8.1
|
||||
- Port to Minecraft 1.15.2 (raoulvdberge)
|
||||
|
||||
### 1.8
|
||||
- Port to Minecraft 1.15 (raoulvdberge)
|
||||
|
||||
|
12
build.gradle
12
build.gradle
@@ -33,7 +33,7 @@ archivesBaseName = 'refinedstorage'
|
||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||
|
||||
minecraft {
|
||||
mappings channel: 'snapshot', version: '20190719-1.14.3'
|
||||
mappings channel: 'snapshot', version: '20200124-1.15.1'
|
||||
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
|
||||
|
||||
runs {
|
||||
@@ -94,14 +94,14 @@ processResources {
|
||||
}
|
||||
|
||||
dependencies {
|
||||
minecraft 'net.minecraftforge:forge:1.15.1-30.0.41'
|
||||
minecraft 'net.minecraftforge:forge:1.15.2-31.0.0'
|
||||
|
||||
compileOnly fg.deobf("mezz.jei:jei-1.15.1:6.0.0.1:api")
|
||||
runtimeOnly fg.deobf("mezz.jei:jei-1.15.1:6.0.0.1")
|
||||
compileOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2:api")
|
||||
runtimeOnly fg.deobf("mezz.jei:jei-1.15.2:6.0.0.2")
|
||||
|
||||
compileOnly 'mouse-tweaks:MouseTweaks:2.13:mc1.15.1'
|
||||
//compileOnly 'mouse-tweaks:MouseTweaks:2.13:mc1.15.1'
|
||||
|
||||
runtimeOnly fg.deobf('crafting-tweaks:CraftingTweaks_1.15.1:11.0.0')
|
||||
//runtimeOnly fg.deobf('crafting-tweaks:CraftingTweaks_1.15.1:11.0.0')
|
||||
}
|
||||
|
||||
jar {
|
||||
|
@@ -56,7 +56,7 @@ public class AllowedTagList {
|
||||
for (Set<ResourceLocation> tags : tagsPerSlot) {
|
||||
ListNBT subList = new ListNBT();
|
||||
|
||||
tags.forEach(t -> subList.add(StringNBT.func_229705_a_(t.toString())));
|
||||
tags.forEach(t -> subList.add(StringNBT.valueOf(t.toString())));
|
||||
|
||||
list.add(subList);
|
||||
}
|
||||
|
@@ -133,7 +133,7 @@ public class CraftingPatternFactory {
|
||||
possibilities.add(input.copy());
|
||||
|
||||
if (allowedTagList != null) {
|
||||
Collection<ResourceLocation> tagsOfFluid = FluidTags.func_226157_a_().getOwningTags(input.getFluid());
|
||||
Collection<ResourceLocation> tagsOfFluid = FluidTags.getCollection().getOwningTags(input.getFluid());
|
||||
Set<ResourceLocation> declaredAllowedTags = allowedTagList.getAllowedFluidTags().get(i);
|
||||
|
||||
for (ResourceLocation declaredAllowedTag : declaredAllowedTags) {
|
||||
@@ -146,7 +146,7 @@ public class CraftingPatternFactory {
|
||||
)
|
||||
);
|
||||
} else {
|
||||
for (Fluid element : FluidTags.func_226157_a_().get(declaredAllowedTag).getAllElements()) {
|
||||
for (Fluid element : FluidTags.getCollection().get(declaredAllowedTag).getAllElements()) {
|
||||
possibilities.add(new FluidStack(element, input.getAmount()));
|
||||
}
|
||||
}
|
||||
|
@@ -1,15 +1,13 @@
|
||||
package com.raoulvdberge.refinedstorage.apiimpl.network.grid;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.raoulvdberge.refinedstorage.api.network.grid.IGridTab;
|
||||
import com.raoulvdberge.refinedstorage.api.render.IElementDrawer;
|
||||
import com.raoulvdberge.refinedstorage.api.util.IFilter;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
@@ -87,7 +87,7 @@ public class ConstructorBlock extends CableBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -107,7 +107,7 @@ public class ControllerBlock extends BaseBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -57,7 +57,7 @@ public class CrafterBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attempt(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -40,7 +40,7 @@ public class CrafterManagerBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attempt(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -41,7 +41,7 @@ public class CraftingMonitorBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
CraftingMonitorTile tile = (CraftingMonitorTile) world.getTileEntity(pos);
|
||||
|
||||
|
@@ -85,7 +85,7 @@ public class DestructorBlock extends CableBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -68,7 +68,7 @@ public class DetectorBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -41,7 +41,7 @@ public class DiskDriveBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, rayTraceResult.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -36,7 +36,7 @@ public class DiskManipulatorBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult rayTraceResult) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, rayTraceResult.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -108,7 +108,7 @@ public class ExporterBlock extends CableBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -88,7 +88,7 @@ public class ExternalStorageBlock extends CableBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -37,7 +37,7 @@ public class FluidInterfaceBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attempt(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -63,7 +63,7 @@ public class FluidStorageBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui((ServerPlayerEntity) player, new PositionalTileContainerProvider<FluidStorageTile>(
|
||||
((FluidStorageTile) world.getTileEntity(pos)).getNode().getTitle(),
|
||||
|
@@ -49,7 +49,7 @@ public class GridBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> API.instance().getGridManager().openGrid(GridBlockGridFactory.ID, (ServerPlayerEntity) player, pos));
|
||||
}
|
||||
|
@@ -108,7 +108,7 @@ public class ImporterBlock extends CableBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -37,7 +37,7 @@ public class InterfaceBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attempt(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -36,7 +36,7 @@ public class NetworkTransmitterBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -76,7 +76,7 @@ public class PortableGridBlock extends BaseBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand hand, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
API.instance().getGridManager().openGrid(PortableGridBlockGridFactory.ID, (ServerPlayerEntity) player, pos);
|
||||
|
||||
|
@@ -36,7 +36,7 @@ public class RelayBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -36,7 +36,7 @@ public class SecurityManagerBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
Runnable action = () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -63,7 +63,7 @@ public class StorageBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui((ServerPlayerEntity) player, new PositionalTileContainerProvider<StorageTile>(
|
||||
((StorageTile) world.getTileEntity(pos)).getNode().getTitle(),
|
||||
|
@@ -45,7 +45,7 @@ public class StorageMonitorBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
ItemStack held = player.inventory.getCurrentItem();
|
||||
|
||||
|
@@ -68,7 +68,7 @@ public class WirelessTransmitterBlock extends NetworkNodeBlock {
|
||||
|
||||
@Override
|
||||
@SuppressWarnings("deprecation")
|
||||
public ActionResultType func_225533_a_(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
public ActionResultType onBlockActivated(BlockState state, World world, BlockPos pos, PlayerEntity player, Hand handIn, BlockRayTraceResult hit) {
|
||||
if (!world.isRemote) {
|
||||
return NetworkUtils.attemptModify(world, pos, hit.getFace(), player, () -> NetworkHooks.openGui(
|
||||
(ServerPlayerEntity) player,
|
||||
|
@@ -49,7 +49,7 @@ public class PatternItem extends Item implements ICraftingPatternProvider {
|
||||
private static final int VERSION = 1;
|
||||
|
||||
public PatternItem() {
|
||||
super(new Item.Properties().group(RS.MAIN_GROUP).setTEISR(() -> PatternItemStackTileRenderer::new));
|
||||
super(new Item.Properties().group(RS.MAIN_GROUP).setISTER(() -> PatternItemStackTileRenderer::new));
|
||||
|
||||
this.setRegistryName(RS.ID, "pattern");
|
||||
}
|
||||
|
@@ -1,18 +1,14 @@
|
||||
package com.raoulvdberge.refinedstorage.render;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.BufferBuilder;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.AtlasTexture;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
import net.minecraft.inventory.container.PlayerContainer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.fluids.FluidAttributes;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
@@ -77,7 +73,7 @@ public class FluidRenderer {
|
||||
|
||||
private void drawTiledSprite(final int xPosition, final int yPosition, final int tiledWidth, final int tiledHeight, int color, int scaledAmount, TextureAtlasSprite sprite) {
|
||||
Minecraft minecraft = Minecraft.getInstance();
|
||||
minecraft.getTextureManager().bindTexture(PlayerContainer.field_226615_c_);
|
||||
minecraft.getTextureManager().bindTexture(PlayerContainer.LOCATION_BLOCKS_TEXTURE);
|
||||
setGLColorFromInt(color);
|
||||
|
||||
final int xTileCount = tiledWidth / TEX_WIDTH;
|
||||
@@ -107,7 +103,7 @@ public class FluidRenderer {
|
||||
Fluid fluid = fluidStack.getFluid();
|
||||
FluidAttributes attributes = fluid.getAttributes();
|
||||
ResourceLocation fluidStill = attributes.getStillTexture(fluidStack);
|
||||
return Minecraft.getInstance().func_228015_a_(PlayerContainer.field_226615_c_).apply(fluidStill);
|
||||
return Minecraft.getInstance().getTextureGetter(PlayerContainer.LOCATION_BLOCKS_TEXTURE).apply(fluidStill);
|
||||
}
|
||||
|
||||
private static void setGLColorFromInt(int color) {
|
||||
@@ -130,10 +126,10 @@ public class FluidRenderer {
|
||||
Tessellator tessellator = Tessellator.getInstance();
|
||||
BufferBuilder bufferBuilder = tessellator.getBuffer();
|
||||
bufferBuilder.begin(7, DefaultVertexFormats.POSITION_TEX);
|
||||
bufferBuilder.func_225582_a_(xCoord, yCoord + 16, zLevel).func_225583_a_((float) uMin, (float) vMax).endVertex();
|
||||
bufferBuilder.func_225582_a_(xCoord + 16 - maskRight, yCoord + 16, zLevel).func_225583_a_((float) uMax, (float) vMax).endVertex();
|
||||
bufferBuilder.func_225582_a_(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).func_225583_a_((float) uMax, (float) vMin).endVertex();
|
||||
bufferBuilder.func_225582_a_(xCoord, yCoord + maskTop, zLevel).func_225583_a_((float) uMin, (float) vMin).endVertex();
|
||||
bufferBuilder.pos(xCoord, yCoord + 16, zLevel).tex((float) uMin, (float) vMax).endVertex();
|
||||
bufferBuilder.pos(xCoord + 16 - maskRight, yCoord + 16, zLevel).tex((float) uMax, (float) vMax).endVertex();
|
||||
bufferBuilder.pos(xCoord + 16 - maskRight, yCoord + maskTop, zLevel).tex((float) uMax, (float) vMin).endVertex();
|
||||
bufferBuilder.pos(xCoord, yCoord + maskTop, zLevel).tex((float) uMin, (float) vMin).endVertex();
|
||||
tessellator.draw();
|
||||
}
|
||||
}
|
||||
|
@@ -8,7 +8,6 @@ import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Direction;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
@@ -37,6 +36,11 @@ public class DelegateBakedModel implements IBakedModel {
|
||||
return base.isGui3d();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_230044_c_() {
|
||||
return base.func_230044_c_();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
return base.isBuiltInRenderer();
|
||||
|
@@ -131,7 +131,7 @@ public class DiskManipulatorBakedModel extends DelegateBakedModel {
|
||||
|
||||
trans.add(0, -((6F / 16F) + (3F * y) / 16F), 0); // Remove from Y
|
||||
|
||||
model.transformation = new TransformationMatrix(trans, model.transformation.func_227989_d_(), model.transformation.getScale(), model.transformation.getRightRot());
|
||||
model.transformation = new TransformationMatrix(trans, model.transformation.getRotationLeft(), model.transformation.getScale(), model.transformation.getRightRot());
|
||||
|
||||
disks.get(facing).get(type).add(model);
|
||||
}
|
||||
|
@@ -51,7 +51,7 @@ public class FullbrightBakedModel extends DelegateBakedModel {
|
||||
for (int i = 0; i < quads.size(); ++i) {
|
||||
BakedQuad quad = quads.get(i);
|
||||
|
||||
if (textures.contains(quad.getSprite().getName())) {
|
||||
if (textures.contains(quad.func_187508_a().getName())) {
|
||||
quads.set(i, transformQuad(quad));
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,7 @@ public class FullbrightBakedModel extends DelegateBakedModel {
|
||||
vertexData,
|
||||
quad.getTintIndex(),
|
||||
quad.getFace(),
|
||||
quad.getSprite(),
|
||||
quad.func_187508_a(),
|
||||
quad.shouldApplyDiffuseLighting()
|
||||
);
|
||||
}
|
||||
|
@@ -58,6 +58,11 @@ public class PortableGridItemBakedModel implements IBakedModel {
|
||||
return base.isGui3d();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_230044_c_() {
|
||||
return base.func_230044_c_();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
return base.isBuiltInRenderer();
|
||||
|
@@ -10,9 +10,7 @@ import net.minecraft.client.renderer.model.ItemCameraTransforms;
|
||||
import net.minecraft.client.renderer.model.ItemOverrideList;
|
||||
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.client.model.ModelDataManager;
|
||||
import net.minecraftforge.client.model.data.EmptyModelData;
|
||||
import net.minecraftforge.client.model.data.ModelDataMap;
|
||||
import net.minecraftforge.client.model.pipeline.BakedQuadBuilder;
|
||||
import net.minecraftforge.client.model.pipeline.TRSRTransformer;
|
||||
import net.minecraftforge.common.model.TransformationHelper;
|
||||
@@ -69,7 +67,7 @@ public class TRSRBakedModel implements IBakedModel {
|
||||
}
|
||||
|
||||
for (BakedQuad quad : original.getQuads(state, side, rand, EmptyModelData.INSTANCE)) {
|
||||
BakedQuadBuilder builder = new BakedQuadBuilder(quad.getSprite());
|
||||
BakedQuadBuilder builder = new BakedQuadBuilder(quad.func_187508_a());
|
||||
TRSRTransformer transformer = new TRSRTransformer(builder, transformation.blockCenterToCorner());
|
||||
|
||||
quad.pipe(transformer);
|
||||
@@ -90,6 +88,11 @@ public class TRSRBakedModel implements IBakedModel {
|
||||
return original.isGui3d();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean func_230044_c_() {
|
||||
return original.func_230044_c_();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isBuiltInRenderer() {
|
||||
return original.isBuiltInRenderer();
|
||||
|
@@ -9,11 +9,11 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class PatternItemStackTileRenderer extends ItemStackTileEntityRenderer {
|
||||
@Override
|
||||
public void func_228364_a_(ItemStack stack, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int p_228364_4_, int p_228364_5_) {
|
||||
public void render(ItemStack stack, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int p_228364_4_, int p_228364_5_) {
|
||||
CraftingPattern pattern = PatternItem.fromCache(null, stack);
|
||||
|
||||
ItemStack outputStack = pattern.getOutputs().get(0);
|
||||
|
||||
outputStack.getItem().getTileEntityItemStackRenderer().func_228364_a_(outputStack, matrixStack, renderTypeBuffer, p_228364_4_, p_228364_5_);
|
||||
outputStack.getItem().getItemStackTileEntityRenderer().render(outputStack, matrixStack, renderTypeBuffer, p_228364_4_, p_228364_5_);
|
||||
}
|
||||
}
|
@@ -14,7 +14,6 @@ import net.minecraft.client.renderer.texture.OverlayTexture;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRenderer;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntityRendererDispatcher;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.math.Vec3d;
|
||||
import net.minecraftforge.common.model.TransformationHelper;
|
||||
|
||||
public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonitorTile> {
|
||||
@@ -23,7 +22,7 @@ public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonito
|
||||
}
|
||||
|
||||
@Override
|
||||
public void func_225616_a_(StorageMonitorTile tile, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int i, int i1) {
|
||||
public void render(StorageMonitorTile tile, float partialTicks, MatrixStack matrixStack, IRenderTypeBuffer renderTypeBuffer, int i, int i1) {
|
||||
Direction direction = Direction.NORTH;
|
||||
|
||||
BlockState state = tile.getWorld().getBlockState(tile.getPos());
|
||||
@@ -35,55 +34,55 @@ public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonito
|
||||
|
||||
if (tile.getItemStack() != null) {
|
||||
// Push
|
||||
matrixStack.func_227860_a_();
|
||||
matrixStack.push();
|
||||
|
||||
double r = Math.PI * (360 - direction.getOpposite().getHorizontalIndex() * 90) / 180d;
|
||||
|
||||
matrixStack.func_227861_a_(0.5D, 0.5D, 0.5D);
|
||||
matrixStack.func_227861_a_((float) direction.getXOffset() * 0.4F, 0, (float) direction.getZOffset() * 0.4F);
|
||||
matrixStack.func_227863_a_(TransformationHelper.quatFromXYZ(new Vector3f(0, (float) r, 0), false));
|
||||
matrixStack.translate(0.5D, 0.5D, 0.5D);
|
||||
matrixStack.translate((float) direction.getXOffset() * 0.8F, 0, (float) direction.getZOffset() * 0.8F);
|
||||
matrixStack.rotate(TransformationHelper.quatFromXYZ(new Vector3f(0, (float) r, 0), false));
|
||||
|
||||
matrixStack.func_227860_a_();
|
||||
matrixStack.func_227862_a_(0.5F, 0.5F, 0.5F);
|
||||
matrixStack.push();
|
||||
matrixStack.scale(0.5F, 0.5F, 0.5F);
|
||||
|
||||
Minecraft.getInstance().getItemRenderer().func_229110_a_(
|
||||
Minecraft.getInstance().getItemRenderer().renderItem(
|
||||
tile.getItemStack(),
|
||||
ItemCameraTransforms.TransformType.FIXED,
|
||||
0x00F000F0,
|
||||
OverlayTexture.field_229196_a_,
|
||||
OverlayTexture.DEFAULT_LIGHT,
|
||||
matrixStack,
|
||||
renderTypeBuffer
|
||||
);
|
||||
|
||||
matrixStack.func_227865_b_();
|
||||
matrixStack.pop();
|
||||
|
||||
// Pop
|
||||
matrixStack.func_227865_b_();
|
||||
matrixStack.pop();
|
||||
|
||||
// Push
|
||||
matrixStack.func_227860_a_();
|
||||
matrixStack.push();
|
||||
|
||||
float stringOffset = -(Minecraft.getInstance().fontRenderer.getStringWidth(amount) * 0.01F) / 2F;
|
||||
|
||||
matrixStack.func_227861_a_(0.5D, 0.5D, 0.5D);
|
||||
matrixStack.func_227861_a_(
|
||||
matrixStack.translate(0.5D, 0.5D, 0.5D);
|
||||
matrixStack.translate(
|
||||
((float) direction.getXOffset() * 0.5F) + (direction.getZOffset() * stringOffset),
|
||||
-0.225,
|
||||
((float) direction.getZOffset() * 0.5F) - (direction.getXOffset() * stringOffset)
|
||||
);
|
||||
|
||||
matrixStack.func_227863_a_(TransformationHelper.quatFromXYZ(new Vector3f(direction.getXOffset() * 180, 0, direction.getZOffset() * 180), true));
|
||||
matrixStack.func_227863_a_(TransformationHelper.quatFromXYZ(new Vector3f(0, (float) r, 0), false));
|
||||
matrixStack.rotate(TransformationHelper.quatFromXYZ(new Vector3f(direction.getXOffset() * 180, 0, direction.getZOffset() * 180), true));
|
||||
matrixStack.rotate(TransformationHelper.quatFromXYZ(new Vector3f(0, (float) r, 0), false));
|
||||
|
||||
matrixStack.func_227862_a_(0.01F, 0.01F, 0.01F);
|
||||
matrixStack.scale(0.01F, 0.01F, 0.01F);
|
||||
|
||||
Minecraft.getInstance().fontRenderer.func_228079_a_(
|
||||
Minecraft.getInstance().fontRenderer.renderString(
|
||||
amount,
|
||||
0,
|
||||
0,
|
||||
-1,
|
||||
false,
|
||||
matrixStack.func_227866_c_().func_227870_a_(),
|
||||
matrixStack.getLast().getPositionMatrix(),
|
||||
renderTypeBuffer,
|
||||
false,
|
||||
0,
|
||||
@@ -91,7 +90,7 @@ public class StorageMonitorTileRenderer extends TileEntityRenderer<StorageMonito
|
||||
);
|
||||
|
||||
// Pop
|
||||
matrixStack.func_227865_b_();
|
||||
matrixStack.pop();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.raoulvdberge.refinedstorage.screen;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.apiimpl.API;
|
||||
@@ -10,14 +9,14 @@ import com.raoulvdberge.refinedstorage.integration.craftingtweaks.CraftingTweaks
|
||||
import com.raoulvdberge.refinedstorage.render.FluidRenderer;
|
||||
import com.raoulvdberge.refinedstorage.render.RenderSettings;
|
||||
import com.raoulvdberge.refinedstorage.screen.grid.AlternativesScreen;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckBoxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckboxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.SideButton;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.screen.inventory.ContainerScreen;
|
||||
import net.minecraft.client.gui.widget.Widget;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.gui.widget.button.CheckboxButton;
|
||||
import net.minecraft.client.settings.KeyBinding;
|
||||
import net.minecraft.client.util.InputMappings;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
@@ -29,7 +28,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.TranslationTextComponent;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@@ -244,8 +243,8 @@ public abstract class BaseScreen<T extends Container> extends ContainerScreen<T>
|
||||
}
|
||||
}
|
||||
|
||||
public CheckBoxWidget addCheckBox(int x, int y, String text, boolean checked, Button.IPressable onPress) {
|
||||
CheckBoxWidget checkBox = new CheckBoxWidget(x, y, text, checked, onPress);
|
||||
public CheckboxWidget addCheckBox(int x, int y, String text, boolean checked, Consumer<CheckboxButton> onPress) {
|
||||
CheckboxWidget checkBox = new CheckboxWidget(x, y, text, checked, onPress);
|
||||
|
||||
this.addButton(checkBox);
|
||||
|
||||
@@ -344,7 +343,7 @@ public abstract class BaseScreen<T extends Container> extends ContainerScreen<T>
|
||||
}
|
||||
|
||||
public static boolean isKeyDown(KeyBinding keybinding) {
|
||||
return InputMappings.isKeyDown(Minecraft.getInstance().func_228018_at_().getHandle(), keybinding.getKey().getKeyCode()) &&
|
||||
return InputMappings.isKeyDown(Minecraft.getInstance().getMainWindow().getHandle(), keybinding.getKey().getKeyCode()) &&
|
||||
keybinding.getKeyConflictContext().isActive() &&
|
||||
keybinding.getKeyModifier().isActive(keybinding.getKeyConflictContext());
|
||||
}
|
||||
|
@@ -18,11 +18,10 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.inventory.container.Slot;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import yalter.mousetweaks.api.MouseTweaksDisableWheelTweak;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
@MouseTweaksDisableWheelTweak
|
||||
// TODO @MouseTweaksDisableWheelTweak
|
||||
public class CrafterManagerScreen extends BaseScreen<CrafterManagerContainer> implements IScreenInfoProvider {
|
||||
private CrafterManagerNetworkNode crafterManager;
|
||||
|
||||
@@ -56,7 +55,7 @@ public class CrafterManagerScreen extends BaseScreen<CrafterManagerContainer> im
|
||||
|
||||
if (searchField == null) {
|
||||
searchField = new SearchWidget(font, sx, sy, 88 - 6);
|
||||
searchField.func_212954_a(value -> {
|
||||
searchField.setResponder(value -> {
|
||||
searchField.updateJei();
|
||||
|
||||
container.initSlots(null);
|
||||
@@ -152,7 +151,7 @@ public class CrafterManagerScreen extends BaseScreen<CrafterManagerContainer> im
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int key, int scanCode, int modifiers) {
|
||||
if (searchField.keyPressed(key, scanCode, modifiers) || searchField.func_212955_f()) {
|
||||
if (searchField.keyPressed(key, scanCode, modifiers) || searchField.canWrite()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -36,7 +36,7 @@ public class DetectorScreen extends BaseScreen<DetectorContainer> {
|
||||
amountField.setCanLoseFocus(true);
|
||||
amountField.setFocused2(false);
|
||||
amountField.setTextColor(RenderSettings.INSTANCE.getSecondaryColor());
|
||||
amountField.func_212954_a(value -> {
|
||||
amountField.setResponder(value -> {
|
||||
try {
|
||||
int result = Integer.parseInt(value);
|
||||
|
||||
@@ -74,7 +74,7 @@ public class DetectorScreen extends BaseScreen<DetectorContainer> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (amountField.keyPressed(key, scanCode, modifiers) || amountField.func_212955_f()) {
|
||||
if (amountField.keyPressed(key, scanCode, modifiers) || amountField.canWrite()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -7,6 +7,7 @@ import com.raoulvdberge.refinedstorage.container.FilterContainer;
|
||||
import com.raoulvdberge.refinedstorage.item.FilterItem;
|
||||
import com.raoulvdberge.refinedstorage.network.FilterUpdateMessage;
|
||||
import com.raoulvdberge.refinedstorage.render.RenderSettings;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckboxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.FilterTypeSideButton;
|
||||
import net.minecraft.client.gui.widget.TextFieldWidget;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
@@ -14,7 +15,6 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.config.GuiCheckBox;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
public class FilterScreen extends BaseScreen<FilterContainer> {
|
||||
@@ -26,7 +26,7 @@ public class FilterScreen extends BaseScreen<FilterContainer> {
|
||||
private String name;
|
||||
private int type;
|
||||
|
||||
private GuiCheckBox modFilterCheckBox;
|
||||
private CheckboxWidget modFilterCheckBox;
|
||||
private Button modeButton;
|
||||
private TextFieldWidget nameField;
|
||||
|
||||
@@ -73,7 +73,7 @@ public class FilterScreen extends BaseScreen<FilterContainer> {
|
||||
nameField.setCanLoseFocus(true);
|
||||
nameField.setFocused2(false);
|
||||
nameField.setTextColor(RenderSettings.INSTANCE.getSecondaryColor());
|
||||
nameField.func_212954_a(name -> sendUpdate());
|
||||
nameField.setResponder(name -> sendUpdate());
|
||||
|
||||
addButton(nameField);
|
||||
|
||||
@@ -96,7 +96,7 @@ public class FilterScreen extends BaseScreen<FilterContainer> {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (nameField.keyPressed(key, scanCode, modifiers) || nameField.func_212955_f()) {
|
||||
if (nameField.keyPressed(key, scanCode, modifiers) || nameField.canWrite()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -5,6 +5,7 @@ import com.raoulvdberge.refinedstorage.api.network.security.Permission;
|
||||
import com.raoulvdberge.refinedstorage.container.SecurityManagerContainer;
|
||||
import com.raoulvdberge.refinedstorage.item.SecurityCardItem;
|
||||
import com.raoulvdberge.refinedstorage.network.SecurityManagerUpdateMessage;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckboxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.sidebutton.RedstoneModeSideButton;
|
||||
import com.raoulvdberge.refinedstorage.tile.SecurityManagerTile;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
@@ -12,11 +13,10 @@ import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.config.GuiCheckBox;
|
||||
|
||||
public class SecurityManagerScreen extends BaseScreen<SecurityManagerContainer> {
|
||||
private final SecurityManagerTile securityManager;
|
||||
private GuiCheckBox[] permissions = new GuiCheckBox[Permission.values().length];
|
||||
private CheckboxWidget[] permissions = new CheckboxWidget[Permission.values().length];
|
||||
|
||||
public SecurityManagerScreen(SecurityManagerContainer container, PlayerInventory inventory, ITextComponent title) {
|
||||
super(container, 176, 234, inventory, title);
|
||||
@@ -47,7 +47,7 @@ public class SecurityManagerScreen extends BaseScreen<SecurityManagerContainer>
|
||||
ItemStack card = securityManager.getNode().getEditCard().getStackInSlot(0);
|
||||
|
||||
for (Permission permission : Permission.values()) {
|
||||
permissions[permission.getId()].setIsChecked(!card.isEmpty() && SecurityCardItem.hasPermission(card, permission));
|
||||
permissions[permission.getId()].setChecked(!card.isEmpty() && SecurityCardItem.hasPermission(card, permission));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -65,7 +65,7 @@ public class SecurityManagerScreen extends BaseScreen<SecurityManagerContainer>
|
||||
renderString(7, 140, I18n.format("container.inventory"));
|
||||
|
||||
for (int i = 0; i < permissions.length; ++i) {
|
||||
GuiCheckBox permission = permissions[i];
|
||||
CheckboxWidget permission = permissions[i];
|
||||
|
||||
if (RenderUtils.inBounds(permission.x - guiLeft, permission.y - guiTop, permission.getWidth(), permission.getHeight(), mouseX, mouseY)) {
|
||||
renderTooltip(mouseX, mouseY, I18n.format("gui.refinedstorage.security_manager.permission." + i + ".tooltip"));
|
||||
|
@@ -5,7 +5,7 @@ import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.container.AlternativesContainer;
|
||||
import com.raoulvdberge.refinedstorage.render.FluidRenderer;
|
||||
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckBoxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckboxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.ScrollbarWidget;
|
||||
import com.raoulvdberge.refinedstorage.tile.config.IType;
|
||||
import com.raoulvdberge.refinedstorage.tile.data.TileDataManager;
|
||||
@@ -13,7 +13,6 @@ import com.raoulvdberge.refinedstorage.tile.grid.GridTile;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import net.minecraft.client.gui.screen.Screen;
|
||||
import net.minecraft.client.gui.widget.button.Button;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerEntity;
|
||||
import net.minecraft.fluid.Fluid;
|
||||
@@ -98,14 +97,14 @@ public class AlternativesScreen extends BaseScreen {
|
||||
} else if (fluid != null) {
|
||||
lines.add(new FluidLine(fluid));
|
||||
|
||||
for (ResourceLocation owningTag : FluidTags.func_226157_a_().getOwningTags(fluid.getFluid())) {
|
||||
for (ResourceLocation owningTag : FluidTags.getCollection().getOwningTags(fluid.getFluid())) {
|
||||
lines.add(new TagLine(owningTag, GridTile.ALLOWED_FLUID_TAGS.getValue().get(slot).contains(owningTag)));
|
||||
|
||||
int fluidCount = 0;
|
||||
|
||||
FluidListLine line = new FluidListLine();
|
||||
|
||||
for (Fluid fluid : FluidTags.func_226157_a_().get(owningTag).getAllElements()) {
|
||||
for (Fluid fluid : FluidTags.getCollection().get(owningTag).getAllElements()) {
|
||||
if (fluidCount > 0 && fluidCount % 8 == 0) {
|
||||
lines.add(line);
|
||||
line = new FluidListLine();
|
||||
@@ -304,7 +303,7 @@ public class AlternativesScreen extends BaseScreen {
|
||||
|
||||
private class TagLine implements Line {
|
||||
private final ResourceLocation tagName;
|
||||
private final CheckBoxWidget widget;
|
||||
private final CheckboxWidget widget;
|
||||
|
||||
public TagLine(ResourceLocation tagName, boolean checked) {
|
||||
this.tagName = tagName;
|
||||
|
@@ -1,7 +1,6 @@
|
||||
package com.raoulvdberge.refinedstorage.screen.grid;
|
||||
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import com.raoulvdberge.refinedstorage.RS;
|
||||
import com.raoulvdberge.refinedstorage.RSKeyBindings;
|
||||
@@ -20,6 +19,7 @@ import com.raoulvdberge.refinedstorage.screen.grid.stack.ItemGridStack;
|
||||
import com.raoulvdberge.refinedstorage.screen.grid.view.FluidGridView;
|
||||
import com.raoulvdberge.refinedstorage.screen.grid.view.IGridView;
|
||||
import com.raoulvdberge.refinedstorage.screen.grid.view.ItemGridView;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.CheckboxWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.ScrollbarWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.SearchWidget;
|
||||
import com.raoulvdberge.refinedstorage.screen.widget.TabListWidget;
|
||||
@@ -31,13 +31,11 @@ import com.raoulvdberge.refinedstorage.tile.grid.portable.PortableGridTile;
|
||||
import com.raoulvdberge.refinedstorage.util.RenderUtils;
|
||||
import com.raoulvdberge.refinedstorage.util.TimeUtils;
|
||||
import net.minecraft.client.audio.SimpleSound;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.PlayerInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.SoundEvents;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraftforge.fml.client.config.GuiCheckBox;
|
||||
import org.lwjgl.glfw.GLFW;
|
||||
|
||||
import java.util.LinkedList;
|
||||
@@ -47,8 +45,8 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
||||
private IGridView view;
|
||||
|
||||
private SearchWidget searchField;
|
||||
private GuiCheckBox exactPattern;
|
||||
private GuiCheckBox processingPattern;
|
||||
private CheckboxWidget exactPattern;
|
||||
private CheckboxWidget processingPattern;
|
||||
|
||||
private ScrollbarWidget scrollbar;
|
||||
|
||||
@@ -104,7 +102,7 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
||||
|
||||
if (searchField == null) {
|
||||
searchField = new SearchWidget(font, sx, sy, 88 - 6);
|
||||
searchField.func_212954_a(value -> {
|
||||
searchField.setResponder(value -> {
|
||||
searchField.updateJei();
|
||||
|
||||
getView().sort(); // Use getter since this view can be replaced.
|
||||
@@ -137,7 +135,13 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
||||
});
|
||||
|
||||
if (!processingPattern.isChecked()) {
|
||||
exactPattern = addCheckBox(processingPattern.x + processingPattern.getWidth() + 5, y + getTopHeight() + (getVisibleRows() * 18) + 60, I18n.format("misc.refinedstorage.exact"), GridTile.EXACT_PATTERN.getValue(), btn -> TileDataManager.setParameter(GridTile.EXACT_PATTERN, exactPattern.isChecked()));
|
||||
exactPattern = addCheckBox(
|
||||
processingPattern.x + processingPattern.getWidth() + 5,
|
||||
y + getTopHeight() + (getVisibleRows() * 18) + 60,
|
||||
I18n.format("misc.refinedstorage.exact"),
|
||||
GridTile.EXACT_PATTERN.getValue(),
|
||||
btn -> TileDataManager.setParameter(GridTile.EXACT_PATTERN, exactPattern.isChecked())
|
||||
);
|
||||
}
|
||||
|
||||
addSideButton(new TypeSideButton(this, GridTile.PROCESSING_TYPE));
|
||||
@@ -538,7 +542,7 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
||||
|
||||
@Override
|
||||
public boolean keyPressed(int key, int scanCode, int modifiers) {
|
||||
if (searchField.keyPressed(key, scanCode, modifiers) || searchField.func_212955_f()) {
|
||||
if (searchField.keyPressed(key, scanCode, modifiers) || searchField.canWrite()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -551,7 +555,7 @@ public class GridScreen extends BaseScreen<GridContainer> implements IScreenInfo
|
||||
|
||||
public void updateExactPattern(boolean checked) {
|
||||
if (exactPattern != null) {
|
||||
exactPattern.setIsChecked(checked);
|
||||
exactPattern.setChecked(checked);
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -120,7 +120,7 @@ public class FluidGridStack implements IGridStack {
|
||||
if (cachedTags == null) {
|
||||
cachedTags = new HashSet<>();
|
||||
|
||||
for (ResourceLocation owningTag : FluidTags.func_226157_a_().getOwningTags(stack.getFluid())) {
|
||||
for (ResourceLocation owningTag : FluidTags.getCollection().getOwningTags(stack.getFluid())) {
|
||||
cachedTags.add(owningTag.getPath());
|
||||
}
|
||||
}
|
||||
|
@@ -1,58 +0,0 @@
|
||||
package com.raoulvdberge.refinedstorage.screen.widget;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraftforge.fml.client.config.GuiCheckBox;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
|
||||
// @Volatile: Copied from Forge 1.12. Remove this if GuiCheckBox gets ported over correctly.
|
||||
public class CheckBoxWidget extends GuiCheckBox {
|
||||
private static final int BOX_WIDTH = 13;
|
||||
|
||||
private IPressable onPress;
|
||||
private String displayString;
|
||||
private boolean shadow = true;
|
||||
|
||||
public CheckBoxWidget(int xPos, int yPos, String displayString, boolean isChecked, IPressable onPress) {
|
||||
super(xPos, yPos, displayString, isChecked);
|
||||
|
||||
this.onPress = onPress;
|
||||
this.displayString = displayString;
|
||||
this.width = Minecraft.getInstance().fontRenderer.getStringWidth(displayString) + BOX_WIDTH + 3;
|
||||
}
|
||||
|
||||
public void setShadow(boolean shadow) {
|
||||
this.shadow = shadow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(int mouseX, int mouseY, float partial) {
|
||||
if (visible) {
|
||||
GuiUtils.drawContinuousTexturedBox(WIDGETS_LOCATION, x, y, 0, 46, BOX_WIDTH, height, 200, 20, 2, 3, 2, 2, 0);
|
||||
|
||||
int color = 14737632;
|
||||
|
||||
if (!active) {
|
||||
color = 10526880;
|
||||
} else if (packedFGColor != 0) {
|
||||
color = packedFGColor;
|
||||
}
|
||||
|
||||
if (isChecked()) {
|
||||
drawCenteredString(Minecraft.getInstance().fontRenderer, "x", x + BOX_WIDTH / 2 + 1, y + 1, 14737632);
|
||||
}
|
||||
|
||||
if (!shadow) {
|
||||
Minecraft.getInstance().fontRenderer.drawString(displayString, x + BOX_WIDTH + 2, y + 2, color);
|
||||
} else {
|
||||
Minecraft.getInstance().fontRenderer.drawStringWithShadow(displayString, x + BOX_WIDTH + 2, y + 2, color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPress() {
|
||||
super.onPress();
|
||||
|
||||
onPress.onPress(this);
|
||||
}
|
||||
}
|
@@ -0,0 +1,74 @@
|
||||
package com.raoulvdberge.refinedstorage.screen.widget;
|
||||
|
||||
import com.mojang.blaze3d.platform.GlStateManager;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.widget.button.CheckboxButton;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
||||
public class CheckboxWidget extends CheckboxButton {
|
||||
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/gui/checkbox.png");
|
||||
private static final int BOX_WIDTH = 13;
|
||||
|
||||
private final Consumer<CheckboxButton> onPress;
|
||||
private boolean shadow = true;
|
||||
|
||||
public CheckboxWidget(int x, int y, String text, boolean isChecked, Consumer<CheckboxButton> onPress) {
|
||||
super(
|
||||
x,
|
||||
y,
|
||||
Minecraft.getInstance().fontRenderer.getStringWidth(text) + BOX_WIDTH,
|
||||
10,
|
||||
text,
|
||||
isChecked
|
||||
);
|
||||
|
||||
this.onPress = onPress;
|
||||
}
|
||||
|
||||
public void setShadow(boolean shadow) {
|
||||
this.shadow = shadow;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPress() {
|
||||
super.onPress();
|
||||
|
||||
this.onPress.accept(this);
|
||||
}
|
||||
|
||||
public void setChecked(boolean value) {
|
||||
this.checked = value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderButton(int p_renderButton_1_, int p_renderButton_2_, float p_renderButton_3_) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
mc.getTextureManager().bindTexture(TEXTURE);
|
||||
RenderSystem.enableDepthTest();
|
||||
FontRenderer fontRenderer = mc.fontRenderer;
|
||||
RenderSystem.color4f(1.0F, 1.0F, 1.0F, this.alpha);
|
||||
RenderSystem.enableBlend();
|
||||
RenderSystem.defaultBlendFunc();
|
||||
RenderSystem.blendFunc(GlStateManager.SourceFactor.SRC_ALPHA, GlStateManager.DestFactor.ONE_MINUS_SRC_ALPHA);
|
||||
blit(this.x, this.y, 0.0F, this.checked ? 10.0F : 0.0F, 10, this.height, 16, 32);
|
||||
this.renderBg(mc, p_renderButton_1_, p_renderButton_2_);
|
||||
|
||||
int color = 14737632;
|
||||
|
||||
if (!active) {
|
||||
color = 10526880;
|
||||
} else if (packedFGColor != 0) {
|
||||
color = packedFGColor;
|
||||
}
|
||||
|
||||
if (shadow) {
|
||||
super.drawString(fontRenderer, this.getMessage(), this.x + 13, this.y + (this.height - 8) / 2, color);
|
||||
} else {
|
||||
fontRenderer.drawString(this.getMessage(), this.x + 13, this.y + (this.height - 8) / 2F, color);
|
||||
}
|
||||
}
|
||||
}
|
@@ -216,30 +216,28 @@ public class ClientSetup {
|
||||
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_WIRELESS_CRAFTING_MONITOR);
|
||||
ClientRegistry.registerKeyBinding(RSKeyBindings.OPEN_PORTABLE_GRID);
|
||||
|
||||
RenderType cutout = RenderType.func_228643_e_();
|
||||
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CONTROLLER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CREATIVE_CONTROLLER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CABLE, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTER_MANAGER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTING_MONITOR, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.DETECTOR, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.DISK_MANIPULATOR, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.GRID, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTING_GRID, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.PATTERN_GRID, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.FLUID_GRID, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.NETWORK_RECEIVER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.NETWORK_TRANSMITTER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.RELAY, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.SECURITY_MANAGER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.WIRELESS_TRANSMITTER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.IMPORTER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.EXPORTER, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.EXTERNAL_STORAGE, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CONSTRUCTOR, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.DESTRUCTOR, cutout);
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CONTROLLER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CREATIVE_CONTROLLER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CABLE, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTER_MANAGER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTING_MONITOR, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.DETECTOR, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.DISK_MANIPULATOR, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.GRID, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CRAFTING_GRID, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.PATTERN_GRID, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.FLUID_GRID, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.NETWORK_RECEIVER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.NETWORK_TRANSMITTER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.RELAY, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.SECURITY_MANAGER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.WIRELESS_TRANSMITTER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.IMPORTER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.EXPORTER, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.EXTERNAL_STORAGE, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.CONSTRUCTOR, RenderType.cutout());
|
||||
RenderTypeLookup.setRenderLayer(RSBlocks.DESTRUCTOR, RenderType.cutout());
|
||||
|
||||
ClientRegistry.bindTileEntityRenderer(RSTiles.STORAGE_MONITOR, StorageMonitorTileRenderer::new);
|
||||
|
||||
|
@@ -106,7 +106,7 @@ public class DiskDriveTile extends NetworkNodeTile<DiskDriveNetworkNode> {
|
||||
ListNBT list = new ListNBT();
|
||||
|
||||
for (DiskState state : getNode().getDiskState()) {
|
||||
list.add(IntNBT.func_229692_a_(state.ordinal()));
|
||||
list.add(IntNBT.valueOf(state.ordinal()));
|
||||
}
|
||||
|
||||
tag.put(NBT_DISK_STATE, list);
|
||||
|
@@ -63,7 +63,7 @@ public class DiskManipulatorTile extends NetworkNodeTile<DiskManipulatorNetworkN
|
||||
ListNBT list = new ListNBT();
|
||||
|
||||
for (DiskState state : getNode().getDiskState()) {
|
||||
list.add(IntNBT.func_229692_a_(state.ordinal()));
|
||||
list.add(IntNBT.valueOf(state.ordinal()));
|
||||
}
|
||||
|
||||
tag.put(NBT_DISK_STATE, list);
|
||||
|
@@ -1,6 +1,5 @@
|
||||
package com.raoulvdberge.refinedstorage.util;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.google.common.collect.Lists;
|
||||
import com.mojang.blaze3d.matrix.MatrixStack;
|
||||
import com.mojang.blaze3d.systems.RenderSystem;
|
||||
@@ -10,20 +9,18 @@ import com.raoulvdberge.refinedstorage.render.Styles;
|
||||
import com.raoulvdberge.refinedstorage.screen.BaseScreen;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.*;
|
||||
import net.minecraft.client.renderer.vertex.DefaultVertexFormats;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormat;
|
||||
import net.minecraft.client.renderer.vertex.VertexFormatElement;
|
||||
import net.minecraft.client.renderer.IRenderTypeBuffer;
|
||||
import net.minecraft.client.renderer.Matrix4f;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.util.ITooltipFlag;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.text.ITextComponent;
|
||||
import net.minecraft.util.text.StringTextComponent;
|
||||
import net.minecraft.util.text.TextFormatting;
|
||||
import net.minecraftforge.client.event.RenderTooltipEvent;
|
||||
import net.minecraftforge.common.ForgeConfig;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fml.client.config.GuiUtils;
|
||||
import net.minecraftforge.fml.client.gui.GuiUtils;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.ArrayList;
|
||||
@@ -109,8 +106,7 @@ public final class RenderUtils {
|
||||
float textScale = Minecraft.getInstance().getForceUnicodeFont() ? 1F : 0.7F;
|
||||
// RS end
|
||||
|
||||
if (!textLines.isEmpty())
|
||||
{
|
||||
if (!textLines.isEmpty()) {
|
||||
RenderTooltipEvent.Pre event = new RenderTooltipEvent.Pre(stack, textLines, mouseX, mouseY, screenWidth, screenHeight, maxTextWidth, font);
|
||||
if (MinecraftForge.EVENT_BUS.post(event))
|
||||
return;
|
||||
@@ -125,8 +121,7 @@ public final class RenderUtils {
|
||||
RenderSystem.disableDepthTest();
|
||||
int tooltipTextWidth = 0;
|
||||
|
||||
for (String textLine : textLines)
|
||||
{
|
||||
for (String textLine : textLines) {
|
||||
int textLineWidth = font.getStringWidth(textLine);
|
||||
if (textLineWidth > tooltipTextWidth)
|
||||
tooltipTextWidth = textLineWidth;
|
||||
@@ -148,8 +143,7 @@ public final class RenderUtils {
|
||||
|
||||
int titleLinesCount = 1;
|
||||
int tooltipX = mouseX + 12;
|
||||
if (tooltipX + tooltipTextWidth + 4 > screenWidth)
|
||||
{
|
||||
if (tooltipX + tooltipTextWidth + 4 > screenWidth) {
|
||||
tooltipX = mouseX - 16 - tooltipTextWidth;
|
||||
if (tooltipX < 4) // if the tooltip doesn't fit on the screen
|
||||
{
|
||||
@@ -161,25 +155,21 @@ public final class RenderUtils {
|
||||
}
|
||||
}
|
||||
|
||||
if (maxTextWidth > 0 && tooltipTextWidth > maxTextWidth)
|
||||
{
|
||||
if (maxTextWidth > 0 && tooltipTextWidth > maxTextWidth) {
|
||||
tooltipTextWidth = maxTextWidth;
|
||||
needsWrap = true;
|
||||
}
|
||||
|
||||
if (needsWrap)
|
||||
{
|
||||
if (needsWrap) {
|
||||
int wrappedTooltipWidth = 0;
|
||||
List<String> wrappedTextLines = new ArrayList<String>();
|
||||
for (int i = 0; i < textLines.size(); i++)
|
||||
{
|
||||
for (int i = 0; i < textLines.size(); i++) {
|
||||
String textLine = textLines.get(i);
|
||||
List<String> wrappedLine = font.listFormattedStringToWidth(textLine, tooltipTextWidth);
|
||||
if (i == 0)
|
||||
titleLinesCount = wrappedLine.size();
|
||||
|
||||
for (String line : wrappedLine)
|
||||
{
|
||||
for (String line : wrappedLine) {
|
||||
int lineWidth = font.getStringWidth(line);
|
||||
if (lineWidth > wrappedTooltipWidth)
|
||||
wrappedTooltipWidth = lineWidth;
|
||||
@@ -198,8 +188,7 @@ public final class RenderUtils {
|
||||
int tooltipY = mouseY - 12;
|
||||
int tooltipHeight = 8;
|
||||
|
||||
if (textLines.size() > 1)
|
||||
{
|
||||
if (textLines.size() > 1) {
|
||||
tooltipHeight += (textLines.size() - 1) * 10;
|
||||
if (textLines.size() > titleLinesCount)
|
||||
tooltipHeight += 2; // gap between title lines and next lines
|
||||
@@ -238,18 +227,17 @@ public final class RenderUtils {
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostBackground(stack, textLines, tooltipX, tooltipY, font, tooltipTextWidth, tooltipHeight));
|
||||
|
||||
IRenderTypeBuffer.Impl renderType = IRenderTypeBuffer.func_228455_a_(Tessellator.getInstance().getBuffer());
|
||||
IRenderTypeBuffer.Impl renderType = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer());
|
||||
MatrixStack textStack = new MatrixStack();
|
||||
textStack.func_227861_a_(0.0D, 0.0D, (double)zLevel);
|
||||
Matrix4f textLocation = textStack.func_227866_c_().func_227870_a_();
|
||||
textStack.translate(0.0D, 0.0D, (double) zLevel);
|
||||
Matrix4f textLocation = textStack.getLast().getPositionMatrix();
|
||||
|
||||
int tooltipTop = tooltipY;
|
||||
|
||||
for (int lineNumber = 0; lineNumber < textLines.size(); ++lineNumber)
|
||||
{
|
||||
for (int lineNumber = 0; lineNumber < textLines.size(); ++lineNumber) {
|
||||
String line = textLines.get(lineNumber);
|
||||
if (line != null)
|
||||
font.func_228079_a_(line, (float)tooltipX, (float)tooltipY, -1, true, textLocation, renderType, false, 0, 15728880);
|
||||
font.renderString(line, (float) tooltipX, (float) tooltipY, -1, true, textLocation, renderType, false, 0, 15728880);
|
||||
|
||||
if (lineNumber + 1 == titleLinesCount)
|
||||
tooltipY += 2;
|
||||
@@ -257,7 +245,7 @@ public final class RenderUtils {
|
||||
tooltipY += 10;
|
||||
}
|
||||
|
||||
renderType.func_228461_a_();
|
||||
renderType.finish();
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new RenderTooltipEvent.PostText(stack, textLines, tooltipX, tooltipTop, font, tooltipTextWidth, tooltipHeight));
|
||||
|
||||
@@ -272,24 +260,24 @@ public final class RenderUtils {
|
||||
|
||||
// FontRenderer#drawStringWithShadow - call to func_228078_a_ (private)
|
||||
MatrixStack smallTextStack = new MatrixStack();
|
||||
smallTextStack.func_227861_a_(0.0D, 0.0D, (double)zLevel);
|
||||
smallTextStack.func_227862_a_(textScale, textScale, 1);
|
||||
smallTextStack.translate(0.0D, 0.0D, (double) zLevel);
|
||||
smallTextStack.scale(textScale, textScale, 1);
|
||||
|
||||
IRenderTypeBuffer.Impl lvt_7_1_ = IRenderTypeBuffer.func_228455_a_(Tessellator.getInstance().getBuffer());
|
||||
font.func_228079_a_(
|
||||
IRenderTypeBuffer.Impl lvt_7_1_ = IRenderTypeBuffer.getImpl(Tessellator.getInstance().getBuffer());
|
||||
font.renderString(
|
||||
TextFormatting.GRAY + smallTextLines.get(i),
|
||||
RenderUtils.getOffsetOnScale(tooltipX, textScale),
|
||||
RenderUtils.getOffsetOnScale(y - (Minecraft.getInstance().getForceUnicodeFont() ? 2 : 0), textScale),
|
||||
-1,
|
||||
true,
|
||||
smallTextStack.func_227866_c_().func_227870_a_(),
|
||||
smallTextStack.getLast().getPositionMatrix(),
|
||||
lvt_7_1_,
|
||||
false,
|
||||
0,
|
||||
15728880
|
||||
);
|
||||
|
||||
lvt_7_1_.func_228461_a_();
|
||||
lvt_7_1_.finish();
|
||||
|
||||
y -= 9;
|
||||
}
|
||||
|
@@ -1,3 +1,4 @@
|
||||
protected net.minecraft.inventory.container.Container field_75153_a # inventoryItemStacks
|
||||
protected net.minecraft.inventory.container.Container field_75149_d # listeners
|
||||
protected net.minecraft.client.gui.widget.TextFieldWidget field_146212_n # canLoseFocus
|
||||
public net.minecraft.client.gui.widget.button.CheckboxButton field_212943_a # checked
|
||||
|
@@ -1,5 +1,5 @@
|
||||
modLoader="javafml"
|
||||
loaderVersion="[30,)"
|
||||
loaderVersion="[31,)"
|
||||
issueTrackerURL="https://github.com/raoulvdberge/refinedstorage"
|
||||
[[mods]]
|
||||
modId="refinedstorage"
|
||||
|
Reference in New Issue
Block a user