mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 21:19:56 +00:00
Begin 1.11 (compiles, does not run yet)
This commit is contained in:
1 parent
5310003659
commit
424fdaaf48
164 files changed
+1396
-1312
No files matched your search
@@ -5,6 +5,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -20,7 +21,7 @@ public class ItemIndustrialFrame extends Item {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> par3List) {
|
||||
for (final IndustrialFrame frame : IndustrialFrame.values()) {
|
||||
final ItemStack stack = new ItemStack(this);
|
||||
final NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
@@ -16,13 +16,16 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyComponent.Active, IAlvearyComponent.BeeModifier, IAlvearyComponent.BeeListener, IBeeListener, IBeeModifier {
|
||||
IMultiblockLogicAlveary structureLogic;
|
||||
BlockPos min;
|
||||
BlockPos max;
|
||||
private IMultiblockLogicAlveary structureLogic;
|
||||
@Nullable
|
||||
private BlockPos min;
|
||||
@Nullable
|
||||
private BlockPos max;
|
||||
|
||||
public TileExtraBeeAlveary() {
|
||||
this.structureLogic = MultiblockManager.logicFactory.createAlvearyLogic();
|
||||
@@ -91,18 +94,18 @@ public class TileExtraBeeAlveary extends TileEntityMachine implements IAlvearyCo
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
structureLogic.invalidate(worldObj, this);
|
||||
structureLogic.invalidate(world, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
structureLogic.onChunkUnload(worldObj, this);
|
||||
structureLogic.onChunkUnload(world, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate() {
|
||||
structureLogic.validate(worldObj, this);
|
||||
structureLogic.validate(world, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -15,6 +15,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraft.world.biome.Biome;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
@@ -22,8 +23,11 @@ import java.util.List;
|
||||
|
||||
public class ExtraBeeMutation implements IBeeMutation {
|
||||
public static List<IBeeMutation> mutations = new ArrayList<>();
|
||||
@Nullable
|
||||
MutationRequirement req;
|
||||
@Nullable
|
||||
IAlleleBeeSpecies species0;
|
||||
@Nullable
|
||||
IAlleleBeeSpecies species1;
|
||||
IAllele[] template;
|
||||
int chance;
|
||||
@@ -199,7 +203,7 @@ public class ExtraBeeMutation implements IBeeMutation {
|
||||
this(allele0, allele1, mutation, chance, null);
|
||||
}
|
||||
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance, final MutationRequirement req) {
|
||||
public ExtraBeeMutation(final IAlleleBeeSpecies allele0, final IAlleleBeeSpecies allele1, final IAllele[] mutation, final int chance, @Nullable final MutationRequirement req) {
|
||||
this.species0 = null;
|
||||
this.species1 = null;
|
||||
this.template = new IAllele[0];
|
||||
@@ -306,7 +310,7 @@ public class ExtraBeeMutation implements IBeeMutation {
|
||||
|
||||
@Override
|
||||
public boolean fufilled(final IBeeHousing housing, final IAllele allele0, final IAllele allele1, final IGenome genome0, final IGenome genome1) {
|
||||
return BiomeDictionary.isBiomeOfType(housing.getBiome(), this.type);
|
||||
return BiomeDictionary.hasType(housing.getBiome(), this.type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ import net.minecraft.block.material.Material;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.EnumPlantType;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -212,10 +212,10 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] affectProducts(World world, IIndividual individual, BlockPos pos, ItemStack[] products) {
|
||||
public NonNullList<ItemStack> affectProducts(World world, IIndividual individual, BlockPos pos, NonNullList<ItemStack> products) {
|
||||
if (this == ExtraBeesFlowers.Mystical) {
|
||||
final List<ItemStack> prods = new ArrayList<>();
|
||||
Collections.addAll(prods, products);
|
||||
final NonNullList<ItemStack> prods = NonNullList.create();
|
||||
prods.addAll(products);
|
||||
for (int k = 0; k < 50; ++k) {
|
||||
final int tX = 7;
|
||||
final int tY = 7;
|
||||
@@ -233,7 +233,7 @@ public enum ExtraBeesFlowers implements IFlowerProvider, IAlleleFlowers, IChromo
|
||||
}
|
||||
}
|
||||
}
|
||||
return prods.toArray(new ItemStack[0]);
|
||||
return prods;
|
||||
}
|
||||
return products;
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -1100,8 +1101,8 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(final World world, final GameProfile researcher, final IIndividual individual, final int bountyLevel) {
|
||||
final ArrayList<ItemStack> bounty = new ArrayList<>();
|
||||
public NonNullList<ItemStack> getResearchBounty(final World world, final GameProfile researcher, final IIndividual individual, final int bountyLevel) {
|
||||
final NonNullList<ItemStack> bounty = NonNullList.create();
|
||||
ItemStack research = null;
|
||||
if (world.rand.nextFloat() < 10.0f / bountyLevel) {
|
||||
final Collection<? extends IMutation> combinations = this.getRoot().getCombinations(this);
|
||||
@@ -1116,16 +1117,16 @@ public enum ExtraBeesSpecies implements IAlleleBeeSpecies {
|
||||
if (bountyLevel > 10) {
|
||||
for (final ItemStack stack : this.specialties.keySet()) {
|
||||
final ItemStack stack2 = stack.copy();
|
||||
stack2.stackSize = world.rand.nextInt((int) (bountyLevel / 2.0f)) + 1;
|
||||
stack2.setCount(world.rand.nextInt((int) (bountyLevel / 2.0f)) + 1);
|
||||
bounty.add(stack2);
|
||||
}
|
||||
}
|
||||
for (final ItemStack stack : this.products.keySet()) {
|
||||
final ItemStack stack2 = stack.copy();
|
||||
stack2.stackSize = world.rand.nextInt((int) (bountyLevel / 2.0f)) + 1;
|
||||
stack2.setCount(world.rand.nextInt((int) (bountyLevel / 2.0f)) + 1);
|
||||
bounty.add(stack2);
|
||||
}
|
||||
return bounty.toArray(new ItemStack[0]);
|
||||
return bounty;
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
||||
@@ -14,6 +14,11 @@ public class EntityBeeLightning extends EntityLightningBolt {
|
||||
int lightningState;
|
||||
int boltLivingTime;
|
||||
|
||||
@SuppressWarnings("unused")
|
||||
public EntityBeeLightning(final World world) {
|
||||
super(world, 0, 0, 0, true);
|
||||
}
|
||||
|
||||
public EntityBeeLightning(final World par1World, final double par2, final double par4, final double par6) {
|
||||
super(par1World, par2, par4, par6, false);
|
||||
this.lightningState = 2;
|
||||
@@ -31,23 +36,23 @@ public class EntityBeeLightning extends EntityLightningBolt {
|
||||
--this.boltLivingTime;
|
||||
this.lightningState = 1;
|
||||
this.boltVertex = this.rand.nextLong();
|
||||
final int i = MathHelper.floor_double(this.posX);
|
||||
final int j = MathHelper.floor_double(this.posY);
|
||||
final int k = MathHelper.floor_double(this.posZ);
|
||||
final int i = MathHelper.floor(this.posX);
|
||||
final int j = MathHelper.floor(this.posY);
|
||||
final int k = MathHelper.floor(this.posZ);
|
||||
final BlockPos pos = new BlockPos(i, j, k);
|
||||
if (!this.worldObj.isRemote && this.worldObj.isAreaLoaded(pos, 10)) {
|
||||
if (this.worldObj.isAirBlock(pos) && Blocks.FIRE.canPlaceBlockAt(this.worldObj, pos)) {
|
||||
this.worldObj.setBlockState(pos, Blocks.FIRE.getDefaultState());
|
||||
if (!this.world.isRemote && this.world.isAreaLoaded(pos, 10)) {
|
||||
if (this.world.isAirBlock(pos) && Blocks.FIRE.canPlaceBlockAt(this.world, pos)) {
|
||||
this.world.setBlockState(pos, Blocks.FIRE.getDefaultState());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.lightningState >= 0) {
|
||||
if (this.worldObj.isRemote) {
|
||||
this.worldObj.setLastLightningBolt(2);
|
||||
if (this.world.isRemote) {
|
||||
this.world.setLastLightningBolt(2);
|
||||
} else {
|
||||
final double d0 = 3.0;
|
||||
final List<Entity> list = this.worldObj.getEntitiesWithinAABBExcludingEntity(this, new AxisAlignedBB(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0 + d0, this.posZ + d0));
|
||||
final List<Entity> list = this.world.getEntitiesWithinAABBExcludingEntity(this, new AxisAlignedBB(this.posX - d0, this.posY - d0, this.posZ - d0, this.posX + d0, this.posY + 6.0 + d0, this.posZ + d0));
|
||||
for (Entity entity : list) {
|
||||
entity.onStruckByLightning(this);
|
||||
}
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.projectile.EntitySmallFireball;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.MobEffects;
|
||||
import net.minecraft.inventory.EntityEquipmentSlot;
|
||||
import net.minecraft.item.ItemDye;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
@@ -30,6 +31,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumParticleTypes;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.util.math.Vec3i;
|
||||
@@ -132,14 +134,14 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return this.dominant;
|
||||
}
|
||||
|
||||
public void spawnMob(final World world, final BlockPos pos, final String name) {
|
||||
public void spawnMob(final World world, final BlockPos pos, final ResourceLocation name) {
|
||||
if (this.anyPlayerInRange(world, pos, 16)) {
|
||||
final double var1 = pos.getX() + world.rand.nextFloat();
|
||||
final double var2 = pos.getY() + world.rand.nextFloat();
|
||||
final double var3 = pos.getZ() + world.rand.nextFloat();
|
||||
world.spawnParticle(EnumParticleTypes.SMOKE_NORMAL, var1, var2, var3, 0.0, 0.0, 0.0);
|
||||
world.spawnParticle(EnumParticleTypes.FLAME, var1, var2, var3, 0.0, 0.0, 0.0);
|
||||
final EntityLiving entity = (EntityLiving) EntityList.createEntityByName(name, world);
|
||||
final EntityLiving entity = (EntityLiving) EntityList.createEntityByIDFromName(name, world);
|
||||
if (entity != null) {
|
||||
final int nearbyEntityCount = world.getEntitiesWithinAABB(entity.getClass(), new AxisAlignedBB(pos, pos.add(1, 1, 1)).expand(8.0, 4.0, 8.0)).size();
|
||||
if (nearbyEntityCount < 6) {
|
||||
@@ -148,7 +150,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
final double var8 = pos.getZ() + (world.rand.nextDouble() - world.rand.nextDouble()) * 4.0;
|
||||
entity.setLocationAndAngles(var6, var7, var8, world.rand.nextFloat() * 360.0f, 0.0f);
|
||||
if (entity.getCanSpawnHere()) {
|
||||
world.spawnEntityInWorld(entity);
|
||||
world.spawnEntity(entity);
|
||||
world.playEvent(2004, pos, 0);//playSFX
|
||||
entity.spawnExplosionParticle();
|
||||
}
|
||||
@@ -209,21 +211,21 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
case SPAWN_ZOMBIE: {
|
||||
if (world.rand.nextInt(200) < 2) {
|
||||
this.spawnMob(world, pos, "Zombie");
|
||||
this.spawnMob(world, pos, new ResourceLocation("zombie"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPAWN_SKELETON: {
|
||||
if (world.rand.nextInt(200) < 2) {
|
||||
this.spawnMob(world, pos, "Skeleton");
|
||||
this.spawnMob(world, pos, new ResourceLocation("skeleton"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case SPAWN_CREEPER: {
|
||||
if (world.rand.nextInt(200) < 2) {
|
||||
this.spawnMob(world, pos, "Creeper");
|
||||
this.spawnMob(world, pos, new ResourceLocation("creeper"));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -237,7 +239,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
case METEOR: {
|
||||
if (world.rand.nextInt(100) < 1 && world.canBlockSeeSky(pos)) {
|
||||
world.spawnEntityInWorld(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0, -0.6, 0.0));
|
||||
world.spawnEntity(new EntitySmallFireball(world, x1, y1 + 64, z1, 0.0, -0.6, 0.0));
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -258,7 +260,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
damage = 3;
|
||||
}
|
||||
}
|
||||
entity.attackEntityFrom(DamageSource.generic, damage);
|
||||
entity.attackEntityFrom(DamageSource.GENERIC, damage);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -353,7 +355,7 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
}
|
||||
final EntityFireworkRocket var11 = new EntityFireworkRocket(world, x1, y1, z1, firework.getFirework());
|
||||
if (world.canBlockSeeSky(pos)) {
|
||||
world.spawnEntityInWorld(var11);
|
||||
world.spawnEntity(var11);
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -509,41 +511,8 @@ public enum ExtraBeesEffect implements IAlleleBeeEffect {
|
||||
return housing.getWorldObj().getEntitiesWithinAABB(eClass, box);
|
||||
}
|
||||
|
||||
public static boolean wearsHelmet(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[3];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsChest(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[2];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsLegs(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[1];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static boolean wearsBoots(final EntityPlayer player) {
|
||||
final ItemStack armorItem = player.inventory.armorInventory[0];
|
||||
return armorItem != null && armorItem.getItem() instanceof IArmorApiarist;
|
||||
}
|
||||
|
||||
public static int wearsItems(final EntityPlayer player) {
|
||||
int count = 0;
|
||||
if (wearsHelmet(player)) {
|
||||
++count;
|
||||
}
|
||||
if (wearsChest(player)) {
|
||||
++count;
|
||||
}
|
||||
if (wearsLegs(player)) {
|
||||
++count;
|
||||
}
|
||||
if (wearsBoots(player)) {
|
||||
++count;
|
||||
}
|
||||
return count;
|
||||
return BeeManager.armorApiaristHelper.wearsItems(player, "", false);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -11,6 +11,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ActionResult;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
@@ -38,20 +39,23 @@ public class ItemDictionary extends Item implements IItemModelRegister {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> par3List) {
|
||||
super.getSubItems(par1, par2CreativeTabs, par3List);
|
||||
par3List.add(new ItemStack(par1, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
final ItemStack itemStack = playerIn.getHeldItem(handIn);
|
||||
final ExtraBeeGUID id;
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.Database, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
id = ExtraBeeGUID.Database;
|
||||
} else {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.DatabaseNEI, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
id = ExtraBeeGUID.DatabaseNEI;
|
||||
}
|
||||
ExtraBees.proxy.openGui(id, playerIn, playerIn.getPosition());
|
||||
|
||||
return super.onItemRightClick(itemStack, world, player, hand);
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -60,6 +64,7 @@ public class ItemDictionary extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
manager.registerItemModel(item, 0, getRegistryName().getResourcePath());
|
||||
manager.registerItemModel(item, 1, getRegistryName().getResourcePath() + "Master");
|
||||
|
||||
@@ -29,11 +29,12 @@ public class ItemPunnettSquare extends Item {
|
||||
return "Punnett Square";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, EnumHand hand) {
|
||||
if (hand == EnumHand.MAIN_HAND)
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
return new ActionResult<>(EnumActionResult.PASS, itemStackIn);
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
if (handIn == EnumHand.MAIN_HAND) {
|
||||
ExtraBees.proxy.openGui(ExtraBeeGUID.PunnettSquare, playerIn, playerIn.getPosition());
|
||||
}
|
||||
ItemStack itemStack = playerIn.getHeldItem(handIn);
|
||||
return new ActionResult<>(EnumActionResult.PASS, itemStack);
|
||||
}
|
||||
}
|
||||
@@ -8,8 +8,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public enum EnumHoneyDrop implements IItemEnum {
|
||||
ENERGY(10242418, 14905713, ""),
|
||||
ACID(4961601, 4841020, "acid"),
|
||||
@@ -43,7 +41,6 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
|
||||
private int[] colour;
|
||||
private String liquidName;
|
||||
@Nullable
|
||||
private ItemStack remnant;
|
||||
|
||||
public void addRemnant(final ItemStack stack) {
|
||||
@@ -55,7 +52,7 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
}
|
||||
|
||||
EnumHoneyDrop(final int colour, final int colour2, final String liquid) {
|
||||
this.remnant = null;
|
||||
this.remnant = ItemStack.EMPTY;
|
||||
this.colour = new int[]{colour, colour2};
|
||||
this.liquidName = liquid;
|
||||
}
|
||||
@@ -63,13 +60,13 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Binnie.LIQUID.getFluidStack(this.getLiquidName(), 200);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{this.get(1)}, liquid, this.getRemnant(), 100);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, this.get(1), liquid, this.getRemnant(), 100);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return this.remnant != null && FluidRegistry.isFluidRegistered(this.getLiquidName());
|
||||
return !this.remnant.isEmpty() && FluidRegistry.isFluidRegistered(this.getLiquidName());
|
||||
}
|
||||
|
||||
public static EnumHoneyDrop get(final ItemStack itemStack) {
|
||||
@@ -98,7 +95,6 @@ public enum EnumHoneyDrop implements IItemEnum {
|
||||
return liquidName;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
public ItemStack getRemnant() {
|
||||
return remnant;
|
||||
}
|
||||
|
||||
@@ -38,7 +38,7 @@ public enum EnumPropolis implements IItemEnum {
|
||||
public void addRecipe() {
|
||||
final FluidStack liquid = Binnie.LIQUID.getFluidStack(this.liquidName, 500);
|
||||
if (liquid != null) {
|
||||
RecipeManagers.squeezerManager.addRecipe(20, new ItemStack[]{this.get(1)}, liquid, null, 0);
|
||||
RecipeManagers.squeezerManager.addRecipe(20, this.get(1), liquid, ItemStack.EMPTY, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -6,6 +6,9 @@ import forestry.api.core.IModelManager;
|
||||
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;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,7 +36,7 @@ public class ItemProduct extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (final IItemEnum type : this.types) {
|
||||
if (type.isActive()) {
|
||||
itemList.add(new ItemStack(this, 1, type.ordinal()));
|
||||
@@ -42,6 +45,7 @@ public class ItemProduct extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for (IItemEnum type : types) {
|
||||
manager.registerItemModel(item, type.ordinal(), getRegistryName().getResourcePath());
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@@ -34,7 +35,7 @@ public class BlockExtraBeeHive extends Block {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (int i = 0; i < EnumHiveType.values().length; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@@ -6,33 +6,29 @@ import forestry.api.apiculture.IBee;
|
||||
import forestry.api.apiculture.IHiveDrop;
|
||||
import forestry.api.genetics.IAllele;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
|
||||
public class HiveDrop implements IHiveDrop {
|
||||
private IAllele[] template;
|
||||
private ArrayList<ItemStack> additional;
|
||||
private NonNullList<ItemStack> extra;
|
||||
private int chance;
|
||||
|
||||
public HiveDrop(final IAlleleBeeSpecies species, final int chance) {
|
||||
this(Binnie.GENETICS.getBeeRoot().getTemplate(species.getUID()), new ItemStack[0], chance);
|
||||
this(Binnie.GENETICS.getBeeRoot().getTemplate(species), NonNullList.create(), chance);
|
||||
}
|
||||
|
||||
public HiveDrop(IAllele[] template, final ItemStack[] bonus, final int chance) {
|
||||
this.additional = new ArrayList<>();
|
||||
public HiveDrop(IAllele[] template, final NonNullList<ItemStack> extra, final int chance) {
|
||||
this.extra = extra;
|
||||
this.template = template;
|
||||
this.chance = chance;
|
||||
Collections.addAll(this.additional, bonus);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Collection<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune) {
|
||||
final ArrayList<ItemStack> ret = new ArrayList<>();
|
||||
for (final ItemStack stack : this.additional) {
|
||||
public NonNullList<ItemStack> getExtraItems(IBlockAccess world, BlockPos pos, int fortune) {
|
||||
final NonNullList<ItemStack> ret = NonNullList.create();
|
||||
for (final ItemStack stack : this.extra) {
|
||||
ret.add(stack.copy());
|
||||
}
|
||||
return ret;
|
||||
@@ -45,7 +41,7 @@ public class HiveDrop implements IHiveDrop {
|
||||
|
||||
@Override
|
||||
public double getIgnobleChance(IBlockAccess world, BlockPos pos, int fortune) {
|
||||
return 0; //TODO implement
|
||||
return 0.5; //TODO implement
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -5,6 +5,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 java.util.List;
|
||||
|
||||
@@ -22,7 +23,7 @@ public class ItemBeehive extends ItemBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (int i = 0; i < EnumHiveType.values().length; ++i) {
|
||||
itemList.add(new ItemStack(this, 1, i));
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ public class WorldGenHiveNether extends WorldGenerator {
|
||||
@Override
|
||||
public boolean generate(final World world, final Random random, final BlockPos pos) {
|
||||
final Biome biome = world.getBiome(pos);
|
||||
if (!BiomeDictionary.isBiomeOfType(biome, BiomeDictionary.Type.NETHER)) {
|
||||
if (!BiomeDictionary.hasType(biome, BiomeDictionary.Type.NETHER)) {
|
||||
return true;
|
||||
}
|
||||
if (this.embedInWall(world, Blocks.NETHERRACK, pos)) {
|
||||
|
||||
Reference in new issue
Block a user