mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-26 06:53:30 +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
@@ -3,7 +3,6 @@ package binnie.genetics;
|
||||
import binnie.extrabees.ExtraBees;
|
||||
import binnie.genetics.item.GeneticsItems;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
@@ -21,6 +20,7 @@ public class CreativeTabGenetics extends CreativeTabs {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public String getTranslatedTabLabel() {
|
||||
return this.getTabLabel();
|
||||
}
|
||||
@@ -33,9 +33,9 @@ public class CreativeTabGenetics extends CreativeTabs {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Item getTabIconItem() {
|
||||
public ItemStack getTabIconItem() {
|
||||
//TODO add icon item for genetics
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -22,10 +22,10 @@ public class GeneProjectTracker extends WorldSavedData {
|
||||
|
||||
public static GeneProjectTracker getTracker(final World world) {
|
||||
final String filename = "GeneProjectTracker.common";
|
||||
GeneProjectTracker tracker = (GeneProjectTracker) world.loadItemData(GeneProjectTracker.class, filename);
|
||||
GeneProjectTracker tracker = (GeneProjectTracker) world.loadData(GeneProjectTracker.class, filename);
|
||||
if (tracker == null) {
|
||||
tracker = new GeneProjectTracker(filename);
|
||||
world.setItemData(filename, tracker);
|
||||
world.setData(filename, tracker);
|
||||
}
|
||||
return tracker;
|
||||
}
|
||||
|
||||
@@ -37,15 +37,15 @@ public class GeneTracker extends WorldSavedData {
|
||||
}
|
||||
|
||||
protected static GeneTracker getCommonTracker(final EntityPlayer player) {
|
||||
return getTracker(player.worldObj, null);
|
||||
return getTracker(player.world, null);
|
||||
}
|
||||
|
||||
public static GeneTracker getTracker(final World world, @Nullable final GameProfile player) {
|
||||
final String filename = "GeneTracker." + ((player == null) ? "common" : player.getId());
|
||||
GeneTracker tracker = (GeneTracker) world.loadItemData(GeneTracker.class, filename);
|
||||
GeneTracker tracker = (GeneTracker) world.loadData(GeneTracker.class, filename);
|
||||
if (tracker == null) {
|
||||
tracker = new GeneTracker(filename, player);
|
||||
world.setItemData(filename, tracker);
|
||||
world.setData(filename, tracker);
|
||||
} else {
|
||||
tracker.username = player;
|
||||
}
|
||||
|
||||
@@ -62,24 +62,19 @@ public class AnalystPageClimate extends ControlAnalystPage {
|
||||
y += 12;
|
||||
final List<Biome> biomes = new ArrayList<>();
|
||||
for (final Biome biome : Biome.EXPLORATION_BIOMES_LIST) { //TODO check
|
||||
if (biome != null) {
|
||||
if (BiomeDictionary.isBiomeRegistered(biome)) {
|
||||
if (biome != Biomes.FROZEN_OCEAN) {
|
||||
if (Tolerance.canTolerate(temp, EnumTemperature.getFromBiome(biome), tempTol)) {
|
||||
if (Tolerance.canTolerate(humid, EnumHumidity.getFromValue(biome.getRainfall()), humidTol)) {
|
||||
boolean match = false;
|
||||
for (final Biome eBiome : biomes) {
|
||||
if (biome.getBiomeName().contains(eBiome.getBiomeName()) && EnumHumidity.getFromValue(eBiome.getRainfall()) == EnumHumidity.getFromValue(biome.getRainfall()) && EnumTemperature.getFromBiome(eBiome) == EnumTemperature.getFromBiome(biome)) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
if (!match) {
|
||||
biomes.add(biome);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (biome != null &&
|
||||
biome != Biomes.FROZEN_OCEAN &&
|
||||
Tolerance.canTolerate(temp, EnumTemperature.getFromBiome(biome), tempTol) &&
|
||||
Tolerance.canTolerate(humid, EnumHumidity.getFromValue(biome.getRainfall()), humidTol)) {
|
||||
boolean match = false;
|
||||
for (final Biome eBiome : biomes) {
|
||||
if (biome.getBiomeName().contains(eBiome.getBiomeName()) && EnumHumidity.getFromValue(eBiome.getRainfall()) == EnumHumidity.getFromValue(biome.getRainfall()) && EnumTemperature.getFromBiome(eBiome) == EnumTemperature.getFromBiome(biome)) {
|
||||
match = true;
|
||||
}
|
||||
}
|
||||
if (!match) {
|
||||
biomes.add(biome);
|
||||
}
|
||||
}
|
||||
}
|
||||
final int maxBiomePerLine = (this.w() + 2 - 16) / 18;
|
||||
|
||||
@@ -206,7 +206,7 @@ public abstract class AnalystPageProduce extends ControlAnalystPage {
|
||||
dy += 18;
|
||||
}
|
||||
final FluidStack fluid = FluidUtil.getFluidContained(soilStack);
|
||||
soilStack.stackSize = 1;
|
||||
soilStack.setCount(1);
|
||||
final ControlItemDisplay display = new ControlItemDisplay(this, biomeListX + dx, y + dy, soilStack, fluid == null);
|
||||
if (fluid != null) {
|
||||
display.addTooltip(fluid.getLocalizedName());
|
||||
|
||||
@@ -21,40 +21,40 @@ public class ControlBiome extends Control implements ITooltip {
|
||||
|
||||
@Override
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.MOUNTAIN)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.MOUNTAIN)) {
|
||||
this.iconCategory = "hills";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.HILLS)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.HILLS)) {
|
||||
this.iconCategory = "hills";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.SANDY)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.SANDY)) {
|
||||
this.iconCategory = "desert";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.SNOWY)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.SNOWY)) {
|
||||
this.iconCategory = "snow";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.FOREST)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.FOREST)) {
|
||||
this.iconCategory = "forest";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.SWAMP)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.SWAMP)) {
|
||||
this.iconCategory = "swamp";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.JUNGLE)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.JUNGLE)) {
|
||||
this.iconCategory = "jungle";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.COLD) && BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.FOREST)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.COLD) && BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.FOREST)) {
|
||||
this.iconCategory = "taiga";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.MUSHROOM)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.MUSHROOM)) {
|
||||
this.iconCategory = "mushroom";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.OCEAN)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.OCEAN)) {
|
||||
this.iconCategory = "ocean";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.NETHER)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.NETHER)) {
|
||||
this.iconCategory = "nether";
|
||||
}
|
||||
if (BiomeDictionary.isBiomeOfType(this.biome, BiomeDictionary.Type.END)) {
|
||||
if (BiomeDictionary.hasType(this.biome, BiomeDictionary.Type.END)) {
|
||||
this.iconCategory = "end";
|
||||
}
|
||||
// final IIcon icon = TextureManager.getInstance().getDefault("habitats/" + this.iconCategory);
|
||||
|
||||
@@ -16,6 +16,8 @@ import forestry.api.arboriculture.EnumTreeChromosome;
|
||||
import forestry.api.genetics.IChromosomeType;
|
||||
import forestry.api.genetics.ISpeciesRoot;
|
||||
import forestry.api.lepidopterology.EnumButterflyChromosome;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
@@ -64,14 +66,11 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
new ControlChromoPicker(this, 84, 54, EnumBeeChromosome.EFFECT);
|
||||
} else if (root == Binnie.GENETICS.getTreeRoot()) {
|
||||
new ControlChromoPicker(this, 48, 48, EnumTreeChromosome.SPECIES);
|
||||
new ControlChromoPicker(this, 43, 12, EnumTreeChromosome.GROWTH);
|
||||
new ControlChromoPicker(this, 43, 84, EnumTreeChromosome.HEIGHT);
|
||||
new ControlChromoPicker(this, 25, 63, EnumTreeChromosome.FERTILITY);
|
||||
new ControlChromoPicker(this, 72, 57, EnumTreeChromosome.FRUITS);
|
||||
new ControlChromoPicker(this, 21, 43, EnumTreeChromosome.YIELD);
|
||||
new ControlChromoPicker(this, 38, 32, EnumTreeChromosome.PLANT);
|
||||
new ControlChromoPicker(this, 15, 17, EnumTreeChromosome.SAPPINESS);
|
||||
new ControlChromoPicker(this, 75, 78, EnumTreeChromosome.TERRITORY);
|
||||
new ControlChromoPicker(this, 67, 15, EnumTreeChromosome.EFFECT);
|
||||
new ControlChromoPicker(this, 70, 34, EnumTreeChromosome.MATURATION);
|
||||
new ControlChromoPicker(this, 45, 67, EnumTreeChromosome.GIRTH);
|
||||
@@ -119,6 +118,7 @@ public class ControlChromosome extends Control implements IControlValue<IChromos
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderBackground(int guiWidth, int guiHeight) {
|
||||
if (this.species == null) {
|
||||
return;
|
||||
|
||||
@@ -42,11 +42,6 @@ public class DatabaseRecipeCategory extends BlankRecipeCategory<DatabaseRecipeWr
|
||||
itemStacks.init(1, true, 58, 18);
|
||||
itemStacks.init(2, false, 85, 0);
|
||||
|
||||
// workaround to support multiple outputs in one slot on 1.10.
|
||||
// Todo: 1.11 use simpler itemStack.set(ingredients)
|
||||
List<List<ItemStack>> inputs = ingredients.getInputs(ItemStack.class);
|
||||
itemStacks.set(0, inputs.get(0));
|
||||
itemStacks.set(1, inputs.get(1));
|
||||
itemStacks.set(2, ingredients.getOutputs(ItemStack.class));
|
||||
itemStacks.set(ingredients);
|
||||
}
|
||||
}
|
||||
@@ -8,9 +8,12 @@ import mezz.jei.api.ingredients.IIngredients;
|
||||
import mezz.jei.api.recipe.BlankRecipeWrapper;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public class DatabaseRecipeWrapper extends BlankRecipeWrapper {
|
||||
@@ -26,6 +29,7 @@ public class DatabaseRecipeWrapper extends BlankRecipeWrapper {
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void drawInfo(Minecraft minecraft, int recipeWidth, int recipeHeight, int mouseX, int mouseY) {
|
||||
IDrawable arrow = GeneticsJeiPlugin.drawables.getArrow();
|
||||
arrow.draw(minecraft, 60, 4);
|
||||
@@ -42,6 +46,6 @@ public class DatabaseRecipeWrapper extends BlankRecipeWrapper {
|
||||
new ItemStack(Genetics.database)
|
||||
));
|
||||
|
||||
ingredients.setOutputs(ItemStack.class, outputs);
|
||||
ingredients.setOutputLists(ItemStack.class, Collections.singletonList(outputs));
|
||||
}
|
||||
}
|
||||
@@ -12,11 +12,6 @@ public class IncubatorRecipeHandler implements IRecipeHandler<IIncubatorRecipe>
|
||||
return IIncubatorRecipe.class;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid() {
|
||||
return RecipeUids.INCUBATOR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeCategoryUid(IIncubatorRecipe recipe) {
|
||||
return RecipeUids.INCUBATOR;
|
||||
|
||||
@@ -26,9 +26,9 @@ public class ItemAnalyst extends ItemCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, EnumHand hand) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Analyst, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
return super.onItemRightClick(itemStackIn, world, player, hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Analyst, playerIn, playerIn.getPosition());
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@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;
|
||||
@@ -36,19 +37,20 @@ public class ItemDatabase extends ItemCore {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) {
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
super.getSubItems(itemIn, tab, subItems);
|
||||
subItems.add(new ItemStack(itemIn, 1, 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World worldIn, EntityPlayer player, EnumHand hand) {
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
final ItemStack itemStack = playerIn.getHeldItem(handIn);
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Database, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
Genetics.proxy.openGui(GeneticsGUI.Database, playerIn, playerIn.getPosition());
|
||||
} else {
|
||||
Genetics.proxy.openGui(GeneticsGUI.DatabaseNEI, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
Genetics.proxy.openGui(GeneticsGUI.DatabaseNEI, playerIn, playerIn.getPosition());
|
||||
}
|
||||
return super.onItemRightClick(itemStack, worldIn, player, hand);
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -8,6 +8,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
|
||||
@@ -61,7 +62,7 @@ public abstract class ItemGene extends ItemCore {
|
||||
public abstract String getItemStackDisplayName(final ItemStack p0);
|
||||
|
||||
@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) {
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -26,9 +26,9 @@ public class ItemMasterRegistry extends ItemCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.MasterRegistry, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
return super.onItemRightClick(itemStack, world, player, hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.MasterRegistry, playerIn, playerIn.getPosition());
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -26,9 +26,9 @@ public class ItemRegistry extends ItemCore {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ActionResult<ItemStack> onItemRightClick(ItemStack itemStackIn, World world, EntityPlayer player, EnumHand hand) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Registry, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
return super.onItemRightClick(itemStackIn, world, player, hand);
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
Genetics.proxy.openGui(GeneticsGUI.Registry, playerIn, playerIn.getPosition());
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
|
||||
@@ -73,7 +74,7 @@ public class ItemSequence extends ItemCore implements IItemAnalysable, IItemChar
|
||||
// }
|
||||
|
||||
@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) {
|
||||
final IAlleleBeeSpecies species = (IAlleleBeeSpecies) AlleleManager.alleleRegistry.getAllele("forestry.speciesMeadows");
|
||||
itemList.add(create(new Gene(species, EnumBeeChromosome.SPECIES, Binnie.GENETICS.getBeeRoot()), false));
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
|
||||
@@ -47,7 +48,7 @@ public class ItemSerum extends ItemGene implements IItemSerum {
|
||||
}
|
||||
|
||||
@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 ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
final Map<IChromosomeType, List<IAllele>> chromosomeMap = Binnie.GENETICS.getChromosomeMap(root);
|
||||
for (final Map.Entry<IChromosomeType, List<IAllele>> entry : chromosomeMap.entrySet()) {
|
||||
|
||||
@@ -19,6 +19,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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;
|
||||
|
||||
@@ -83,7 +84,7 @@ public class ItemSerumArray extends ItemGene implements IItemSerum {
|
||||
}
|
||||
|
||||
@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 ISpeciesRoot root : AlleleManager.alleleRegistry.getSpeciesRoot().values()) {
|
||||
for (final IIndividual template : root.getIndividualTemplates()) {
|
||||
if (template.getGenome().getPrimary().isSecret()) {
|
||||
|
||||
@@ -45,24 +45,22 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack getStackInSlot(final int index) {
|
||||
if (index >= 0 && index < this.indexerInventory.size()) {
|
||||
return this.indexerInventory.get(index);
|
||||
}
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public ItemStack decrStackSize(final int index, final int amount) {
|
||||
ItemStack stackInSlot = this.getStackInSlot(index);
|
||||
if (stackInSlot != null) {
|
||||
if (!stackInSlot.isEmpty()) {
|
||||
final ItemStack returnStack = stackInSlot.copy();
|
||||
this.setInventorySlotContents(index, null);
|
||||
this.setInventorySlotContents(index, ItemStack.EMPTY);
|
||||
return returnStack;
|
||||
}
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -72,10 +70,10 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(final int index, @Nullable final ItemStack itemStack) {
|
||||
public void setInventorySlotContents(final int index, final ItemStack itemStack) {
|
||||
if (index >= 0 && index < this.indexerInventory.size()) {
|
||||
this.indexerInventory.set(index, itemStack);
|
||||
} else if (itemStack != null) {
|
||||
} else if (!itemStack.isEmpty()) {
|
||||
this.indexerInventory.add(itemStack);
|
||||
}
|
||||
this.needsSorting = true;
|
||||
@@ -98,7 +96,7 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(final EntityPlayer var1) {
|
||||
public boolean isUsableByPlayer(final EntityPlayer var1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -140,7 +138,7 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
this.indexerInventory.clear();
|
||||
for (int i = 0; i < indexerNBT.tagCount(); ++i) {
|
||||
final NBTTagCompound itemNBT = indexerNBT.getCompoundTagAt(i);
|
||||
this.setInventorySlotContents(i, ItemStack.loadItemStackFromNBT(itemNBT));
|
||||
this.setInventorySlotContents(i, new ItemStack(itemNBT));
|
||||
}
|
||||
this.needsSorting = true;
|
||||
this.markDirty();
|
||||
@@ -271,10 +269,14 @@ public abstract class ComponentIndexerInventory<T> extends ComponentInventory im
|
||||
}
|
||||
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public boolean isEmpty() {
|
||||
return this.sortedInventory.isEmpty();
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack removeStackFromSlot(int index) {
|
||||
return null;
|
||||
return ItemStack.EMPTY;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -77,7 +77,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
@Override
|
||||
public void readFromNBT(final NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.stack = ItemStack.loadItemStackFromNBT(nbttagcompound.getCompoundTag("Item"));
|
||||
this.stack = new ItemStack(nbttagcompound.getCompoundTag("Item"));
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -108,15 +108,15 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
final float f = this.getMachine().getWorld().rand.nextFloat() * 0.8f + 0.1f;
|
||||
final float f2 = this.getMachine().getWorld().rand.nextFloat() * 0.8f + 0.1f;
|
||||
final float f3 = this.getMachine().getWorld().rand.nextFloat() * 0.8f + 0.1f;
|
||||
if (this.stack.stackSize == 0) {
|
||||
this.stack.stackSize = 1;
|
||||
if (this.stack.getCount() == 0) {
|
||||
this.stack.setCount(1);
|
||||
}
|
||||
final EntityItem entityitem = new EntityItem(this.getMachine().getWorld(), this.getMachine().getTileEntity().getPos().getX() + f, this.getMachine().getTileEntity().getPos().getY() + f2, this.getMachine().getTileEntity().getPos().getZ() + f3, this.stack.copy());
|
||||
final float accel = 0.05f;
|
||||
entityitem.motionX = (float) this.getMachine().getWorld().rand.nextGaussian() * accel;
|
||||
entityitem.motionY = (float) this.getMachine().getWorld().rand.nextGaussian() * accel + 0.2f;
|
||||
entityitem.motionZ = (float) this.getMachine().getWorld().rand.nextGaussian() * accel;
|
||||
this.getMachine().getWorld().spawnEntityInWorld(entityitem);
|
||||
this.getMachine().getWorld().spawnEntity(entityitem);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -134,7 +134,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
// final double d3 = world.rand.nextFloat() * f + (1.0f - f) * 0.5;
|
||||
// final EntityItem entityitem = new EntityItem(world, x + d0, y + d2, z + d3, this.stack);
|
||||
// entityitem.delayBeforeCanPickup = 10;
|
||||
// world.spawnEntityInWorld(entityitem);
|
||||
// world.spawnEntity(entityitem);
|
||||
// this.stack = null;
|
||||
// ((IToolWrench) player.getHeldItem().getItem()).wrenchUsed(player, x, y, z);
|
||||
// this.getUtil().refreshBlock();
|
||||
@@ -161,7 +161,7 @@ public enum LaboratoryMachine implements IMachineType {
|
||||
// if (this.stack == null && validSelections.contains(player.getHeldItem().getItem())) {
|
||||
// this.stack = player.getHeldItem().copy();
|
||||
// final ItemStack heldItem = player.getHeldItem();
|
||||
// --heldItem.stackSize;
|
||||
// heldItem.shrink(1);
|
||||
// world.markBlockForUpdate(x, y, z);
|
||||
// return;
|
||||
// }
|
||||
|
||||
@@ -21,7 +21,7 @@ public class MachineRendererLab {
|
||||
private long lastTick;
|
||||
|
||||
public MachineRendererLab() {
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
World world = Minecraft.getMinecraft().world;
|
||||
this.dummyEntityItem = new EntityItem(world);
|
||||
this.itemSides = new EntityItem[]{new EntityItem(world), new EntityItem(world), new EntityItem(world), new EntityItem(world)};
|
||||
}
|
||||
@@ -46,7 +46,7 @@ public class MachineRendererLab {
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance();
|
||||
if (Minecraft.isFancyGraphicsEnabled()) {
|
||||
final ItemStack stack = holder.getStack();
|
||||
this.dummyEntityItem.worldObj = world;
|
||||
this.dummyEntityItem.world = world;
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
if (world.getTotalWorldTime() != this.lastTick) {
|
||||
this.lastTick = world.getTotalWorldTime();
|
||||
@@ -70,7 +70,7 @@ public class MachineRendererLab {
|
||||
int rot = 0;
|
||||
for (EntityItem item : this.itemSides) {
|
||||
GlStateManager.pushMatrix();
|
||||
item.worldObj = world;
|
||||
item.world = world;
|
||||
item.setEntityItemStack(stack);
|
||||
GlStateManager.rotate(rot, 0.0f, 1.0f, 0.0f);
|
||||
GlStateManager.rotate(180.0f, 1.0f, 0.0f, 0.0f);
|
||||
|
||||
@@ -45,7 +45,7 @@ public class AnalyserFX extends MachineComponent implements IRender.DisplayTick,
|
||||
this.motionY = 0.0;
|
||||
this.particleMaxAge = 25;
|
||||
this.particleGravity = 0.05f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.6f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
@@ -70,7 +70,7 @@ public class AnalyserFX extends MachineComponent implements IRender.DisplayTick,
|
||||
return;
|
||||
}
|
||||
final ItemStack stack = this.getUtil().getStack(6);
|
||||
this.dummyEntityItem.worldObj = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.world = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
final EntityItem dummyEntityItem = this.dummyEntityItem;
|
||||
dummyEntityItem.setAgeToCreativeDespawnTime(); //++dummyEntityItem.age;
|
||||
@@ -102,7 +102,7 @@ public class AnalyserFX extends MachineComponent implements IRender.DisplayTick,
|
||||
@Override
|
||||
public void syncFromNBT(final NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("item")) {
|
||||
this.getUtil().setStack(6, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item")));
|
||||
this.getUtil().setStack(6, new ItemStack(nbt.getCompoundTag("item")));
|
||||
} else {
|
||||
this.getUtil().setStack(6, null);
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ public class ControlGene extends Control implements IControlValue<IGene>, IToolt
|
||||
}
|
||||
|
||||
private boolean canFill(final ItemStack stack) {
|
||||
return stack != null && stack.stackSize == 1 && Engineering.isGeneAcceptor(stack) && Engineering.canAcceptGene(stack, this.getValue());
|
||||
return stack != null && stack.getCount() == 1 && Engineering.isGeneAcceptor(stack) && Engineering.canAcceptGene(stack, this.getValue());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -35,7 +35,7 @@ public class GenepoolFX extends MachineComponent implements IRender.DisplayTick
|
||||
this.motionY = this.rand.nextFloat() * 0.01;
|
||||
this.particleMaxAge = 25;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.4f + 0.6f * this.rand.nextFloat(), 0.6f * this.rand.nextFloat(), 0.6f + 0.4f * this.rand.nextFloat());
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 0.92, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
double angle = (int) (this.world.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -46,7 +46,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
this.motionY = 0.007 + this.rand.nextDouble() * 0.002;
|
||||
this.particleMaxAge = 240;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
return;
|
||||
}
|
||||
final ItemStack stack = this.getUtil().getStack(9);
|
||||
this.dummyEntityItem.worldObj = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.world = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
final EntityItem dummyEntityItem = this.dummyEntityItem;
|
||||
dummyEntityItem.setAgeToCreativeDespawnTime(); // ++dummyEntityItem.age;
|
||||
@@ -113,7 +113,7 @@ public class InoculatorFX extends MachineComponent implements IRender.DisplayTic
|
||||
@Override
|
||||
public void syncFromNBT(final NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("item")) {
|
||||
this.getUtil().setStack(9, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item")));
|
||||
this.getUtil().setStack(9, new ItemStack(nbt.getCompoundTag("item")));
|
||||
} else {
|
||||
this.getUtil().setStack(9, null);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ public class IsolaterFX extends MachineComponent implements IRender.RandomDispla
|
||||
this.motionY = -0.012;
|
||||
this.particleMaxAge = 100;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.4f, 0.0f);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class IsolaterFX extends MachineComponent implements IRender.RandomDispla
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||
double angle = 0.7 + (int) (this.world.getTotalWorldTime() % 2L) * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -71,7 +71,7 @@ public class IsolaterFX extends MachineComponent implements IRender.RandomDispla
|
||||
this.motionY = 0.012;
|
||||
this.particleMaxAge = 100;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@ public class PolymeriserFX extends MachineComponent implements IRender.DisplayTi
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.8, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = 0.7 + (int) (this.worldObj.getTotalWorldTime() % 2L) * 3.1415;
|
||||
double angle = 0.7 + (int) (this.world.getTotalWorldTime() % 2L) * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -36,7 +36,7 @@ public class PolymeriserFX extends MachineComponent implements IRender.DisplayTi
|
||||
this.motionY = -0.006;
|
||||
this.particleMaxAge = 140;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.8f, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
|
||||
@@ -37,7 +37,7 @@ public class SequencerFX extends MachineComponent implements IRender.RandomDispl
|
||||
this.motionY = 0.0;
|
||||
this.particleMaxAge = 200;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.6f + this.rand.nextFloat() * 0.2f, 1.0f, 0.8f * this.rand.nextFloat() * 0.2f);
|
||||
}
|
||||
|
||||
@@ -73,7 +73,7 @@ public class SequencerFX extends MachineComponent implements IRender.RandomDispl
|
||||
this.motionY = 0.012;
|
||||
this.particleMaxAge = 50;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.particleScale = 2.0f;
|
||||
//TODO: Add sprites
|
||||
//this.setParticleIcon((new BinnieIcon[] { Sequencer.fxSeqA, Sequencer.fxSeqG, Sequencer.fxSeqC, Sequencer.fxSeqT })[this.rand.nextInt(4)].getIcon());
|
||||
|
||||
@@ -54,7 +54,7 @@ public class SequencerLogic extends ComponentProcess implements IProcess {
|
||||
return new ErrorState.NoItem(Genetics.proxy.localise("machine.machine.sequencer.errors.insufficient.dye"), Sequencer.SLOT_DYE);
|
||||
}
|
||||
ItemStack stackDone = this.getUtil().getStack(Sequencer.SLOT_DONE);
|
||||
if (stackDone != null && stackDone.stackSize >= 64) {
|
||||
if (stackDone != null && stackDone.getCount() >= 64) {
|
||||
return new ErrorState.NoSpace(Genetics.proxy.localise("machine.machine.sequencer.errors.no.space"), new int[]{Sequencer.SLOT_DONE});
|
||||
}
|
||||
return super.canProgress();
|
||||
|
||||
@@ -35,7 +35,7 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
BinnieCore.getBinnieProxy().getMinecraftInstance().effectRenderer.addEffect(new Particle(world, pos.getX() + 0.5, pos.getY() + 1.5, pos.getZ() + 0.5, 0.0, 0.0, 0.0) {
|
||||
double axisX = this.posX;
|
||||
double axisZ = this.posZ;
|
||||
double angle = (int) (this.worldObj.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
double angle = (int) (this.world.getTotalWorldTime() % 4L) * 0.5 * 3.1415;
|
||||
|
||||
{
|
||||
this.axisX = 0.0;
|
||||
@@ -46,11 +46,12 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
this.motionY = (this.rand.nextDouble() - 0.5) * 0.02;
|
||||
this.particleMaxAge = 240;
|
||||
this.particleGravity = 0.0f;
|
||||
this.field_190017_n = true;
|
||||
this.canCollide = true;
|
||||
this.setRBGColorF(0.3f + this.rand.nextFloat() * 0.5f, 0.3f + this.rand.nextFloat() * 0.5f, 0.0f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
final double speed = 0.04;
|
||||
@@ -75,7 +76,7 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
return;
|
||||
}
|
||||
final ItemStack stack = this.getUtil().getStack(9);
|
||||
this.dummyEntityItem.worldObj = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.world = this.getMachine().getWorld();
|
||||
this.dummyEntityItem.setEntityItemStack(stack);
|
||||
final EntityItem dummyEntityItem = this.dummyEntityItem;
|
||||
dummyEntityItem.setAgeToCreativeDespawnTime(); //++dummyEntityItem.age;
|
||||
@@ -107,7 +108,7 @@ public class SplicerFX extends MachineComponent implements IRender.DisplayTick,
|
||||
@Override
|
||||
public void syncFromNBT(final NBTTagCompound nbt) {
|
||||
if (nbt.hasKey("item")) {
|
||||
this.getUtil().setStack(9, ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("item")));
|
||||
this.getUtil().setStack(9, new ItemStack(nbt.getCompoundTag("item")));
|
||||
} else {
|
||||
this.getUtil().setStack(9, null);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user