From ce7ae6029d887931475075fd361ad3e4ec22b782 Mon Sep 17 00:00:00 2001 From: Kino Date: Tue, 27 Dec 2016 15:26:59 -0500 Subject: [PATCH] Assigned creature type for hostile mobs This is to fix a sponge issue that is making the aether unplayable --- .../aether/server/entities/hostile/EntityAechorPlant.java | 7 +++++++ .../aether/server/entities/hostile/EntityCockatrice.java | 7 +++++++ .../aether/server/entities/hostile/EntityZephyr.java | 7 +++++++ .../aether/server/entities/passive/EntityAerwhale.java | 7 +++++++ 4 files changed, 28 insertions(+) diff --git a/src/main/java/com/legacy/aether/server/entities/hostile/EntityAechorPlant.java b/src/main/java/com/legacy/aether/server/entities/hostile/EntityAechorPlant.java index 3b273be..c470c64 100644 --- a/src/main/java/com/legacy/aether/server/entities/hostile/EntityAechorPlant.java +++ b/src/main/java/com/legacy/aether/server/entities/hostile/EntityAechorPlant.java @@ -2,6 +2,7 @@ package com.legacy.aether.server.entities.hostile; import net.minecraft.entity.Entity; import net.minecraft.entity.EntityAgeable; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.SoundEvents; @@ -52,6 +53,12 @@ public class EntityAechorPlant extends EntityAetherAnimal this.tasks.addTask(0, new AechorPlantAIShootPlayer(this)); } + @Override + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { + return type == EnumCreatureType.MONSTER; + } + @Override public void onLivingUpdate() { diff --git a/src/main/java/com/legacy/aether/server/entities/hostile/EntityCockatrice.java b/src/main/java/com/legacy/aether/server/entities/hostile/EntityCockatrice.java index 1075f8f..ff64700 100644 --- a/src/main/java/com/legacy/aether/server/entities/hostile/EntityCockatrice.java +++ b/src/main/java/com/legacy/aether/server/entities/hostile/EntityCockatrice.java @@ -1,5 +1,6 @@ package com.legacy.aether.server.entities.hostile; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAINearestAttackableTarget; @@ -73,6 +74,12 @@ public class EntityCockatrice extends EntityMob return this.worldObj.getBlockState(pos).getBlock() == BlocksAether.aether_grass ? 10.0F : 0.0F; } + @Override + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { + return type == EnumCreatureType.MONSTER; + } + @Override public void onUpdate() { diff --git a/src/main/java/com/legacy/aether/server/entities/hostile/EntityZephyr.java b/src/main/java/com/legacy/aether/server/entities/hostile/EntityZephyr.java index e18a299..c51483a 100644 --- a/src/main/java/com/legacy/aether/server/entities/hostile/EntityZephyr.java +++ b/src/main/java/com/legacy/aether/server/entities/hostile/EntityZephyr.java @@ -1,6 +1,7 @@ package com.legacy.aether.server.entities.hostile; import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.ai.EntityAIWatchClosest; import net.minecraft.entity.monster.IMob; @@ -61,6 +62,12 @@ public class EntityZephyr extends EntityFlying implements IMob return this.worldObj.getLight(pos) > 8 && this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox().expand(0D, 10D, 0D)) && this.worldObj.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.containsAnyLiquid(this.getEntityBoundingBox()); } + @Override + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { + return type == EnumCreatureType.AMBIENT; + } + @Override public void onEntityUpdate() { diff --git a/src/main/java/com/legacy/aether/server/entities/passive/EntityAerwhale.java b/src/main/java/com/legacy/aether/server/entities/passive/EntityAerwhale.java index d96e826..1bc486b 100644 --- a/src/main/java/com/legacy/aether/server/entities/passive/EntityAerwhale.java +++ b/src/main/java/com/legacy/aether/server/entities/passive/EntityAerwhale.java @@ -1,6 +1,7 @@ package com.legacy.aether.server.entities.passive; import net.minecraft.entity.EntityFlying; +import net.minecraft.entity.EnumCreatureType; import net.minecraft.entity.SharedMonsterAttributes; import net.minecraft.entity.ai.EntityAILookIdle; import net.minecraft.entity.monster.IMob; @@ -63,6 +64,12 @@ public class EntityAerwhale extends EntityFlying implements IMob return this.worldObj.getLight(pos) > 8 && this.worldObj.checkNoEntityCollision(this.getEntityBoundingBox().expand(0D, 30D, 0D)) && this.worldObj.getCollisionBoxes(this, this.getEntityBoundingBox()).isEmpty() && !this.worldObj.containsAnyLiquid(this.getEntityBoundingBox()); } + @Override + public boolean isCreatureType(EnumCreatureType type, boolean forSpawnCount) + { + return type == EnumCreatureType.AMBIENT; + } + @Override public void onUpdate() {