Initial commit (Forge 1291).
This commit is contained in:
@ -0,0 +1,46 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/MobSpawnerBaseLogic.java
|
||||
@@ -17,6 +17,8 @@
|
||||
import net.minecraft.util.WeightedRandom;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+import org.bukkit.event.entity.CreatureSpawnEvent; // CraftBukkit
|
||||
+
|
||||
public abstract class MobSpawnerBaseLogic
|
||||
{
|
||||
public int spawnDelay = 20;
|
||||
@@ -162,7 +164,15 @@
|
||||
|
||||
if (p_98265_1_.worldObj != null)
|
||||
{
|
||||
- p_98265_1_.worldObj.spawnEntityInWorld(p_98265_1_);
|
||||
+ p_98265_1_.worldObj.addEntity(p_98265_1_, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
||||
+
|
||||
+ // Spigot Start
|
||||
+ if (p_98265_1_.worldObj.getSpigotConfig().nerfSpawnerMobs) // Cauldron
|
||||
+ {
|
||||
+ p_98265_1_.fromMobSpawner = true;
|
||||
+ }
|
||||
+
|
||||
+ // Spigot End
|
||||
}
|
||||
|
||||
NBTTagCompound nbttagcompound2;
|
||||
@@ -190,7 +200,7 @@
|
||||
|
||||
if (p_98265_1_.worldObj != null)
|
||||
{
|
||||
- p_98265_1_.worldObj.spawnEntityInWorld(entity2);
|
||||
+ p_98265_1_.worldObj.addEntity(entity2, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
||||
}
|
||||
|
||||
entity1.mountEntity(entity2);
|
||||
@@ -202,7 +212,7 @@
|
||||
else if (p_98265_1_ instanceof EntityLivingBase && p_98265_1_.worldObj != null)
|
||||
{
|
||||
((EntityLiving)p_98265_1_).onSpawnWithEgg((IEntityLivingData)null);
|
||||
- this.getSpawnerWorld().spawnEntityInWorld(p_98265_1_);
|
||||
+ this.getSpawnerWorld().addEntity(p_98265_1_, CreatureSpawnEvent.SpawnReason.SPAWNER); // CraftBukkit
|
||||
}
|
||||
|
||||
return p_98265_1_;
|
61
patches/net/minecraft/tileentity/TileEntity.java.patch
Normal file
61
patches/net/minecraft/tileentity/TileEntity.java.patch
Normal file
@ -0,0 +1,61 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntity.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntity.java
|
||||
@@ -22,18 +22,22 @@
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
import org.apache.logging.log4j.Logger;
|
||||
|
||||
+import org.spigotmc.CustomTimingsHandler; // Spigot
|
||||
+import org.bukkit.inventory.InventoryHolder; // CraftBukkit
|
||||
+
|
||||
public class TileEntity
|
||||
{
|
||||
private static final Logger logger = LogManager.getLogger();
|
||||
private static Map nameToClassMap = new HashMap();
|
||||
- private static Map classToNameMap = new HashMap();
|
||||
- protected World worldObj;
|
||||
+ public static Map classToNameMap = new HashMap(); // Cauldron - private -> public
|
||||
+ public World worldObj; // CraftBukkit - protected -> public
|
||||
public int xCoord;
|
||||
public int yCoord;
|
||||
public int zCoord;
|
||||
protected boolean tileEntityInvalid;
|
||||
public int blockMetadata = -1;
|
||||
public Block blockType;
|
||||
+ public CustomTimingsHandler tickTimer = org.bukkit.craftbukkit.SpigotTimings.getTileEntityTimings(this); // Spigot
|
||||
private static final String __OBFID = "CL_00000340";
|
||||
|
||||
public static void addMapping(Class p_145826_0_, String p_145826_1_)
|
||||
@@ -106,7 +110,11 @@
|
||||
}
|
||||
catch (Exception exception)
|
||||
{
|
||||
- exception.printStackTrace();
|
||||
+ // Cauldron start - better debug
|
||||
+ FMLLog.log(Level.ERROR, exception,
|
||||
+ "A TileEntity %s(%s) located @ %s,%s,%s has thrown an exception during creation, it cannot be created. Report this to the mod author",
|
||||
+ p_145827_0_.getString("id"), oclass.getName(), p_145827_0_.getInteger("x"), p_145827_0_.getInteger("y"), p_145827_0_.getInteger("z"));
|
||||
+ // Cauldron end
|
||||
}
|
||||
|
||||
if (tileentity != null)
|
||||
@@ -282,6 +290,20 @@
|
||||
addMapping(TileEntityFlowerPot.class, "FlowerPot");
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public InventoryHolder getOwner()
|
||||
+ {
|
||||
+ org.bukkit.block.BlockState state = worldObj.getWorld().getBlockAt(xCoord, yCoord, zCoord).getState();
|
||||
+
|
||||
+ if (state instanceof InventoryHolder)
|
||||
+ {
|
||||
+ return (InventoryHolder) state;
|
||||
+ }
|
||||
+
|
||||
+ return null;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
// -- BEGIN FORGE PATCHES --
|
||||
/**
|
||||
* Determines if this TileEntity requires update calls.
|
59
patches/net/minecraft/tileentity/TileEntityBeacon.java.patch
Normal file
59
patches/net/minecraft/tileentity/TileEntityBeacon.java.patch
Normal file
@ -0,0 +1,59 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBeacon.java
|
||||
@@ -18,6 +18,11 @@
|
||||
import net.minecraft.stats.AchievementList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityBeacon extends TileEntity implements IInventory
|
||||
{
|
||||
public static final Potion[][] effectsList = new Potion[][] {{Potion.moveSpeed, Potion.digSpeed}, {Potion.resistance, Potion.jump}, {Potion.damageBoost}, {Potion.regeneration}};
|
||||
@@ -31,6 +36,35 @@
|
||||
private int secondaryEffect;
|
||||
private ItemStack payment;
|
||||
private String field_146008_p;
|
||||
+ // CraftBukkit start
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+ private int maxStack = MAX_STACK;
|
||||
+
|
||||
+ public ItemStack[] getContents()
|
||||
+ {
|
||||
+ return new ItemStack[] { this.payment };
|
||||
+ }
|
||||
+
|
||||
+ public void onOpen(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public List<HumanEntity> getViewers()
|
||||
+ {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size)
|
||||
+ {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
private static final String __OBFID = "CL_00000339";
|
||||
|
||||
public void updateEntity()
|
||||
@@ -343,7 +377,7 @@
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
- return 1;
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_)
|
@ -0,0 +1,109 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityBrewingStand.java
|
||||
@@ -13,17 +13,55 @@
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.potion.PotionHelper;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+import org.bukkit.event.inventory.BrewEvent;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityBrewingStand extends TileEntity implements ISidedInventory
|
||||
{
|
||||
private static final int[] field_145941_a = new int[] {3};
|
||||
private static final int[] field_145947_i = new int[] {0, 1, 2};
|
||||
- private ItemStack[] brewingItemStacks = new ItemStack[4];
|
||||
- private int brewTime;
|
||||
+ public ItemStack[] brewingItemStacks = new ItemStack[4]; // CraftBukkit - private -> public
|
||||
+ public int brewTime; // CraftBukkit - private -> public
|
||||
private int filledSlots;
|
||||
private Item ingredientID;
|
||||
private String field_145942_n;
|
||||
+ private int lastTick = MinecraftServer.currentTick; // CraftBukkit
|
||||
private static final String __OBFID = "CL_00000345";
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+ private int maxStack = 64;
|
||||
+
|
||||
+ public void onOpen(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public List<HumanEntity> getViewers()
|
||||
+ {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ public ItemStack[] getContents()
|
||||
+ {
|
||||
+ return this.brewingItemStacks;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size)
|
||||
+ {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public String getInventoryName()
|
||||
{
|
||||
return this.hasCustomInventoryName() ? this.field_145942_n : "container.brewing";
|
||||
@@ -46,12 +84,17 @@
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
+ // CraftBukkit start - Use wall time instead of ticks for brewing
|
||||
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||
+ this.lastTick = MinecraftServer.currentTick;
|
||||
+
|
||||
if (this.brewTime > 0)
|
||||
{
|
||||
- --this.brewTime;
|
||||
+ this.brewTime -= elapsedTicks;
|
||||
|
||||
- if (this.brewTime == 0)
|
||||
+ if (this.brewTime <= 0) // == -> <=
|
||||
{
|
||||
+ // CraftBukkit end
|
||||
this.brewPotions();
|
||||
this.markDirty();
|
||||
}
|
||||
@@ -141,7 +184,19 @@
|
||||
if (this.canBrew())
|
||||
{
|
||||
ItemStack itemstack = this.brewingItemStacks[3];
|
||||
+ // CraftBukkit start
|
||||
+ if (getOwner() != null)
|
||||
+ {
|
||||
+ BrewEvent event = new BrewEvent(worldObj.getWorld().getBlockAt(xCoord, yCoord, zCoord), (org.bukkit.inventory.BrewerInventory) this.getOwner()
|
||||
+ .getInventory());
|
||||
+ org.bukkit.Bukkit.getPluginManager().callEvent(event);
|
||||
|
||||
+ if (event.isCancelled())
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
for (int i = 0; i < 3; ++i)
|
||||
{
|
||||
if (this.brewingItemStacks[i] != null && this.brewingItemStacks[i].getItem() instanceof ItemPotion)
|
||||
@@ -280,7 +335,7 @@
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
- return 64;
|
||||
+ return this.maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_)
|
123
patches/net/minecraft/tileentity/TileEntityChest.java.patch
Normal file
123
patches/net/minecraft/tileentity/TileEntityChest.java.patch
Normal file
@ -0,0 +1,123 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityChest.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityChest.java
|
||||
@@ -15,6 +15,12 @@
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.init.Blocks;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityChest extends TileEntity implements IInventory
|
||||
{
|
||||
private ItemStack[] chestContents = new ItemStack[36];
|
||||
@@ -31,6 +37,36 @@
|
||||
private String customName;
|
||||
private static final String __OBFID = "CL_00000346";
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+ private int maxStack = MAX_STACK;
|
||||
+
|
||||
+ public ItemStack[] getContents()
|
||||
+ {
|
||||
+ return this.chestContents;
|
||||
+ }
|
||||
+
|
||||
+ public void onOpen(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public List<HumanEntity> getViewers()
|
||||
+ {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size)
|
||||
+ {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public TileEntityChest()
|
||||
{
|
||||
this.cachedChestType = -1;
|
||||
@@ -296,6 +332,12 @@
|
||||
public void updateEntity()
|
||||
{
|
||||
super.updateEntity();
|
||||
+
|
||||
+ if (this.worldObj == null)
|
||||
+ {
|
||||
+ return; // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
this.checkForAdjacentChests();
|
||||
++this.ticksSinceSync;
|
||||
float f;
|
||||
@@ -410,8 +452,28 @@
|
||||
this.numPlayersUsing = 0;
|
||||
}
|
||||
|
||||
+ int oldPower = Math.max(0, Math.min(15, this.numPlayersUsing)); // CraftBukkit - Get power before new viewer is added
|
||||
++this.numPlayersUsing;
|
||||
+
|
||||
+ if (this.worldObj == null)
|
||||
+ {
|
||||
+ return; // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
|
||||
+
|
||||
+ // CraftBukkit start - Call redstone event
|
||||
+ if (this.getBlockType() == Blocks.trapped_chest)
|
||||
+ {
|
||||
+ int newPower = Math.max(0, Math.min(15, this.numPlayersUsing));
|
||||
+
|
||||
+ if (oldPower != newPower)
|
||||
+ {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(worldObj, this.xCoord, this.yCoord, this.zCoord, oldPower, newPower);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
|
||||
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
|
||||
}
|
||||
@@ -420,8 +482,28 @@
|
||||
{
|
||||
if (this.getBlockType() instanceof BlockChest)
|
||||
{
|
||||
+ int oldPower = Math.max(0, Math.min(15, this.numPlayersUsing)); // CraftBukkit - Get power before new viewer is added
|
||||
--this.numPlayersUsing;
|
||||
+
|
||||
+ if (this.worldObj == null)
|
||||
+ {
|
||||
+ return; // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
this.worldObj.addBlockEvent(this.xCoord, this.yCoord, this.zCoord, this.getBlockType(), 1, this.numPlayersUsing);
|
||||
+
|
||||
+ // CraftBukkit start - Call redstone event
|
||||
+ if (this.getBlockType() == Blocks.trapped_chest)
|
||||
+ {
|
||||
+ int newPower = Math.max(0, Math.min(15, this.numPlayersUsing));
|
||||
+
|
||||
+ if (oldPower != newPower)
|
||||
+ {
|
||||
+ org.bukkit.craftbukkit.event.CraftEventFactory.callRedstoneChange(worldObj, this.xCoord, this.yCoord, this.zCoord, oldPower, newPower);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord, this.zCoord, this.getBlockType());
|
||||
this.worldObj.notifyBlocksOfNeighborChange(this.xCoord, this.yCoord - 1, this.zCoord, this.getBlockType());
|
||||
}
|
@ -0,0 +1,58 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityCommandBlock.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityCommandBlock.java
|
||||
@@ -12,39 +12,9 @@
|
||||
|
||||
public class TileEntityCommandBlock extends TileEntity
|
||||
{
|
||||
- private final CommandBlockLogic field_145994_a = new CommandBlockLogic()
|
||||
- {
|
||||
- private static final String __OBFID = "CL_00000348";
|
||||
- public ChunkCoordinates getPlayerCoordinates()
|
||||
- {
|
||||
- return new ChunkCoordinates(TileEntityCommandBlock.this.xCoord, TileEntityCommandBlock.this.yCoord, TileEntityCommandBlock.this.zCoord);
|
||||
- }
|
||||
- public World getEntityWorld()
|
||||
- {
|
||||
- return TileEntityCommandBlock.this.getWorldObj();
|
||||
- }
|
||||
- public void func_145752_a(String p_145752_1_)
|
||||
- {
|
||||
- super.func_145752_a(p_145752_1_);
|
||||
- TileEntityCommandBlock.this.markDirty();
|
||||
- }
|
||||
- public void func_145756_e()
|
||||
- {
|
||||
- TileEntityCommandBlock.this.getWorldObj().markBlockForUpdate(TileEntityCommandBlock.this.xCoord, TileEntityCommandBlock.this.yCoord, TileEntityCommandBlock.this.zCoord);
|
||||
- }
|
||||
- @SideOnly(Side.CLIENT)
|
||||
- public int func_145751_f()
|
||||
- {
|
||||
- return 0;
|
||||
- }
|
||||
- @SideOnly(Side.CLIENT)
|
||||
- public void func_145757_a(ByteBuf p_145757_1_)
|
||||
- {
|
||||
- p_145757_1_.writeInt(TileEntityCommandBlock.this.xCoord);
|
||||
- p_145757_1_.writeInt(TileEntityCommandBlock.this.yCoord);
|
||||
- p_145757_1_.writeInt(TileEntityCommandBlock.this.zCoord);
|
||||
- }
|
||||
- };
|
||||
+ private final TileEntityCommandBlockListener field_145994_a_CB = new TileEntityCommandBlockListener(this); // CraftBukkit
|
||||
+ private final CommandBlockLogic field_145994_a = field_145994_a_CB; // Cauldron
|
||||
+
|
||||
private static final String __OBFID = "CL_00000347";
|
||||
|
||||
public void writeToNBT(NBTTagCompound p_145841_1_)
|
||||
@@ -70,4 +40,12 @@
|
||||
{
|
||||
return this.field_145994_a;
|
||||
}
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityComparator.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityComparator.java
|
||||
@@ -28,4 +28,12 @@
|
||||
{
|
||||
this.field_145997_a = p_145995_1_;
|
||||
}
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
@ -0,0 +1,87 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityDispenser.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityDispenser.java
|
||||
@@ -7,6 +7,13 @@
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.List;
|
||||
+
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityDispenser extends TileEntity implements IInventory
|
||||
{
|
||||
private ItemStack[] field_146022_i = new ItemStack[9];
|
||||
@@ -14,6 +21,36 @@
|
||||
protected String field_146020_a;
|
||||
private static final String __OBFID = "CL_00000352";
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+ private int maxStack = MAX_STACK;
|
||||
+
|
||||
+ public ItemStack[] getContents()
|
||||
+ {
|
||||
+ return this.field_146022_i;
|
||||
+ }
|
||||
+
|
||||
+ public void onOpen(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public List<HumanEntity> getViewers()
|
||||
+ {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size)
|
||||
+ {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return 9;
|
||||
@@ -79,6 +116,11 @@
|
||||
{
|
||||
if (this.field_146022_i[k] != null && this.field_146021_j.nextInt(j++) == 0)
|
||||
{
|
||||
+ if (this.field_146022_i[k].stackSize == 0)
|
||||
+ {
|
||||
+ continue; // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
i = k;
|
||||
}
|
||||
}
|
||||
@@ -176,7 +218,7 @@
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
- return 64;
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer p_70300_1_)
|
||||
@@ -192,4 +234,12 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityDropper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityDropper.java
|
||||
@@ -8,4 +8,12 @@
|
||||
{
|
||||
return this.hasCustomInventoryName() ? this.field_146020_a : "container.dropper";
|
||||
}
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityEndPortal.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityEndPortal.java
|
||||
@@ -3,4 +3,12 @@
|
||||
public class TileEntityEndPortal extends TileEntity
|
||||
{
|
||||
private static final String __OBFID = "CL_00000365";
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
@ -0,0 +1,15 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFlowerPot.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFlowerPot.java
|
||||
@@ -55,4 +55,12 @@
|
||||
{
|
||||
return this.flowerPotData;
|
||||
}
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
219
patches/net/minecraft/tileentity/TileEntityFurnace.java.patch
Normal file
219
patches/net/minecraft/tileentity/TileEntityFurnace.java.patch
Normal file
@ -0,0 +1,219 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityFurnace.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityFurnace.java
|
||||
@@ -19,7 +19,17 @@
|
||||
import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
+import net.minecraft.server.MinecraftServer;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import java.util.List;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+import org.bukkit.event.inventory.FurnaceBurnEvent;
|
||||
+import org.bukkit.event.inventory.FurnaceSmeltEvent;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityFurnace extends TileEntity implements ISidedInventory
|
||||
{
|
||||
private static final int[] slotsTop = new int[] {0};
|
||||
@@ -30,6 +40,37 @@
|
||||
public int currentItemBurnTime;
|
||||
public int furnaceCookTime;
|
||||
private String field_145958_o;
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ private int lastTick = MinecraftServer.currentTick;
|
||||
+ private int maxStack = MAX_STACK;
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+
|
||||
+ public ItemStack[] getContents()
|
||||
+ {
|
||||
+ return this.furnaceItemStacks;
|
||||
+ }
|
||||
+
|
||||
+ public void onOpen(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public List<HumanEntity> getViewers()
|
||||
+ {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size)
|
||||
+ {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
private static final String __OBFID = "CL_00000357";
|
||||
|
||||
public int getSizeInventory()
|
||||
@@ -166,7 +207,7 @@
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
- return 64;
|
||||
+ return maxStack; // CraftBukkit
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -195,52 +236,85 @@
|
||||
{
|
||||
boolean flag = this.furnaceBurnTime > 0;
|
||||
boolean flag1 = false;
|
||||
+ // CraftBukkit start - Use wall time instead of ticks for cooking
|
||||
+ int elapsedTicks = MinecraftServer.currentTick - this.lastTick;
|
||||
+ this.lastTick = MinecraftServer.currentTick;
|
||||
|
||||
+ // CraftBukkit - moved from below
|
||||
+ if (this.isBurning() && this.canSmelt())
|
||||
+ {
|
||||
+ this.furnaceCookTime += elapsedTicks;
|
||||
+
|
||||
+ if (this.furnaceCookTime >= 200)
|
||||
+ {
|
||||
+ this.furnaceCookTime %= 200;
|
||||
+ this.smeltItem();
|
||||
+ flag1 = true;
|
||||
+ }
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this.furnaceCookTime = 0;
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
if (this.furnaceBurnTime > 0)
|
||||
{
|
||||
- --this.furnaceBurnTime;
|
||||
+ this.furnaceBurnTime -= elapsedTicks; // CraftBukkit
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
- if (this.furnaceBurnTime != 0 || this.furnaceItemStacks[1] != null && this.furnaceItemStacks[0] != null)
|
||||
+ // CraftBukkit start - Handle multiple elapsed ticks
|
||||
+ if (this.furnaceBurnTime <= 0 && this.canSmelt() && this.furnaceItemStacks[1] != null) // CraftBukkit - == to <=
|
||||
{
|
||||
- if (this.furnaceBurnTime == 0 && this.canSmelt())
|
||||
+ CraftItemStack fuel = CraftItemStack.asCraftMirror(this.furnaceItemStacks[1]);
|
||||
+ FurnaceBurnEvent furnaceBurnEvent = new FurnaceBurnEvent(this.worldObj.getWorld().getBlockAt(this.xCoord, this.yCoord, this.zCoord), fuel, getItemBurnTime(this.furnaceItemStacks[1]));
|
||||
+ this.worldObj.getServer().getPluginManager().callEvent(furnaceBurnEvent);
|
||||
+
|
||||
+ if (furnaceBurnEvent.isCancelled())
|
||||
{
|
||||
- this.currentItemBurnTime = this.furnaceBurnTime = getItemBurnTime(this.furnaceItemStacks[1]);
|
||||
+ return;
|
||||
+ }
|
||||
|
||||
- if (this.furnaceBurnTime > 0)
|
||||
+ this.currentItemBurnTime = furnaceBurnEvent.getBurnTime();
|
||||
+ this.furnaceBurnTime += this.currentItemBurnTime;
|
||||
+
|
||||
+ if (this.furnaceBurnTime > 0 && furnaceBurnEvent.isBurning())
|
||||
+ {
|
||||
+ // CraftBukkit end
|
||||
+ flag1 = true;
|
||||
+
|
||||
+ if (this.furnaceItemStacks[1] != null)
|
||||
{
|
||||
- flag1 = true;
|
||||
+ --this.furnaceItemStacks[1].stackSize;
|
||||
|
||||
- if (this.furnaceItemStacks[1] != null)
|
||||
+ if (this.furnaceItemStacks[1].stackSize == 0)
|
||||
{
|
||||
- --this.furnaceItemStacks[1].stackSize;
|
||||
-
|
||||
- if (this.furnaceItemStacks[1].stackSize == 0)
|
||||
- {
|
||||
- this.furnaceItemStacks[1] = furnaceItemStacks[1].getItem().getContainerItem(furnaceItemStacks[1]);
|
||||
- }
|
||||
+ this.furnaceItemStacks[1] = furnaceItemStacks[1].getItem().getContainerItem(furnaceItemStacks[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
+ }
|
||||
|
||||
- if (this.isBurning() && this.canSmelt())
|
||||
- {
|
||||
- ++this.furnaceCookTime;
|
||||
+ /* CraftBukkit start - Moved up
|
||||
+ if (this.isBurning() && this.canSmelt())
|
||||
+ {
|
||||
+ ++this.furnaceCookTime;
|
||||
|
||||
- if (this.furnaceCookTime == 200)
|
||||
- {
|
||||
- this.furnaceCookTime = 0;
|
||||
- this.smeltItem();
|
||||
- flag1 = true;
|
||||
- }
|
||||
- }
|
||||
- else
|
||||
+ if (this.furnaceCookTime == 200)
|
||||
{
|
||||
this.furnaceCookTime = 0;
|
||||
+ this.smeltItem();
|
||||
+ flag1 = true;
|
||||
}
|
||||
}
|
||||
+ else
|
||||
+ {
|
||||
+ this.furnaceCookTime = 0;
|
||||
+ }
|
||||
+ // CraftBukkit end */
|
||||
|
||||
if (flag != this.furnaceBurnTime > 0)
|
||||
{
|
||||
@@ -277,16 +351,37 @@
|
||||
if (this.canSmelt())
|
||||
{
|
||||
ItemStack itemstack = FurnaceRecipes.smelting().getSmeltingResult(this.furnaceItemStacks[0]);
|
||||
+ // CraftBukkit start
|
||||
+ CraftItemStack source = CraftItemStack.asCraftMirror(this.furnaceItemStacks[0]);
|
||||
+ org.bukkit.inventory.ItemStack result = CraftItemStack.asBukkitCopy(itemstack);
|
||||
+ FurnaceSmeltEvent furnaceSmeltEvent = new FurnaceSmeltEvent(this.worldObj.getWorld().getBlockAt(this.xCoord, this.yCoord, this.zCoord), source, result);
|
||||
+ this.worldObj.getServer().getPluginManager().callEvent(furnaceSmeltEvent);
|
||||
|
||||
- if (this.furnaceItemStacks[2] == null)
|
||||
+ if (furnaceSmeltEvent.isCancelled())
|
||||
{
|
||||
- this.furnaceItemStacks[2] = itemstack.copy();
|
||||
+ return;
|
||||
}
|
||||
- else if (this.furnaceItemStacks[2].getItem() == itemstack.getItem())
|
||||
+
|
||||
+ result = furnaceSmeltEvent.getResult();
|
||||
+ itemstack = CraftItemStack.asNMSCopy(result);
|
||||
+
|
||||
+ if (itemstack != null)
|
||||
{
|
||||
- this.furnaceItemStacks[2].stackSize += itemstack.stackSize; // Forge BugFix: Results may have multiple items
|
||||
+ if (this.furnaceItemStacks[2] == null)
|
||||
+ {
|
||||
+ this.furnaceItemStacks[2] = itemstack;
|
||||
+ }
|
||||
+ else if (CraftItemStack.asCraftMirror(this.furnaceItemStacks[2]).isSimilar(result))
|
||||
+ {
|
||||
+ this.furnaceItemStacks[2].stackSize += itemstack.stackSize;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
}
|
||||
|
||||
+ // CraftBukkit end
|
||||
--this.furnaceItemStacks[0].stackSize;
|
||||
|
||||
if (this.furnaceItemStacks[0].stackSize <= 0)
|
245
patches/net/minecraft/tileentity/TileEntityHopper.java.patch
Normal file
245
patches/net/minecraft/tileentity/TileEntityHopper.java.patch
Normal file
@ -0,0 +1,245 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityHopper.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityHopper.java
|
||||
@@ -18,11 +18,52 @@
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
+// CraftBukkit start
|
||||
+import net.minecraft.entity.item.EntityMinecartHopper;
|
||||
+import net.minecraft.inventory.InventoryLargeChest;
|
||||
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
|
||||
+import org.bukkit.craftbukkit.inventory.CraftItemStack;
|
||||
+import org.bukkit.entity.HumanEntity;
|
||||
+import org.bukkit.event.inventory.InventoryMoveItemEvent;
|
||||
+import org.bukkit.event.inventory.InventoryPickupItemEvent;
|
||||
+import org.bukkit.inventory.Inventory;
|
||||
+// CraftBukkit end
|
||||
+
|
||||
public class TileEntityHopper extends TileEntity implements IHopper
|
||||
{
|
||||
private ItemStack[] field_145900_a = new ItemStack[5];
|
||||
private String field_145902_i;
|
||||
private int field_145901_j = -1;
|
||||
+
|
||||
+ // CraftBukkit start
|
||||
+ public List<HumanEntity> transaction = new java.util.ArrayList<HumanEntity>();
|
||||
+ private int maxStack = MAX_STACK;
|
||||
+
|
||||
+ public ItemStack[] getContents()
|
||||
+ {
|
||||
+ return this.field_145900_a;
|
||||
+ }
|
||||
+
|
||||
+ public void onOpen(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.add(who);
|
||||
+ }
|
||||
+
|
||||
+ public void onClose(CraftHumanEntity who)
|
||||
+ {
|
||||
+ transaction.remove(who);
|
||||
+ }
|
||||
+
|
||||
+ public List<HumanEntity> getViewers()
|
||||
+ {
|
||||
+ return transaction;
|
||||
+ }
|
||||
+
|
||||
+ public void setMaxStackSize(int size)
|
||||
+ {
|
||||
+ maxStack = size;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
private static final String __OBFID = "CL_00000359";
|
||||
|
||||
public void readFromNBT(NBTTagCompound p_145839_1_)
|
||||
@@ -212,12 +253,18 @@
|
||||
|
||||
if (flag)
|
||||
{
|
||||
- this.func_145896_c(8);
|
||||
+ this.func_145896_c(this.worldObj.getSpigotConfig().hopperTransfer); // Spigot // Cauldron
|
||||
this.markDirty();
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
+ // Spigot start
|
||||
+ if (!this.func_145888_j())
|
||||
+ {
|
||||
+ this.func_145896_c(this.worldObj.getSpigotConfig().hopperCheck); // Cauldron
|
||||
+ }
|
||||
+ // Spigot end
|
||||
return false;
|
||||
}
|
||||
else
|
||||
@@ -285,18 +332,70 @@
|
||||
if (this.getStackInSlot(j) != null)
|
||||
{
|
||||
ItemStack itemstack = this.getStackInSlot(j).copy();
|
||||
- ItemStack itemstack1 = func_145889_a(iinventory, this.decrStackSize(j, 1), i);
|
||||
-
|
||||
+ // CraftBukkit start - Call event when pushing items into other inventories
|
||||
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(this.decrStackSize(j, 1));
|
||||
+ Inventory destinationInventory;
|
||||
+
|
||||
+ // Have to special case large chests as they work oddly
|
||||
+ if (iinventory instanceof InventoryLargeChest)
|
||||
+ {
|
||||
+ destinationInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) iinventory);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ // Cauldron start - support mod inventories, with no owners
|
||||
+ try {
|
||||
+ if (iinventory.getOwner() != null) {
|
||||
+ destinationInventory = iinventory.getOwner().getInventory();
|
||||
+ } else {
|
||||
+ // TODO: create a mod inventory for passing to the event, instead of null
|
||||
+ destinationInventory = null;
|
||||
+ }
|
||||
+ } catch (AbstractMethodError e) { // fixes openblocks AbstractMethodError
|
||||
+ if (iinventory instanceof net.minecraft.tileentity.TileEntity) {
|
||||
+ org.bukkit.inventory.InventoryHolder holder = net.minecraftforge.cauldron.CauldronUtils.getOwner((net.minecraft.tileentity.TileEntity)iinventory);
|
||||
+ if (holder != null) {
|
||||
+ destinationInventory = holder.getInventory();
|
||||
+ } else {
|
||||
+ destinationInventory = null;
|
||||
+ }
|
||||
+ } else {
|
||||
+ destinationInventory = null;
|
||||
+ }
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
+ }
|
||||
+
|
||||
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(this.getOwner().getInventory(), oitemstack.clone(), destinationInventory, true);
|
||||
+ this.getWorldObj().getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled())
|
||||
+ {
|
||||
+ this.setInventorySlotContents(j, itemstack);
|
||||
+ this.func_145896_c(worldObj.spigotConfig.hopperTransfer); // Spigot
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ ItemStack itemstack1 = func_145889_a(iinventory, CraftItemStack.asNMSCopy(event.getItem()), i);
|
||||
+
|
||||
if (itemstack1 == null || itemstack1.stackSize == 0)
|
||||
{
|
||||
- iinventory.markDirty();
|
||||
+ if (event.getItem().equals(oitemstack))
|
||||
+ {
|
||||
+ iinventory.markDirty();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ this.setInventorySlotContents(j, itemstack);
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
return true;
|
||||
}
|
||||
-
|
||||
+
|
||||
this.setInventorySlotContents(j, itemstack);
|
||||
}
|
||||
}
|
||||
-
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -427,11 +526,70 @@
|
||||
if (itemstack != null && func_145890_b(p_145892_1_, itemstack, p_145892_2_, p_145892_3_))
|
||||
{
|
||||
ItemStack itemstack1 = itemstack.copy();
|
||||
- ItemStack itemstack2 = func_145889_a(p_145892_0_, p_145892_1_.decrStackSize(p_145892_2_, 1), -1);
|
||||
+ // CraftBukkit start - Call event on collection of items from inventories into the hopper
|
||||
+ CraftItemStack oitemstack = CraftItemStack.asCraftMirror(p_145892_1_.decrStackSize(p_145892_2_, 1));
|
||||
+ Inventory sourceInventory;
|
||||
|
||||
+ // Have to special case large chests as they work oddly
|
||||
+ if (p_145892_1_ instanceof InventoryLargeChest)
|
||||
+ {
|
||||
+ sourceInventory = new org.bukkit.craftbukkit.inventory.CraftInventoryDoubleChest((InventoryLargeChest) p_145892_1_);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ // Cauldron start - support mod inventories, with no owners
|
||||
+ try
|
||||
+ {
|
||||
+ if (p_145892_1_.getOwner() != null)
|
||||
+ {
|
||||
+ sourceInventory = p_145892_1_.getOwner().getInventory();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ // TODO: create a mod inventory for passing to the event, instead of null
|
||||
+ sourceInventory = null;
|
||||
+ }
|
||||
+ }
|
||||
+ catch (AbstractMethodError e)
|
||||
+ {
|
||||
+ sourceInventory = null;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
+ }
|
||||
+
|
||||
+ InventoryMoveItemEvent event = new InventoryMoveItemEvent(sourceInventory, oitemstack.clone(), p_145892_0_.getOwner().getInventory(), false);
|
||||
+ p_145892_0_.getWorldObj().getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled())
|
||||
+ {
|
||||
+ p_145892_1_.setInventorySlotContents(p_145892_2_, itemstack1);
|
||||
+
|
||||
+ if (p_145892_0_ instanceof TileEntityHopper)
|
||||
+ {
|
||||
+ ((TileEntityHopper) p_145892_0_).func_145896_c(p_145892_0_.getWorldObj().spigotConfig.hopperTransfer); // Spigot
|
||||
+ }
|
||||
+ else if (p_145892_0_ instanceof EntityMinecartHopper)
|
||||
+ {
|
||||
+ ((EntityMinecartHopper) p_145892_0_).setDisplayTileData(p_145892_0_.getWorldObj().spigotConfig.hopperTransfer / 2); // Spigot
|
||||
+ }
|
||||
+
|
||||
+ return false;
|
||||
+ }
|
||||
+
|
||||
+ ItemStack itemstack2 = func_145889_a(p_145892_0_, CraftItemStack.asNMSCopy(event.getItem()), -1);
|
||||
+
|
||||
if (itemstack2 == null || itemstack2.stackSize == 0)
|
||||
{
|
||||
- p_145892_1_.markDirty();
|
||||
+ if (event.getItem().equals(oitemstack))
|
||||
+ {
|
||||
+ p_145892_1_.markDirty();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ p_145892_1_.setInventorySlotContents(p_145892_2_, itemstack1);
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -451,6 +609,20 @@
|
||||
}
|
||||
else
|
||||
{
|
||||
+ // CraftBukkit start
|
||||
+ // Cauldron start - vanilla compatibility
|
||||
+ if (p_145898_0_.getOwner() != null && p_145898_1_.getBukkitEntity() != null)
|
||||
+ {
|
||||
+ InventoryPickupItemEvent event = new InventoryPickupItemEvent(p_145898_0_.getOwner().getInventory(), (org.bukkit.entity.Item) p_145898_1_.getBukkitEntity());
|
||||
+ p_145898_1_.worldObj.getServer().getPluginManager().callEvent(event);
|
||||
+
|
||||
+ if (event.isCancelled())
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
+ // CraftBukkit end
|
||||
ItemStack itemstack = p_145898_1_.getEntityItem().copy();
|
||||
ItemStack itemstack1 = func_145889_a(p_145898_0_, itemstack, -1);
|
||||
|
27
patches/net/minecraft/tileentity/TileEntityNote.java.patch
Normal file
27
patches/net/minecraft/tileentity/TileEntityNote.java.patch
Normal file
@ -0,0 +1,27 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityNote.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityNote.java
|
||||
@@ -68,7 +68,23 @@
|
||||
b0 = 4;
|
||||
}
|
||||
|
||||
- p_145878_1_.addBlockEvent(p_145878_2_, p_145878_3_, p_145878_4_, Blocks.noteblock, b0, this.note);
|
||||
+ // CraftBukkit start
|
||||
+ org.bukkit.event.block.NotePlayEvent event = org.bukkit.craftbukkit.event.CraftEventFactory.callNotePlayEvent(this.worldObj, p_145878_2_, p_145878_3_, p_145878_4_, b0, this.note);
|
||||
+
|
||||
+ if (!event.isCancelled())
|
||||
+ {
|
||||
+ this.worldObj.addBlockEvent(p_145878_2_, p_145878_3_, p_145878_4_, Blocks.noteblock, event.getInstrument().getType(), event.getNote().getId());
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
}
|
||||
}
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
14
patches/net/minecraft/tileentity/TileEntityPiston.java.patch
Normal file
14
patches/net/minecraft/tileentity/TileEntityPiston.java.patch
Normal file
@ -0,0 +1,14 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntityPiston.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntityPiston.java
|
||||
@@ -140,6 +140,11 @@
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
+ if (this.worldObj == null)
|
||||
+ {
|
||||
+ return; // CraftBukkit
|
||||
+ }
|
||||
+
|
||||
this.lastProgress = this.progress;
|
||||
|
||||
if (this.lastProgress >= 1.0F)
|
59
patches/net/minecraft/tileentity/TileEntitySign.java.patch
Normal file
59
patches/net/minecraft/tileentity/TileEntitySign.java.patch
Normal file
@ -0,0 +1,59 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntitySign.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntitySign.java
|
||||
@@ -11,7 +11,7 @@
|
||||
{
|
||||
public String[] signText = new String[] {"", "", "", ""};
|
||||
public int lineBeingEdited = -1;
|
||||
- private boolean field_145916_j = true;
|
||||
+ public boolean field_145916_j = true; // CraftBukkit - private -> public
|
||||
private EntityPlayer field_145917_k;
|
||||
private static final String __OBFID = "CL_00000363";
|
||||
|
||||
@@ -43,7 +43,19 @@
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
String[] astring = new String[4];
|
||||
- System.arraycopy(this.signText, 0, astring, 0, 4);
|
||||
+
|
||||
+ // CraftBukkit start - Limit sign text to 15 chars per line
|
||||
+ for (int i = 0; i < 4; ++i)
|
||||
+ {
|
||||
+ astring[i] = this.signText[i];
|
||||
+
|
||||
+ if (this.signText[i].length() > 15)
|
||||
+ {
|
||||
+ astring[i] = this.signText[i].substring(0, 15);
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
+ // CraftBukkit end
|
||||
return new S33PacketUpdateSign(this.xCoord, this.yCoord, this.zCoord, astring);
|
||||
}
|
||||
|
||||
@@ -72,4 +84,26 @@
|
||||
{
|
||||
return this.field_145917_k;
|
||||
}
|
||||
+
|
||||
+ // CraftBukkit start - central method to limit sign text to 15 chars per line
|
||||
+ public static String[] sanitizeLines(String[] lines) {
|
||||
+ String[] astring = new String[4];
|
||||
+ for (int i = 0; i < 4; ++i) {
|
||||
+ astring[i] = lines[i];
|
||||
+
|
||||
+ if (lines[i].length() > 15) {
|
||||
+ astring[i] = lines[i].substring(0, 15);
|
||||
+ }
|
||||
+ }
|
||||
+ return astring;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
}
|
31
patches/net/minecraft/tileentity/TileEntitySkull.java.patch
Normal file
31
patches/net/minecraft/tileentity/TileEntitySkull.java.patch
Normal file
@ -0,0 +1,31 @@
|
||||
--- ../src-base/minecraft/net/minecraft/tileentity/TileEntitySkull.java
|
||||
+++ ../src-work/minecraft/net/minecraft/tileentity/TileEntitySkull.java
|
||||
@@ -79,6 +79,14 @@
|
||||
this.func_152109_d();
|
||||
}
|
||||
|
||||
+ // Cauldron start
|
||||
+ @Override
|
||||
+ public boolean canUpdate()
|
||||
+ {
|
||||
+ return false;
|
||||
+ }
|
||||
+ // Cauldron end
|
||||
+
|
||||
private void func_152109_d()
|
||||
{
|
||||
if (this.field_152110_j != null && !StringUtils.isNullOrEmpty(this.field_152110_j.getName()))
|
||||
@@ -113,6 +121,13 @@
|
||||
this.field_145910_i = p_145903_1_;
|
||||
}
|
||||
|
||||
+ // CraftBukkit start
|
||||
+ public int getRotation()
|
||||
+ {
|
||||
+ return this.field_145910_i;
|
||||
+ }
|
||||
+ // CraftBukkit end
|
||||
+
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int func_145906_b()
|
||||
{
|
Reference in New Issue
Block a user