Updated to the latest MCP mappings and Forge. Entities now work.

This commit is contained in:
Adubbz 2016-11-19 13:34:43 +11:00
parent 522406c2f5
commit 519c1b844b
42 changed files with 110 additions and 113 deletions

View File

@ -1,4 +1,4 @@
minecraft_version=1.11
forge_version=13.19.0.2133
forge_version=13.19.0.2152
mod_version=6.0.0
mappings_version=snapshot_nodoc_20161115
mappings_version=snapshot_nodoc_20161118

View File

@ -78,7 +78,7 @@ public abstract class BOPGeneratorBase extends WorldGenerator implements IGenera
public int getAmountToScatter(Random random)
{
int amount = MathHelper.floor_float(this.amountPerChunk);
int amount = MathHelper.floor(this.amountPerChunk);
float remainder = this.amountPerChunk - amount;
if (random.nextFloat() < remainder) {amount++;}
return amount;

View File

@ -61,7 +61,7 @@ public class EntityPixieTrailFX extends Particle
FMLClientHandler.instance().getClient().renderEngine.bindTexture(ClientProxy.particleTexturesLocation);
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;
GlStateManager.depthMask(false);
@ -88,7 +88,7 @@ public class EntityPixieTrailFX extends Particle
}
this.particleTextureIndexX = 7 - particleAge * 8 / particleMaxAge;
this.moveEntity(motionX, motionY, motionZ);
this.move(motionX, motionY, motionZ);
if (posY == prevPosY)
{

View File

@ -51,6 +51,7 @@ import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraft.world.chunk.ChunkPrimer;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
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
// case insensitive, dot used as mod delimiter, no spaces or underscores
// 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;
if (!(entityClazz.isAssignableFrom(EntityLiving.class))) {
confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving");

View File

@ -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)
{
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);
}
// 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
// Use it to add the top half of the block
@Override

View File

@ -115,7 +115,7 @@ public class BlockBOPGemOre extends Block implements IBOPBlock
public int getExpDrop(IBlockState state, IBlockAccess world, BlockPos pos, int fortune)
{
Random rand = world instanceof World ? ((World)world).rand : new Random();
return MathHelper.getRandomIntegerInRange(rand, 3, 7);
return MathHelper.getInt(rand, 3, 7);
}
}

View File

@ -168,7 +168,7 @@ public class BlockBOPGrass extends BlockGrass implements IBOPBlock, ISustainsPla
}
@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);
switch ((BOPGrassType) state.getValue(VARIANT))

View File

@ -164,7 +164,7 @@ public class BlockBOPHive extends Block implements IBOPBlock
case EMPTY_HONEYCOMB:
EntityWasp wasp = new EntityWasp(worldIn);
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;
default:

View File

@ -187,7 +187,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
// blocks that are not placed during generation should not decay
@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));
}
@ -203,11 +203,11 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
// leaves in the inventory should not be decayable
//TODO REMOVE
@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));
return super.createStackedBlock(newState);
return super.getSilkTouchDrop(newState);
}
@Override

View File

