Initial update to 1.11
This commit is contained in:
parent
fcc7c37195
commit
7f19449317
60 changed files with 190 additions and 195 deletions
5
.gitignore
vendored
5
.gitignore
vendored
|
@ -4,12 +4,11 @@
|
|||
/Mixin/
|
||||
/repo/
|
||||
/run/
|
||||
.idea/*
|
||||
/.gradle/
|
||||
/.settings/
|
||||
/.classpath
|
||||
/.project
|
||||
# OS generated files
|
||||
*.DS_Store
|
||||
BiomesOPlenty.iml
|
||||
BiomesOPlenty.ipr
|
||||
BiomesOPlenty.iws
|
||||
*.iml
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
minecraft_version=1.10.2
|
||||
forge_version=12.18.1.2073
|
||||
mod_version=5.0.0
|
||||
mappings_version=snapshot_nodoc_20160808
|
||||
minecraft_version=1.11
|
||||
forge_version=13.19.0.2127-1.11.x
|
||||
mod_version=6.0.0
|
||||
mappings_version=snapshot_nodoc_20161115
|
||||
|
|
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
|
@ -1,4 +1,4 @@
|
|||
#Tue Dec 15 20:33:12 AEDT 2015
|
||||
#Wed Nov 16 15:40:47 AEDT 2016
|
||||
distributionBase=GRADLE_USER_HOME
|
||||
distributionPath=wrapper/dists
|
||||
zipStoreBase=GRADLE_USER_HOME
|
||||
|
|
10
gradlew
vendored
10
gradlew
vendored
|
@ -42,11 +42,6 @@ case "`uname`" in
|
|||
;;
|
||||
esac
|
||||
|
||||
# For Cygwin, ensure paths are in UNIX format before anything is touched.
|
||||
if $cygwin ; then
|
||||
[ -n "$JAVA_HOME" ] && JAVA_HOME=`cygpath --unix "$JAVA_HOME"`
|
||||
fi
|
||||
|
||||
# Attempt to set APP_HOME
|
||||
# Resolve links: $0 may be a link
|
||||
PRG="$0"
|
||||
|
@ -61,9 +56,9 @@ while [ -h "$PRG" ] ; do
|
|||
fi
|
||||
done
|
||||
SAVED="`pwd`"
|
||||
cd "`dirname \"$PRG\"`/" >&-
|
||||
cd "`dirname \"$PRG\"`/" >/dev/null
|
||||
APP_HOME="`pwd -P`"
|
||||
cd "$SAVED" >&-
|
||||
cd "$SAVED" >/dev/null
|
||||
|
||||
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
|
||||
|
||||
|
@ -114,6 +109,7 @@ fi
|
|||
if $cygwin ; then
|
||||
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
|
||||
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
|
||||
JAVACMD=`cygpath --unix "$JAVACMD"`
|
||||
|
||||
# We build the pattern for arguments to be converted via cygpath
|
||||
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
|
||||
|
|
|
@ -38,7 +38,7 @@ public class ModelBiomeFinder extends ItemOverrideList
|
|||
@Override
|
||||
public IBakedModel handleItemState(IBakedModel originalModel, ItemStack stack, World world, EntityLivingBase entity)
|
||||
{
|
||||
EntityPlayerSP player = Minecraft.getMinecraft().thePlayer;
|
||||
EntityPlayerSP player = Minecraft.getMinecraft().player;
|
||||
if (player == null) {return this.frames[0];}
|
||||
|
||||
NBTTagCompound nbt = stack.getTagCompound();
|
||||
|
|
|
@ -41,6 +41,7 @@ import biomesoplenty.core.BiomesOPlenty;
|
|||
import net.minecraft.block.BlockSand;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EnumCreatureType;
|
||||
|
@ -195,21 +196,22 @@ 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 EntityLiving> entityClazz = null;
|
||||
for (Object entry : EntityList.NAME_TO_CLASS.entrySet())
|
||||
{
|
||||
String entryEntityName = (String)((Entry)entry).getKey();
|
||||
if (entryEntityName.equalsIgnoreCase(entityName))
|
||||
{
|
||||
entityClazz = (Class <? extends EntityLiving>)((Entry)entry).getValue();
|
||||
Class <? extends Entity> entityClazz = EntityList.field_191308_b.getObject(new ResourceLocation(entityName));
|
||||
Class <? extends EntityLiving> livingClazz = null;
|
||||
if (!(entityClazz.isAssignableFrom(EntityLiving.class))) {
|
||||
confEntity.addMessage("Entity " + entityName + " is not of type EntityLiving");
|
||||
continue;
|
||||
}
|
||||
else {
|
||||
livingClazz = (Class <? extends EntityLiving>)entityClazz;
|
||||
}
|
||||
if (entityClazz == null)
|
||||
|
||||
if (livingClazz == null)
|
||||
{
|
||||
confEntity.addMessage("No entity registered called " + entityName);
|
||||
continue;
|
||||
}
|
||||
if (!creatureType.getCreatureClass().isAssignableFrom(entityClazz))
|
||||
if (!creatureType.getCreatureClass().isAssignableFrom(livingClazz))
|
||||
{
|
||||
confEntity.addMessage("Entity " + entityName + " is not of type " + creatureType);
|
||||
continue;
|
||||
|
@ -224,7 +226,7 @@ public class BOPBiome extends Biome implements IExtendedBiome
|
|||
while (spawnIterator.hasNext())
|
||||
{
|
||||
SpawnListEntry entry = spawnIterator.next();
|
||||
if (entry.entityClass == entityClazz)
|
||||
if (entry.entityClass == livingClazz)
|
||||
{
|
||||
spawnIterator.remove();
|
||||
}
|
||||
|
@ -248,7 +250,7 @@ public class BOPBiome extends Biome implements IExtendedBiome
|
|||
if (!foundIt)
|
||||
{
|
||||
// the entry does not exist - add it
|
||||
SpawnListEntry entry = new SpawnListEntry(entityClazz, confEntity.getInt("weight", 10), confEntity.getInt("minGroupCount", 4), confEntity.getInt("maxGroupCount", 4));
|
||||
SpawnListEntry entry = new SpawnListEntry(livingClazz, confEntity.getInt("weight", 10), confEntity.getInt("minGroupCount", 4), confEntity.getInt("maxGroupCount", 4));
|
||||
spawns.add(entry);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -22,6 +22,7 @@ import net.minecraft.util.EnumFacing;
|
|||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
@ -41,7 +42,7 @@ public class BlockBOPAsh extends BlockBOPGeneric
|
|||
|
||||
// ash blocks are slightly lower
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return COLLISION_BOX;
|
||||
}
|
||||
|
@ -51,7 +52,7 @@ public class BlockBOPAsh extends BlockBOPGeneric
|
|||
{
|
||||
if (entity instanceof EntityPlayer) {
|
||||
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
||||
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) {
|
||||
if (inventory.armorInventory.get(0).getItem() == BOPItems.wading_boots) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -61,7 +61,7 @@ public class BlockBOPBamboo extends BlockBOPDecoration
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return BOUNDING_BOX;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import net.minecraft.block.properties.IProperty;
|
|||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.client.renderer.color.IBlockColor;
|
||||
import net.minecraft.client.renderer.color.IItemColor;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -25,6 +26,7 @@ import net.minecraft.util.BlockRenderLayer;
|
|||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
@ -66,51 +68,25 @@ public class BlockBOPDecoration extends Block implements IBOPBlock
|
|||
|
||||
// no collision box - you can walk straight through them
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
||||
/* // utility function for setting the block bounds - typically decoration blocks are smaller than full block size
|
||||
public void setBlockBoundsByRadiusAndHeight(float radius, float height)
|
||||
{
|
||||
this.setBlockBoundsByRadiusAndHeight(radius, height, false);
|
||||
}
|
||||
public void setBlockBoundsByRadiusAndHeight(float radius, float height, boolean fromTop)
|
||||
{
|
||||
this.setBlockBounds(0.5F - radius, (fromTop ? 1.0F - height : 0.0F), 0.5F - radius, 0.5F + radius, (fromTop ? 1.0F : height), 0.5F + radius);
|
||||
}
|
||||
// some decoration blocks have a random XZ offset applied - if we set block bounds based on state, we may need these functions to correct for the offset
|
||||
public void setBlockBoundsByRadiusAndHeightWithXZOffset(float radius, float height, BlockPos pos)
|
||||
{
|
||||
this.setBlockBoundsByRadiusAndHeightWithXZOffset(radius, height, false, pos);
|
||||
}
|
||||
public void setBlockBoundsByRadiusAndHeightWithXZOffset(float radius, float height, boolean fromTop, BlockPos pos)
|
||||
{
|
||||
// some Minecraft weirdness to get over here: in BlockModelRenderer there are 2 alternative quad drawers
|
||||
// renderModelAmbientOcclusionQuads and renderModelStandardQuads, and they use very nearly but not quite the same functions for the XZ offset
|
||||
// both versions rely on getting an unpredictable long 'hash' of the BlockPos coordinates
|
||||
// the ambient one uses long i = MathHelper.getPositionRandom(pos) (which equates to long i = (long)(x * 3129871) ^ (long)z * 116129781L ^ (long)y; )
|
||||
// the standard one uses long i = (long)(x * 3129871) ^ (long)z * 116129781L; (no dependence on y)
|
||||
// we use the standard one here, because that's the one being used to draw the plants
|
||||
// it looks like a mistake to me. I think they probably intended to use MathHelper.getPositionRandom for both, but maybe there is some reason behind it
|
||||
long i = (long)(pos.getX() * 3129871) ^ (long)pos.getZ() * 116129781L;
|
||||
i = i * i * 42317861L + i * 11L;
|
||||
float dx = (((float)(i >> 16 & 15L) / 15.0F) - 0.5F) * 0.5F;
|
||||
float dz = (((float)(i >> 24 & 15L) / 15.0F) - 0.5F) * 0.5F;
|
||||
this.setBlockBounds(0.5F - radius + dx, (fromTop ? 1.0F - height : 0.0F), 0.5F - radius + dz, 0.5F + radius + dx, (fromTop ? 1.0F : height), 0.5F + radius + dz);
|
||||
}
|
||||
*/
|
||||
// add a canBlockStay() check before placing this block
|
||||
@Override
|
||||
public boolean canReplace(World world, BlockPos pos, EnumFacing side, ItemStack stack)
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return world.getBlockState(pos).getBlock().isReplaceable(world, pos) && this.canBlockStay(world, pos, this.getStateFromMeta(stack.getMetadata()));
|
||||
if (world.getBlockState(pos).getBlock().isReplaceable(world, pos) && this.canBlockStay(world, pos, this.getStateFromMeta(meta))) {
|
||||
return super.getStateForPlacement(world, pos, facing, hitX, hitY, hitZ, meta, placer);
|
||||
}
|
||||
|
||||
return world.getBlockState(pos);
|
||||
}
|
||||
|
||||
// check this block is still able to remain after neighbor change
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos)
|
||||
{
|
||||
this.checkAndDropBlock(world, pos, state);
|
||||
}
|
||||
|
|
|
@ -130,9 +130,13 @@ public class BlockBOPDoubleDecoration extends BlockBOPDecoration {
|
|||
|
||||
// This DoubleDecoration can replace the block at pos if both the block and the one above it are replaceable and the environment is suitable (canBlockStay)
|
||||
@Override
|
||||
public boolean canReplace(World world, BlockPos pos, EnumFacing side, ItemStack stack)
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer)
|
||||
{
|
||||
return world.getBlockState(pos).getBlock().isReplaceable(world, pos) && world.getBlockState(pos.up()).getBlock().isReplaceable(world, pos.up()) && this.canBlockStay(world, pos, this.getStateFromMeta(stack.getMetadata()));
|
||||
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 world.getBlockState(pos);
|
||||
}
|
||||
|
||||
// Called by ItemBlock before the block is placed - the placed block must always be Half.LOWER
|
||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
|
@ -244,7 +245,7 @@ public class BlockBOPDoublePlant extends BlockBOPDoubleDecoration implements ISh
|
|||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List<ItemStack> list)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list)
|
||||
{
|
||||
// get the preset blocks variants
|
||||
ImmutableSet<IBlockState> presets = BlockStateUtils.getBlockPresets(this);
|
||||
|
|
|
@ -30,6 +30,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -154,7 +155,7 @@ public class BlockBOPDoubleWoodSlab extends BlockSlab implements IBOPBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list)
|
||||
{
|
||||
// get the preset blocks variants
|
||||
ImmutableSet<IBlockState> presets = BlockStateUtils.getBlockPresets(this);
|
||||
|
|
|
@ -156,7 +156,7 @@ public class BlockBOPFarmland extends BlockFarmland implements IBOPBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock)
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block neighborBlock, BlockPos neighborPos)
|
||||
{
|
||||
if (world.getBlockState(pos.up()).getMaterial().isSolid())
|
||||
{
|
||||
|
|
|
@ -84,7 +84,7 @@ public class BlockBOPFlesh extends Block implements IBOPBlock
|
|||
|
||||
if (entity instanceof EntityPlayer) {
|
||||
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
||||
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) {
|
||||
if (inventory.armorInventory.get(0).getItem() == BOPItems.wading_boots) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ public class BlockBOPGrassPath extends BlockGrassPath implements IBOPBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn)
|
||||
public void neighborChanged(IBlockState state, World world, BlockPos pos, Block blockIn, BlockPos neighborPos)
|
||||
{
|
||||
if (world.getBlockState(pos.up()).getMaterial().isSolid())
|
||||
{
|
||||
|
|
|
@ -28,6 +28,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IStringSerializable;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -185,7 +186,7 @@ public class BlockBOPHalfOtherSlab extends BlockSlab implements IBOPBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list)
|
||||
{
|
||||
// get the preset blocks variants
|
||||
ImmutableSet<IBlockState> presets = BlockStateUtils.getBlockPresets(this);
|
||||
|
|
|
@ -29,6 +29,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -146,7 +147,7 @@ public class BlockBOPHalfWoodSlab extends BlockSlab implements IBOPBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, List list)
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> list)
|
||||
{
|
||||
// get the preset blocks variants
|
||||
ImmutableSet<IBlockState> presets = BlockStateUtils.getBlockPresets(this);
|
||||
|
|
|
@ -32,6 +32,7 @@ import net.minecraft.stats.StatList;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
|
@ -157,9 +158,7 @@ public class BlockBOPLeaves extends BlockLeaves implements IBOPBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list)
|
||||
{
|
||||
}
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {}
|
||||
|
||||
// map from meta to state and vice verca. Use the same scheme as for the vanilla leaf blocks
|
||||
// highest bit is for CHECK_DECAY true=>1 false=>0
|
||||
|
|
|
@ -23,6 +23,7 @@ import net.minecraft.item.Item;
|
|||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
@ -101,7 +102,7 @@ public class BlockBOPLog extends BlockLog implements IBOPBlock
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, NonNullList<ItemStack> list)
|
||||
{
|
||||
}
|
||||
|
||||
|
|
|
@ -120,7 +120,7 @@ public class BlockBOPMud extends Block implements IBOPBlock, ISustainsPlantType
|
|||
case MUD:
|
||||
if (entity instanceof EntityPlayer) {
|
||||
InventoryPlayer inventory = ((EntityPlayer)entity).inventory;
|
||||
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.wading_boots) {
|
||||
if (inventory.armorInventory.get(0).getItem() == BOPItems.wading_boots) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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[0] != null && inventory.armorInventory[1] != null) {
|
||||
if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) {
|
||||
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[0] != null && inventory.armorInventory[1] != null) {
|
||||
if (inventory.armorInventory.get(0) != ItemStack.field_190927_a && inventory.armorInventory.get(1) != ItemStack.field_190927_a) {
|
||||
break;
|
||||
}
|
||||
entity.attackEntityFrom(DamageSource.cactus, 1);
|
||||
|
@ -461,7 +461,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, ItemStack heldItem, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
public boolean onBlockActivated(World worldIn, BlockPos pos, IBlockState state, EntityPlayer playerIn, EnumHand hand, EnumFacing side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
switch ((BOPPlants) state.getValue(this.variantProperty))
|
||||
{
|
||||
|
@ -479,7 +479,7 @@ public class BlockBOPPlant extends BlockBOPDecoration implements IShearable, IHo
|
|||
}
|
||||
return true;
|
||||
}
|
||||
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, heldItem, side, hitX, hitY, hitZ);
|
||||
return super.onBlockActivated(worldIn, pos, state, playerIn, hand, side, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ public class BlockBOPTerrarium extends Block implements IBOPBlock
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, World world, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState state, IBlockAccess world, BlockPos pos)
|
||||
{
|
||||
return BOUNDING_BOX;
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ public class BOPCommand extends CommandBase
|
|||
}
|
||||
|
||||
EntityPlayerMP player = getCommandSenderAsPlayer(sender);
|
||||
World world = player.worldObj;
|
||||
World world = player.world;
|
||||
BlockPos closestBiomePos = biomeToFind == null ? null : BiomeUtils.spiralOutwardsLookingForBiome(world, biomeToFind, player.posX, player.posZ);
|
||||
|
||||
if (closestBiomePos != null)
|
||||
|
@ -216,7 +216,7 @@ public class BOPCommand extends CommandBase
|
|||
{
|
||||
blockStorage.set(x, y, z, Blocks.AIR.getDefaultState());
|
||||
world.notifyBlockUpdate(pos, state, Blocks.AIR.getDefaultState(), 3);
|
||||
world.notifyNeighborsRespectDebug(pos, Blocks.AIR);
|
||||
world.notifyNeighborsRespectDebug(pos, Blocks.AIR, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import net.minecraft.inventory.InventoryCrafting;
|
|||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
|
||||
|
@ -84,16 +85,16 @@ public class BiomeEssenceRecipe implements IRecipe
|
|||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems(InventoryCrafting inv)
|
||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv)
|
||||
{
|
||||
ItemStack[] aitemstack = new ItemStack[inv.getSizeInventory()];
|
||||
NonNullList<ItemStack> itemList = NonNullList.func_191196_a();
|
||||
|
||||
for (int i = 0; i < aitemstack.length; ++i)
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i)
|
||||
{
|
||||
ItemStack itemstack = inv.getStackInSlot(i);
|
||||
aitemstack[i] = net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack);
|
||||
itemList.add(i, net.minecraftforge.common.ForgeHooks.getContainerItem(itemstack));
|
||||
}
|
||||
|
||||
return aitemstack;
|
||||
return itemList;
|
||||
}
|
||||
}
|
|
@ -110,7 +110,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
{
|
||||
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
|
||||
|
||||
if (blockpos.getY() <= this.worldObj.getSeaLevel())
|
||||
if (blockpos.getY() <= this.world.getSeaLevel())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
@ -122,7 +122,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
}
|
||||
else
|
||||
{
|
||||
int light = this.worldObj.getLightFromNeighbors(blockpos);
|
||||
int light = this.world.getLightFromNeighbors(blockpos);
|
||||
|
||||
return light > 8 && super.getCanSpawnHere();
|
||||
}
|
||||
|
@ -188,7 +188,7 @@ public class EntityButterfly extends EntityFlying implements IMob {
|
|||
|
||||
public boolean isBoxBlocked(AxisAlignedBB box)
|
||||
{
|
||||
return !this.butterfly.worldObj.getCollisionBoxes(this.butterfly, box).isEmpty();
|
||||
return !this.butterfly.world.getCollisionBoxes(this.butterfly, box).isEmpty();
|
||||
}
|
||||
|
||||
// check nothing will collide with the butterfly in the direction of aim, for howFar units (or until the destination - whichever is closer)
|
||||
|
|
|
@ -55,7 +55,7 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
public void onLivingUpdate()
|
||||
{
|
||||
super.onLivingUpdate();
|
||||
if (this.worldObj.isRemote)
|
||||
if (this.world.isRemote)
|
||||
{
|
||||
for (int i = 0; i < 7; i++)
|
||||
{
|
||||
|
@ -74,22 +74,22 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
{
|
||||
BlockPos blockpos = new BlockPos(this.posX, this.getEntityBoundingBox().minY, this.posZ);
|
||||
|
||||
if (this.worldObj.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
|
||||
if (this.world.getLightFor(EnumSkyBlock.SKY, blockpos) > this.rand.nextInt(32))
|
||||
{
|
||||
// TODO: not sure what's going on here...
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
int light = this.worldObj.getLightFromNeighbors(blockpos);
|
||||
int light = this.world.getLightFromNeighbors(blockpos);
|
||||
|
||||
// if it's thundering, force getSkylightSubtracted to 10 before calculating getLightFromNeighbors, then restore it
|
||||
if (this.worldObj.isThundering())
|
||||
if (this.world.isThundering())
|
||||
{
|
||||
int oldSkyLightSubtracted = this.worldObj.getSkylightSubtracted();
|
||||
this.worldObj.setSkylightSubtracted(10);
|
||||
light = this.worldObj.getLightFromNeighbors(blockpos);
|
||||
this.worldObj.setSkylightSubtracted(oldSkyLightSubtracted);
|
||||
int oldSkyLightSubtracted = this.world.getSkylightSubtracted();
|
||||
this.world.setSkylightSubtracted(10);
|
||||
light = this.world.getLightFromNeighbors(blockpos);
|
||||
this.world.setSkylightSubtracted(oldSkyLightSubtracted);
|
||||
}
|
||||
|
||||
return light <= this.rand.nextInt(8);
|
||||
|
@ -166,7 +166,7 @@ public class EntityPixie extends EntityFlying implements IMob {
|
|||
|
||||
public boolean isBoxBlocked(AxisAlignedBB box)
|
||||
{
|
||||
return !this.pixie.worldObj.getCollisionBoxes(this.pixie, box).isEmpty();
|
||||
return !this.pixie.world.getCollisionBoxes(this.pixie, box).isEmpty();
|
||||
}
|
||||
|
||||
// check nothing will collide with the pixie in the direction of aim, for howFar units (or until the destination - whichever is closer)
|
||||
|
|
|
@ -38,19 +38,19 @@ public class EntitySnail extends EntityLiving implements IMob {
|
|||
int y = MathHelper.floor_double(this.getEntityBoundingBox().minY);
|
||||
int z = MathHelper.floor_double(this.posZ);
|
||||
BlockPos blockpos = new BlockPos(x, y, z);
|
||||
if (this.worldObj.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.worldObj.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass)
|
||||
if (this.world.getBlockState(blockpos.down()).getBlock() != Blocks.GRASS && this.world.getBlockState(blockpos.down()).getBlock() != BOPBlocks.grass)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (blockpos.getY() <= this.worldObj.getSeaLevel())
|
||||
if (blockpos.getY() <= this.world.getSeaLevel())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else
|
||||
{
|
||||
return this.worldObj.getLight(blockpos) > 6 && super.getCanSpawnHere();
|
||||
return this.world.getLight(blockpos) > 6 && super.getCanSpawnHere();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -129,7 +129,7 @@ public class EntityWasp extends EntityFlying implements IMob {
|
|||
public boolean isBoxBlocked(AxisAlignedBB box)
|
||||
{
|
||||
//Im assuming this does what getCubes did. If not, im terribly sorry - Topisani
|
||||
return !this.wasp.worldObj.getCollisionBoxes(this.wasp, box).isEmpty();
|
||||
return !this.wasp.world.getCollisionBoxes(this.wasp, box).isEmpty();
|
||||
}
|
||||
|
||||
// check nothing will collide with the wasp in the direction of aim, for howFar units (or until the destination - whichever is closer)
|
||||
|
|
|
@ -33,7 +33,7 @@ public class EntityAIEatBOPGrass extends EntityAIEatGrass
|
|||
{
|
||||
super(entityLiving);
|
||||
this.sheep = entityLiving;
|
||||
this.world = entityLiving.worldObj;
|
||||
this.world = entityLiving.world;
|
||||
this.setMutexBits(7);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ public class EntityMudball extends EntityThrowable
|
|||
BiomesOPlenty.proxy.spawnParticle(BOPParticleTypes.MUD, this.posX, this.posY, this.posZ);
|
||||
}
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
if (!this.world.isRemote)
|
||||
{
|
||||
this.setDead();
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ public class BlockBloodFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
@ -47,9 +47,9 @@ public class BlockBloodFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos)
|
||||
{
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
super.neighborChanged(state, worldIn, pos, blockIn, neighborPos);
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class BlockHoneyFluid extends BlockFluidFinite
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
@ -63,9 +63,9 @@ public class BlockHoneyFluid extends BlockFluidFinite
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos)
|
||||
{
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
super.neighborChanged(state, worldIn, pos, blockIn, neighborPos);
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
@ -77,9 +77,9 @@ public class BlockHotSpringWaterFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos)
|
||||
{
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
super.neighborChanged(state, worldIn, pos, blockIn, neighborPos);
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ public class BlockPoisonFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, World worldIn, BlockPos pos)
|
||||
public AxisAlignedBB getCollisionBoundingBox(IBlockState blockState, IBlockAccess worldIn, BlockPos pos)
|
||||
{
|
||||
return NULL_AABB;
|
||||
}
|
||||
|
@ -63,9 +63,9 @@ public class BlockPoisonFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos)
|
||||
{
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
super.neighborChanged(state, worldIn, pos, blockIn, neighborPos);
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,9 +52,9 @@ public class BlockQuicksandFluid extends BlockFluidClassic
|
|||
}
|
||||
|
||||
@Override
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn)
|
||||
public void neighborChanged(IBlockState state, World worldIn, BlockPos pos, Block blockIn, BlockPos neighborPos)
|
||||
{
|
||||
super.neighborChanged(state, worldIn, pos, blockIn);
|
||||
super.neighborChanged(state, worldIn, pos, blockIn, neighborPos);
|
||||
this.checkForMixing(worldIn, pos, state);
|
||||
}
|
||||
|
||||
|
|
|
@ -252,7 +252,7 @@ public class AchievementEventHandler
|
|||
|
||||
private void updateBiomeRadarExplore(EntityPlayerMP player)
|
||||
{
|
||||
Biome currentBiome = player.worldObj.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
|
||||
Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
|
||||
|
||||
//Search every item in the player's main inventory for a biome radar
|
||||
for (ItemStack stack : player.inventory.mainInventory)
|
||||
|
@ -277,7 +277,7 @@ public class AchievementEventHandler
|
|||
|
||||
private void updateBiomesExplored(EntityPlayerMP player)
|
||||
{
|
||||
Biome currentBiome = player.worldObj.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
|
||||
Biome currentBiome = player.world.getBiome(new BlockPos(MathHelper.floor_double(player.posX), 0, MathHelper.floor_double(player.posZ)));
|
||||
String biomeName = currentBiome.getBiomeName();
|
||||
//Get a list of the current explored biomes
|
||||
JsonSerializableSet exploredBiomeNames = (JsonSerializableSet)player.getStatFile().getProgress(BOPAchievements.explore_all_biomes);
|
||||
|
|
|
@ -43,7 +43,7 @@ public class DyeEventHandler
|
|||
if (dyeColor != wolf.getCollarColor())
|
||||
{
|
||||
wolf.setCollarColor(dyeColor);
|
||||
if (!event.getEntityPlayer().capabilities.isCreativeMode) {--stack.stackSize;}
|
||||
if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 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.stackSize;}
|
||||
if (!event.getEntityPlayer().capabilities.isCreativeMode) {stack.func_190920_e(stack.func_190916_E() - 1);}
|
||||
event.setResult(Result.ALLOW);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class FlippersEventHandler
|
|||
|
||||
if (player.isInWater() && !player.capabilities.isFlying)
|
||||
{
|
||||
if (inventory.armorInventory[0] != null && inventory.armorInventory[0].getItem() == BOPItems.flippers)
|
||||
if (inventory.armorInventory.get(0).getItem() == BOPItems.flippers)
|
||||
{
|
||||
player.motionX *= 1.125D;
|
||||
player.motionY *= 1.1D;
|
||||
|
|
|
@ -46,7 +46,7 @@ public class ItemEventHandler
|
|||
ItemStack stack = event.getItem().getEntityItem();
|
||||
ItemStack basketStack = ItemFlowerBasket.findBasketStack(player);
|
||||
|
||||
if (!player.worldObj.isRemote)
|
||||
if (!player.world.isRemote)
|
||||
{
|
||||
//Check if the player has a basket in their inventory, and if the stack is suitable for adding
|
||||
//to the basket
|
||||
|
@ -58,7 +58,7 @@ public class ItemEventHandler
|
|||
if (inventory.addItem(stack) == null)
|
||||
{
|
||||
//Set stack size to 0 to cause it to be removed
|
||||
stack.stackSize = 0;
|
||||
stack.func_190920_e(0);
|
||||
//Prevent the stack from being added to the player's inventory
|
||||
event.setResult(Result.ALLOW);
|
||||
}
|
||||
|
|
|
@ -37,17 +37,17 @@ public class TrailsEventHandler
|
|||
EntityPlayer player = (EntityPlayer)event.player;
|
||||
|
||||
//Check if the player has a trail
|
||||
if (minecraft.thePlayer != null && TrailManager.trailsMap.containsKey(player.getUniqueID()))
|
||||
if (minecraft.player != null && TrailManager.trailsMap.containsKey(player.getUniqueID()))
|
||||
{
|
||||
//Don't display if the local player's trail if they have the visibility set to others
|
||||
if (MiscConfigurationHandler.trailVisbilityMode == TrailVisibilityMode.OTHERS && minecraft.thePlayer.getUniqueID() == player.getUniqueID())
|
||||
if (MiscConfigurationHandler.trailVisbilityMode == TrailVisibilityMode.OTHERS && minecraft.player.getUniqueID() == player.getUniqueID())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
String trailName = TrailManager.trailsMap.get(player.getUniqueID());
|
||||
|
||||
World world = player.worldObj;
|
||||
World world = player.world;
|
||||
float groundYOffset = 0.015625F; //Prevents particles from z-fighting with the ground
|
||||
BlockPos playerPos = player.getPosition();
|
||||
|
||||
|
@ -73,7 +73,7 @@ public class TrailsEventHandler
|
|||
public void onPlayerLoggedIn(PlayerLoggedInEvent event)
|
||||
{
|
||||
EntityPlayer player = event.player;
|
||||
World world = player.worldObj;
|
||||
World world = player.world;
|
||||
|
||||
if (world.isRemote)
|
||||
{
|
||||
|
|
|
@ -24,7 +24,7 @@ public class PotionPossessionEventHandler
|
|||
{
|
||||
EntityLivingBase entity = event.getEntityLiving();
|
||||
|
||||
Random rand = entity.worldObj.rand;
|
||||
Random rand = entity.world.rand;
|
||||
|
||||
double posX = entity.posX;
|
||||
double posY = entity.posY;
|
||||
|
@ -40,7 +40,7 @@ public class PotionPossessionEventHandler
|
|||
|
||||
if (rand.nextInt(5) == 0)
|
||||
{
|
||||
if (!entity.worldObj.checkBlockCollision(entity.getEntityBoundingBox().offset(randX, randY, randZ)))
|
||||
if (!entity.world.checkBlockCollision(entity.getEntityBoundingBox().offset(randX, randY, randZ)))
|
||||
entity.setPosition(posX + randX, posY + randY, posZ + randZ);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ import biomesoplenty.core.BiomesOPlenty;
|
|||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityList;
|
||||
import net.minecraft.entity.EntityList.EntityEggInfo;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.common.FMLCommonHandler;
|
||||
import net.minecraftforge.fml.common.ModContainer;
|
||||
|
@ -63,7 +64,7 @@ public class ModEntities
|
|||
public static int registerBOPEntityWithSpawnEgg(Class<? extends Entity> entityClass, String entityName, int trackingRange, int updateFrequency, boolean sendsVelocityUpdates, int eggBackgroundColor, int eggForegroundColor)
|
||||
{
|
||||
int bopEntityId = registerBOPEntity(entityClass, entityName, trackingRange, updateFrequency, sendsVelocityUpdates);
|
||||
entityEggs.put(Integer.valueOf(bopEntityId), new EntityList.EntityEggInfo(entityName, eggBackgroundColor, eggForegroundColor));
|
||||
entityEggs.put(Integer.valueOf(bopEntityId), new EntityList.EntityEggInfo(new ResourceLocation(BiomesOPlenty.MOD_ID, entityName), eggBackgroundColor, eggForegroundColor));
|
||||
return bopEntityId;
|
||||
}
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class ContainerFlowerBasket extends Container
|
|||
{
|
||||
super.onContainerClosed(player);
|
||||
|
||||
if (!player.worldObj.isRemote)
|
||||
if (!player.world.isRemote)
|
||||
{
|
||||
//Ensure all baskets are closed once the inventory is
|
||||
ItemFlowerBasket.clearOpenBaskets(player);
|
||||
|
@ -99,7 +99,7 @@ public class ContainerFlowerBasket extends Container
|
|||
return null;
|
||||
}
|
||||
|
||||
if (mergedStack.stackSize == 0)
|
||||
if (mergedStack.func_190916_E() == 0)
|
||||
{
|
||||
slot.putStack((ItemStack)null);
|
||||
}
|
||||
|
|
|
@ -81,7 +81,7 @@ public class InventoryFlowerBasket extends InventoryBasic
|
|||
//Ensure the slot index is valid
|
||||
if (slotIndex >= 0 && slotIndex < this.getSizeInventory())
|
||||
{
|
||||
this.setInventorySlotContents(slotIndex, ItemStack.loadItemStackFromNBT(itemTag));
|
||||
this.setInventorySlotContents(slotIndex, new ItemStack(itemTag));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -20,6 +20,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -45,7 +46,7 @@ public class ItemBOPBlock extends ItemBlock
|
|||
// define the items which will appear in the creative tab (called by ItemBlock class)
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List subItems)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||
{
|
||||
ImmutableSet<IBlockState> presets = BlockStateUtils.getBlockPresets(this.block);
|
||||
if (presets.isEmpty())
|
||||
|
|
|
@ -32,8 +32,9 @@ public class ItemBOPLilypad extends ItemBOPBlock {
|
|||
// (usually when you point the cursor at water the picked block is whatever is underneath the water - when placing lilies the water itself has to be picked)
|
||||
// The below is copied from vanille BlockLilyPad
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
{
|
||||
ItemStack itemStackIn = playerIn.getHeldItem(hand);
|
||||
RayTraceResult movingobjectposition = this.rayTrace(worldIn, playerIn, true);
|
||||
|
||||
if (movingobjectposition == null)
|
||||
|
@ -73,7 +74,7 @@ public class ItemBOPLilypad extends ItemBOPBlock {
|
|||
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--itemStackIn.stackSize;
|
||||
itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1);
|
||||
}
|
||||
|
||||
//TODO: playerIn.addStat(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
||||
|
|
|
@ -32,8 +32,9 @@ public class ItemBOPPlant extends ItemBOPBlock {
|
|||
// The code for right clicking needs to be overridden to handle the unique way reeds are placed - on top of the water
|
||||
// (usually when you point the cursor at water the picked block is whatever is underneath the water - when placing reeds the water itself has to be picked)
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand hand)
|
||||
{
|
||||
ItemStack itemStackIn = playerIn.getHeldItem(hand);
|
||||
if (this.block instanceof BlockBOPPlant)
|
||||
{
|
||||
BlockBOPPlant block = (BlockBOPPlant)this.block;
|
||||
|
@ -81,7 +82,7 @@ public class ItemBOPPlant extends ItemBOPBlock {
|
|||
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--itemStackIn.stackSize;
|
||||
itemStackIn.func_190920_e(itemStackIn.func_190916_E() - 1);
|
||||
}
|
||||
|
||||
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
||||
|
@ -96,7 +97,7 @@ public class ItemBOPPlant extends ItemBOPBlock {
|
|||
|
||||
}
|
||||
// in all other cases take the default action
|
||||
return super.onItemRightClick(itemStackIn, worldIn, playerIn, hand);
|
||||
return super.onItemRightClick(worldIn, playerIn, hand);
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -29,10 +29,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.MobSpawnerBaseLogic;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityMobSpawner;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumActionResult;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.*;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraft.util.math.RayTraceResult;
|
||||
|
@ -51,7 +48,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List subItems)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||
{
|
||||
for (Entry<Integer, EntityList.EntityEggInfo> entry : ModEntities.entityEggs.entrySet())
|
||||
{
|
||||
|
@ -102,8 +99,9 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
public EnumActionResult onItemUse(EntityPlayer playerIn, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack stack = playerIn.getHeldItem(hand);
|
||||
if (worldIn.isRemote)
|
||||
{
|
||||
return EnumActionResult.SUCCESS;
|
||||
|
@ -123,13 +121,13 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
if (tileentity instanceof TileEntityMobSpawner)
|
||||
{
|
||||
MobSpawnerBaseLogic mobspawnerbaselogic = ((TileEntityMobSpawner)tileentity).getSpawnerBaseLogic();
|
||||
mobspawnerbaselogic.setEntityName(EntityList.CLASS_TO_NAME.get(EntityList.getClassFromID(stack.getMetadata())));
|
||||
mobspawnerbaselogic.func_190894_a(EntityList.field_191308_b.getNameForObject(EntityList.getClassFromID(stack.getMetadata())));
|
||||
tileentity.markDirty();
|
||||
worldIn.notifyBlockUpdate(pos, iblockstate, iblockstate, 3);
|
||||
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
||||
}
|
||||
|
||||
return EnumActionResult.SUCCESS;
|
||||
|
@ -155,7 +153,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
|
||||
if (!playerIn.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,8 +162,9 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (world.isRemote)
|
||||
{
|
||||
return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack);
|
||||
|
@ -207,7 +206,7 @@ public class ItemBOPSpawnEgg extends Item implements IColoredItem
|
|||
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
||||
}
|
||||
|
||||
//TODO: 1.9 playerIn.triggerAchievement(StatList.objectUseStats[Item.getIdFromItem(this)]);
|
||||
|
|
|
@ -93,9 +93,9 @@ public class ItemBiomeFinder extends Item
|
|||
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (!stack.hasTagCompound()) {stack.setTagCompound(new NBTTagCompound());}
|
||||
NBTTagCompound nbt = stack.getTagCompound();
|
||||
|
||||
|
|
|
@ -31,8 +31,9 @@ public class ItemEnderporter extends Item {
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick( World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (player.getRidingEntity() != null) {return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack);}
|
||||
// can only use the enderporter on the surface world
|
||||
if (world.provider.isSurfaceWorld())
|
||||
|
|
|
@ -60,8 +60,9 @@ public class ItemFlowerBasket extends Item
|
|||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (!world.isRemote)
|
||||
{
|
||||
NBTTagCompound compound = NBTUtil.getOrCreateStackNBT(stack);
|
||||
|
|
|
@ -14,6 +14,7 @@ import biomesoplenty.api.enums.BOPGems;
|
|||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
@ -29,7 +30,7 @@ public class ItemGem extends Item
|
|||
// add all the gem types as separate items in the creative tab
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List subItems)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||
{
|
||||
for (BOPGems gemType : BOPGems.values())
|
||||
{
|
||||
|
|
|
@ -38,8 +38,9 @@ public class ItemJarEmpty extends Item
|
|||
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
RayTraceResult hit = this.rayTrace(world, player, true);
|
||||
|
||||
if (hit == null) {
|
||||
|
@ -79,11 +80,11 @@ public class ItemJarEmpty extends Item
|
|||
|
||||
private ItemStack fillJar(ItemStack stack, EntityPlayer player, ItemStack jarStack)
|
||||
{
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 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.stackSize <= 0)
|
||||
if (stack.func_190916_E() <= 0)
|
||||
{
|
||||
return jarStack;
|
||||
} else {
|
||||
|
@ -105,12 +106,12 @@ public class ItemJarEmpty extends Item
|
|||
{
|
||||
EntityPixie pixie = (EntityPixie)target;
|
||||
pixie.setDead();
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
||||
ItemStack pixieJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.PIXIE.ordinal());
|
||||
EntityItem pixieJarEntity = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, pixieJar);
|
||||
if (!player.worldObj.isRemote)
|
||||
EntityItem pixieJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, pixieJar);
|
||||
if (!player.world.isRemote)
|
||||
{
|
||||
player.worldObj.spawnEntityInWorld(pixieJarEntity);
|
||||
player.world.spawnEntityInWorld(pixieJarEntity);
|
||||
if (!(player instanceof FakePlayer)) {pixieJarEntity.onCollideWithPlayer(player);}
|
||||
}
|
||||
return true;
|
||||
|
@ -119,12 +120,12 @@ public class ItemJarEmpty extends Item
|
|||
{
|
||||
EntityButterfly butterfly = (EntityButterfly)target;
|
||||
butterfly.setDead();
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
||||
ItemStack butterflyJar = new ItemStack(BOPItems.jar_filled, 1, ItemJarFilled.JarContents.BUTTERFLY.ordinal());
|
||||
EntityItem butterflyJarEntity = new EntityItem(player.worldObj, player.posX, player.posY, player.posZ, butterflyJar);
|
||||
if (!player.worldObj.isRemote)
|
||||
EntityItem butterflyJarEntity = new EntityItem(player.world, player.posX, player.posY, player.posZ, butterflyJar);
|
||||
if (!player.world.isRemote)
|
||||
{
|
||||
player.worldObj.spawnEntityInWorld(butterflyJarEntity);
|
||||
player.world.spawnEntityInWorld(butterflyJarEntity);
|
||||
if (!(player instanceof FakePlayer)) {butterflyJarEntity.onCollideWithPlayer(player);}
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -57,7 +57,7 @@ public class ItemJarFilled extends Item
|
|||
// add all the contents types as separate items in the creative tab
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List subItems)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems)
|
||||
{
|
||||
for (JarContents contents : JarContents.values())
|
||||
{
|
||||
|
@ -130,7 +130,7 @@ public class ItemJarFilled extends Item
|
|||
if (stack.hasDisplayName()) {pixie.setCustomNameTag(stack.getDisplayName());}
|
||||
return true;
|
||||
} else {
|
||||
player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"));
|
||||
player.addChatComponentMessage(new TextComponentString("\u00a75Pixies cannot survive in this environment!"), false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
@ -146,14 +146,15 @@ public class ItemJarFilled extends Item
|
|||
if (stack.hasDisplayName()) {butterfly.setCustomNameTag(stack.getDisplayName());}
|
||||
return true;
|
||||
} else {
|
||||
player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"));
|
||||
player.addChatComponentMessage(new TextComponentString("\u00a75Butterflies cannot survive in this environment!"), false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (world.isRemote) {return new ActionResult<ItemStack>(EnumActionResult.FAIL, stack);}
|
||||
switch (this.getContentsType(stack))
|
||||
{
|
||||
|
@ -185,7 +186,7 @@ public class ItemJarFilled extends Item
|
|||
|
||||
protected ItemStack emptyJar(ItemStack stack, EntityPlayer player, ItemStack emptyJarStack)
|
||||
{
|
||||
if (!player.capabilities.isCreativeMode) { --stack.stackSize; }
|
||||
if (!player.capabilities.isCreativeMode) { stack.func_190920_e(stack.func_190916_E() - 1); }
|
||||
player.addStat(StatList.getObjectUseStats(this));
|
||||
|
||||
if (!player.inventory.addItemStackToInventory(emptyJarStack)) {
|
||||
|
@ -196,8 +197,9 @@ public class ItemJarFilled extends Item
|
|||
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack stack, EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
public EnumActionResult onItemUse(EntityPlayer player, World world, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (world.isRemote) {return EnumActionResult.FAIL;}
|
||||
switch (this.getContentsType(stack))
|
||||
{
|
||||
|
|
|
@ -29,11 +29,12 @@ public class ItemMudball extends Item
|
|||
|
||||
// throw a mudball on right click
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack stack, World world, EntityPlayer player, EnumHand hand)
|
||||
public ActionResult<ItemStack> onItemRightClick(World world, EntityPlayer player, EnumHand hand)
|
||||
{
|
||||
ItemStack stack = player.getHeldItem(hand);
|
||||
if (!player.capabilities.isCreativeMode)
|
||||
{
|
||||
--stack.stackSize;
|
||||
stack.func_190920_e(stack.func_190916_E() - 1);
|
||||
}
|
||||
|
||||
world.playSound(player, player.getPosition(), SoundEvents.ENTITY_ARROW_SHOOT, SoundCategory.NEUTRAL, 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||
|
|
|
@ -11,6 +11,7 @@ package biomesoplenty.common.util.inventory;
|
|||
import biomesoplenty.api.item.BOPItems;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CreativeTabBOP extends CreativeTabs
|
||||
{
|
||||
|
@ -22,8 +23,8 @@ public class CreativeTabBOP extends CreativeTabs
|
|||
}
|
||||
|
||||
@Override
|
||||
public Item getTabIconItem()
|
||||
public ItemStack getTabIconItem()
|
||||
{
|
||||
return BOPItems.earth;
|
||||
return new ItemStack(BOPItems.earth);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -605,9 +605,9 @@ public class ChunkProviderGenerateBOP implements IChunkGenerator
|
|||
}
|
||||
|
||||
@Override
|
||||
public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position)
|
||||
public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position, boolean p_180513_4_)
|
||||
{
|
||||
return "Stronghold".equals(structureName) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(worldIn, position) : null;
|
||||
return "Stronghold".equals(structureName) && this.strongholdGenerator != null ? this.strongholdGenerator.getClosestStrongholdPos(worldIn, position, p_180513_4_) : null;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -471,7 +471,7 @@ public class ChunkProviderHellBOP implements IChunkGenerator
|
|||
}
|
||||
|
||||
@Nullable
|
||||
public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position)
|
||||
public BlockPos getStrongholdGen(World worldIn, String structureName, BlockPos position, boolean p_180513_4_)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
|
|
@ -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@[12.18.1.2039,)", guiFactory = BiomesOPlenty.GUI_FACTORY)
|
||||
@Mod(modid = BiomesOPlenty.MOD_ID, version = BiomesOPlenty.MOD_VERSION , name = BiomesOPlenty.MOD_NAME, dependencies = "required-after:forge@[12.18.1.2039,)", guiFactory = BiomesOPlenty.GUI_FACTORY)
|
||||
public class BiomesOPlenty
|
||||
{
|
||||
public static final String MOD_NAME = "Biomes O' Plenty";
|
||||
|
|
|
@ -59,6 +59,7 @@ import net.minecraft.entity.Entity;
|
|||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.client.model.ModelDynBucket;
|
||||
|
@ -157,7 +158,7 @@ public class ClientProxy extends CommonProxy
|
|||
// register sub types if there are any
|
||||
if (item.getHasSubtypes())
|
||||
{
|
||||
List<ItemStack> subItems = new ArrayList<ItemStack>();
|
||||
NonNullList<ItemStack> subItems = NonNullList.func_191196_a();
|
||||
item.getSubItems(item, CreativeTabBOP.instance, subItems);
|
||||
for (ItemStack subItem : subItems)
|
||||
{
|
||||
|
@ -204,17 +205,17 @@ public class ClientProxy extends CommonProxy
|
|||
switch (type)
|
||||
{
|
||||
case PIXIETRAIL:
|
||||
entityFx = new EntityPixieTrailFX(minecraft.theWorld, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.03, 0.03), -0.02D, MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.03, 0.03));
|
||||
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));
|
||||
break;
|
||||
case MUD:
|
||||
int itemId = Item.getIdFromItem(BOPItems.mudball);
|
||||
minecraft.theWorld.spawnParticle(EnumParticleTypes.ITEM_CRACK, x, y, z, MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.08D, 0.08D), MathHelper.getRandomDoubleInRange(minecraft.theWorld.rand, -0.08D, 0.08D), new int[] {itemId});
|
||||
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});
|
||||
return;
|
||||
case PLAYER_TRAIL:
|
||||
if (info.length < 1)
|
||||
throw new RuntimeException("Missing argument for trail name!");
|
||||
|
||||
entityFx = new EntityTrailFX(minecraft.theWorld, x, y, z, (String)info[0]);
|
||||
entityFx = new EntityTrailFX(minecraft.world, x, y, z, (String)info[0]);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue