Removed horse altering events, can't get them to work properly

This commit is contained in:
Adubbz 2013-07-05 12:25:22 +10:00
parent c1011ac73b
commit 5932080022
3 changed files with 2 additions and 109 deletions

View file

@ -9,7 +9,6 @@ import net.minecraft.entity.effect.EntityLightningBolt;
import net.minecraft.entity.monster.EntityEnderman;
import net.minecraft.entity.passive.EntityChicken;
import net.minecraft.entity.passive.EntityCow;
import net.minecraft.entity.passive.EntityHorse;
import net.minecraft.entity.passive.EntityPig;
import net.minecraft.entity.passive.EntitySheep;
import net.minecraft.entity.passive.EntityVillager;
@ -25,9 +24,7 @@ import net.minecraftforge.event.Event.Result;
import net.minecraftforge.event.ForgeSubscribe;
import net.minecraftforge.event.entity.EntityJoinWorldEvent;
import net.minecraftforge.event.entity.living.LivingHurtEvent;
import net.minecraftforge.event.entity.living.LivingSpawnEvent.CheckSpawn;
import net.minecraftforge.event.entity.player.EntityInteractEvent;
import biomesoplenty.api.Biomes;
import biomesoplenty.api.Blocks;
import biomesoplenty.api.Items;
import biomesoplenty.configuration.BOPConfiguration;
@ -84,72 +81,6 @@ public class EntityEventHandler
}
}
}*/
@ForgeSubscribe
public void canHorseSpawn(CheckSpawn event)
{
World world = event.world;
if (event.entity instanceof EntityHorse)
{
int x = MathHelper.floor_double(event.entity.posX);
int y = MathHelper.floor_double(event.entity.boundingBox.minY);
int z = MathHelper.floor_double(event.entity.posZ);
EntityHorse horse = (EntityHorse)event.entity;
//horse.getDataWatcher().updateObject(19, Byte.valueOf((byte)x); x: 0 = Horses, 1 = Mules, 2 = Dark Brown Donkey, 3 = Zombie Horse, 4 = Skeleton Horse
if (world.getBiomeGenForCoords(x, z).biomeID == Biomes.deadlands.get().biomeID)
{
if (horse.getDataWatcher().getWatchableObjectByte(19) == (byte)4)
{
event.setResult(Result.ALLOW);
}
else
{
event.setResult(Result.DENY);
event.setCanceled(true);
}
}
if (world.getBiomeGenForCoords(x, z).biomeID == Biomes.wasteland.get().biomeID)
{
if (horse.getDataWatcher().getWatchableObjectByte(19) == (byte)3)
{
event.setResult(Result.ALLOW);
}
else
{
event.setResult(Result.DENY);
event.setCanceled(true);
}
}
}
}
@ForgeSubscribe
public void changeHorseType(EntityJoinWorldEvent event)
{
World world = event.world;
if (event.entity instanceof EntityHorse)
{
int x = MathHelper.floor_double(event.entity.posX);
int y = MathHelper.floor_double(event.entity.boundingBox.minY);
int z = MathHelper.floor_double(event.entity.posZ);
EntityHorse horse = (EntityHorse)event.entity;
//horse.getDataWatcher().updateObject(19, Byte.valueOf((byte)x); x: 0 = Horses, 1 = Mules, 2 = Dark Brown Donkey, 3 = Zombie Horse, 4 = Skeleton Horse
if (world.getBiomeGenForCoords(x, z).biomeID == Biomes.deadlands.get().biomeID)
{
horse.getDataWatcher().updateObject(19, Byte.valueOf((byte)4));
}
if (world.getBiomeGenForCoords(x, z).biomeID == Biomes.wasteland.get().biomeID)
{
horse.getDataWatcher().updateObject(19, Byte.valueOf((byte)3));
}
}
}
@ForgeSubscribe
public void fallingFromPromisedLand(LivingHurtEvent event)

View file

@ -12,11 +12,10 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.liquids.ILiquid;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluidLiquidPoison extends BlockFluidClassic implements ILiquid
public class BlockFluidLiquidPoison extends BlockFluidClassic
{
public static Icon liquidPoisonStillIcon;
public static Icon liquidPoisonFlowingIcon;
@ -79,22 +78,4 @@ public class BlockFluidLiquidPoison extends BlockFluidClassic implements ILiquid
{
return par1 != 0 && par1 != 1 ? liquidPoisonFlowingIcon : liquidPoisonStillIcon;
}
@Override
public int stillLiquidId()
{
return this.blockID;
}
@Override
public boolean isMetaSensitive()
{
return false;
}
@Override
public int stillLiquidMeta()
{
return 0;
}
}

View file

@ -17,13 +17,12 @@ import net.minecraftforge.fluids.BlockFluidClassic;
import net.minecraftforge.fluids.Fluid;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.liquids.ILiquid;
import biomesoplenty.BiomesOPlenty;
import biomesoplenty.api.Liquids;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
public class BlockFluidSpringWater extends BlockFluidClassic implements ILiquid
public class BlockFluidSpringWater extends BlockFluidClassic
{
public static Icon springWaterStillIcon;
public static Icon springWaterFlowingIcon;
@ -113,22 +112,4 @@ public class BlockFluidSpringWater extends BlockFluidClassic implements ILiquid
{
return par1 != 0 && par1 != 1 ? springWaterFlowingIcon : springWaterStillIcon;
}
@Override
public int stillLiquidId()
{
return this.blockID;
}
@Override
public boolean isMetaSensitive()
{
return false;
}
@Override
public int stillLiquidMeta()
{
return 0;
}
}