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,23 +1,33 @@
--- ../src-base/minecraft/net/minecraftforge/event/world/BlockEvent.java
+++ ../src-work/minecraft/net/minecraftforge/event/world/BlockEvent.java
@@ -16,6 +16,16 @@
import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.util.BlockSnapshot;
@@ -3,17 +3,23 @@
import java.util.ArrayList;
import java.util.List;
+import org.bukkit.block.BlockState;
+import org.bukkit.craftbukkit.block.CraftBlockState;
+// Cauldron start
+import org.bukkit.craftbukkit.event.CraftEventFactory;
+import org.bukkit.event.block.BlockBreakEvent;
+import org.bukkit.event.block.BlockMultiPlaceEvent;
+
import com.google.common.collect.ImmutableList;
+import cc.capture.type.CaptureBlock;
import cpw.mods.fml.common.eventhandler.Cancelable;
import cpw.mods.fml.common.eventhandler.Event;
import net.minecraft.block.Block;
-import net.minecraft.enchantment.EnchantmentHelper;
import net.minecraft.entity.player.EntityPlayer;
-import net.minecraft.init.Blocks;
+import net.minecraft.entity.player.EntityPlayerMP;
+// Cauldron end
+
public class BlockEvent extends Event {
private static final boolean DEBUG = Boolean.parseBoolean(System.getProperty("forge.debugBlockEvent", "false"));
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
-import net.minecraftforge.common.ForgeHooks;
import net.minecraftforge.common.util.BlockSnapshot;
@@ -80,17 +90,18 @@
public class BlockEvent extends Event {
@@ -80,17 +86,18 @@
super(x, y, z, world, block, blockMetadata);
this.player = player;
@ -42,7 +52,7 @@
}
public EntityPlayer getPlayer()
@@ -140,6 +151,16 @@
@@ -140,6 +147,21 @@
this.blockSnapshot = blockSnapshot;
this.placedBlock = blockSnapshot.getCurrentBlock();
this.placedAgainst = placedAgainst;
@ -54,12 +64,17 @@
+ if(bukkitEvent.isCancelled()||!bukkitEvent.canBuild()){
+ this.setCanceled(true);
+ }
+
+ CaptureBlock tCapture=world.mCapture.getLastBlockCapture();
+ if(tCapture!=null&&tCapture.mEnable){
+ tCapture.addCheckedBlock(world,x,y,z);
+ }
+ }
+ // Cauldron end
if (DEBUG)
{
System.out.printf("Created PlaceEvent - [PlacedBlock: %s ][PlacedAgainst: %s ][ItemStack: %s ][Player: %s ]\n", placedBlock, placedAgainst, player.getCurrentEquippedItem(), player);
@@ -160,7 +181,17 @@
@@ -160,7 +182,17 @@
public MultiPlaceEvent(List<BlockSnapshot> blockSnapshots, Block placedAgainst, EntityPlayer player) {
super(blockSnapshots.get(0), placedAgainst, player);