3
0

模块化方块捕获还原动作

This commit is contained in:
2017-07-04 14:29:35 +08:00
parent 559b9ad248
commit bfe43ae465
12 changed files with 992 additions and 402 deletions

View File

@ -1,37 +1,23 @@
--- ../src-base/minecraft/net/minecraft/entity/player/InventoryPlayer.java
+++ ../src-work/minecraft/net/minecraft/entity/player/InventoryPlayer.java
@@ -2,10 +2,13 @@
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
+
import java.util.concurrent.Callable;
+
import net.minecraft.block.Block;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
+import net.minecraft.entity.item.EntityItem;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.Item;
import net.minecraft.item.ItemArmor;
@@ -13,7 +16,16 @@
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.nbt.NBTTagList;
import net.minecraft.util.ReportedException;
+import net.minecraftforge.common.util.EntitySnapshot;
@@ -1,8 +1,15 @@
package net.minecraft.entity.player;
+// CraftBukkit start
+import java.util.List;
+import java.util.concurrent.Callable;
+
+import org.bukkit.craftbukkit.entity.CraftHumanEntity;
+import org.bukkit.entity.HumanEntity;
+// CraftBukkit end
+import org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason;
+
public class InventoryPlayer implements IInventory
{
public ItemStack[] mainInventory = new ItemStack[36];
@@ -25,7 +37,46 @@
+import cc.capture.type.CaptureBlock;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
-import java.util.concurrent.Callable;
import net.minecraft.block.Block;
import net.minecraft.crash.CrashReport;
import net.minecraft.crash.CrashReportCategory;
@@ -25,7 +32,46 @@
private ItemStack itemStack;
public boolean inventoryChanged;
private static final String __OBFID = "CL_00001709";
@ -78,7 +64,7 @@
public InventoryPlayer(EntityPlayer p_i1750_1_)
{
this.player = p_i1750_1_;
@@ -81,6 +132,34 @@
@@ -81,6 +127,34 @@
return -1;
}
@ -113,18 +99,19 @@
public int getFirstEmptyStack()
{
for (int i = 0; i < this.mainInventory.length; ++i)
@@ -350,6 +429,10 @@
@@ -350,6 +424,11 @@
{
if (p_70441_1_ != null && p_70441_1_.stackSize != 0 && p_70441_1_.getItem() != null)
{
+ if(player.worldObj.captureBlockSnapshots){
+ player.worldObj.capturedItems.add(ItemStack.copyItemStack(p_70441_1_));
+ CaptureBlock tBlockCapture=player.worldObj.mCapture.getLastBlockCapture();
+ if(tBlockCapture!=null&&tBlockCapture.mEnable){
+ tBlockCapture.addCaptureItem(player,ItemStack.copyItemStack(p_70441_1_));
+ return true;
+ }
try
{
int i;
@@ -430,25 +513,24 @@
@@ -430,25 +509,24 @@
if (aitemstack[p_70298_1_] != null)
{
@ -158,7 +145,7 @@
}
else
{
@@ -658,7 +740,7 @@
@@ -658,7 +736,7 @@
if (this.mainInventory[i] != null)
{
this.player.func_146097_a(this.mainInventory[i], true, false);
@ -167,7 +154,7 @@
}
}
@@ -667,7 +749,7 @@
@@ -667,7 +745,7 @@
if (this.armorInventory[i] != null)
{
this.player.func_146097_a(this.armorInventory[i], true, false);