Move to a hook in EntityMinecart

This commit is contained in:
Vincent Lee 2016-07-09 08:53:07 -05:00
parent 7b5a5fbcbe
commit 591ecdd7c9
No known key found for this signature in database
GPG key ID: 5E313C116869B316
2 changed files with 11 additions and 3 deletions

View file

@ -4,8 +4,8 @@
{
if (((Boolean)p_180641_1_.func_177229_b(field_176574_M)).booleanValue())
{
+ int result = net.minecraftforge.event.ForgeEventFactory.onDetectorRailCompare(p_180641_3_, func_176572_a(p_180641_3_));
+ if (result > -1) return result;
+ List<EntityMinecart> carts = this.func_176571_a(p_180641_2_, p_180641_3_, EntityMinecart.class);
+ if (!carts.isEmpty() && carts.get(0).getComparatorLevel() > -1) return carts.get(0).getComparatorLevel();
List<EntityMinecartCommandBlock> list = this.<EntityMinecartCommandBlock>func_176571_a(p_180641_2_, p_180641_3_, EntityMinecartCommandBlock.class, new Predicate[0]);
if (!list.isEmpty())

View file

@ -236,7 +236,7 @@
{
p_70108_1_.field_70159_w *= 0.20000000298023224D;
p_70108_1_.field_70179_y *= 0.20000000298023224D;
@@ -1017,6 +1049,221 @@
@@ -1017,6 +1049,229 @@
this.func_184212_Q().func_187227_b(field_184270_f, Boolean.valueOf(p_94096_1_));
}
@ -453,6 +453,14 @@
+ return 0.0078125D;
+ }
+
+ /**
+ * Called from Detector Rails to retrieve a redstone power level for comparators.
+ */
+ public int getComparatorLevel()
+ {
+ return -1;
+ }
+
+ /* =================================== FORGE END ===========================================*/
+
public static enum Type