mirror of
https://github.com/barkeser2002/CatServer.git
synced 2026-09-25 08:39:58 +03:00
65 lines
3.2 KiB
Diff
65 lines
3.2 KiB
Diff
--- ../src-base/minecraft/net/minecraft/entity/monster/EntitySpider.java
|
|
+++ ../src-work/minecraft/net/minecraft/entity/monster/EntitySpider.java
|
|
@@ -55,13 +55,13 @@
|
|
{
|
|
this.tasks.addTask(1, new EntityAISwimming(this));
|
|
this.tasks.addTask(3, new EntityAILeapAtTarget(this, 0.4F));
|
|
- this.tasks.addTask(4, new EntitySpider.AISpiderAttack(this));
|
|
+ this.tasks.addTask(4, new AISpiderAttack(this));
|
|
this.tasks.addTask(5, new EntityAIWanderAvoidWater(this, 0.8D));
|
|
this.tasks.addTask(6, new EntityAIWatchClosest(this, EntityPlayer.class, 8.0F));
|
|
this.tasks.addTask(6, new EntityAILookIdle(this));
|
|
this.targetTasks.addTask(1, new EntityAIHurtByTarget(this, false, new Class[0]));
|
|
- this.targetTasks.addTask(2, new EntitySpider.AISpiderTarget(this, EntityPlayer.class));
|
|
- this.targetTasks.addTask(3, new EntitySpider.AISpiderTarget(this, EntityIronGolem.class));
|
|
+ this.targetTasks.addTask(2, new AISpiderTarget(this, EntityPlayer.class));
|
|
+ this.targetTasks.addTask(3, new AISpiderTarget(this, EntityIronGolem.class));
|
|
}
|
|
|
|
public double getMountedYOffset()
|
|
@@ -139,7 +139,13 @@
|
|
|
|
public boolean isPotionApplicable(PotionEffect potioneffectIn)
|
|
{
|
|
- return potioneffectIn.getPotion() == MobEffects.POISON ? false : super.isPotionApplicable(potioneffectIn);
|
|
+ if(potioneffectIn.getPotion() == MobEffects.POISON)
|
|
+ {
|
|
+ net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent event = new net.minecraftforge.event.entity.living.PotionEvent.PotionApplicableEvent(this, potioneffectIn);
|
|
+ net.minecraftforge.common.MinecraftForge.EVENT_BUS.post(event);
|
|
+ return event.getResult() == net.minecraftforge.fml.common.eventhandler.Event.Result.ALLOW;
|
|
+ }
|
|
+ return super.isPotionApplicable(potioneffectIn);
|
|
}
|
|
|
|
public boolean isBesideClimbableBlock()
|
|
@@ -173,23 +179,24 @@
|
|
EntitySkeleton entityskeleton = new EntitySkeleton(this.world);
|
|
entityskeleton.setLocationAndAngles(this.posX, this.posY, this.posZ, this.rotationYaw, 0.0F);
|
|
entityskeleton.onInitialSpawn(difficulty, (IEntityLivingData)null);
|
|
- this.world.spawnEntity(entityskeleton);
|
|
+ // this.world.spawnEntity(entityskeleton);
|
|
+ this.world.addEntity(entityskeleton, org.bukkit.event.entity.CreatureSpawnEvent.SpawnReason.JOCKEY);
|
|
entityskeleton.startRiding(this);
|
|
}
|
|
|
|
if (livingdata == null)
|
|
{
|
|
- livingdata = new EntitySpider.GroupData();
|
|
+ livingdata = new GroupData();
|
|
|
|
if (this.world.getDifficulty() == EnumDifficulty.HARD && this.world.rand.nextFloat() < 0.1F * difficulty.getClampedAdditionalDifficulty())
|
|
{
|
|
- ((EntitySpider.GroupData)livingdata).setRandomEffect(this.world.rand);
|
|
+ ((GroupData)livingdata).setRandomEffect(this.world.rand);
|
|
}
|
|
}
|
|
|
|
- if (livingdata instanceof EntitySpider.GroupData)
|
|
+ if (livingdata instanceof GroupData)
|
|
{
|
|
- Potion potion = ((EntitySpider.GroupData)livingdata).effect;
|
|
+ Potion potion = ((GroupData)livingdata).effect;
|
|
|
|
if (potion != null)
|
|
{
|