2021-11-06 20:43:24 +01:00
|
|
|
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
|
|
|
From: Jake Potrebic <jake.m.potrebic@gmail.com>
|
|
|
|
Date: Thu, 4 Nov 2021 11:50:40 -0700
|
2024-05-23 19:32:02 +02:00
|
|
|
Subject: [PATCH] Add hasCollision methods to various places
|
2021-11-06 20:43:24 +01:00
|
|
|
|
2022-11-20 00:53:20 +01:00
|
|
|
== AT ==
|
|
|
|
public net.minecraft.world.level.block.state.BlockBehaviour hasCollision
|
2021-11-06 20:43:24 +01:00
|
|
|
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
2024-10-23 21:43:06 +02:00
|
|
|
index 9c8aac69f01db647e20d49d272ccc107a7edceaf..d5b495b5a3ca7f4411d1a700f7149042a16509f1 100644
|
2021-11-06 20:43:24 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlock.java
|
2023-12-06 05:49:31 +01:00
|
|
|
@@ -457,6 +457,11 @@ public class CraftBlock implements Block {
|
2021-11-06 20:43:24 +01:00
|
|
|
public boolean isSolid() {
|
2023-06-08 04:12:38 +02:00
|
|
|
return this.getNMS().blocksMotion();
|
2021-11-06 20:43:24 +01:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isCollidable() {
|
|
|
|
+ return getNMS().getBlock().hasCollision;
|
|
|
|
+ }
|
|
|
|
// Paper end
|
|
|
|
|
|
|
|
@Override
|
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
2024-04-24 17:27:28 +02:00
|
|
|
index 1002123cd0c6f57cecc4e80f5f21cc6ff5886d37..e96023b71845526383288917e8d7c5759a4c0e9b 100644
|
2021-11-06 20:43:24 +01:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockState.java
|
2024-04-24 17:27:28 +02:00
|
|
|
@@ -341,4 +341,11 @@ public class CraftBlockState implements BlockState {
|
|
|
|
public BlockState copy(Location location) {
|
|
|
|
return new CraftBlockState(this, location);
|
2021-11-06 20:43:24 +01:00
|
|
|
}
|
|
|
|
+
|
|
|
|
+ // Paper start
|
|
|
|
+ @Override
|
|
|
|
+ public boolean isCollidable() {
|
|
|
|
+ return this.data.getBlock().hasCollision;
|
|
|
|
+ }
|
|
|
|
+ // Paper end
|
|
|
|
}
|
2024-05-23 19:32:02 +02:00
|
|
|
diff --git a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java
|
2024-07-18 10:13:20 +02:00
|
|
|
index 2d8a509446c0ed0d7358f10f67ef29c4df683696..785d3fe4929e008d4150f3ecab258fd5b6d7cdaf 100644
|
2024-05-23 19:32:02 +02:00
|
|
|
--- a/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java
|
|
|
|
+++ b/src/main/java/org/bukkit/craftbukkit/block/CraftBlockType.java
|
2024-07-18 10:13:20 +02:00
|
|
|
@@ -241,4 +241,11 @@ public class CraftBlockType<B extends BlockData> implements BlockType.Typed<B>,
|
2024-05-23 19:32:02 +02:00
|
|
|
return this.block.getDescriptionId();
|
2021-11-06 20:43:24 +01:00
|
|
|
}
|
2024-05-23 19:32:02 +02:00
|
|
|
// Paper end - add Translatable
|
2021-11-06 20:43:24 +01:00
|
|
|
+
|
2024-05-23 19:32:02 +02:00
|
|
|
+ // Paper start - hasCollision API
|
2021-11-06 20:43:24 +01:00
|
|
|
+ @Override
|
2024-05-23 19:32:02 +02:00
|
|
|
+ public boolean hasCollision() {
|
|
|
|
+ return this.block.hasCollision;
|
2021-11-06 20:43:24 +01:00
|
|
|
+ }
|
2024-05-23 19:32:02 +02:00
|
|
|
+ // Paper end - hasCollision API
|
|
|
|
}
|