@ -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
if (entity instanceof EntityPlayer) {
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;
}
((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
if (entity instanceof EntityPlayer) {
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;
}
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));
if (!worldIn.isRemote)
{
worldIn.spawnEntityInWorld(berries);
worldIn.spawnEntity(berries);
if (!(playerIn instanceof FakePlayer))
{
berries.onCollideWithPlayer(playerIn);

View File

@ -40,19 +40,19 @@ public class BOPCommand extends CommandBase
public static int biomeCount = 0;
@Override
public String getCommandName()
public String getName()
{
return "biomesoplenty";
}
@Override
public List getCommandAliases()
public List getAliases()
{
return Lists.newArrayList("bop", "biomesop");
}
@Override
public String getCommandUsage(ICommandSender sender)
public String getUsage(ICommandSender sender)
{
return "commands.biomesoplenty.usage";
}
@ -98,7 +98,7 @@ public class BOPCommand extends CommandBase
int biomeId = parseInt(args[1], 0, 255);
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
@ -131,11 +131,11 @@ public class BOPCommand extends CommandBase
double z = (double)closestBiomePos.getZ();
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
{
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);
text.getStyle().setColor(TextFormatting.GREEN);
sender.addChatMessage(text);
sender.sendMessage(text);
text = new TextComponentTranslation("commands.biomesoplenty.stats.items", itemCount);
text.getStyle().setColor(TextFormatting.GREEN);
sender.addChatMessage(text);
sender.sendMessage(text);
text = new TextComponentTranslation("commands.biomesoplenty.stats.entities", entityCount);
text.getStyle().setColor(TextFormatting.GREEN);
sender.addChatMessage(text);
sender.sendMessage(text);
text = new TextComponentTranslation("commands.biomesoplenty.stats.biomes", biomeCount);
text.getStyle().setColor(TextFormatting.GREEN);
sender.addChatMessage(text);
sender.sendMessage(text);
}
private void stripChunk(ICommandSender sender, String[] args) throws CommandException
@ -230,7 +230,7 @@ public class BOPCommand extends CommandBase
}
@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)
{

View File

@ -23,13 +23,13 @@ public class BiomeEssenceRecipe implements IRecipe
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
public boolean matches(InventoryCrafting inventoryCrafting, World world)
{
ItemStack biomeRadar = ItemStack.field_190927_a;
ItemStack biomeEssence = ItemStack.field_190927_a;
ItemStack biomeRadar = ItemStack.EMPTY;
ItemStack biomeEssence = ItemStack.EMPTY;
for (int i = 0; i < 3; ++i)
{
@ -87,7 +87,7 @@ public class BiomeEssenceRecipe implements IRecipe
@Override
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)
{

View File

@ -169,7 +169,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
this.distY = this.posY - this.butterfly.posY;
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
if (this.dist == 0.0D)

View File

@ -147,7 +147,7 @@ public class EntityPixie extends EntityFlying implements IMob {
this.distY = this.posY - this.pixie.posY;
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
if (this.dist == 0.0D)

View File

@ -34,9 +34,9 @@ public class EntitySnail extends EntityLiving implements IMob {
@Override
public boolean getCanSpawnHere()
{
int x = MathHelper.floor_double(this.posX);
int y = MathHelper.floor_double(this.getEntityBoundingBox().minY);
int z = MathHelper.floor_double(this.posZ);
int x = MathHelper.floor(this.posX);
int y = MathHelper.floor(this.getEntityBoundingBox().minY);
int z = MathHelper.floor(this.posZ);
BlockPos blockpos = new BlockPos(x, y, z);
if (this.world.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.world.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass)
{

View File

@ -109,7 +109,7 @@ public class EntityWasp extends EntityFlying implements IMob {
this.distY = this.posY - this.wasp.posY;
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
if (this.dist == 0.0D)

View File

@ -253,7 +253,7 @@ public class AchievementEventHandler
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
for (ItemStack stack : player.inventory.mainInventory)
@ -278,7 +278,7 @@ public class AchievementEventHandler
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();
//Get a list of the current explored biomes
JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().getProgress(BOPAchievements.explore_all_biomes);

View File

@ -43,7 +43,7 @@ public class DyeEventHandler
if (dyeColor != wolf.getCollarColor())
{
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);
}
}
@ -53,7 +53,7 @@ public class DyeEventHandler
if (!sheep.getSheared() && dyeColor != sheep.getFleeceColor())
{
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);
}
}

View File

@ -58,7 +58,7 @@ public class ItemEventHandler
if (inventory.addItem(stack) == null)
{
//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
event.setResult(Result.ALLOW);
}

View File

@ -24,6 +24,7 @@ import net.minecraft.entity.EntityList;
import net.minecraft.entity.EntityList.EntityEggInfo;
import net.minecraft.util.ResourceLocation;
import net.minecraft.world.World;
import net.minecraft.world.biome.Biome;
import net.minecraftforge.fml.common.FMLCommonHandler;
import net.minecraftforge.fml.common.ModContainer;
import net.minecraftforge.fml.common.registry.EntityRegistry;
@ -54,7 +55,7 @@ public class ModEntities
{
int bopEntityId = 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);
BOPCommand.entityCount++;
return bopEntityId;

View File

@ -99,7 +99,7 @@ public class ContainerFlowerBasket extends Container
return null;
}
if (mergedStack.func_190916_E() == 0)
if (mergedStack.getCount() == 0)
{
slot.putStack((ItemStack)null);
}

View File

@ -74,7 +74,7 @@ public class ItemBOPLilypad extends ItemBOPBlock {
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)]);

View File

@ -82,7 +82,7 @@ public class ItemBOPPlant extends ItemBOPBlock {
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)]);

