mirror of
https://github.com/GTNewHorizons/ForgeMultipart.git
synced 2026-11-20 20:22:15 +00:00
Added some more redstone utilities and made sure masks line up
Fixed smoke particles on redstone torches (bugged in vanilla) Added functions for world and coordinates on parts to clean code Added more placement and world interaction events Properly distinguished converted tiles Fixed tick scheduler to remain in better sync with vanilla
This commit is contained in:
1 parent
5032937cfb
commit
16a3ea3875
16 files changed
+273
-164
No files matched your search
@@ -100,7 +100,7 @@ public class ButtonPart extends McSidedMetaPart implements IRedstonePart
|
||||
if(pressed())
|
||||
return false;
|
||||
|
||||
if(!getTile().worldObj.isRemote)
|
||||
if(!world().isRemote)
|
||||
toggle();
|
||||
|
||||
return true;
|
||||
@@ -121,7 +121,7 @@ public class ButtonPart extends McSidedMetaPart implements IRedstonePart
|
||||
@Override
|
||||
public void onEntityCollision(Entity entity)
|
||||
{
|
||||
if(!pressed() && !getTile().worldObj.isRemote && entity instanceof EntityArrow)
|
||||
if(!pressed() && !world().isRemote && entity instanceof EntityArrow)
|
||||
updateState();
|
||||
}
|
||||
|
||||
@@ -129,7 +129,7 @@ public class ButtonPart extends McSidedMetaPart implements IRedstonePart
|
||||
{
|
||||
boolean in = !pressed();
|
||||
meta^=8;
|
||||
getTile().worldObj.playSoundEffect(getTile().xCoord + 0.5, getTile().yCoord + 0.5, getTile().zCoord + 0.5, "random.click", 0.3F, in ? 0.6F : 0.5F);
|
||||
world().playSoundEffect(x() + 0.5, y() + 0.5, z() + 0.5, "random.click", 0.3F, in ? 0.6F : 0.5F);
|
||||
if(in)
|
||||
TickScheduler.scheduleTick(this, delay());
|
||||
|
||||
@@ -141,7 +141,7 @@ public class ButtonPart extends McSidedMetaPart implements IRedstonePart
|
||||
|
||||
private void updateState()
|
||||
{
|
||||
boolean arrows = sensitive() && !getTile().worldObj.getEntitiesWithinAABB(EntityArrow.class,
|
||||
boolean arrows = sensitive() && !world().getEntitiesWithinAABB(EntityArrow.class,
|
||||
getBounds().add(Vector3.fromTileEntity(getTile())).toAABB()).isEmpty();
|
||||
boolean pressed = pressed();
|
||||
|
||||
|
||||
Reference in new issue
Block a user