mirror of
https://github.com/Thorfusion/Mekanism-Community-Edition.git
synced 2026-11-19 19:49:50 +00:00
Glow panels now break off of non-solid surfaces
This commit is contained in:
1 parent
81477966ee
commit
ef7f6e91eb
2 files changed
+22
-1
No files matched your search
@@ -37,7 +37,14 @@ public class ItemGlowPanel extends JItemMultiPart
|
||||
EnumColor col = EnumColor.DYES[item.getItemDamage()];
|
||||
ForgeDirection orientation = getSideFromVector3(vHit.subtract(Vector3.center));
|
||||
|
||||
return new PartGlowPanel(col, orientation);
|
||||
BlockCoord pos1 = pos.copy().inset(orientation.getOpposite().ordinal());
|
||||
|
||||
if(world.isSideSolid(pos1.x, pos1.y, pos1.z, orientation.getOpposite()))
|
||||
{
|
||||
return new PartGlowPanel(col, orientation);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ForgeDirection getSideFromVector3(Vector3 vector)
|
||||
|
||||
@@ -2,6 +2,7 @@ package mekanism.common.multipart;
|
||||
|
||||
import java.util.Collections;
|
||||
|
||||
import mekanism.api.Coord4D;
|
||||
import mekanism.api.EnumColor;
|
||||
import mekanism.client.render.RenderGlowPanel;
|
||||
import mekanism.common.Mekanism;
|
||||
@@ -23,6 +24,7 @@ import codechicken.multipart.JIconHitEffects;
|
||||
import codechicken.multipart.JNormalOcclusion;
|
||||
import codechicken.multipart.NormalOcclusionTest;
|
||||
import codechicken.multipart.TMultiPart;
|
||||
import codechicken.multipart.TileMultipart;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -78,6 +80,18 @@ public class PartGlowPanel extends JCuboidPart implements JNormalOcclusion, JIco
|
||||
{
|
||||
side = newSide;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborChanged()
|
||||
{
|
||||
Coord4D adj = Coord4D.get(tile()).getFromSide(side);
|
||||
|
||||
if(!world().isRemote && !world().isSideSolid(adj.xCoord, adj.yCoord, adj.zCoord, side.getOpposite()))
|
||||
{
|
||||
TileMultipart.dropItem(new ItemStack(Mekanism.GlowPanel, 1, colour.getMetaValue()), world(), Vector3.fromTileEntityCenter(tile()));
|
||||
tile().remPart(this);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeDesc(MCDataOutput data)
|
||||
|
||||
Reference in new issue
Block a user