Compare commits

..
Author SHA1 Message Date
229e4bcaa9 lots of building blocks + a large backport of architect's palette content (#95) (#112)
* more album blocks

* rocks and such

* spootless

* gemz

* gemz

* architect's palette

* spotle-who the hell is playing the goldship song

* optimize images

---------



(cherry picked from commit 9c00a7d61f)

Co-authored-by: June <[email protected]>
Co-authored-by: Algent <[email protected]>
Co-authored-by: UltraProdigy <[email protected]>
2026-11-20 21:27:46 +01:00
boubou19andDarkShadow44 6163776962 Little Tiles support (#107) (#111)
* Refactor: Extract "matches" as method and use early exit

* Extend API to allow Little Tiles support

* Render little tiles with partial textures

* spotless

* Fix LT AO

* Ask for the right block

---------


(cherry picked from commit a431e2a65c)

Co-authored-by: DarkShadow44 <[email protected]>
2026-11-19 05:42:55 +01:00
UltraProdigy 806b9b9613 ci: run build and test on release branches 2026-11-09 01:42:58 -05:00
2 changed files with 67 additions and 71 deletions

No files matched your search

@@ -2,6 +2,7 @@ package team.chisel.block.tileentity;
import java.util.List;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory;
import net.minecraft.item.ItemStack;
@@ -63,6 +64,7 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
private int progress = 0;
private static EntityItem ghostItem;
boolean equal = false;
private ItemStack[] inventory = new ItemStack[8];
private String name = "autoChisel";
@@ -405,15 +407,27 @@ public class TileEntityAutoChisel extends TileEntity implements ISidedInventory
}
@SideOnly(Side.CLIENT)
public ItemStack getItemForRendering(int slot) {
public EntityItem getItemForRendering(int slot) {
if (ghostItem == null) {
ghostItem = new EntityItem(worldObj);
ghostItem.hoverStart = 0.0F;
}
if (slot == BASE && lastBase != null) {
return lastBase.copy();
ghostItem.setEntityItemStack(lastBase.copy());
return ghostItem;
} else if (slot == TARGET) {
return getTarget();
ItemStack target = getTarget();
if (target != null) {
ghostItem.setEntityItemStack(target);
return ghostItem;
}
return null;
} else if (inventory[slot] == null) {
return null;
} else {
return inventory[slot].copy();
ghostItem.setEntityItemStack(inventory[slot].copy());
return ghostItem;
}
}
@@ -27,7 +27,6 @@ import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.client.settings.GameSettings;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.init.Items;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
@@ -161,83 +160,66 @@ public class RenderAutoChisel extends TileEntitySpecialRenderer implements ISimp
}
private static final Random rand = new Random();
private final EntityItem entityItem = new EntityItem(null, 0, 0, 0, new ItemStack(Items.apple));
@Override
public void renderTileEntityAt(TileEntity tile, double x, double y, double z, float scale) {
// Render Blocks
try {
this.entityItem.setWorld(tile.getWorldObj());
TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile;
EntityItem item = this.getItemForRendering(autoChisel, TileEntityAutoChisel.TARGET);
TileEntityAutoChisel autoChisel = (TileEntityAutoChisel) tile;
EntityItem item = autoChisel.getItemForRendering(TileEntityAutoChisel.TARGET);
rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord);
rand.nextBoolean();
rand.setSeed(tile.xCoord + tile.yCoord + tile.zCoord);
rand.nextBoolean();
float max = 0.35f;
float max = 0.35f;
if (!Minecraft.getMinecraft()
.isGamePaused()) {
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
autoChisel.zRot += (rand.nextFloat() * max) - (max / 2);
}
if (!Minecraft.getMinecraft()
.isGamePaused()) {
autoChisel.xRot += (rand.nextFloat() * max) - (max / 2);
autoChisel.yRot += (rand.nextFloat() * max) - (max / 2);
autoChisel.zRot += (rand.nextFloat() * max) - (max / 2);
}
if (item != null) {
glPushMatrix();
glPushAttrib(GL_ALL_ATTRIB_BITS);
glTranslated(x + 0.5, y + 1.5, z + 0.5);
glRotatef(autoChisel.xRot, 1, 0, 0);
glRotatef(autoChisel.yRot, 0, 1, 0);
glRotatef(autoChisel.zRot, 0, 0, 1);
glEnable(GL_BLEND);
glDepthMask(false);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
renderItem.doRender(item, 0, 0, 0, 0, 0);
glPopMatrix();
glPopAttrib();
}
if (item != null) {
glPushMatrix();
glPushAttrib(GL_ALL_ATTRIB_BITS);
glTranslated(x + 0.5, y + 1.5, z + 0.5);
glRotatef(autoChisel.xRot, 1, 0, 0);
glRotatef(autoChisel.yRot, 0, 1, 0);
glRotatef(autoChisel.zRot, 0, 0, 1);
glEnable(GL_BLEND);
glDepthMask(false);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_CONSTANT_ALPHA);
renderItem.doRender(item, 0, 0, 0, 0, 0);
glPopMatrix();
glPopAttrib();
}
item = this.getItemForRendering(autoChisel, TileEntityAutoChisel.BASE);
if (item != null) {
glPushMatrix();
glTranslated(x + 0.35, y + 0.934, z + 0.5);
item.getEntityItem().stackSize = autoChisel.getLastBase() == null ? 1
: autoChisel.getLastBase().stackSize;
renderItem.doRender(item, 0, 0, 0, 0, 0);
glPopMatrix();
}
item = autoChisel.getItemForRendering(TileEntityAutoChisel.BASE);
if (item != null) {
glPushMatrix();
glTranslated(x + 0.35, y + 0.934, z + 0.5);
item.getEntityItem().stackSize = autoChisel.getLastBase() == null ? 1 : autoChisel.getLastBase().stackSize;
renderItem.doRender(item, 0, 0, 0, 0, 0);
glPopMatrix();
}
GameSettings settings = Minecraft.getMinecraft().gameSettings;
item = this.getItemForRendering(autoChisel, TileEntityAutoChisel.CHISEL);
if (item != null) {
glPushMatrix();
glTranslated(x + 0.7, y + 1.01, z + 0.5);
float rot = autoChisel.chiselRot == 0 ? 0
: autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale)
: autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale);
glRotatef(rot, 0, 0, 1);
glTranslated(-0.12, 0, 0);
glScalef(0.9f, 0.9f, 0.9f);
boolean was = settings.fancyGraphics;
settings.fancyGraphics = true;
renderItem.doRender(item, 0, 0, 0, 0, 0);
settings.fancyGraphics = was;
glPopMatrix();
}
} finally {
this.entityItem.setWorld(null);
GameSettings settings = Minecraft.getMinecraft().gameSettings;
item = autoChisel.getItemForRendering(TileEntityAutoChisel.CHISEL);
if (item != null) {
glPushMatrix();
glTranslated(x + 0.7, y + 1.01, z + 0.5);
float rot = autoChisel.chiselRot == 0 ? 0
: autoChisel.chiseling ? autoChisel.chiselRot + (TileEntityAutoChisel.rotAmnt * scale)
: autoChisel.chiselRot - (TileEntityAutoChisel.rotAmnt * scale);
glRotatef(rot, 0, 0, 1);
glTranslated(-0.12, 0, 0);
glScalef(0.9f, 0.9f, 0.9f);
boolean was = settings.fancyGraphics;
settings.fancyGraphics = true;
renderItem.doRender(item, 0, 0, 0, 0, 0);
settings.fancyGraphics = was;
glPopMatrix();
}
}
private EntityItem getItemForRendering(TileEntityAutoChisel autoChisel, int slot) {
final ItemStack stack = autoChisel.getItemForRendering(slot);
if (stack != null) {
this.entityItem.setEntityItemStack(stack);
return this.entityItem;
}
return null;
}
}