Fix JABBA-related issues with crafting station slots (#54)

* Fix shift-merging tools voiding items

fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/11392>

* Change 0-sized ItemStacks into null stacks in crafting station attached slots

Fixes <https://github.com/GTNewHorizons/GT-New-Horizons-Modpack/issues/10425>

* Update buildscript

* spotlessApply
This commit is contained in:
Raven Szewczyk authored and GitHub committed 2022-09-22 20:51:23 +02:00
1 parent 18bfeaff32
commit 39be06c23b
571 files changed
+25959 -28223

No files matched your search

@@ -5,9 +5,7 @@ import net.minecraft.client.renderer.entity.*;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.*;
import net.minecraft.tileentity.TileEntity;
import org.lwjgl.opengl.GL11;
import tconstruct.library.ItemBlocklike;
import tconstruct.smeltery.TinkerSmeltery;
import tconstruct.smeltery.logic.CastingTableLogic;
@@ -16,17 +14,14 @@ import tconstruct.tools.entity.FancyEntityItem;
/* Special renderer, only used for drawing tools */
@SideOnly(Side.CLIENT)
public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
{
public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer {
@Override
public void renderTileEntityAt (TileEntity logic, double var2, double var4, double var6, float var8)
{
public void renderTileEntityAt(TileEntity logic, double var2, double var4, double var6, float var8) {
// TConstruct.logger.info("Render!!!");
this.render((CastingTableLogic) logic, var2, var4, var6, var8);
}
public void render (CastingTableLogic logic, double posX, double posY, double posZ, float var8)
{
public void render(CastingTableLogic logic, double posX, double posY, double posZ, float var8) {
GL11.glPushMatrix();
float var10 = (float) (posX - 0.5F);
float var11 = (float) (posY - 0.5F);
@@ -36,21 +31,17 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
GL11.glPopMatrix();
}
private void func_82402_b (CastingTableLogic logic)
{
private void func_82402_b(CastingTableLogic logic) {
ItemStack stack = logic.getStackInSlot(0);
if (stack != null)
renderItem(logic, stack);
if (stack != null) renderItem(logic, stack);
stack = logic.getStackInSlot(1);
if (stack != null)
renderItem(logic, stack);
if (stack != null) renderItem(logic, stack);
}
void renderItem (CastingTableLogic logic, ItemStack stack)
{
void renderItem(CastingTableLogic logic, ItemStack stack) {
FancyEntityItem entityitem = new FancyEntityItem(logic.getWorldObj(), 0.0D, 0.0D, 0.0D, stack);
entityitem.getEntityItem().stackSize = 1;
entityitem.hoverStart = 0.0F;
@@ -58,17 +49,15 @@ public class CastingTableSpecialRenderer extends TileEntitySpecialRenderer
GL11.glTranslatef(1F, 1.48F, 0.55F);
GL11.glRotatef(90F, 1, 0F, 0F);
GL11.glScalef(2F, 2F, 2F);
if (stack.getItem() instanceof ItemBlock || stack.getItem() instanceof ItemBlocklike)
{
if (stack.getItem() instanceof ItemBlock || stack.getItem() instanceof ItemBlocklike) {
GL11.glRotatef(90F, -1, 0F, 0F);
GL11.glTranslatef(0F, -0.1F, 0.2275F);
}
if (stack.isItemEqual(new ItemStack(TinkerSmeltery.glassPane)))
{
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glTranslatef(0F, -0.194F, -0.1F);
GL11.glScalef(0.85F, 0.85F, 0.85F);
if (stack.isItemEqual(new ItemStack(TinkerSmeltery.glassPane))) {
GL11.glRotatef(90F, 1F, 0F, 0F);
GL11.glTranslatef(0F, -0.194F, -0.1F);
GL11.glScalef(0.85F, 0.85F, 0.85F);
}
RenderItem.renderInFrame = true;