mirror of
https://github.com/PaperMC/Paper.git
synced 2025-08-16 20:53:54 -07:00
Reverting the Drop API for now, we need to re-evalute this as it is causing too many issues and blocking releases.
This reverts commits: - d2d03afc8854394aeefb40ea5ebf224c8032b19f - 6245746e91123dd8ef70e5f15b7cdfc7e36d8e8c - 41fae5c613e9e69a8f6bdf33b23bb09d7f407433 - c34bdecab42cf4098054a5ea43e1c2958d44ae92 - d7445084ac9a90fa0b66d8b050b8d0d2a062eaf3 - 6a6ed2e6ae2328a8a791bcc6857c44dc6c6a7030 - a783bc4dc95da8e26c673abe48fad96b550aba28 - cb50fd68766df8e07631ba5be85759f8257e8068 - 34dfff2ad5c407c712b2783f02960aac5e8649f2 - f33b513820de987b49a4338e85df80968217a601 - 5fd9fdfde055e6eb6a83db246d009b69377b7c94 - 2795b116f40d06551fbb7b96d1963c0ddbeac384
This commit is contained in:
@@ -164,7 +164,6 @@ public class Block {
|
||||
public final Material material;
|
||||
public float frictionFactor;
|
||||
private String name;
|
||||
public final ArrayList<ItemStack> dropList = new ArrayList<ItemStack>(1); // CraftBukkit
|
||||
|
||||
protected Block(int i, Material material) {
|
||||
this.bR = true;
|
||||
@@ -338,9 +337,7 @@ public class Block {
|
||||
}
|
||||
|
||||
public final void b(World world, int i, int j, int k, int l, int i1) {
|
||||
this.dropList.clear(); // CraftBukkit
|
||||
this.dropNaturally(world, i, j, k, l, 1.0F, i1);
|
||||
this.doActualDrop(world, i, j, k); // CraftBukkit
|
||||
}
|
||||
|
||||
public void dropNaturally(World world, int i, int j, int k, int l, float f, int i1) {
|
||||
@@ -361,13 +358,6 @@ public class Block {
|
||||
}
|
||||
|
||||
protected void a(World world, int i, int j, int k, ItemStack itemstack) {
|
||||
// CraftBukkit start - the logic of this function is moved into finishDrop
|
||||
// This is such a hackish change it's ridiculous.
|
||||
this.dropList.add(itemstack);
|
||||
}
|
||||
|
||||
public final void finishDrop(World world, int i, int j, int k, ItemStack itemstack) {
|
||||
// CraftBukkit end
|
||||
if (!world.isStatic) {
|
||||
float f = 0.7F;
|
||||
double d0 = (double) (world.random.nextFloat() * f) + (double) (1.0F - f) * 0.5D;
|
||||
@@ -539,20 +529,7 @@ public class Block {
|
||||
public void a(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
entityhuman.a(StatisticList.C[this.id], 1);
|
||||
entityhuman.c(0.025F);
|
||||
// CraftBukkit start - A way to separate statistics from the logic of determining what to drop
|
||||
this.doActualDrop(world, i, j, k);
|
||||
}
|
||||
|
||||
public void doActualDrop(World world, int i, int j, int k) {
|
||||
for (ItemStack stack : this.dropList) {
|
||||
finishDrop(world, i, j, k, stack);
|
||||
}
|
||||
this.dropList.clear();
|
||||
}
|
||||
|
||||
// Blocks that have different drops in certain situations need to override this. IE: Sheers on BlockLeaves
|
||||
public ArrayList<ItemStack> calculateDrops(World world, EntityHuman entityhuman, int i, int j, int k, int l) {
|
||||
// CraftBukkit end
|
||||
if (this.h() && EnchantmentManager.hasSilkTouchEnchantment(entityhuman.inventory)) {
|
||||
ItemStack itemstack = this.a_(l);
|
||||
|
||||
@@ -562,10 +539,8 @@ public class Block {
|
||||
} else {
|
||||
int i1 = EnchantmentManager.getBonusBlockLootEnchantmentLevel(entityhuman.inventory);
|
||||
|
||||
this.dropNaturally(world, i, j, k, l, 1.0F, i1); // CraftBukkit
|
||||
this.b(world, i, j, k, l, i1);
|
||||
}
|
||||
|
||||
return this.dropList;
|
||||
}
|
||||
|
||||
protected boolean h() {
|
||||
|
Reference in New Issue
Block a user