mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 05:02:34 +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
@@ -1,5 +1,6 @@
|
||||
package binnie.extratrees;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.Constants;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
@@ -23,6 +24,7 @@ import binnie.extratrees.proxy.Proxy;
|
||||
import forestry.api.arboriculture.ITreeRoot;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.AlleleSpeciesRegisterEvent;
|
||||
import forestry.api.genetics.IClassification;
|
||||
import net.minecraft.client.renderer.block.model.ModelResourceLocation;
|
||||
import net.minecraftforge.client.event.ModelBakeEvent;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
@@ -42,6 +44,8 @@ import java.util.stream.Collectors;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@Mod(modid = Constants.EXTRA_TREES_MOD_ID, name = "Binnie's Extra Trees", useMetadata = true, dependencies = "required-after:" + Constants.CORE_MOD_ID)
|
||||
public class ExtraTrees extends AbstractMod {
|
||||
@@ -175,8 +179,8 @@ public class ExtraTrees extends AbstractMod {
|
||||
PlankType.ExtraTreePlanks.initWoodTypes();
|
||||
|
||||
if (BinnieCore.isLepidopteryActive()) {
|
||||
for (final ButterflySpecies species2 : ButterflySpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species2);
|
||||
for (final ButterflySpecies species : ButterflySpecies.values()) {
|
||||
AlleleManager.alleleRegistry.registerAllele(species);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -189,6 +193,7 @@ public class ExtraTrees extends AbstractMod {
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onBakedEvent(ModelBakeEvent e) {
|
||||
//Find all ExtraTrees saplings
|
||||
List<ModelResourceLocation> models = e.getModelRegistry().getKeys().stream()
|
||||
|
||||
@@ -8,21 +8,21 @@ import javax.annotation.Nullable;
|
||||
|
||||
|
||||
public enum Glassware {
|
||||
BeerMug(16, 10, 14),
|
||||
Pint(20, 6, 20),
|
||||
Snifter(17, 14, 11),
|
||||
Flute(6, 13, 15),
|
||||
Cocktail(8, 20, 8),
|
||||
Cordial(2, 15, 7),
|
||||
Collins(12, 8, 18),
|
||||
Highball(8, 10, 14),
|
||||
Hurricane(15, 10, 18),
|
||||
Margarita(12, 18, 9),
|
||||
OldFashioned(8, 13, 8),
|
||||
Wine(8, 17, 10),
|
||||
Shot(1, 13, 7),
|
||||
Sherry(2, 17, 7),
|
||||
Coupe(6, 19, 8);
|
||||
BeerMug(480, 10, 14),
|
||||
Pint(600, 6, 20),
|
||||
Snifter(510, 14, 11),
|
||||
Flute(180, 13, 15),
|
||||
Cocktail(240, 20, 8),
|
||||
Cordial(60, 15, 7),
|
||||
Collins(360, 8, 18),
|
||||
Highball(240, 10, 14),
|
||||
Hurricane(450, 10, 18),
|
||||
Margarita(360, 18, 9),
|
||||
OldFashioned(240, 13, 8),
|
||||
Wine(240, 17, 10),
|
||||
Shot(30, 13, 7),
|
||||
Sherry(60, 17, 7),
|
||||
Coupe(180, 19, 8);
|
||||
|
||||
private int capacity;
|
||||
float contentBottom;
|
||||
@@ -42,7 +42,7 @@ public enum Glassware {
|
||||
}
|
||||
|
||||
Glassware(final int capacity, final int contentBottom, final int contentHeight) {
|
||||
this.capacity = 30 * capacity;
|
||||
this.capacity = capacity;
|
||||
this.contentBottom = contentBottom / 32.0f;
|
||||
this.contentHeight = contentHeight / 32.0f;
|
||||
}
|
||||
|
||||
@@ -76,7 +76,7 @@ public class ModuleAlcohol implements IInitializable {
|
||||
}
|
||||
for (final ItemStack stack : ores) {
|
||||
for (final ISqueezerRecipe entry : RecipeManagers.squeezerManager.recipes()) {
|
||||
final ItemStack input = entry.getResources()[0];
|
||||
final ItemStack input = entry.getResources().get(0);
|
||||
final FluidStack output = entry.getFluidOutput();
|
||||
if (!ItemStack.areItemStacksEqual(stack, input) && !OreDictionary.itemMatches(input, stack, true)) {
|
||||
continue;
|
||||
|
||||
@@ -8,15 +8,15 @@ import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class DrinkManager {
|
||||
static Map<String, IDrinkLiquid> drinkLiquids = new HashMap<>();
|
||||
private static final Map<String, IDrinkLiquid> DRINK_LIQUIDS = new HashMap<>();
|
||||
|
||||
@Nullable
|
||||
public static IDrinkLiquid getLiquid(final String id) {
|
||||
return DrinkManager.drinkLiquids.get(id.toLowerCase());
|
||||
return DrinkManager.DRINK_LIQUIDS.get(id.toLowerCase());
|
||||
}
|
||||
|
||||
public static void registerDrinkLiquid(final IDrinkLiquid liquid) {
|
||||
DrinkManager.drinkLiquids.put(liquid.getIdentifier(), liquid);
|
||||
DrinkManager.DRINK_LIQUIDS.put(liquid.getIdentifier(), liquid);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
package binnie.extratrees.alcohol.drink;
|
||||
|
||||
import binnie.extratrees.alcohol.Glassware;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.capability.templates.FluidHandlerItemStackSimple;
|
||||
|
||||
// TODO implement cocktails and only allow glassware to hold the correct cocktails.
|
||||
public class FluidHandlerItemGlassware extends FluidHandlerItemStackSimple {
|
||||
|
||||
public FluidHandlerItemGlassware(ItemStack container, Glassware glassware) {
|
||||
super(container, glassware.getCapacity());
|
||||
}
|
||||
|
||||
private boolean contentsAllowed(FluidStack fluidStack) {
|
||||
Fluid fluid = fluidStack.getFluid();
|
||||
return fluid != null && DrinkManager.getLiquid(fluidStack) != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canFillFluidType(FluidStack fluid) {
|
||||
return contentsAllowed(fluid);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canDrainFluidType(FluidStack fluid) {
|
||||
return contentsAllowed(fluid);
|
||||
}
|
||||
}
|
||||
@@ -9,16 +9,16 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.common.capabilities.ICapabilityProvider;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||
import net.minecraftforge.fluids.FluidUtil;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
// TODO use capabilities and remove IFluidContainerItem
|
||||
public class ItemDrink extends ItemFood implements IFluidContainerItem {
|
||||
public class ItemDrink extends ItemFood {
|
||||
public ItemDrink() {
|
||||
super(0, 0.0f, false);
|
||||
this.setCreativeTab(Tabs.tabArboriculture);
|
||||
@@ -69,89 +69,24 @@ public class ItemDrink extends ItemFood implements IFluidContainerItem {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack getFluid(final ItemStack container) {
|
||||
if (container.getTagCompound() == null || !container.getTagCompound().hasKey("fluid")) {
|
||||
return null;
|
||||
}
|
||||
return FluidStack.loadFluidStackFromNBT(container.getTagCompound().getCompoundTag("fluid"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity(final ItemStack container) {
|
||||
return this.getGlassware(container).getCapacity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int fill(final ItemStack container, final FluidStack resource, final boolean doFill) {
|
||||
if (resource == null || !container.hasTagCompound()) {
|
||||
return 0;
|
||||
}
|
||||
if (DrinkManager.getLiquid(resource.getFluid()) == null) {
|
||||
return 0;
|
||||
}
|
||||
final FluidStack existing = this.getFluid(container);
|
||||
final int space = this.getGlassware(container).getCapacity() - ((existing == null) ? 0 : existing.amount);
|
||||
final int added = Math.min(space, resource.amount);
|
||||
if (space <= 0) {
|
||||
return 0;
|
||||
}
|
||||
if (existing == null) {
|
||||
if (doFill) {
|
||||
final FluidStack fill = resource.copy();
|
||||
fill.amount = added;
|
||||
this.saveFluid(fill, container);
|
||||
}
|
||||
return added;
|
||||
}
|
||||
if (!existing.isFluidEqual(resource)) {
|
||||
return 0;
|
||||
}
|
||||
if (doFill) {
|
||||
final FluidStack fill = existing.copy();
|
||||
fill.amount += added;
|
||||
this.saveFluid(fill, container);
|
||||
}
|
||||
return added;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public FluidStack drain(final ItemStack container, final int maxDrain, final boolean doDrain) {
|
||||
if (!container.hasTagCompound()) {
|
||||
return null;
|
||||
}
|
||||
final FluidStack content = this.getFluid(container);
|
||||
if (content == null) {
|
||||
return null;
|
||||
}
|
||||
final int toRemove = Math.min(maxDrain, content.amount);
|
||||
FluidStack fill = content.copy();
|
||||
final FluidStack drain = content.copy();
|
||||
drain.amount = toRemove;
|
||||
fill.amount -= toRemove;
|
||||
if (fill.amount == 0) {
|
||||
fill = null;
|
||||
}
|
||||
if (doDrain) {
|
||||
this.saveFluid(fill, container);
|
||||
}
|
||||
return drain;
|
||||
public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) {
|
||||
return new FluidHandlerItemGlassware(stack, getGlassware(stack));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(final Item par1, final CreativeTabs par2CreativeTabs, final List<ItemStack> par3List) {
|
||||
public void getSubItems(final Item item, final CreativeTabs creativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
for (final Glassware glassware : Glassware.values()) {
|
||||
par3List.add(this.getStack(glassware, null));
|
||||
itemList.add(this.getStack(glassware, null));
|
||||
}
|
||||
par3List.add(this.getStack(Glassware.Wine, Alcohol.RedWine.get(Glassware.Wine.getCapacity())));
|
||||
itemList.add(this.getStack(Glassware.Wine, Alcohol.RedWine.get(Glassware.Wine.getCapacity())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(final ItemStack stack) {
|
||||
final FluidStack fluid = this.getFluid(stack);
|
||||
final FluidStack fluid = FluidUtil.getFluidContained(stack);
|
||||
final IDrinkLiquid liquid;
|
||||
if (fluid == null) {
|
||||
liquid = null;
|
||||
@@ -203,8 +138,12 @@ public class ItemDrink extends ItemFood implements IFluidContainerItem {
|
||||
// }
|
||||
|
||||
@Override
|
||||
public EnumAction getItemUseAction(final ItemStack p_77661_1_) {
|
||||
return (this.getFluid(p_77661_1_) == null) ? EnumAction.NONE : EnumAction.DRINK;
|
||||
public EnumAction getItemUseAction(final ItemStack itemStack) {
|
||||
if (FluidUtil.getFluidContained(itemStack) != null) {
|
||||
return EnumAction.DRINK;
|
||||
} else {
|
||||
return EnumAction.NONE;
|
||||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
|
||||
@@ -24,6 +24,8 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.EnumHand;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
@@ -94,7 +96,7 @@ public abstract class BlockETDecorativeLeaves extends Block implements IItemMode
|
||||
*/
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List<ItemStack> list) {
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, NonNullList<ItemStack> list) {
|
||||
for (IBlockState state : getBlockState().getValidStates()) {
|
||||
int meta = getMetaFromState(state);
|
||||
ItemStack itemStack = new ItemStack(item, 1, meta);
|
||||
@@ -120,12 +122,12 @@ public abstract class BlockETDecorativeLeaves extends Block implements IItemMode
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isVisuallyOpaque()
|
||||
{
|
||||
public boolean causesSuffocation(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
return (Proxies.render.fancyGraphicsEnabled() || blockAccess.getBlockState(pos.offset(side)).getBlock() != this) && super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
}
|
||||
@@ -187,11 +189,8 @@ public abstract class BlockETDecorativeLeaves extends Block implements IItemMode
|
||||
return Collections.emptyList();
|
||||
}
|
||||
|
||||
/**
|
||||
* Called by ItemBlocks just before a block is actually set in the world, to allow for adjustments to the IBlockstate
|
||||
*/
|
||||
@Override
|
||||
public IBlockState onBlockPlaced(World worldIn, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer) {
|
||||
public IBlockState getStateForPlacement(World world, BlockPos pos, EnumFacing facing, float hitX, float hitY, float hitZ, int meta, EntityLivingBase placer, EnumHand hand) {
|
||||
ETTreeDefinition type = getTreeType(meta);
|
||||
return getDefaultState().withProperty(getVariant(), type);
|
||||
}
|
||||
|
||||
@@ -16,6 +16,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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.IBlockAccess;
|
||||
@@ -240,7 +241,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@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 (final IPlankType type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(WoodManager.getDoor(type, DoorType.Standard));
|
||||
}
|
||||
|
||||
@@ -83,12 +83,12 @@ public enum EnumETLog implements IWoodType {
|
||||
}
|
||||
ItemStack log = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, false);
|
||||
ItemStack result = plank.getStack(false);
|
||||
result.stackSize = 4;
|
||||
result.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(result, log);
|
||||
|
||||
ItemStack logFireproof = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, true);
|
||||
ItemStack resultFireproof = plank.getStack(true);
|
||||
resultFireproof.stackSize = 4;
|
||||
resultFireproof.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(resultFireproof, logFireproof);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class ItemETDoor extends ItemMetadata {
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumActionResult onItemUse(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, World par3World, BlockPos pos, EnumHand hand, EnumFacing facing, float par8, float par9, float par10) {
|
||||
public EnumActionResult onItemUse(EntityPlayer player, World worldIn, BlockPos pos, EnumHand hand, EnumFacing facing, float hitX, float hitY, float hitZ) {
|
||||
// if (par7 != 1) {
|
||||
// return false;
|
||||
// }
|
||||
@@ -39,10 +39,10 @@ public class ItemETDoor extends ItemMetadata {
|
||||
// if (!block.canPlaceBlockAt(par3World, pos)) {
|
||||
// return false;
|
||||
// }
|
||||
// final int i1 = MathHelper.floor_double((par2EntityPlayer.rotationYaw + 180.0f) * 4.0f / 360.0f - 0.5) & 0x3;
|
||||
// final int i1 = MathHelper.floor((par2EntityPlayer.rotationYaw + 180.0f) * 4.0f / 360.0f - 0.5) & 0x3;
|
||||
// placeDoorBlock(par3World, par4, par5, par6, i1, block, par1ItemStack, par2EntityPlayer);
|
||||
// --par1ItemStack.stackSize;
|
||||
return super.onItemUse(par1ItemStack, par2EntityPlayer, par3World, pos, hand, facing, par8, par9, par10);
|
||||
// par1ItemStack.shrink(1);
|
||||
return super.onItemUse(player, worldIn, pos, hand, facing, hitX, hitY, hitZ);
|
||||
}
|
||||
|
||||
public static void placeDoorBlock(final World par0World, final int par1, final int par2, final int par3, final int par4, final Block par5Block, final ItemStack item, final EntityPlayer player) {
|
||||
|
||||
@@ -260,14 +260,14 @@ public class ModuleBlocks implements IInitializable {
|
||||
ItemStack slabs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.SLAB, fireproof);
|
||||
ItemStack stairs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.STAIRS, fireproof);
|
||||
|
||||
stairs.stackSize = 4;
|
||||
stairs.setCount(4);
|
||||
RecipeUtil.addPriorityRecipe(stairs.copy(),
|
||||
"# ",
|
||||
"## ",
|
||||
"###",
|
||||
'#', planks.copy());
|
||||
|
||||
slabs.stackSize = 6;
|
||||
slabs.setCount(6);
|
||||
RecipeUtil.addPriorityRecipe(slabs.copy(), "###", '#', planks.copy());
|
||||
}
|
||||
}
|
||||
@@ -283,9 +283,9 @@ public class ModuleBlocks implements IInitializable {
|
||||
final ItemStack doorSplit = WoodManager.getDoor(plank2, DoorType.Double);
|
||||
final ItemStack doorFull = WoodManager.getDoor(plank2, DoorType.Full);
|
||||
if (planks2 != null && gate != null) {
|
||||
gate.stackSize = 1;
|
||||
gate.setCount(1);
|
||||
GameRegistry.addRecipe(gate.copy(), "fpf", 'f', fenceNormal.copy(), 'p', planks2.copy());
|
||||
fenceNormal.stackSize = 4;
|
||||
fenceNormal.setCount(4);
|
||||
GameRegistry.addRecipe(fenceNormal.copy(), "###", "# #", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorSolid.copy(), "###", "###", "###", '#', planks2.copy());
|
||||
GameRegistry.addRecipe(doorStandard.copy(), "# #", "###", "###", '#', planks2.copy());
|
||||
@@ -298,7 +298,8 @@ public class ModuleBlocks implements IInitializable {
|
||||
|
||||
public void addSqueezer(final IWoodType log, final ILiquidType liquid, final int amount, final float pulpChance) {
|
||||
final FluidStack liquidStack = liquid.get(amount);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, new ItemStack[]{TreeManager.woodAccess.getStack(log, WoodBlockKind.LOG, false)}, liquidStack, Mods.Forestry.stack("woodPulp"), (int) (100.0f * pulpChance));
|
||||
ItemStack logStack = TreeManager.woodAccess.getStack(log, WoodBlockKind.LOG, false);
|
||||
RecipeManagers.squeezerManager.addRecipe(10, logStack, liquidStack, Mods.Forestry.stack("woodPulp"), (int) (100.0f * pulpChance));
|
||||
}
|
||||
|
||||
public void addSqueezer(final IWoodType log, final ILiquidType liquid, final int amount) {
|
||||
|
||||
@@ -108,14 +108,14 @@ public class WoodManager {
|
||||
if (plank instanceof IFenceProvider && plank == plank2 && type.isPlain()) {
|
||||
final ItemStack original = ((IFenceProvider) plank).getFence();
|
||||
if (original != null) {
|
||||
original.stackSize = amount;
|
||||
original.setCount(amount);
|
||||
return original;
|
||||
}
|
||||
}
|
||||
final int ord = type.ordinal();
|
||||
final int i = getPlankTypeIndex(plank) + 256 * ord;
|
||||
final ItemStack stack = TileEntityMetadata.getItemStack(ExtraTrees.blocks().blockMultiFence, i + 65536 * getPlankTypeIndex(plank2));
|
||||
stack.stackSize = amount;
|
||||
stack.setCount(amount);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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.IBlockAccess;
|
||||
@@ -37,7 +38,7 @@ public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@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 (final IPlankType type : WoodManager.getAllPlankTypes()) {
|
||||
final ItemStack gate = WoodManager.getGate(type);
|
||||
itemList.add(gate);
|
||||
|
||||
@@ -23,6 +23,7 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
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.IBlockAccess;
|
||||
@@ -42,7 +43,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
}
|
||||
|
||||
@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 (final IFenceProvider type : PlankType.ExtraTreePlanks.values()) {
|
||||
itemList.add(type.getFence());
|
||||
}
|
||||
|
||||
@@ -14,6 +14,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.ColorizerFoliage;
|
||||
@@ -33,7 +34,7 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn) {
|
||||
public void addCollisionBoxToList(IBlockState state, World world, BlockPos pos, AxisAlignedBB entityBox, List<AxisAlignedBB> collidingBoxes, @Nullable Entity entityIn, boolean p_185477_7_) {
|
||||
final boolean connectNegZ = this.canConnectFenceTo(world, pos.north());
|
||||
final boolean connectPosZ = this.canConnectFenceTo(world, pos.south());
|
||||
final boolean connectNegX = this.canConnectFenceTo(world, pos.west());
|
||||
@@ -164,7 +165,7 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final List<ItemStack> list) {
|
||||
public void getSubBlocks(final Item item, final CreativeTabs tab, final NonNullList<ItemStack> list) {
|
||||
for (int i = 0; i < 6; ++i) {
|
||||
for (int f = 0; f < 2; ++f) {
|
||||
list.add(new ItemStack(item, 1, i + f * 8));
|
||||
|
||||
@@ -10,6 +10,7 @@ import binnie.extratrees.block.WoodManager;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@@ -19,7 +20,7 @@ public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
}
|
||||
|
||||
@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 (final FenceType type : FenceType.values()) {
|
||||
itemList.add(WoodManager.getFence(PlankType.VanillaPlanks.SPRUCE, PlankType.VanillaPlanks.BIRCH, type, 1));
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
@@ -60,7 +61,7 @@ public class MultiFenceRecipeEmbedded implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
|
||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
|
||||
}
|
||||
}
|
||||
@@ -6,6 +6,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
@@ -24,11 +25,11 @@ public class MultiFenceRecipeSize implements IRecipe {
|
||||
final List<IPlankType> types = new ArrayList<>();
|
||||
for (int i = 0; i < inv.getSizeInventory(); ++i) {
|
||||
final ItemStack stack = inv.getStackInSlot(i);
|
||||
final IPlankType type = (stack == null) ? null : WoodManager.get(stack);
|
||||
if (stack != null && type == null) {
|
||||
final IPlankType type = (stack.isEmpty()) ? null : WoodManager.get(stack);
|
||||
if (!stack.isEmpty() && type == null) {
|
||||
return false;
|
||||
}
|
||||
if (stack == null) {
|
||||
if (stack.isEmpty()) {
|
||||
pattern += " ";
|
||||
} else {
|
||||
if (!types.contains(type)) {
|
||||
@@ -76,6 +77,7 @@ public class MultiFenceRecipeSize implements IRecipe {
|
||||
return (this.cached == null) ? new ItemStack(Blocks.OAK_FENCE) : this.cached;
|
||||
}
|
||||
|
||||
// TODO: what is this?
|
||||
public static void generateTypes() {
|
||||
final int type = 0;
|
||||
for (int type2 = 0; type2 < 2; ++type2) {
|
||||
@@ -83,7 +85,7 @@ public class MultiFenceRecipeSize implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
|
||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
@@ -23,8 +24,8 @@ public class MultiFenceRecipeSolid implements IRecipe {
|
||||
final ItemStack a = inv.getStackInSlot(row * 3);
|
||||
final ItemStack b = inv.getStackInSlot(row * 3 + 1);
|
||||
final ItemStack c = inv.getStackInSlot(row * 3 + 2);
|
||||
if (a != null && b != null) {
|
||||
if (c != null) {
|
||||
if (!a.isEmpty() && !b.isEmpty()) {
|
||||
if (!c.isEmpty()) {
|
||||
type = WoodManager.getFenceType(a);
|
||||
final FenceType type2 = WoodManager.getFenceType(b);
|
||||
final FenceType type3 = WoodManager.getFenceType(c);
|
||||
@@ -57,7 +58,7 @@ public class MultiFenceRecipeSolid implements IRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getRemainingItems(InventoryCrafting inv) {
|
||||
public NonNullList<ItemStack> getRemainingItems(InventoryCrafting inv) {
|
||||
return ForgeHooks.defaultRecipeGetRemainingItems(inv);
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,12 @@
|
||||
package binnie.extratrees.block.property;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
import forestry.arboriculture.blocks.PropertyWoodType;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PropertyETWoodType extends PropertyWoodType<EnumETLog> {
|
||||
|
||||
|
||||
@@ -1,19 +1,17 @@
|
||||
package binnie.extratrees.block.wood;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.arboriculture.IWoodTyped;
|
||||
import forestry.arboriculture.blocks.fence.BlockForestryFence;
|
||||
import forestry.arboriculture.blocks.BlockForestryFence;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BlockETFence extends BlockForestryFence<EnumETLog> implements IWoodTyped, IItemModelRegister, IStateMapperRegister {
|
||||
public static List<BlockETFence> create(boolean fireproof) {
|
||||
List<BlockETFence> blocks = new ArrayList<>();
|
||||
|
||||
@@ -3,12 +3,11 @@ package binnie.extratrees.block.wood;
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.arboriculture.blocks.log.BlockForestryLog;
|
||||
import forestry.arboriculture.blocks.property.PropertyWoodType;
|
||||
import forestry.arboriculture.blocks.BlockForestryLog;
|
||||
import forestry.arboriculture.blocks.PropertyWoodType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class BlockETLog extends BlockForestryLog<EnumETLog> {
|
||||
public static List<BlockETLog> create(boolean fireproof) {
|
||||
@@ -17,7 +16,7 @@ public abstract class BlockETLog extends BlockForestryLog<EnumETLog> {
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyETWoodType variant = variants[i];
|
||||
BlockETLog block = new BlockETLog(fireproof, i) {
|
||||
@Override
|
||||
@Override
|
||||
public PropertyWoodType<EnumETLog> getVariant() {
|
||||
return variant;
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ package binnie.extratrees.block.wood;
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.arboriculture.blocks.planks.BlockForestryPlanks;
|
||||
import forestry.arboriculture.blocks.BlockForestryPlanks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -18,7 +18,7 @@ public abstract class BlockETPlank extends BlockForestryPlanks<EnumETLog> {
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyETWoodType variant = variants[i];
|
||||
BlockETPlank block = new BlockETPlank(fireproof, i) {
|
||||
@Override
|
||||
@Override
|
||||
public PropertyETWoodType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
|
||||
@@ -3,9 +3,8 @@ package binnie.extratrees.block.wood;
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.arboriculture.blocks.slab.BlockForestrySlab;
|
||||
import forestry.arboriculture.blocks.BlockForestrySlab;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -17,7 +16,7 @@ public abstract class BlockETSlab extends BlockForestrySlab<EnumETLog> {
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyETWoodType variant = variants[i];
|
||||
BlockETSlab block = new BlockETSlab(fireproof, i) {
|
||||
@Override
|
||||
@Override
|
||||
public PropertyETWoodType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.math.AxisAlignedBB;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -25,7 +26,7 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
}
|
||||
|
||||
@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) {
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,8 +17,8 @@ import forestry.api.core.ISpriteRegister;
|
||||
import forestry.api.core.IStateMapperRegister;
|
||||
import forestry.api.core.ITextureManager;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import forestry.core.blocks.propertys.UnlistedBlockAccess;
|
||||
import forestry.core.blocks.propertys.UnlistedBlockPos;
|
||||
import forestry.core.blocks.properties.UnlistedBlockAccess;
|
||||
import forestry.core.blocks.properties.UnlistedBlockPos;
|
||||
import forestry.core.models.BlockModelEntry;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.block.properties.IProperty;
|
||||
@@ -34,6 +34,7 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.BlockRenderLayer;
|
||||
import net.minecraft.util.EnumBlockRenderType;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
@@ -90,7 +91,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
public abstract ItemStack getCreativeStack(final IDesign p0);
|
||||
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final List<ItemStack> itemList) {
|
||||
public void getSubBlocks(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> itemList) {
|
||||
for (final IDesign design : CarpentryManager.carpentryInterface.getSortedDesigns()) {
|
||||
itemList.add(this.getCreativeStack(design));
|
||||
}
|
||||
@@ -113,7 +114,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer) {
|
||||
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.CUTOUT_MIPPED;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canRenderInLayer(BlockRenderLayer layer) {
|
||||
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,10 +21,13 @@ import forestry.arboriculture.genetics.alleles.AlleleTreeSpecies;
|
||||
import forestry.core.genetics.alleles.AlleleCategorized;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
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;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
@@ -360,6 +363,7 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerSprites() {
|
||||
if(this == Apple){
|
||||
for(FruitSprite sprite : FruitSprite.VALUES){
|
||||
@@ -396,42 +400,38 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
|
||||
@Override
|
||||
public boolean trySpawnFruitBlock(ITreeGenome genome, World world, Random rand, BlockPos pos) {
|
||||
if(this.pod != null && world.rand.nextFloat() <= genome.getSappiness()){
|
||||
TreeManager.treeRoot.setFruitBlock(world, this, genome.getSappiness(), pos);
|
||||
TreeManager.treeRoot.setFruitBlock(world, genome, this, genome.getSappiness(), pos);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getFruits(ITreeGenome genome, World world, BlockPos pos, int ripeningTime) {
|
||||
public NonNullList<ItemStack> getFruits(ITreeGenome genome, World world, BlockPos pos, int ripeningTime) {
|
||||
NonNullList<ItemStack> products = NonNullList.create();
|
||||
if (this.pod != null) {
|
||||
if (ripeningTime >= 2) {
|
||||
List<ItemStack> products = new ArrayList<ItemStack>();
|
||||
for (Map.Entry<ItemStack, Float> product : this.products.entrySet()) {
|
||||
ItemStack single = product.getKey().copy();
|
||||
single.stackSize = 1;
|
||||
for (int i = 0; i < product.getKey().stackSize; ++i) {
|
||||
single.setCount(1);
|
||||
for (int i = 0; i < product.getKey().getCount(); ++i) {
|
||||
if (world.rand.nextFloat() <= product.getValue()) {
|
||||
products.add(single.copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return products;
|
||||
}
|
||||
return Collections.emptyList();
|
||||
} else {
|
||||
ArrayList<ItemStack> products = new ArrayList<ItemStack>();
|
||||
float stage = this.getRipeningStage(ripeningTime);
|
||||
if (stage < 0.5f) {
|
||||
return Collections.emptyList();
|
||||
}
|
||||
float modeYieldMod = 1.0f;
|
||||
for (final Map.Entry<ItemStack, Float> product : this.products.entrySet()) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * product.getValue() * 5.0f * stage) {
|
||||
products.add(product.getKey().copy());
|
||||
if (stage >= 0.5f) {
|
||||
float modeYieldMod = 1.0f;
|
||||
for (final Map.Entry<ItemStack, Float> product : this.products.entrySet()) {
|
||||
if (world.rand.nextFloat() <= genome.getYield() * modeYieldMod * product.getValue() * 5.0f * stage) {
|
||||
products.add(product.getKey().copy());
|
||||
}
|
||||
}
|
||||
}
|
||||
return products;
|
||||
}
|
||||
return products;
|
||||
}
|
||||
|
||||
@Nullable
|
||||
|
||||
@@ -5,6 +5,7 @@ import binnie.core.Mods;
|
||||
import binnie.core.resource.BinnieResource;
|
||||
import binnie.core.resource.ResourceType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import com.google.common.base.Preconditions;
|
||||
import com.mojang.authlib.GameProfile;
|
||||
import forestry.api.core.EnumHumidity;
|
||||
import forestry.api.core.EnumTemperature;
|
||||
@@ -17,12 +18,16 @@ import forestry.api.lepidopterology.IAlleleButterflySpecies;
|
||||
import forestry.api.lepidopterology.IButterflyRoot;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.BiomeDictionary;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
|
||||
public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
WhiteAdmiral("White Admiral", "Limenitis camilla", 16448250),
|
||||
@@ -48,12 +53,12 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
Monarch("Monarch", "Danaus plexippus", 16757254),
|
||||
MarbledWhite("Marbled White", "Melanargia galathea", 15527148);
|
||||
|
||||
String name;
|
||||
String branchName;
|
||||
String scientific;
|
||||
BinnieResource texture;
|
||||
public IClassification branch;
|
||||
int colour;
|
||||
private String name;
|
||||
private String branchName;
|
||||
private String scientific;
|
||||
private BinnieResource texture;
|
||||
private IClassification branch;
|
||||
private int colour;
|
||||
private Map<ItemStack, Float> butterflyLoot;
|
||||
private Map<ItemStack, Float> caterpillarLoot;
|
||||
|
||||
@@ -65,6 +70,22 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
this.scientific = scientific.split(" ")[1];
|
||||
this.texture = Binnie.RESOURCE.getPNG(ExtraTrees.instance, ResourceType.Entity, this.toString());
|
||||
this.colour = colour;
|
||||
|
||||
final String uid = "trees." + branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
}
|
||||
this.branch = branch;
|
||||
|
||||
// final String scientific = species2.branchName.substring(0, 1).toUpperCase() + species2.branchName.substring(1).toLowerCase();
|
||||
// final String uid = "trees." + species2.branchName.toLowerCase();
|
||||
// IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
// if (branch == null) {
|
||||
// branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
// }
|
||||
// (species2.branch = branch).addMemberSpecies(species2);
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -115,6 +136,7 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
|
||||
@Override
|
||||
public IClassification getBranch() {
|
||||
Preconditions.checkState(this.branch != null, "branch has not been initialized yet");
|
||||
return this.branch;
|
||||
}
|
||||
|
||||
@@ -237,13 +259,16 @@ public enum ButterflySpecies implements IAlleleButterflySpecies {
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack[] getResearchBounty(final World world, final GameProfile researcher, final IIndividual individual, final int bountyLevel) {
|
||||
return new ItemStack[]{this.getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM)};
|
||||
public NonNullList<ItemStack> getResearchBounty(final World world, final GameProfile researcher, final IIndividual individual, final int bountyLevel) {
|
||||
NonNullList<ItemStack> bounty = NonNullList.create();
|
||||
ItemStack serum = this.getRoot().getMemberStack(individual.copy(), EnumFlutterType.SERUM);
|
||||
bounty.add(serum);
|
||||
return bounty;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EnumSet<BiomeDictionary.Type> getSpawnBiomes() {
|
||||
return EnumSet.noneOf(BiomeDictionary.Type.class);
|
||||
public Set<BiomeDictionary.Type> getSpawnBiomes() {
|
||||
return Collections.emptySet();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2223,13 +2223,13 @@ public enum ETTreeDefinition implements IStringSerializable, ITreeDefinition, IT
|
||||
|
||||
@Override
|
||||
public boolean setLeaves(ITreeGenome genome, World world, GameProfile owner, BlockPos pos) {
|
||||
boolean placed = world.setBlockState(pos, PluginArboriculture.blocks.leaves.getDefaultState());
|
||||
boolean placed = world.setBlockState(pos, PluginArboriculture.getBlocks().leaves.getDefaultState());
|
||||
if (!placed) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Block block = world.getBlockState(pos).getBlock();
|
||||
if (PluginArboriculture.blocks.leaves != block) {
|
||||
if (PluginArboriculture.getBlocks().leaves != block) {
|
||||
world.setBlockToAir(pos);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import forestry.api.arboriculture.IAlleleGrowth;
|
||||
import forestry.api.arboriculture.IGrowthProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ExtraTreeGrowthProvider implements IAlleleGrowth, IGrowthProvider {
|
||||
@Override
|
||||
public String getUID() {
|
||||
return "extratrees.fruit." + this.toString().toLowerCase();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isDominant() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IGrowthProvider getProvider() {
|
||||
return this;
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public boolean canGrow(final ITreeGenome genome, final World world, final int xPos, final int yPos, final int zPos, final int expectedGirth, final int expectedHeight) {
|
||||
// return false;
|
||||
// }
|
||||
//
|
||||
// @Override
|
||||
// public EnumGrowthConditions getGrowthConditions(final ITreeGenome genome, final World world, final int xPos, final int yPos, final int zPos) {
|
||||
// return null;
|
||||
// }
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
public BlockPos canGrow(ITreeGenome genome, World world, BlockPos pos, int expectedGirth, int expectedHeight) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String getDescription() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Nullable
|
||||
public String[] getInfo() {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return this.getProvider().getDescription();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName() {
|
||||
return this.getUID();
|
||||
}
|
||||
}
|
||||
@@ -38,13 +38,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
for (final ButterflySpecies species2 : ButterflySpecies.values()) {
|
||||
//AlleleManager.alleleRegistry.registerAllele(species2);
|
||||
Binnie.GENETICS.getButterflyRoot().registerTemplate(species2.getTemplate());
|
||||
final String scientific = species2.branchName.substring(0, 1).toUpperCase() + species2.branchName.substring(1).toLowerCase();
|
||||
final String uid = "trees." + species2.branchName.toLowerCase();
|
||||
IClassification branch = AlleleManager.alleleRegistry.getClassification("genus." + uid);
|
||||
if (branch == null) {
|
||||
branch = AlleleManager.alleleRegistry.createAndRegisterClassification(IClassification.EnumClassLevel.GENUS, uid, scientific);
|
||||
}
|
||||
(species2.branch = branch).addMemberSpecies(species2);
|
||||
species2.getBranch().addMemberSpecies(species2);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,15 +123,15 @@ public enum Food implements IItemMiscProvider {
|
||||
}
|
||||
|
||||
public void addJuice(final Juice juice, final int time, final int amount, final int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Fluids.JUICE.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(time, this.get(1), Fluids.JUICE.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
}
|
||||
|
||||
public void addJuice(final int time, final int amount, final int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Fluids.JUICE.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(time, this.get(1), Fluids.JUICE.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
}
|
||||
|
||||
public void addOil(final int time, final int amount, final int mulch) {
|
||||
RecipeManagers.squeezerManager.addRecipe(time, new ItemStack[]{this.get(1)}, Fluids.SEED_OIL.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
RecipeManagers.squeezerManager.addRecipe(time, this.get(1), Fluids.SEED_OIL.getFluid(amount), Mods.Forestry.stack("mulch"), mulch);
|
||||
}
|
||||
|
||||
public static void registerOreDictionary() {
|
||||
|
||||
@@ -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.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
@@ -39,7 +40,7 @@ public class ItemArboristDatabase 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));
|
||||
}
|
||||
@@ -52,13 +53,16 @@ public class ItemArboristDatabase extends Item implements IItemModelRegister {
|
||||
}
|
||||
|
||||
@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 ExtraTreesGUID id;
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.Database, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
id = ExtraTreesGUID.Database;
|
||||
} else {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.DatabaseNEI, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
id = ExtraTreesGUID.DatabaseNEI;
|
||||
}
|
||||
return super.onItemRightClick(itemStack, world, player, hand);
|
||||
ExtraTrees.proxy.openGui(id, playerIn, playerIn.getPosition());
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -9,6 +9,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemFood;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@@ -28,7 +29,7 @@ public class ItemETFood extends ItemFood implements IItemModelRegister {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, List<ItemStack> subItems) {
|
||||
public void getSubItems(Item itemIn, CreativeTabs tab, NonNullList<ItemStack> subItems) {
|
||||
for (IItemMiscProvider item : this.items) {
|
||||
if (item.isActive()) {
|
||||
subItems.add(this.getStack(item, 1));
|
||||
|
||||
@@ -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.util.text.TextFormatting;
|
||||
import net.minecraft.world.World;
|
||||
@@ -46,19 +47,24 @@ public class ItemMothDatabase 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) {
|
||||
if (itemStack.getItemDamage() == 0) {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.MothDatabase, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
public ActionResult<ItemStack> onItemRightClick(World worldIn, EntityPlayer playerIn, EnumHand handIn) {
|
||||
final ItemStack itemStack = playerIn.getHeldItem(handIn);
|
||||
final ExtraTreesGUID id;
|
||||
if (itemStack.getMetadata() == 0) {
|
||||
id = ExtraTreesGUID.MothDatabase;
|
||||
} else {
|
||||
ExtraTrees.proxy.openGui(ExtraTreesGUID.MothDatabaseNEI, player, new BlockPos((int) player.posX, (int) player.posY, (int) player.posZ));
|
||||
id = ExtraTreesGUID.MothDatabaseNEI;
|
||||
}
|
||||
return super.onItemRightClick(itemStack, world, player, hand);
|
||||
|
||||
ExtraTrees.proxy.openGui(id, playerIn, playerIn.getPosition());
|
||||
|
||||
return super.onItemRightClick(worldIn, playerIn, handIn);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
@@ -152,11 +151,7 @@ public class ModuleItems implements IInitializable {
|
||||
if (Binnie.LIQUID.getFluidStack("Creosote Oil", 100) != null) {
|
||||
RecipeManagers.carpenterManager.addRecipe(25, Binnie.LIQUID.getFluidStack("Creosote Oil", 50), null, items.itemMisc.getStack(ExtraTreeItems.WoodWax, 1), "x", 'x', Mods.Forestry.stack("beeswax"));
|
||||
}
|
||||
for (final FluidContainerRegistry.FluidContainerData data : FluidContainerRegistry.getRegisteredFluidContainerData()) {
|
||||
if (data.fluid.isFluidEqual(Binnie.LIQUID.getFluidStack("water", 0)) && data.fluid.amount == 1000) {
|
||||
CraftingManager.getInstance().addRecipe(Mods.Forestry.stack("mulch"), " b ", "bwb", " b ", 'b', ExtraTreeItems.Bark.get(1), 'w', data.filledContainer.copy());
|
||||
}
|
||||
}
|
||||
|
||||
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Sap.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Sap.get(1).getFluid(), 20, 10000, 1));
|
||||
FuelManager.bronzeEngineFuel.put(ExtraTreeLiquid.Resin.get(1).getFluid(), new EngineBronzeFuel(ExtraTreeLiquid.Resin.get(1).getFluid(), 30, 10000, 1));
|
||||
for (EnumETLog log : EnumETLog.values()) {
|
||||
|
||||
@@ -148,10 +148,10 @@ public abstract class Designer {
|
||||
if (playerInv.getItemStack() == null) {
|
||||
playerInv.setItemStack(this.doRecipe(true));
|
||||
} else if (playerInv.getItemStack().isItemEqual(recipe) && ItemStack.areItemStackTagsEqual(playerInv.getItemStack(), recipe)) {
|
||||
final int fit = recipe.getMaxStackSize() - (recipe.stackSize + playerInv.getItemStack().stackSize);
|
||||
final int fit = recipe.getMaxStackSize() - (recipe.getCount() + playerInv.getItemStack().getCount());
|
||||
if (fit >= 0) {
|
||||
this.doRecipe(true);
|
||||
recipe.stackSize += playerInv.getItemStack().stackSize;
|
||||
recipe.grow(playerInv.getItemStack().getCount());
|
||||
playerInv.setItemStack(recipe);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ public enum DesignerType {
|
||||
stackSize = 1;
|
||||
}
|
||||
final ItemStack stack = ModuleCarpentry.getItemStack(this.getBlock(), type1, type2, design);
|
||||
stack.stackSize = stackSize;
|
||||
stack.setCount(stackSize);
|
||||
return stack;
|
||||
}
|
||||
|
||||
|
||||
@@ -32,7 +32,7 @@ public class TileEntityNursery extends TileEntityMachine implements IButterflyNu
|
||||
|
||||
@Override
|
||||
public World getWorld() {
|
||||
return this.worldObj;
|
||||
return this.world;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,13 +26,13 @@ public class BreweryCrafting implements INbtWritable {
|
||||
|
||||
public static BreweryCrafting create(final NBTTagCompound nbt) {
|
||||
FluidStack inputFluid = FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("fluid"));
|
||||
ItemStack ingredient = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("ingr"));
|
||||
ItemStack ingredient = new ItemStack(nbt.getCompoundTag("ingr"));
|
||||
ItemStack[] inputGrains = new ItemStack[] {
|
||||
ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("in1")),
|
||||
ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("in2")),
|
||||
ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("in3"))
|
||||
new ItemStack(nbt.getCompoundTag("in1")),
|
||||
new ItemStack(nbt.getCompoundTag("in2")),
|
||||
new ItemStack(nbt.getCompoundTag("in3"))
|
||||
};
|
||||
ItemStack yeast = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("yeast"));
|
||||
ItemStack yeast = new ItemStack(nbt.getCompoundTag("yeast"));
|
||||
return new BreweryCrafting(inputFluid, ingredient, inputGrains, yeast);
|
||||
}
|
||||
|
||||
|
||||
@@ -58,7 +58,6 @@ public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
final int th = 14;
|
||||
final int th2 = 18;
|
||||
final BreedingSystem syst = Binnie.GENETICS.treeBreedingSystem;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.PLANT) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), treeSpecies.getPlantType().toString(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), BinnieCore.getBinnieProxy().localise("gui.temperature.short") + " : ", TextJustification.MiddleRight);
|
||||
@@ -94,9 +93,6 @@ public class PageSpeciesTreeGenome extends PageSpecies {
|
||||
display.setTooltip();
|
||||
y += th2;
|
||||
}
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.GROWTH) + " : ", TextJustification.MiddleRight);
|
||||
//new ControlText(contents, new IArea(w2, y, w3, th), genome.getGrowthProvider().getDescription(), TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
new ControlText(contents, new IArea(0, y, w2, th), syst.getChromosomeShortName(EnumTreeChromosome.HEIGHT) + " : ", TextJustification.MiddleRight);
|
||||
new ControlText(contents, new IArea(w2, y, w3, th), genome.getHeight() + "x", TextJustification.MiddleLeft);
|
||||
y += th;
|
||||
|
||||
@@ -25,7 +25,7 @@ public class LumbermillLogic extends ComponentProcessSetCost implements IProcess
|
||||
final ItemStack plankResult = LumbermillRecipes.getPlankProduct(logStack);
|
||||
if (!this.getUtil().isSlotEmpty(LumbermillMachine.SLOT_PLANKS) && plankResult != null) {
|
||||
final ItemStack currentPlank = this.getUtil().getStack(LumbermillMachine.SLOT_PLANKS);
|
||||
if (!plankResult.isItemEqual(currentPlank) || plankResult.stackSize + currentPlank.stackSize > currentPlank.getMaxStackSize()) {
|
||||
if (!plankResult.isItemEqual(currentPlank) || plankResult.getCount() + currentPlank.getCount() > currentPlank.getMaxStackSize()) {
|
||||
return new ErrorState.NoSpace("No room for new planks", new int[]{LumbermillMachine.SLOT_PLANKS});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ public class LumbermillRecipes {
|
||||
for (IWoodType woodType : registeredWoodTypes) {
|
||||
ItemStack logStack = TreeManager.woodAccess.getStack(woodType, WoodBlockKind.LOG, false);
|
||||
ItemStack logCopy = logStack.copy();
|
||||
logCopy.stackSize = 1;
|
||||
logCopy.setCount(1);
|
||||
|
||||
fakeCraftingInventory.clear();
|
||||
fakeCraftingInventory.setInventorySlotContents(0, logCopy);
|
||||
@@ -70,7 +70,7 @@ public class LumbermillRecipes {
|
||||
if (OreDictionaryUtil.hasOreId(recipeOutput, plankOreId)) {
|
||||
Item logItem = logCopy.getItem();
|
||||
ItemStack outputCopy = recipeOutput.copy();
|
||||
outputCopy.stackSize = (int) Math.ceil(outputCopy.stackSize * 1.5f); // turns stack of 4 up to 6
|
||||
outputCopy.setCount((int) Math.ceil(outputCopy.getCount() * 1.5f)); // turns stack of 4 up to 6
|
||||
recipes.put(logItem, Pair.of(logCopy, outputCopy));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,10 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class ModelETDecorativeLeaves extends ModelBlockCached<BlockETDecorativeLeaves, ETTreeDefinition> {
|
||||
public ModelETDecorativeLeaves() {
|
||||
super(BlockETDecorativeLeaves.class);
|
||||
@@ -57,35 +60,33 @@ public class ModelETDecorativeLeaves extends ModelBlockCached<BlockETDecorativeL
|
||||
TextureAtlasSprite leafSprite = map.getAtlasSprite(leafSpriteLocation.toString());
|
||||
|
||||
// Render the plain leaf block.
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, leafSprite, 0);
|
||||
baker.addBlockModel(null, leafSprite, 0);
|
||||
|
||||
// Render overlay for fruit leaves.
|
||||
ResourceLocation fruitSpriteLocation = genome.getFruitProvider().getDecorativeSprite();
|
||||
if (fruitSpriteLocation != null) {
|
||||
TextureAtlasSprite fruitSprite = map.getAtlasSprite(fruitSpriteLocation.toString());
|
||||
baker.addBlockModel(block, Block.FULL_BLOCK_AABB, null, fruitSprite, 1);
|
||||
baker.addBlockModel(null, fruitSprite, 1);
|
||||
}
|
||||
|
||||
// Set the particle sprite
|
||||
baker.setParticleSprite(leafSprite);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@Override
|
||||
protected IBakedModel bakeModel(IBlockState state, ETTreeDefinition key) {
|
||||
protected IBakedModel bakeModel(IBlockState state, ETTreeDefinition key, BlockETDecorativeLeaves block) {
|
||||
if (key == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
IModelBaker baker = new ModelBaker();
|
||||
|
||||
Block block = state.getBlock();
|
||||
if (!blockClass.isInstance(block)) {
|
||||
return null;
|
||||
}
|
||||
BlockETDecorativeLeaves bBlock = blockClass.cast(block);
|
||||
|
||||
baker.setRenderBounds(Block.FULL_BLOCK_AABB);
|
||||
// baker.setRenderBounds(Block.FULL_BLOCK_AABB);
|
||||
bakeBlock(bBlock, key, baker, false);
|
||||
|
||||
blockModel = baker.bakeModel(false);
|
||||
|
||||
Reference in new issue
Block a user