3
0
Mirror von https://github.com/PaperMC/Paper.git synchronisiert 2024-12-21 05:50:05 +01:00
Paper/nms-patches/Block.patch

53 Zeilen
2.0 KiB
Diff

2015-05-25 12:37:24 +02:00
--- a/net/minecraft/server/Block.java
+++ b/net/minecraft/server/Block.java
2016-11-17 02:41:03 +01:00
@@ -37,7 +37,7 @@
2016-02-29 22:32:46 +01:00
private String name;
public static int getId(Block block) {
- return Block.REGISTRY.a((Object) block);
+ return Block.REGISTRY.a(block); // CraftBukkit - decompile error
}
public static int getCombinedId(IBlockData iblockdata) {
2016-11-17 02:41:03 +01:00
@@ -334,7 +334,8 @@
int j = this.getDropCount(i, world.random);
for (int k = 0; k < j; ++k) {
- if (world.random.nextFloat() <= f) {
+ // CraftBukkit - <= to < to allow for plugins to completely disable block drops from explosions
+ if (world.random.nextFloat() < f) {
Item item = this.getDropType(iblockdata, world.random, i);
2016-11-17 02:41:03 +01:00
if (item != Items.a) {
@@ -896,7 +897,7 @@
2016-02-29 22:32:46 +01:00
if (hashset.contains(block16)) {
for (int i = 0; i < 15; ++i) {
- int j = Block.REGISTRY.a((Object) block16) << 4 | i;
+ int j = Block.REGISTRY.a(block16) << 4 | i; // CraftBukkit - decompile error
Block.REGISTRY_ID.a(block16.fromLegacyData(i), j);
}
2016-11-17 02:41:03 +01:00
@@ -905,7 +906,7 @@
2016-02-29 22:32:46 +01:00
2016-11-17 02:41:03 +01:00
while (unmodifiableiterator.hasNext()) {
IBlockData iblockdata = (IBlockData) unmodifiableiterator.next();
2016-02-29 22:32:46 +01:00
- int k = Block.REGISTRY.a((Object) block16) << 4 | block16.toLegacyData(iblockdata);
+ int k = Block.REGISTRY.a(block16) << 4 | block16.toLegacyData(iblockdata); // CraftBukkit - decompile error
Block.REGISTRY_ID.a(iblockdata, k);
}
2016-11-17 02:41:03 +01:00
@@ -914,6 +915,12 @@
2016-02-29 22:32:46 +01:00
}
2016-02-29 22:32:46 +01:00
+ // CraftBukkit start
+ public int getExpDrop(World world, IBlockData data, int enchantmentLevel) {
+ return 0;
+ }
+ // CraftBukkit end
2016-02-29 22:32:46 +01:00
+
private static void a(int i, MinecraftKey minecraftkey, Block block) {
Block.REGISTRY.a(i, minecraftkey, block);
}