Mirror von
https://github.com/PaperMC/Paper.git
synchronisiert 2024-11-16 21:10:17 +01:00
Added more control over block placement on interactable objects. Thanks Acru!
Plugins can now allow placing a block on an interactable object, by DENYing the interact and ALLOWing the place.
Dieser Commit ist enthalten in:
Ursprung
b5d1619e75
Commit
a285a7b211
@ -213,11 +213,13 @@ public class ItemInWorldManager {
|
|||||||
boolean bottom = (world.getData(i, j, k) & 8) == 0;
|
boolean bottom = (world.getData(i, j, k) & 8) == 0;
|
||||||
((EntityPlayer) entityhuman).netServerHandler.sendPacket(new Packet53BlockChange(i, j + (bottom ? 1 : -1), k, world));
|
((EntityPlayer) entityhuman).netServerHandler.sendPacket(new Packet53BlockChange(i, j + (bottom ? 1 : -1), k, world));
|
||||||
}
|
}
|
||||||
|
result = (event.useItemInHand() != Event.Result.ALLOW);
|
||||||
} else {
|
} else {
|
||||||
result = Block.byId[i1].interact(world, i, j, k, entityhuman);
|
result = Block.byId[i1].interact(world, i, j, k, entityhuman);
|
||||||
if (itemstack != null && !result) {
|
}
|
||||||
result = itemstack.placeItem(entityhuman, world, i, j, k, l);
|
|
||||||
}
|
if (itemstack != null && !result) {
|
||||||
|
result = itemstack.placeItem(entityhuman, world, i, j, k, l);
|
||||||
}
|
}
|
||||||
|
|
||||||
// If we have 'true' and no explicit deny *or* an explicit allow -- run the item part of the hook
|
// If we have 'true' and no explicit deny *or* an explicit allow -- run the item part of the hook
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren