mirror of
https://github.com/GTNewHorizons/Chisel.git
synced 2026-10-26 14:24:34 +00:00
Improve glass side rendering logic
Conflicts: src/main/java/team/chisel/block/BlockCarvableGlass.java
This commit is contained in:
1 parent
4649395ce5
commit
e28636d571
1 file changed
+24
-6
@@ -2,12 +2,7 @@ package team.chisel.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockGlass;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
@@ -15,6 +10,15 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import team.chisel.ctmlib.CTM;
|
||||
|
||||
import com.cricketcraft.chisel.api.ChiselTabs;
|
||||
import com.cricketcraft.chisel.api.ICarvable;
|
||||
import com.cricketcraft.chisel.api.carving.CarvableHelper;
|
||||
import com.cricketcraft.chisel.api.carving.IVariationInfo;
|
||||
import com.cricketcraft.chisel.api.rendering.ClientUtils;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -22,6 +26,7 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||
|
||||
public CarvableHelper carverHelper;
|
||||
private boolean isAlpha = false;
|
||||
private CTM ctm = CTM.getInstance();
|
||||
|
||||
public BlockCarvableGlass() {
|
||||
super(Material.glass, false);
|
||||
@@ -54,6 +59,19 @@ public class BlockCarvableGlass extends BlockGlass implements ICarvable {
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return carverHelper.getIcon(side, metadata);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldSideBeRendered(IBlockAccess world, int x, int y, int z, int side) {
|
||||
ForgeDirection face = ForgeDirection.getOrientation(side).getOpposite();
|
||||
int meX = x + face.offsetX;
|
||||
int meY = y + face.offsetY;
|
||||
int meZ = z + face.offsetZ;
|
||||
Block block = world.getBlock(meX, meY, meZ);
|
||||
int meta = world.getBlockMetadata(meX, meY, meZ);
|
||||
Block otherBlock = ctm.getBlockOrFacade(world, x, y, z, face.ordinal());
|
||||
int otherMeta = ctm.getBlockOrFacadeMetadata(world, x, y, z, face.ordinal());
|
||||
return block != otherBlock || meta != otherMeta;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int i) {
|
||||
|
||||
Reference in new issue
Block a user