3
0
Fork 1
KCauldronX/patches/net/minecraft/block/Block.java.patch

53 lines
2.3 KiB
Diff

--- ../src-base/minecraft/net/minecraft/block/Block.java
+++ ../src-work/minecraft/net/minecraft/block/Block.java
@@ -122,6 +122,7 @@
private String unlocalizedName;
@SideOnly(Side.CLIENT)
protected IIcon blockIcon;
+ public boolean isForgeBlock; // Cauldron
private static final String __OBFID = "CL_00000199";
public final cpw.mods.fml.common.registry.RegistryDelegate<Block> delegate =
@@ -650,7 +651,7 @@
public void dropBlockAsItemWithChance(World p_149690_1_, int p_149690_2_, int p_149690_3_, int p_149690_4_, int p_149690_5_, float p_149690_6_, int p_149690_7_)
{
- if (!p_149690_1_.isRemote && !p_149690_1_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe
+ if (!p_149690_1_.isRemote && (!p_149690_1_.restoringBlockSnapshots || !p_149690_1_.restoringBlockStates)) // do not drop items while restoring blockstates, prevents item dupe
{
ArrayList<ItemStack> items = getDrops(p_149690_1_, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_);
p_149690_6_ = ForgeEventFactory.fireBlockHarvesting(items, p_149690_1_, this, p_149690_2_, p_149690_3_, p_149690_4_, p_149690_5_, p_149690_7_, p_149690_6_, false, harvesters.get());
@@ -667,7 +668,7 @@
protected void dropBlockAsItem(World p_149642_1_, int p_149642_2_, int p_149642_3_, int p_149642_4_, ItemStack p_149642_5_)
{
- if (!p_149642_1_.isRemote && p_149642_1_.getGameRules().getGameRuleBooleanValue("doTileDrops") && !p_149642_1_.restoringBlockSnapshots) // do not drop items while restoring blockstates, prevents item dupe
+ if (!p_149642_1_.isRemote && p_149642_1_.getGameRules().getGameRuleBooleanValue("doTileDrops") && (!p_149642_1_.restoringBlockSnapshots || !p_149642_1_.restoringBlockStates)) // do not drop items while restoring blockstates, prevents item dupe
{
if (captureDrops.get())
{
@@ -1131,6 +1132,23 @@
return this;
}
+ // Spigot start
+ public static float range(float min, float value, float max)
+ {
+ if (value < min)
+ {
+ return min;
+ }
+
+ if (value > max)
+ {
+ return max;
+ }
+
+ return value;
+ }
+ // Spigot end
+
@SideOnly(Side.CLIENT)
protected String getTextureName()
{