View File

@ -25,6 +25,7 @@ import net.minecraft.entity.IEntityLivingData;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
import net.minecraft.item.ItemMonsterPlacer;
import net.minecraft.item.ItemStack;
import net.minecraft.tileentity.MobSpawnerBaseLogic;
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.RayTraceResult;
import net.minecraft.world.World;
import net.minecraftforge.fml.common.registry.ForgeRegistries;
import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly;
@ -68,7 +70,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
entityliving.rotationYawHead = entityliving.rotationYaw;
entityliving.renderYawOffset = entityliving.rotationYaw;
entityliving.onInitialSpawn(worldIn.getDifficultyForLocation(new BlockPos(entityliving)), (IEntityLivingData)null);
worldIn.spawnEntityInWorld(entity);
worldIn.spawnEntity(entity);
entityliving.playLivingSound();
}
@ -121,13 +123,13 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
if (tileentity instanceof TileEntityMobSpawner)
{
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();
worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3);
if (!playerIn.capabilities.isCreativeMode)
{
stack.func_190920_e(stack.func_190916_E() - 1);
stack.setCount(stack.getCount() - 1);
}
return EnumActionResult.SUCCESS;
@ -153,7 +155,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
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)
{
stack.func_190920_e(stack.func_190916_E() - 1);
stack.setCount(stack.getCount() - 1);
}
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);

View File

@ -155,7 +155,7 @@ public class ItemBiomeFinder extends Item
{
TextComponentTranslation chatComponent = new TextComponentTranslation(msg);
chatComponent.getStyle().setColor(color);
player.addChatMessage(chatComponent);
player.sendMessage(chatComponent);
}
public static void writeNBTSearching(NBTTagCompound nbt, World world)

View File

@ -54,7 +54,7 @@ public class ItemEnderporter extends Item {
{
TextComponentTranslation msg = new TextComponentTranslation("enderporter.prevent");
msg.getStyle().setColor(TextFormatting.DARK_PURPLE);
player.addChatMessage(msg);
player.sendMessage(msg);
}
}
return new ActionResult<ItemStack>(EnumActionResult.SUCCESS, stack);

View File

@ -80,11 +80,11 @@ public class ItemJarEmpty extends Item
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));
// 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;
} else {
@ -106,12 +106,12 @@ public class ItemJarEmpty extends Item
{
EntityPixie pixie = (EntityPixie)target;
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());
EntityItem pixieJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, pixieJar);
if (!player.world.isRemote)
{
player.world.spawnEntityInWorld(pixieJarEntity);
player.world.spawnEntity(pixieJarEntity);
if (!(player instanceof FakePlayer)) {pixieJarEntity.onCollideWithPlayer(player);}
}
return true;
@ -120,12 +120,12 @@ public class ItemJarEmpty extends Item
{
EntityButterfly butterfly = (EntityButterfly)target;
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());
EntityItem butterflyJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, butterflyJar);
if (!player.world.isRemote)
{
player.world.spawnEntityInWorld(butterflyJarEntity);
player.world.spawnEntity(butterflyJarEntity);
if (!(player instanceof FakePlayer)) {butterflyJarEntity.onCollideWithPlayer(player);}
}
return true;

View File

