mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 02:20:01 +03:00
49 lines
2.3 KiB
Diff
49 lines
2.3 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/item/EntityEnderCrystal.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/item/EntityEnderCrystal.java
|
|
@@ -17,6 +17,8 @@
|
|
import net.minecraft.world.end.DragonFightManager;
|
|
import net.minecraftforge.fml.relauncher.Side;
|
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
|
+import org.bukkit.craftbukkit.event.CraftEventFactory;
|
|
+import org.bukkit.event.entity.ExplosionPrimeEvent;
|
|
|
|
public class EntityEnderCrystal extends Entity
|
|
{
|
|
@@ -62,7 +64,10 @@
|
|
|
|
if (this.world.provider instanceof WorldProviderEnd && this.world.getBlockState(blockpos).getBlock() != Blocks.FIRE)
|
|
{
|
|
- this.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState());
|
|
+// this.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState());
|
|
+ if (!CraftEventFactory.callBlockIgniteEvent(this.world, blockpos.getX(), blockpos.getY(), blockpos.getZ(), this).isCancelled()) {
|
|
+ this.world.setBlockState(blockpos, Blocks.FIRE.getDefaultState());
|
|
+ }
|
|
}
|
|
}
|
|
}
|
|
@@ -109,13 +114,23 @@
|
|
{
|
|
if (!this.isDead && !this.world.isRemote)
|
|
{
|
|
+ if (CraftEventFactory.handleNonLivingEntityDamageEvent(this, source, amount)) {
|
|
+ return false;
|
|
+ }
|
|
this.setDead();
|
|
|
|
if (!this.world.isRemote)
|
|
{
|
|
if (!source.isExplosion())
|
|
{
|
|
- this.world.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true);
|
|
+// this.world.createExplosion((Entity)null, this.posX, this.posY, this.posZ, 6.0F, true);
|
|
+ ExplosionPrimeEvent event = new ExplosionPrimeEvent(this.getBukkitEntity(), 6.0F, true);
|
|
+ this.world.getServer().getPluginManager().callEvent(event);
|
|
+ if (event.isCancelled()) {
|
|
+ this.isDead = false;
|
|
+ return false;
|
|
+ }
|
|
+ this.world.createExplosion(this, this.posX, this.posY, this.posZ, event.getRadius(), event.getFire());
|
|
}
|
|
|
|
this.onCrystalDestroyed(source);
|