Skip to content

Commit

Permalink
Merge pull request MinecraftForge#1721 from me4502/update-event
Browse files Browse the repository at this point in the history
Added NeighborNotifyEvent fired on server side only, allows for monitoring and disabling world 'physics' updates.
  • Loading branch information
LexManos committed Mar 1, 2015
2 parents 1af0734 + c21e38c commit 7355bdf
Show file tree
Hide file tree
Showing 6 changed files with 172 additions and 49 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- ../src-base/minecraft/net/minecraft/block/BlockRedstoneDiode.java
+++ ../src-work/minecraft/net/minecraft/block/BlockRedstoneDiode.java
@@ -200,6 +200,8 @@
{
EnumFacing enumfacing = (EnumFacing)p_176400_3_.func_177229_b(field_176387_N);
BlockPos blockpos1 = p_176400_2_.func_177972_a(enumfacing.func_176734_d());
+ if(net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(p_176400_1_, p_176400_2_, p_176400_1_.func_180495_p(p_176400_2_), java.util.EnumSet.of(enumfacing.func_176734_d())).isCanceled())
+ return;
p_176400_1_.func_180496_d(blockpos1, this);
p_176400_1_.func_175695_a(blockpos1, this, enumfacing);
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java
@@ -151,7 +151,8 @@
if (this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M)
{
this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
- this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c());
+ if(!net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(field_145850_b, field_174879_c, field_145850_b.func_180495_p(field_174879_c), java.util.EnumSet.noneOf(EnumFacing.class)).isCanceled())
+ this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c());
}
}
}
@@ -169,7 +170,8 @@
if (this.field_145850_b.func_180495_p(this.field_174879_c).func_177230_c() == Blocks.field_180384_M)
{
this.field_145850_b.func_180501_a(this.field_174879_c, this.field_174932_a, 3);
- this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c());
+ if(!net.minecraftforge.event.ForgeEventFactory.onNeighborNotify(field_145850_b, field_174879_c, field_145850_b.func_180495_p(field_174879_c), java.util.EnumSet.noneOf(EnumFacing.class)).isCanceled())
+ this.field_145850_b.func_180496_d(this.field_174879_c, this.field_174932_a.func_177230_c());
}
}
else
Loading

0 comments on commit 7355bdf

Please sign in to comment.