@ -125,12 +125,12 @@ public class ItemJarFilled extends Item
{
EntityPixie pixie = new EntityPixie(world);
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();
if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());}
return true;
} else {
player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"), false);
player.sendMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"));
return false;
}
}
@ -141,12 +141,12 @@ public class ItemJarFilled extends Item
{
EntityButterfly butterfly = new EntityButterfly(world);
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();
if (stack.hasDisplayName()) {butterfly.setCustomNameTag(stack.getDisplayName());}
return true;
} else {
player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"), false);
player.sendMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"));
return false;
}
}
@ -186,7 +186,7 @@ public class ItemJarFilled extends Item
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));
if (!player.inventory.addItemStackToInventory(emptyJarStack)) {

View File

@ -34,7 +34,7 @@ public class ItemMudball extends Item
ItemStack stack = player.getHeldItem(hand);
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));
@ -43,7 +43,7 @@ public class ItemMudball extends Item
{
EntityMudball mudball = new EntityMudball(world, player);
mudball.setHeadingFromThrower(player, player.rotationPitch, player.rotationYaw, 0.0F, 1.5F, 1.0F);
world.spawnEntityInWorld(mudball);
world.spawnEntity(mudball);
}
player.addStat(StatList.getObjectUseStats(this));

View File

@ -326,7 +326,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
{
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);
}
}
@ -437,7 +437,7 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
double xyzNoiseA = this.xyzNoiseArrayA[xyzCounter] / lowerLimitScale;
double xyzNoiseB = this.xyzNoiseArrayB[xyzCounter] / upperLimitScale;
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
double depth = baseLevel - y + (xyzAmplitude * xyzNoiseValue);

View File

@ -367,7 +367,7 @@ public class ChunkProviderHellBOP implements IChunkGenerator
if ((double)k < d3)
{
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;
}

View File

@ -81,7 +81,7 @@ public class NoiseGeneratorBOP extends NoiseGenerator
public double wraparound(double d)
{
long intD = MathHelper.floor_double_long(d);
long intD = MathHelper.floor(d);
return d - intD + (intD % 0x1000000);
}

View File

@ -58,7 +58,7 @@ public class TerrainSettings
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;
}
@ -76,13 +76,13 @@ public class TerrainSettings
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;
}
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;
}

View File

@ -15,7 +15,7 @@ public class WorldProviderHellBOP extends WorldProvider
public void createBiomeProvider()
{
this.biomeProvider = new BiomeProviderSingle(Biomes.HELL);
this.isHellWorld = true;
this.doesWaterVaporize = true;
this.hasNoSky = true;
}
@ -38,7 +38,7 @@ public class WorldProviderHellBOP extends WorldProvider
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()

View File

