geforkt von Mirrors/Paper
[Bleeding] Call BlockRedstoneEvent for all rails. Adds BUKKIT-4080
Previously, Detector Rails were the only rails that properly called BlockRedstoneEvent when they changed from powered to unpowered. This commit adds BlockRedstoneEvent calls for both Powered Rails and Activator Rails.
Dieser Commit ist enthalten in:
Ursprung
610c58c733
Commit
7df7778ccb
@ -1,5 +1,7 @@
|
|||||||
package net.minecraft.server;
|
package net.minecraft.server;
|
||||||
|
|
||||||
|
import org.bukkit.craftbukkit.event.CraftEventFactory; // CraftBukkit
|
||||||
|
|
||||||
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
|
public class BlockPoweredRail extends BlockMinecartTrackAbstract {
|
||||||
protected BlockPoweredRail() {
|
protected BlockPoweredRail() {
|
||||||
super(true);
|
super(true);
|
||||||
@ -115,9 +117,21 @@ public class BlockPoweredRail extends BlockMinecartTrackAbstract {
|
|||||||
boolean flag1 = false;
|
boolean flag1 = false;
|
||||||
|
|
||||||
if (flag && (l & 0x8) == 0) {
|
if (flag && (l & 0x8) == 0) {
|
||||||
|
// CraftBukkit start
|
||||||
|
if (CraftEventFactory.callRedstoneChange(world, i, j, k, 0, 15).getNewCurrent() <= 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
world.setData(i, j, k, i1 | 0x8, 3);
|
world.setData(i, j, k, i1 | 0x8, 3);
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
} else if (!flag && (l & 0x8) != 0) {
|
} else if (!flag && (l & 0x8) != 0) {
|
||||||
|
// CraftBukkit start
|
||||||
|
if (CraftEventFactory.callRedstoneChange(world, i, j, k, 15, 0).getNewCurrent() > 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// CraftBukkit end
|
||||||
|
|
||||||
world.setData(i, j, k, i1, 3);
|
world.setData(i, j, k, i1, 3);
|
||||||
flag1 = true;
|
flag1 = true;
|
||||||
}
|
}
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren