Updated to the latest MCP mappings and Forge. Entities now work.
This commit is contained in:
parent
522406c2f5
commit
519c1b844b
|
@ -1,4 +1,4 @@
|
||||||
minecraft_version=1.11
|
minecraft_version=1.11
|
||||||
forge_version=13.19.0.2133
|
forge_version=13.19.0.2152
|
||||||
mod_version=6.0.0
|
mod_version=6.0.0
|
||||||
mappings_version=snapshot_nodoc_20161115
|
mappings_version=snapshot_nodoc_20161118
|
||||||
|
|
|
@ -78,7 +78,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera
|
||||||
|
|
||||||
public int getAmountToScatter(Random random)
|
public int getAmountToScatter(Random random)
|
||||||
{
|
{
|
||||||
int amount = MathHelper.floor_float(this.amountPerChunk);
|
int amount = MathHelper.floor(this.amountPerChunk);
|
||||||
float remainder = this.amountPerChunk - amount;
|
float remainder = this.amountPerChunk - amount;
|
||||||
if (random.nextFloat() < remainder) {amount++;}
|
if (random.nextFloat() < remainder) {amount++;}
|
||||||
return amount;
|
return amount;
|
||||||
|
|
|
@ -61,7 +61,7 @@ public class EntityPixieTrailFX extends Particle
|
||||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particleTexturesLocation);
|
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particleTexturesLocation);
|
||||||
|
|
||||||
float scaleMultiplier = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
|
float scaleMultiplier = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge * 32.0F;
|
||||||
scaleMultiplier = MathHelper.clamp_float(scaleMultiplier, 0.0F, 1.0F);
|
scaleMultiplier = MathHelper.clamp(scaleMultiplier, 0.0F, 1.0F);
|
||||||
this.particleScale = this.particleScale * scaleMultiplier;
|
this.particleScale = this.particleScale * scaleMultiplier;
|
||||||
|
|
||||||
GlStateManager.depthMask(false);
|
GlStateManager.depthMask(false);
|
||||||
|
@ -88,7 +88,7 @@ public class EntityPixieTrailFX extends Particle
|
||||||
}
|
}
|
||||||
|
|
||||||
this.particleTextureIndexX = 7 - particleAge * 8 / particleMaxAge;
|
this.particleTextureIndexX = 7 - particleAge * 8 / particleMaxAge;
|
||||||
this.moveEntity(motionX, motionY, motionZ);
|
this.move(motionX, motionY, motionZ);
|
||||||
|
|
||||||
if (posY == prevPosY)
|
if (posY == prevPosY)
|
||||||
{
|
{
|
||||||
|
|
|
@ -51,6 +51,7 @@ import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraft.world.biome.Biome;
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraft.world.chunk.ChunkPrimer;
|
import net.minecraft.world.chunk.ChunkPrimer;
|
||||||
|
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||||
|
|
||||||
public class BOPBiome extends Biome implements IExtendedBiome
|
public class BOPBiome extends Biome implements IExtendedBiome
|
||||||
{
|
{
|
||||||
|
@ -196,7 +197,7 @@ public class BOPBiome extends Biome implements IExtendedBiome
|
||||||
// Look for an entity class matching this name
|
// Look for an entity class matching this name
|
||||||
// case insensitive, dot used as mod delimiter, no spaces or underscores
|
// case insensitive, dot used as mod delimiter, no spaces or underscores
|
||||||
// eg 'villager', 'Zombie', 'SQUID', 'enderdragon', 'biomesoplenty.wasp' all ok
|
// eg 'villager', 'Zombie', 'SQUID', 'enderdragon', 'biomesoplenty.wasp' all ok
|
||||||
Class <? extends Entity> entityClazz = EntityList.field_191308_b.getObject(new ResourceLocation(entityName));
|
Class <? extends Entity> entityClazz = ForgeRegistries.ENTITIES.getValue(new ResourceLocation(entityName)).getEntityClass();
|
||||||
Class <? extends EntityLiving> livingClazz = null;
|
Class <? extends EntityLiving> livingClazz = null;
|
||||||
if (!(entityClazz.isAssignableFrom(EntityLiving.class))) {
|
if (!(entityClazz.isAssignableFrom(EntityLiving.class))) {
|
||||||
confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving");
|
confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving");
|
||||||
|
|
|
@ -133,19 +133,12 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration {
|
||||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||||
{
|
{
|
||||||
if (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos.up()).getBlock().isReplaceable(world, pos.up()) && this.canBlockStay(world, pos, this.getStateFromMeta(meta))) {
|
if (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos.up()).getBlock().isReplaceable(world, pos.up()) && this.canBlockStay(world, pos, this.getStateFromMeta(meta))) {
|
||||||
return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer);
|
return this.getStateFromMeta(meta).withProperty(HALF, Half.LOWER);
|
||||||
}
|
}
|
||||||
|
|
||||||
return world.getBlockState(pos);
|
return world.getBlockState(pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called by ItemBlock before the block is placed - the placed block must always be Half.LOWER
|
|
||||||
@Override
|
|
||||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
|
||||||
{
|
|
||||||
return this.getStateFromMeta(meta).withProperty(HALF, Half.LOWER);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Called by ItemBlock after the (lower) block has been placed
|
// Called by ItemBlock after the (lower) block has been placed
|
||||||
// Use it to add the top half of the block
|
// Use it to add the top half of the block
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -115,7 +115,7 @@ public class BlockBOPGemOre extends Block implements IBOPBlock
|
||||||
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
|
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
|
||||||
{
|
{
|
||||||
Random rand = world instanceof World ? ((World)world).rand : new Random();
|
Random rand = world instanceof World ? ((World)world).rand : new Random();
|
||||||
return MathHelper.getRandomIntegerInRange(rand, 3, 7);
|
return MathHelper.getInt(rand, 3, 7);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -168,7 +168,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public IBlockState onBlockPlaced(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||||
{
|
{
|
||||||
IBlockState state = this.getStateFromMeta(meta);
|
IBlockState state = this.getStateFromMeta(meta);
|
||||||
switch ((BOPGrassType) state.getValue(VARIANT))
|
switch ((BOPGrassType) state.getValue(VARIANT))
|
||||||
|
|
|
@ -164,7 +164,7 @@ public class BlockBOPHive extends Block implements IBOPBlock
|
||||||
case EMPTY_HONEYCOMB:
|
case EMPTY_HONEYCOMB:
|
||||||
EntityWasp wasp = new EntityWasp(worldIn);
|
EntityWasp wasp = new EntityWasp(worldIn);
|
||||||
wasp.setLocationAndAngles((double)pos.getX() + 0.6D, (double)pos.getY(), (double)pos.getZ() + 0.3D, 0.0F, 0.0F);
|
wasp.setLocationAndAngles((double)pos.getX() + 0.6D, (double)pos.getY(), (double)pos.getZ() + 0.3D, 0.0F, 0.0F);
|
||||||
worldIn.spawnEntityInWorld(wasp);
|
worldIn.spawnEntity(wasp);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -187,7 +187,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
|
||||||
|
|
||||||
// blocks that are not placed during generation should not decay
|
// blocks that are not placed during generation should not decay
|
||||||
@Override
|
@Override
|
||||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
public IBlockState getStateForPlacement(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||||
{
|
{
|
||||||
return this.getStateFromMeta(meta).withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false));
|
return this.getStateFromMeta(meta).withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false));
|
||||||
}
|
}
|
||||||
|
@ -203,11 +203,11 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
|
||||||
// leaves in the inventory should not be decayable
|
// leaves in the inventory should not be decayable
|
||||||
//TODO REMOVE
|
//TODO REMOVE
|
||||||
@Override
|
@Override
|
||||||
protected ItemStack createStackedBlock(IBlockState state)
|
protected ItemStack getSilkTouchDrop(IBlockState state)
|
||||||
{
|
{
|
||||||
IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false));
|
IBlockState newState = state.withProperty(CHECK_DECAY, Boolean.valueOf(false)).withProperty(DECAYABLE, Boolean.valueOf(false));
|
||||||
|
|
||||||
return super.createStackedBlock(newState);
|
return super.getSilkTouchDrop(newState);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -439,7 +439,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
|
||||||
// poison ivy poisons players who walk into it, unless they're wearing boots and pants
|
// poison ivy poisons players who walk into it, unless they're wearing boots and pants
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
||||||
if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) {
|
if (inventory.armorInventory.get(0) != ItemStack.EMPTY && inventory.armorInventory.get(1) != ItemStack.EMPTY) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.POISON, 100));
|
((EntityLivingBase) entity).addPotionEffect(new PotionEffect(MobEffects.POISON, 100));
|
||||||
|
@ -449,7 +449,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
|
||||||
// thorns and tiny cacti damage players who walk into them, unless they're wearing boots and pants
|
// thorns and tiny cacti damage players who walk into them, unless they're wearing boots and pants
|
||||||
if (entity instanceof EntityPlayer) {
|
if (entity instanceof EntityPlayer) {
|
||||||
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
||||||
if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) {
|
if (inventory.armorInventory.get(0) != ItemStack.EMPTY && inventory.armorInventory.get(1) != ItemStack.EMPTY) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
entity.attackEntityFrom(DamageSource.cactus, 1);
|
entity.attackEntityFrom(DamageSource.cactus, 1);
|
||||||
|
@ -471,7 +471,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
|
||||||
EntityItem berries = new EntityItem(worldIn, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), new ItemStack(BOPItems.berries));
|
EntityItem berries = new EntityItem(worldIn, (double)pos.getX(), (double)pos.getY(), (double)pos.getZ(), new ItemStack(BOPItems.berries));
|
||||||
if (!worldIn.isRemote)
|
if (!worldIn.isRemote)
|
||||||
{
|
{
|
||||||
worldIn.spawnEntityInWorld(berries);
|
worldIn.spawnEntity(berries);
|
||||||
if (!(playerIn instanceof FakePlayer))
|
if (!(playerIn instanceof FakePlayer))
|
||||||
{
|
{
|
||||||
berries.onCollideWithPlayer(playerIn);
|
berries.onCollideWithPlayer(playerIn);
|
||||||
|
|
|
@ -40,19 +40,19 @@ public class BOPCommand extends CommandBase
|
||||||
public static int biomeCount = 0;
|
public static int biomeCount = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCommandName()
|
public String getName()
|
||||||
{
|
{
|
||||||
return "biomesoplenty";
|
return "biomesoplenty";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List getCommandAliases()
|
public List getAliases()
|
||||||
{
|
{
|
||||||
return Lists.newArrayList("bop", "biomesop");
|
return Lists.newArrayList("bop", "biomesop");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getCommandUsage(ICommandSender sender)
|
public String getUsage(ICommandSender sender)
|
||||||
{
|
{
|
||||||
return "commands.biomesoplenty.usage";
|
return "commands.biomesoplenty.usage";
|
||||||
}
|
}
|
||||||
|
@ -98,7 +98,7 @@ public class BOPCommand extends CommandBase
|
||||||
int biomeId = parseInt(args[1], 0, 255);
|
int biomeId = parseInt(args[1], 0, 255);
|
||||||
Biome biome = Biome.getBiome(biomeId);
|
Biome biome = Biome.getBiome(biomeId);
|
||||||
|
|
||||||
sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.biomename.success", biomeId, biome == null ? "Undefined" : biome.getBiomeName()));
|
sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.biomename.success", biomeId, biome == null ? "Undefined" : biome.getBiomeName()));
|
||||||
}
|
}
|
||||||
|
|
||||||
private void teleportFoundBiome(ICommandSender sender, String[] args) throws CommandException
|
private void teleportFoundBiome(ICommandSender sender, String[] args) throws CommandException
|
||||||
|
@ -131,11 +131,11 @@ public class BOPCommand extends CommandBase
|
||||||
double z = (double)closestBiomePos.getZ();
|
double z = (double)closestBiomePos.getZ();
|
||||||
|
|
||||||
player.connection.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
|
player.connection.setPlayerLocation(x, y, z, player.rotationYaw, player.rotationPitch);
|
||||||
sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.success", player.getName(), biomeToFind.getBiomeName(), x, y, z));
|
sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.success", player.getName(), biomeToFind.getBiomeName(), x, y, z));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
sender.addChatMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.error", biomeToFind == null ? "Undefined" : biomeToFind.getBiomeName()));
|
sender.sendMessage(new TextComponentTranslation("commands.biomesoplenty.tpbiome.error", biomeToFind == null ? "Undefined" : biomeToFind.getBiomeName()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -144,19 +144,19 @@ public class BOPCommand extends CommandBase
|
||||||
TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount);
|
TextComponentTranslation text = new TextComponentTranslation("commands.biomesoplenty.stats.blocks", blockCount);
|
||||||
|
|
||||||
text.getStyle().setColor(TextFormatting.GREEN);
|
text.getStyle().setColor(TextFormatting.GREEN);
|
||||||
sender.addChatMessage(text);
|
sender.sendMessage(text);
|
||||||
|
|
||||||
text = new TextComponentTranslation("commands.biomesoplenty.stats.items", itemCount);
|
text = new TextComponentTranslation("commands.biomesoplenty.stats.items", itemCount);
|
||||||
text.getStyle().setColor(TextFormatting.GREEN);
|
text.getStyle().setColor(TextFormatting.GREEN);
|
||||||
sender.addChatMessage(text);
|
sender.sendMessage(text);
|
||||||
|
|
||||||
text = new TextComponentTranslation("commands.biomesoplenty.stats.entities", entityCount);
|
text = new TextComponentTranslation("commands.biomesoplenty.stats.entities", entityCount);
|
||||||
text.getStyle().setColor(TextFormatting.GREEN);
|
text.getStyle().setColor(TextFormatting.GREEN);
|
||||||
sender.addChatMessage(text);
|
sender.sendMessage(text);
|
||||||
|
|
||||||
text = new TextComponentTranslation("commands.biomesoplenty.stats.biomes", biomeCount);
|
text = new TextComponentTranslation("commands.biomesoplenty.stats.biomes", biomeCount);
|
||||||
text.getStyle().setColor(TextFormatting.GREEN);
|
text.getStyle().setColor(TextFormatting.GREEN);
|
||||||
sender.addChatMessage(text);
|
sender.sendMessage(text);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void stripChunk(ICommandSender sender, String[] args) throws CommandException
|
private void stripChunk(ICommandSender sender, String[] args) throws CommandException
|
||||||
|
@ -230,7 +230,7 @@ public class BOPCommand extends CommandBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<String> getTabCompletionOptions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
|
public List<String> getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, BlockPos pos)
|
||||||
{
|
{
|
||||||
if (args.length == 1)
|
if (args.length == 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -23,13 +23,13 @@ public class BiomeEssenceRecipe implements IRecipe
|
||||||
RecipeSorter.register("biomesoplenty:biomeessenceRecipe", BiomeEssenceRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
|
RecipeSorter.register("biomesoplenty:biomeessenceRecipe", BiomeEssenceRecipe.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
|
||||||
}
|
}
|
||||||
|
|
||||||
private ItemStack recipeOutput = ItemStack.field_190927_a;
|
private ItemStack recipeOutput = ItemStack.EMPTY;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean matches(InventoryCrafting inventoryCrafting, World world)
|
public boolean matches(InventoryCrafting inventoryCrafting, World world)
|
||||||
{
|
{
|
||||||
ItemStack biomeRadar = ItemStack.field_190927_a;
|
ItemStack biomeRadar = ItemStack.EMPTY;
|
||||||
ItemStack biomeEssence = ItemStack.field_190927_a;
|
ItemStack biomeEssence = ItemStack.EMPTY;
|
||||||
|
|
||||||
for (int i = 0; i < 3; ++i)
|
for (int i = 0; i < 3; ++i)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +87,7 @@ public class BiomeEssenceRecipe implements IRecipe
|
||||||
@Override
|
@Override
|
||||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
|
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
|
||||||
{
|
{
|
||||||
NonNullList<ItemStack> itemList = NonNullList.func_191196_a();
|
NonNullList<ItemStack> itemList = NonNullList.create();
|
||||||
|
|
||||||
for (int i = 0; i < inv.getSizeInventory(); ++i)
|
for (int i = 0; i < inv.getSizeInventory(); ++i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -169,7 +169,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
||||||
this.distY = this.posY - this.butterfly.posY;
|
this.distY = this.posY - this.butterfly.posY;
|
||||||
this.distZ = this.posZ - this.butterfly.posZ;
|
this.distZ = this.posZ - this.butterfly.posZ;
|
||||||
|
|
||||||
this.dist = (double)MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ);
|
this.dist = (double)MathHelper.sqrt(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ);
|
||||||
|
|
||||||
// (aimX,aimY,aimZ) is a unit vector in the direction we want to go
|
// (aimX,aimY,aimZ) is a unit vector in the direction we want to go
|
||||||
if (this.dist == 0.0D)
|
if (this.dist == 0.0D)
|
||||||
|
|
|
@ -147,7 +147,7 @@ public class EntityPixie extends EntityFlying implements IMob {
|
||||||
this.distY = this.posY - this.pixie.posY;
|
this.distY = this.posY - this.pixie.posY;
|
||||||
this.distZ = this.posZ - this.pixie.posZ;
|
this.distZ = this.posZ - this.pixie.posZ;
|
||||||
|
|
||||||
this.dist = (double)MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ);
|
this.dist = (double)MathHelper.sqrt(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ);
|
||||||
|
|
||||||
// (aimX,aimY,aimZ) is a unit vector in the direction we want to go
|
// (aimX,aimY,aimZ) is a unit vector in the direction we want to go
|
||||||
if (this.dist == 0.0D)
|
if (this.dist == 0.0D)
|
||||||
|
|
|
@ -34,9 +34,9 @@ public class EntitySnail extends EntityLiving implements IMob {
|
||||||
@Override
|
@Override
|
||||||
public boolean getCanSpawnHere()
|
public boolean getCanSpawnHere()
|
||||||
{
|
{
|
||||||
int x = MathHelper.floor_double(this.posX);
|
int x = MathHelper.floor(this.posX);
|
||||||
int y = MathHelper.floor_double(this.getEntityBoundingBox().minY);
|
int y = MathHelper.floor(this.getEntityBoundingBox().minY);
|
||||||
int z = MathHelper.floor_double(this.posZ);
|
int z = MathHelper.floor(this.posZ);
|
||||||
BlockPos blockpos = new BlockPos(x, y, z);
|
BlockPos blockpos = new BlockPos(x, y, z);
|
||||||
if (this.world.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.world.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass)
|
if (this.world.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.world.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass)
|
||||||
{
|
{
|
||||||
|
|
|
@ -109,7 +109,7 @@ public class EntityWasp extends EntityFlying implements IMob {
|
||||||
this.distY = this.posY - this.wasp.posY;
|
this.distY = this.posY - this.wasp.posY;
|
||||||
this.distZ = this.posZ - this.wasp.posZ;
|
this.distZ = this.posZ - this.wasp.posZ;
|
||||||
|
|
||||||
this.dist = (double)MathHelper.sqrt_double(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ);
|
this.dist = (double)MathHelper.sqrt(this.distX * this.distX + this.distY * this.distY + this.distZ * this.distZ);
|
||||||
|
|
||||||
// (aimX,aimY,aimZ) is a unit vector in the direction we want to go
|
// (aimX,aimY,aimZ) is a unit vector in the direction we want to go
|
||||||
if (this.dist == 0.0D)
|
if (this.dist == 0.0D)
|
||||||
|
|
|
@ -253,7 +253,7 @@ public class AchievementEventHandler
|
||||||
|
|
||||||
private void updateBiomeRadarExplore(EntityPlayerMP player)
|
private void updateBiomeRadarExplore(EntityPlayerMP player)
|
||||||
{
|
{
|
||||||
Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
|
Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor(player.posX), 0, MathHelper.floor(player.posZ)));
|
||||||
|
|
||||||
//Search every item in the player's main inventory for a biome radar
|
//Search every item in the player's main inventory for a biome radar
|
||||||
for (ItemStack stack : player.inventory.mainInventory)
|
for (ItemStack stack : player.inventory.mainInventory)
|
||||||
|
@ -278,7 +278,7 @@ public class AchievementEventHandler
|
||||||
|
|
||||||
private void updateBiomesExplored(EntityPlayerMP player)
|
private void updateBiomesExplored(EntityPlayerMP player)
|
||||||
{
|
{
|
||||||
Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
|
Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor(player.posX), 0, MathHelper.floor(player.posZ)));
|
||||||
String biomeName = currentBiome.getBiomeName();
|
String biomeName = currentBiome.getBiomeName();
|
||||||
//Get a list of the current explored biomes
|
//Get a list of the current explored biomes
|
||||||
JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().getProgress(BOPAchievements.explore_all_biomes);
|
JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().getProgress(BOPAchievements.explore_all_biomes);
|
||||||
|
|
|
@ -43,7 +43,7 @@ public class DyeEventHandler
|
||||||
if (dyeColor != wolf.getCollarColor())
|
if (dyeColor != wolf.getCollarColor())
|
||||||
{
|
{
|
||||||
wolf.setCollarColor(dyeColor);
|
wolf.setCollarColor(dyeColor);
|
||||||
if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 1);}
|
if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.setCount(stack.getCount() - 1);}
|
||||||
event.setResult(Result.ALLOW);
|
event.setResult(Result.ALLOW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -53,7 +53,7 @@ public class DyeEventHandler
|
||||||
if (!sheep.getSheared() && dyeColor != sheep.getFleeceColor())
|
if (!sheep.getSheared() && dyeColor != sheep.getFleeceColor())
|
||||||
{
|
{
|
||||||
sheep.setFleeceColor(dyeColor);
|
sheep.setFleeceColor(dyeColor);
|
||||||
if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 1);}
|
if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.setCount(stack.getCount() - 1);}
|
||||||
event.setResult(Result.ALLOW);
|
event.setResult(Result.ALLOW);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class ItemEventHandler
|
||||||
if (inventory.addItem(stack) == null)
|
if (inventory.addItem(stack) == null)
|
||||||
{
|
{
|
||||||
//Set stack size to 0 to cause it to be removed
|
//Set stack size to 0 to cause it to be removed
|
||||||
stack.func_190920_e(0);
|
stack.setCount(0);
|
||||||
//Prevent the stack from being added to the player's inventory
|
//Prevent the stack from being added to the player's inventory
|
||||||
event.setResult(Result.ALLOW);
|
event.setResult(Result.ALLOW);
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,6 +24,7 @@ import net.minecraft.entity.EntityList;
|
||||||
import net.minecraft.entity.EntityList.EntityEggInfo;
|
import net.minecraft.entity.EntityList.EntityEggInfo;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraft.world.biome.Biome;
|
||||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||||
import net.minecraftforge.fml.common.ModContainer;
|
import net.minecraftforge.fml.common.ModContainer;
|
||||||
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
import net.minecraftforge.fml.common.registry.EntityRegistry;
|
||||||
|
@ -54,7 +55,7 @@ public class ModEntities
|
||||||
{
|
{
|
||||||
int bopEntityId = nextBOPEntityId;
|
int bopEntityId = nextBOPEntityId;
|
||||||
nextBOPEntityId++;
|
nextBOPEntityId++;
|
||||||
EntityRegistry.registerModEntity(entityClass, entityName, bopEntityId, BiomesOPlenty.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
|
EntityRegistry.registerModEntity(new ResourceLocation(BiomesOPlenty.MOD_ID, entityName), entityClass, entityName, bopEntityId, BiomesOPlenty.instance, trackingRange, updateFrequency, sendsVelocityUpdates);
|
||||||
idToBOPEntityName.put(bopEntityId, entityName);
|
idToBOPEntityName.put(bopEntityId, entityName);
|
||||||
BOPCommand.entityCount++;
|
BOPCommand.entityCount++;
|
||||||
return bopEntityId;
|
return bopEntityId;
|
||||||
|
|
|
@ -99,7 +99,7 @@ public class ContainerFlowerBasket extends Container
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mergedStack.func_190916_E() == 0)
|
if (mergedStack.getCount() == 0)
|
||||||
{
|
{
|
||||||
slot.putStack((ItemStack)null);
|
slot.putStack((ItemStack)null);
|
||||||
}
|
}
|
||||||
|
|
|
@ -74,7 +74,7 @@ public class ItemBOPLilypad extends ItemBOPBlock {
|
||||||
|
|
||||||
if (!playerIn.capabilities.isCreativeMode)
|
if (!playerIn.capabilities.isCreativeMode)
|
||||||
{
|
{
|
||||||
itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1);
|
itemStackIn.setCount(itemStackIn.getCount() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: playerIn.addStat(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
//TODO: playerIn.addStat(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
||||||
|
|
|
@ -82,7 +82,7 @@ public class ItemBOPPlant extends ItemBOPBlock {
|
||||||
|
|
||||||
if (!playerIn.capabilities.isCreativeMode)
|
if (!playerIn.capabilities.isCreativeMode)
|
||||||
{
|
{
|
||||||
itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1);
|
itemStackIn.setCount(itemStackIn.getCount() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
||||||
|
|
|
@ -25,6 +25,7 @@ import net.minecraft.entity.IEntityLivingData;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemMonsterPlacer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
@ -34,6 +35,7 @@ import net.minecraft.util.math.BlockPos;
|
||||||
import net.minecraft.util.math.MathHelper;
|
import net.minecraft.util.math.MathHelper;
|
||||||
import net.minecraft.util.math.RayTraceResult;
|
import net.minecraft.util.math.RayTraceResult;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.fml.common.registry.ForgeRegistries;
|
||||||
import net.minecraftforge.fml.relauncher.Side;
|
import net.minecraftforge.fml.relauncher.Side;
|
||||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
@ -68,7 +70,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
||||||
entityliving.rotationYawHead = entityliving.rotationYaw;
|
entityliving.rotationYawHead = entityliving.rotationYaw;
|
||||||
entityliving.renderYawOffset = entityliving.rotationYaw;
|
entityliving.renderYawOffset = entityliving.rotationYaw;
|
||||||
entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null);
|
entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null);
|
||||||
worldIn.spawnEntityInWorld(entity);
|
worldIn.spawnEntity(entity);
|
||||||
entityliving.playLivingSound();
|
entityliving.playLivingSound();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -121,13 +123,13 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
||||||
if (tileentity instanceof TileEntityMobSpawner)
|
if (tileentity instanceof TileEntityMobSpawner)
|
||||||
{
|
{
|
||||||
MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic();
|
MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic();
|
||||||
mobspawnerbaselogic.func_190894_a(EntityList.field_191308_b.getNameForObject(EntityList.getClassFromID(stack.getMetadata())));
|
mobspawnerbaselogic.setEntityId(ItemMonsterPlacer.getNamedIdFrom(stack));
|
||||||
tileentity.markDirty();
|
tileentity.markDirty();
|
||||||
worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3);
|
worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3);
|
||||||
|
|
||||||
if (!playerIn.capabilities.isCreativeMode)
|
if (!playerIn.capabilities.isCreativeMode)
|
||||||
{
|
{
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
return EnumActionResult.SUCCESS;
|
return EnumActionResult.SUCCESS;
|
||||||
|
@ -153,7 +155,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
||||||
|
|
||||||
if (!playerIn.capabilities.isCreativeMode)
|
if (!playerIn.capabilities.isCreativeMode)
|
||||||
{
|
{
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -206,7 +208,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
||||||
|
|
||||||
if (!player.capabilities.isCreativeMode)
|
if (!player.capabilities.isCreativeMode)
|
||||||
{
|
{
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
||||||
|
|
|
@ -155,7 +155,7 @@ public class ItemBiomeFinder extends Item
|
||||||
{
|
{
|
||||||
TextComponentTranslation chatComponent = new TextComponentTranslation(msg);
|
TextComponentTranslation chatComponent = new TextComponentTranslation(msg);
|
||||||
chatComponent.getStyle().setColor(color);
|
chatComponent.getStyle().setColor(color);
|
||||||
player.addChatMessage(chatComponent);
|
player.sendMessage(chatComponent);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void writeNBTSearching(NBTTagCompound nbt, World world)
|
public static void writeNBTSearching(NBTTagCompound nbt, World world)
|
||||||
|
|
|
@ -54,7 +54,7 @@ public class ItemEnderporter extends Item {
|
||||||
{
|
{
|
||||||
TextComponentTranslation msg = new TextComponentTranslation("enderporter.prevent");
|
TextComponentTranslation msg = new TextComponentTranslation("enderporter.prevent");
|
||||||
msg.getStyle().setColor(TextFormatting.DARK_PURPLE);
|
msg.getStyle().setColor(TextFormatting.DARK_PURPLE);
|
||||||
player.addChatMessage(msg);
|
player.sendMessage(msg);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);
|
||||||
|
|
|
@ -80,11 +80,11 @@ public class ItemJarEmpty extends Item
|
||||||
|
|
||||||
private ItemStack fillJar(ItemStack stack, EntityPlayer player, ItemStack jarStack)
|
private ItemStack fillJar(ItemStack stack, EntityPlayer player, ItemStack jarStack)
|
||||||
{
|
{
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
player.addStat(StatList.getObjectUseStats(this));
|
player.addStat(StatList.getObjectUseStats(this));
|
||||||
|
|
||||||
// if there was only one empty jar in the stack, replace it, otherwise add the filledJar elsewhere in the inventory
|
// if there was only one empty jar in the stack, replace it, otherwise add the filledJar elsewhere in the inventory
|
||||||
if (stack.func_190916_E() <= 0)
|
if (stack.getCount() <= 0)
|
||||||
{
|
{
|
||||||
return jarStack;
|
return jarStack;
|
||||||
} else {
|
} else {
|
||||||
|
@ -106,12 +106,12 @@ public class ItemJarEmpty extends Item
|
||||||
{
|
{
|
||||||
EntityPixie pixie = (EntityPixie)target;
|
EntityPixie pixie = (EntityPixie)target;
|
||||||
pixie.setDead();
|
pixie.setDead();
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
ItemStack pixieJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.PIXIE.ordinal());
|
ItemStack pixieJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.PIXIE.ordinal());
|
||||||
EntityItem pixieJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, pixieJar);
|
EntityItem pixieJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, pixieJar);
|
||||||
if (!player.world.isRemote)
|
if (!player.world.isRemote)
|
||||||
{
|
{
|
||||||
player.world.spawnEntityInWorld(pixieJarEntity);
|
player.world.spawnEntity(pixieJarEntity);
|
||||||
if (!(player instanceof FakePlayer)) {pixieJarEntity.onCollideWithPlayer(player);}
|
if (!(player instanceof FakePlayer)) {pixieJarEntity.onCollideWithPlayer(player);}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
@ -120,12 +120,12 @@ public class ItemJarEmpty extends Item
|
||||||
{
|
{
|
||||||
EntityButterfly butterfly = (EntityButterfly)target;
|
EntityButterfly butterfly = (EntityButterfly)target;
|
||||||
butterfly.setDead();
|
butterfly.setDead();
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
ItemStack butterflyJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.BUTTERFLY.ordinal());
|
ItemStack butterflyJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.BUTTERFLY.ordinal());
|
||||||
EntityItem butterflyJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, butterflyJar);
|
EntityItem butterflyJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, butterflyJar);
|
||||||
if (!player.world.isRemote)
|
if (!player.world.isRemote)
|
||||||
{
|
{
|
||||||
player.world.spawnEntityInWorld(butterflyJarEntity);
|
player.world.spawnEntity(butterflyJarEntity);
|
||||||
if (!(player instanceof FakePlayer)) {butterflyJarEntity.onCollideWithPlayer(player);}
|
if (!(player instanceof FakePlayer)) {butterflyJarEntity.onCollideWithPlayer(player);}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|
|
@ -125,12 +125,12 @@ public class ItemJarFilled extends Item
|
||||||
{
|
{
|
||||||
EntityPixie pixie = new EntityPixie(world);
|
EntityPixie pixie = new EntityPixie(world);
|
||||||
pixie.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F);
|
pixie.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F);
|
||||||
world.spawnEntityInWorld(pixie);
|
world.spawnEntity(pixie);
|
||||||
pixie.playLivingSound();
|
pixie.playLivingSound();
|
||||||
if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());}
|
if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"), false);
|
player.sendMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -141,12 +141,12 @@ public class ItemJarFilled extends Item
|
||||||
{
|
{
|
||||||
EntityButterfly butterfly = new EntityButterfly(world);
|
EntityButterfly butterfly = new EntityButterfly(world);
|
||||||
butterfly.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F);
|
butterfly.setLocationAndAngles(releasePoint.xCoord, releasePoint.yCoord, releasePoint.zCoord, MathHelper.wrapDegrees(world.rand.nextFloat() * 360.0F), 0.0F);
|
||||||
world.spawnEntityInWorld(butterfly);
|
world.spawnEntity(butterfly);
|
||||||
butterfly.playLivingSound();
|
butterfly.playLivingSound();
|
||||||
if (stack.hasDisplayName()) {butterfly.setCustomNameTag(stack.getDisplayName());}
|
if (stack.hasDisplayName()) {butterfly.setCustomNameTag(stack.getDisplayName());}
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"), false);
|
player.sendMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"));
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -186,7 +186,7 @@ public class ItemJarFilled extends Item
|
||||||
|
|
||||||
protected ItemStack emptyJar(ItemStack stack, EntityPlayer player, ItemStack emptyJarStack)
|
protected ItemStack emptyJar(ItemStack stack, EntityPlayer player, ItemStack emptyJarStack)
|
||||||
{
|
{
|
||||||
if (!player.capabilities.isCreativeMode) { stack.func_190920_e(stack.func_190916_E() - 1); }
|
if (!player.capabilities.isCreativeMode) { stack.setCount(stack.getCount() - 1); }
|
||||||
player.addStat(StatList.getObjectUseStats(this));
|
player.addStat(StatList.getObjectUseStats(this));
|
||||||
|
|
||||||
if (!player.inventory.addItemStackToInventory(emptyJarStack)) {
|
if (!player.inventory.addItemStackToInventory(emptyJarStack)) {
|
||||||
|
|
|
@ -34,7 +34,7 @@ public class ItemMudball extends Item
|
||||||
ItemStack stack = player.getHeldItem(hand);
|
ItemStack stack = player.getHeldItem(hand);
|
||||||
if (!player.capabilities.isCreativeMode)
|
if (!player.capabilities.isCreativeMode)
|
||||||
{
|
{
|
||||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
stack.setCount(stack.getCount() - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||||
|
@ -43,7 +43,7 @@ public class ItemMudball extends Item
|
||||||
{
|
{
|
||||||
EntityMudball mudball = new EntityMudball(world, player);
|
EntityMudball mudball = new EntityMudball(world, player);
|
||||||
mudball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F);
|
mudball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F);
|
||||||
world.spawnEntityInWorld(mudball);
|
world.spawnEntity(mudball);
|
||||||
}
|
}
|
||||||
|
|
||||||
player.addStat(StatList.getObjectUseStats(this));
|
player.addStat(StatList.getObjectUseStats(this));
|
||||||
|
|
|
@ -326,7 +326,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
|
||||||
{
|
{
|
||||||
for (int k = -2; k <= 2; ++k)
|
for (int k = -2; k <= 2; ++k)
|
||||||
{
|
{
|
||||||
radialFalloff5x5[j + 2 + (k + 2) * 5] = 0.06476162171F / MathHelper.sqrt_float((float)(j * j + k * k) + 0.2F);
|
radialFalloff5x5[j + 2 + (k + 2) * 5] = 0.06476162171F / MathHelper.sqrt((float)(j * j + k * k) + 0.2F);
|
||||||
radialStrongFalloff5x5[j + 2 + (k + 2) * 5] = 0.076160519601F / ((float)(j * j + k * k) + 0.2F);
|
radialStrongFalloff5x5[j + 2 + (k + 2) * 5] = 0.076160519601F / ((float)(j * j + k * k) + 0.2F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -437,7 +437,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
|
||||||
double xyzNoiseA = this.xyzNoiseArrayA[xyzCounter] / lowerLimitScale;
|
double xyzNoiseA = this.xyzNoiseArrayA[xyzCounter] / lowerLimitScale;
|
||||||
double xyzNoiseB = this.xyzNoiseArrayB[xyzCounter] / upperLimitScale;
|
double xyzNoiseB = this.xyzNoiseArrayB[xyzCounter] / upperLimitScale;
|
||||||
double balance = (this.xyzBalanceNoiseArray[xyzCounter] / 10.0D + 1.0D) / 2.0D;
|
double balance = (this.xyzBalanceNoiseArray[xyzCounter] / 10.0D + 1.0D) / 2.0D;
|
||||||
double xyzNoiseValue = MathHelper.denormalizeClamp(xyzNoiseA, xyzNoiseB, balance) / 50.0D;
|
double xyzNoiseValue = MathHelper.clamp(xyzNoiseA, xyzNoiseB, balance) / 50.0D;
|
||||||
|
|
||||||
// calculate the depth
|
// calculate the depth
|
||||||
double depth = baseLevel - y + (xyzAmplitude * xyzNoiseValue);
|
double depth = baseLevel - y + (xyzAmplitude * xyzNoiseValue);
|
||||||
|
|
|
@ -367,7 +367,7 @@ public class ChunkProviderHellBOP implements IChunkGenerator
|
||||||
if ((double)k < d3)
|
if ((double)k < d3)
|
||||||
{
|
{
|
||||||
double d10 = (d3 - (double)k) / 4.0D;
|
double d10 = (d3 - (double)k) / 4.0D;
|
||||||
d10 = MathHelper.clamp_double(d10, 0.0D, 1.0D);
|
d10 = MathHelper.clamp(d10, 0.0D, 1.0D);
|
||||||
d4 = d4 * (1.0D - d10) + -10.0D * d10;
|
d4 = d4 * (1.0D - d10) + -10.0D * d10;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -81,7 +81,7 @@ public class NoiseGeneratorBOP extends NoiseGenerator
|
||||||
|
|
||||||
public double wraparound(double d)
|
public double wraparound(double d)
|
||||||
{
|
{
|
||||||
long intD = MathHelper.floor_double_long(d);
|
long intD = MathHelper.floor(d);
|
||||||
return d - intD + (intD % 0x1000000);
|
return d - intD + (intD % 0x1000000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class TerrainSettings
|
||||||
|
|
||||||
public TerrainSettings sidewaysNoise(double a)
|
public TerrainSettings sidewaysNoise(double a)
|
||||||
{
|
{
|
||||||
this.sidewaysNoiseAmount = MathHelper.clamp_double(a, 0.0F, 1.0F);
|
this.sidewaysNoiseAmount = MathHelper.clamp(a, 0.0F, 1.0F);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -76,13 +76,13 @@ public class TerrainSettings
|
||||||
|
|
||||||
public TerrainSettings minHeight(double minHeight)
|
public TerrainSettings minHeight(double minHeight)
|
||||||
{
|
{
|
||||||
this.minHeight = MathHelper.clamp_double(minHeight, 0.0D, 255.0D);
|
this.minHeight = MathHelper.clamp(minHeight, 0.0D, 255.0D);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public TerrainSettings maxHeight(double maxHeight)
|
public TerrainSettings maxHeight(double maxHeight)
|
||||||
{
|
{
|
||||||
this.maxHeight = MathHelper.clamp_double(maxHeight, 0.0D, 255.0D);
|
this.maxHeight = MathHelper.clamp(maxHeight, 0.0D, 255.0D);
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ public class WorldProviderHellBOP extends WorldProvider
|
||||||
public void createBiomeProvider()
|
public void createBiomeProvider()
|
||||||
{
|
{
|
||||||
this.biomeProvider = new BiomeProviderSingle(Biomes.HELL);
|
this.biomeProvider = new BiomeProviderSingle(Biomes.HELL);
|
||||||
this.isHellWorld = true;
|
this.doesWaterVaporize = true;
|
||||||
this.hasNoSky = true;
|
this.hasNoSky = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -38,7 +38,7 @@ public class WorldProviderHellBOP extends WorldProvider
|
||||||
|
|
||||||
public IChunkGenerator createChunkGenerator()
|
public IChunkGenerator createChunkGenerator()
|
||||||
{
|
{
|
||||||
return new ChunkProviderHellBOP(this.worldObj, this.worldObj.getWorldInfo().isMapFeaturesEnabled(), this.worldObj.getSeed());
|
return new ChunkProviderHellBOP(this.world, this.world.getWorldInfo().isMapFeaturesEnabled(), this.world.getSeed());
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isSurfaceWorld()
|
public boolean isSurfaceWorld()
|
||||||
|
|
|
@ -116,12 +116,12 @@ public class GeneratorBlobs extends GeneratorReplacing
|
||||||
float radiusY = minRadius + radiusRand + (rand.nextFloat() * radiusVariation * 0.5F);
|
float radiusY = minRadius + radiusRand + (rand.nextFloat() * radiusVariation * 0.5F);
|
||||||
float radiusZ = minRadius + radiusRand + (rand.nextFloat() * radiusVariation * 0.5F);
|
float radiusZ = minRadius + radiusRand + (rand.nextFloat() * radiusVariation * 0.5F);
|
||||||
|
|
||||||
int x0 = MathHelper.floor_float(centerX - radiusX + 0.5F);
|
int x0 = MathHelper.floor(centerX - radiusX + 0.5F);
|
||||||
int y0 = MathHelper.floor_float(centerY - radiusY + 0.5F);
|
int y0 = MathHelper.floor(centerY - radiusY + 0.5F);
|
||||||
int z0 = MathHelper.floor_float(centerZ - radiusZ + 0.5F);
|
int z0 = MathHelper.floor(centerZ - radiusZ + 0.5F);
|
||||||
int x1 = MathHelper.floor_float(centerX + radiusX + 0.5F);
|
int x1 = MathHelper.floor(centerX + radiusX + 0.5F);
|
||||||
int y1 = MathHelper.floor_float(centerY + radiusY + 0.5F);
|
int y1 = MathHelper.floor(centerY + radiusY + 0.5F);
|
||||||
int z1 = MathHelper.floor_float(centerZ + radiusZ + 0.5F);
|
int z1 = MathHelper.floor(centerZ + radiusZ + 0.5F);
|
||||||
|
|
||||||
for (int x = x0; x <= x1; ++x)
|
for (int x = x0; x <= x1; ++x)
|
||||||
{
|
{
|
||||||
|
|
|
@ -94,12 +94,12 @@ public class GeneratorSplotches extends GeneratorReplacing
|
||||||
public void replaceInEllipsoid(World world, double centerX, double centerY, double centerZ, double radiusX, double radiusY, double radiusZ)
|
public void replaceInEllipsoid(World world, double centerX, double centerY, double centerZ, double radiusX, double radiusY, double radiusZ)
|
||||||
{
|
{
|
||||||
|
|
||||||
int x0 = MathHelper.floor_double(centerX - radiusX + 0.5D);
|
int x0 = MathHelper.floor(centerX - radiusX + 0.5D);
|
||||||
int y0 = MathHelper.floor_double(centerY - radiusY + 0.5D);
|
int y0 = MathHelper.floor(centerY - radiusY + 0.5D);
|
||||||
int z0 = MathHelper.floor_double(centerZ - radiusZ + 0.5D);
|
int z0 = MathHelper.floor(centerZ - radiusZ + 0.5D);
|
||||||
int x1 = MathHelper.floor_double(centerX + radiusX + 0.5D);
|
int x1 = MathHelper.floor(centerX + radiusX + 0.5D);
|
||||||
int y1 = MathHelper.floor_double(centerY + radiusY + 0.5D);
|
int y1 = MathHelper.floor(centerY + radiusY + 0.5D);
|
||||||
int z1 = MathHelper.floor_double(centerZ + radiusZ + 0.5D);
|
int z1 = MathHelper.floor(centerZ + radiusZ + 0.5D);
|
||||||
|
|
||||||
for (int x = x0; x <= x1; ++x)
|
for (int x = x0; x <= x1; ++x)
|
||||||
{
|
{
|
||||||
|
|
|
@ -237,7 +237,7 @@ public class GeneratorBigTree extends GeneratorTreeBase
|
||||||
final float radius = height / 2.0f;
|
final float radius = height / 2.0f;
|
||||||
final float adjacent = radius - y;
|
final float adjacent = radius - y;
|
||||||
|
|
||||||
float distance = MathHelper.sqrt_float(radius * radius - adjacent * adjacent);
|
float distance = MathHelper.sqrt(radius * radius - adjacent * adjacent);
|
||||||
|
|
||||||
if (adjacent == 0) {
|
if (adjacent == 0) {
|
||||||
distance = radius;
|
distance = radius;
|
||||||
|
@ -318,9 +318,9 @@ public class GeneratorBigTree extends GeneratorTreeBase
|
||||||
|
|
||||||
private int getSteps(BlockPos pos)
|
private int getSteps(BlockPos pos)
|
||||||
{
|
{
|
||||||
final int absX = MathHelper.abs_int(pos.getX());
|
final int absX = MathHelper.abs(pos.getX());
|
||||||
final int absY = MathHelper.abs_int(pos.getY());
|
final int absY = MathHelper.abs(pos.getY());
|
||||||
final int absZ = MathHelper.abs_int(pos.getZ());
|
final int absZ = MathHelper.abs(pos.getZ());
|
||||||
|
|
||||||
//Determine which axis has the greatest distance from the origin (0, 0, 0)
|
//Determine which axis has the greatest distance from the origin (0, 0, 0)
|
||||||
if (absZ > absX && absZ > absY) {
|
if (absZ > absX && absZ > absY) {
|
||||||
|
@ -334,9 +334,9 @@ public class GeneratorBigTree extends GeneratorTreeBase
|
||||||
|
|
||||||
private int getGreatestDistance(BlockPos posIn)
|
private int getGreatestDistance(BlockPos posIn)
|
||||||
{
|
{
|
||||||
int i = MathHelper.abs_int(posIn.getX());
|
int i = MathHelper.abs(posIn.getX());
|
||||||
int j = MathHelper.abs_int(posIn.getY());
|
int j = MathHelper.abs(posIn.getY());
|
||||||
int k = MathHelper.abs_int(posIn.getZ());
|
int k = MathHelper.abs(posIn.getZ());
|
||||||
return k > i && k > j ? k : (j > i ? j : i);
|
return k > i && k > j ? k : (j > i ? j : i);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -69,8 +69,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase
|
||||||
{
|
{
|
||||||
|
|
||||||
int trunkWidth = (this.trunkWidth * (height - y) / height) + 1;
|
int trunkWidth = (this.trunkWidth * (height - y) / height) + 1;
|
||||||
int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D);
|
int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D);
|
||||||
int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D);
|
int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D);
|
||||||
|
|
||||||
// require 3x3 for the leaves, 1x1 for the trunk
|
// require 3x3 for the leaves, 1x1 for the trunk
|
||||||
int start = (y <= baseHeight ? trunkStart : trunkStart - 1);
|
int start = (y <= baseHeight ? trunkStart : trunkStart - 1);
|
||||||
|
@ -178,8 +178,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase
|
||||||
{
|
{
|
||||||
|
|
||||||
int trunkWidth = (this.trunkWidth * i / height) + 1;
|
int trunkWidth = (this.trunkWidth * i / height) + 1;
|
||||||
int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D);
|
int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D);
|
||||||
int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D);
|
int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D);
|
||||||
|
|
||||||
|
|
||||||
int radius = Math.min(Math.min((i + 2) / 3, 3 + (leavesHeight - i)), 6);
|
int radius = Math.min(Math.min((i + 2) / 3, 3 + (leavesHeight - i)), 6);
|
||||||
|
@ -217,8 +217,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase
|
||||||
for (int y = 0; y < height - 1; y++)
|
for (int y = 0; y < height - 1; y++)
|
||||||
{
|
{
|
||||||
int trunkWidth = (this.trunkWidth * (height - y) / height) + 1;
|
int trunkWidth = (this.trunkWidth * (height - y) / height) + 1;
|
||||||
int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D);
|
int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D);
|
||||||
int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D);
|
int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D);
|
||||||
|
|
||||||
// TODO: Temporary fix for trees generating larger than normal bases when in the sides of hills
|
// TODO: Temporary fix for trees generating larger than normal bases when in the sides of hills
|
||||||
// Should look into doing this properly but i'm busy :P
|
// Should look into doing this properly but i'm busy :P
|
||||||
|
|
|
@ -32,7 +32,7 @@ public class GenLayerClimate extends BOPGenLayer {
|
||||||
|
|
||||||
// temperature values from 0 (cold) to 8 (hot) and rainfall values from 0 (wet) to 11 (dry), index is (temperatureValue * 12) + rainfallValue
|
// temperature values from 0 (cold) to 8 (hot) and rainfall values from 0 (wet) to 11 (dry), index is (temperatureValue * 12) + rainfallValue
|
||||||
// index is clamped to account for potential rounding errors due to use of doubles/floats
|
// index is clamped to account for potential rounding errors due to use of doubles/floats
|
||||||
out[i] = this.climateMapping[MathHelper.clamp_int(index, 0, this.climateMapping.length - 1)];
|
out[i] = this.climateMapping[MathHelper.clamp(index, 0, this.climateMapping.length - 1)];
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ public class GenLayerTemperatureLatitude extends BOPGenLayer
|
||||||
// set value between 1 and 4 which is periodic in Y (with some random variation)
|
// set value between 1 and 4 which is periodic in Y (with some random variation)
|
||||||
// ocean generally stays as ocean, unless it's ICY when it becomes frozen ocean
|
// ocean generally stays as ocean, unless it's ICY when it becomes frozen ocean
|
||||||
double Yoffset = Y + this.offset + ((this.nextInt(1001) - 500) * this.offsetVariation / 500.0D);
|
double Yoffset = Y + this.offset + ((this.nextInt(1001) - 500) * this.offsetVariation / 500.0D);
|
||||||
out[x + y * areaWidth] = MathHelper.floor_double(this.amplitude * Math.abs((Math.abs(Yoffset % period) - halfPeriod)));
|
out[x + y * areaWidth] = MathHelper.floor(this.amplitude * Math.abs((Math.abs(Yoffset % period) - halfPeriod)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -44,7 +44,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||||
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
|
||||||
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
import net.minecraftforge.fml.common.network.NetworkRegistry;
|
||||||
|
|
||||||
@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:forge@[13.19.0.2133,)", guiFactory = BiomesOPlenty.GUI_FACTORY)
|
@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:forge@[13.19.0.2152,)", guiFactory = BiomesOPlenty.GUI_FACTORY)
|
||||||
public class BiomesOPlenty
|
public class BiomesOPlenty
|
||||||
{
|
{
|
||||||
public static final String MOD_NAME = "Biomes O' Plenty";
|
public static final String MOD_NAME = "Biomes O' Plenty";
|
||||||
|
|
|
@ -159,7 +159,7 @@ public class ClientProxy extends CommonProxy
|
||||||
// register sub types if there are any
|
// register sub types if there are any
|
||||||
if (item.getHasSubtypes())
|
if (item.getHasSubtypes())
|
||||||
{
|
{
|
||||||
NonNullList<ItemStack> subItems = NonNullList.func_191196_a();
|
NonNullList<ItemStack> subItems = NonNullList.create();
|
||||||
item.getSubItems(item, CreativeTabBOP.instance, subItems);
|
item.getSubItems(item, CreativeTabBOP.instance, subItems);
|
||||||
for (ItemStack subItem : subItems)
|
for (ItemStack subItem : subItems)
|
||||||
{
|
{
|
||||||
|
@ -206,11 +206,11 @@ public class ClientProxy extends CommonProxy
|
||||||
switch (type)
|
switch (type)
|
||||||
{
|
{
|
||||||
case PIXIETRAIL:
|
case PIXIETRAIL:
|
||||||
entityFx = new EntityPixieTrailFX(minecraft.world, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.03, 0.03));
|
entityFx = new EntityPixieTrailFX(minecraft.world, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.03, 0.03), -0.02D, MathHelper.nextDouble(minecraft.world.rand, -0.03, 0.03));
|
||||||
break;
|
break;
|
||||||
case MUD:
|
case MUD:
|
||||||
int itemId = Item.getIdFromItem(BOPItems.mudball);
|
int itemId = Item.getIdFromItem(BOPItems.mudball);
|
||||||
minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId});
|
minecraft.world.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), MathHelper.nextDouble(minecraft.world.rand, -0.08D, 0.08D), new int[] {itemId});
|
||||||
return;
|
return;
|
||||||
case PLAYER_TRAIL:
|
case PLAYER_TRAIL:
|
||||||
if (info.length < 1)
|
if (info.length < 1)
|
||||||
|
|
Loading…
Reference in New Issue