@ -116,12 +116,12 @@ public class GeneratorBlobs extends GeneratorReplacing
float radiusY = 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 y0 = MathHelper.floor_float(centerY - radiusY + 0.5F);
int z0 = MathHelper.floor_float(centerZ - radiusZ + 0.5F);
int x1 = MathHelper.floor_float(centerX + radiusX + 0.5F);
int y1 = MathHelper.floor_float(centerY + radiusY + 0.5F);
int z1 = MathHelper.floor_float(centerZ + radiusZ + 0.5F);
int x0 = MathHelper.floor(centerX - radiusX + 0.5F);
int y0 = MathHelper.floor(centerY - radiusY + 0.5F);
int z0 = MathHelper.floor(centerZ - radiusZ + 0.5F);
int x1 = MathHelper.floor(centerX + radiusX + 0.5F);
int y1 = MathHelper.floor(centerY + radiusY + 0.5F);
int z1 = MathHelper.floor(centerZ + radiusZ + 0.5F);
for (int x = x0; x <= x1; ++x)
{

View File

@ -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)
{
int x0 = MathHelper.floor_double(centerX - radiusX + 0.5D);
int y0 = MathHelper.floor_double(centerY - radiusY + 0.5D);
int z0 = MathHelper.floor_double(centerZ - radiusZ + 0.5D);
int x1 = MathHelper.floor_double(centerX + radiusX + 0.5D);
int y1 = MathHelper.floor_double(centerY + radiusY + 0.5D);
int z1 = MathHelper.floor_double(centerZ + radiusZ + 0.5D);
int x0 = MathHelper.floor(centerX - radiusX + 0.5D);
int y0 = MathHelper.floor(centerY - radiusY + 0.5D);
int z0 = MathHelper.floor(centerZ - radiusZ + 0.5D);
int x1 = MathHelper.floor(centerX + radiusX + 0.5D);
int y1 = MathHelper.floor(centerY + radiusY + 0.5D);
int z1 = MathHelper.floor(centerZ + radiusZ + 0.5D);
for (int x = x0; x <= x1; ++x)
{

View File

@ -237,7 +237,7 @@ public class GeneratorBigTree extends GeneratorTreeBase
final float radius = height / 2.0f;
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) {
distance = radius;
@ -318,9 +318,9 @@ public class GeneratorBigTree extends GeneratorTreeBase
private int getSteps(BlockPos pos)
{
final int absX = MathHelper.abs_int(pos.getX());
final int absY = MathHelper.abs_int(pos.getY());
final int absZ = MathHelper.abs_int(pos.getZ());
final int absX = MathHelper.abs(pos.getX());
final int absY = MathHelper.abs(pos.getY());
final int absZ = MathHelper.abs(pos.getZ());
//Determine which axis has the greatest distance from the origin (0, 0, 0)
if (absZ > absX && absZ > absY) {
@ -334,9 +334,9 @@ public class GeneratorBigTree extends GeneratorTreeBase
private int getGreatestDistance(BlockPos posIn)
{
int i = MathHelper.abs_int(posIn.getX());
int j = MathHelper.abs_int(posIn.getY());
int k = MathHelper.abs_int(posIn.getZ());
int i = MathHelper.abs(posIn.getX());
int j = MathHelper.abs(posIn.getY());
int k = MathHelper.abs(posIn.getZ());
return k > i && k > j ? k : (j > i ? j : i);
}

View File

@ -69,8 +69,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase
{
int trunkWidth = (this.trunkWidth * (height - y) / height) + 1;
int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D);
int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D);
int trunkStart = MathHelper.ceil(0.25D - trunkWidth / 2.0D);
int trunkEnd = MathHelper.floor(0.25D + trunkWidth / 2.0D);
// require 3x3 for the leaves, 1x1 for the trunk
int start = (y <= baseHeight ? trunkStart : trunkStart - 1);
@ -178,8 +178,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase
{
int trunkWidth = (this.trunkWidth * i / height) + 1;
int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D);
int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D);
int trunkStart = MathHelper.ceil(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);
@ -217,8 +217,8 @@ public class GeneratorTaigaTree extends GeneratorTreeBase
for (int y = 0; y < height - 1; y++)
{
int trunkWidth = (this.trunkWidth * (height - y) / height) + 1;
int trunkStart = MathHelper.ceiling_double_int(0.25D - trunkWidth / 2.0D);
int trunkEnd = MathHelper.floor_double(0.25D + trunkWidth / 2.0D);
int trunkStart = MathHelper.ceil(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
// Should look into doing this properly but i'm busy :P

View File

@ -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
// 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;
}

View File

@ -51,7 +51,7 @@ public class GenLayerTemperatureLatitude extends BOPGenLayer
// 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
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)));
}
}

View File

@ -44,7 +44,7 @@ import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
import net.minecraftforge.fml.common.event.FMLServerStartingEvent;
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 static final String MOD_NAME = "Biomes O' Plenty";

View File

@ -159,7 +159,7 @@ public class ClientProxy extends CommonProxy
// register sub types if there are any
if (item.getHasSubtypes())
{
NonNullList<ItemStack> subItems = NonNullList.func_191196_a();
NonNullList<ItemStack> subItems = NonNullList.create();
item.getSubItems(item, CreativeTabBOP.instance, subItems);
for (ItemStack subItem : subItems)
{
@ -206,11 +206,11 @@ public class ClientProxy extends CommonProxy
switch (type)
{
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;
case MUD:
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;
case PLAYER_TRAIL:
if (info.length < 1)