Mirror von
https://github.com/ViaVersion/ViaVersion.git
synchronisiert 2024-11-03 14:50:30 +01:00
Allow non-solid blocks to be placed at feet (#472)
Dieser Commit ist enthalten in:
Ursprung
9bedb6c741
Commit
c3b343fbc8
@ -1,6 +1,7 @@
|
|||||||
package us.myles.ViaVersion.protocols.protocol1_9to1_8.listeners;
|
package us.myles.ViaVersion.protocols.protocol1_9to1_8.listeners;
|
||||||
|
|
||||||
import org.bukkit.Location;
|
import org.bukkit.Location;
|
||||||
|
import org.bukkit.Material;
|
||||||
import org.bukkit.block.BlockFace;
|
import org.bukkit.block.BlockFace;
|
||||||
import org.bukkit.event.EventHandler;
|
import org.bukkit.event.EventHandler;
|
||||||
import org.bukkit.event.block.BlockPlaceEvent;
|
import org.bukkit.event.block.BlockPlaceEvent;
|
||||||
@ -25,6 +26,10 @@ public class PaperPatch extends ViaListener {
|
|||||||
public void onPlace(BlockPlaceEvent e) {
|
public void onPlace(BlockPlaceEvent e) {
|
||||||
if (isOnPipe(e.getPlayer())) {
|
if (isOnPipe(e.getPlayer())) {
|
||||||
Location diff = e.getPlayer().getLocation().subtract(e.getBlock().getLocation().add(0.5D, 0, 0.5D));
|
Location diff = e.getPlayer().getLocation().subtract(e.getBlock().getLocation().add(0.5D, 0, 0.5D));
|
||||||
|
Material block = e.getBlockPlaced().getType();
|
||||||
|
if (!block.isSolid()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (e.getPlayer().getLocation().getBlock().equals(e.getBlock())) {
|
if (e.getPlayer().getLocation().getBlock().equals(e.getBlock())) {
|
||||||
e.setCancelled(true);
|
e.setCancelled(true);
|
||||||
} else {
|
} else {
|
||||||
|
Laden…
In neuem Issue referenzieren
Einen Benutzer sperren