mirror of
https://github.com/GTNewHorizons/Binnie.git
synced 2026-11-22 05:02:34 +00:00
Auto-format fix imports, tabs/spaces
This commit is contained in:
1 parent
5816af57bc
commit
cce3b7b901
174 files changed
+1025
-1259
No files matched your search
@@ -1,6 +1,5 @@
|
||||
package binnie.extratrees;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.Constants;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.BinnieCore;
|
||||
@@ -16,15 +15,18 @@ import binnie.extratrees.carpentry.ModuleCarpentry;
|
||||
import binnie.extratrees.config.ConfigurationMain;
|
||||
import binnie.extratrees.core.ExtraTreesGUID;
|
||||
import binnie.extratrees.core.ModuleCore;
|
||||
import binnie.extratrees.genetics.*;
|
||||
import binnie.extratrees.genetics.AlleleETFruit;
|
||||
import binnie.extratrees.genetics.ButterflySpecies;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import binnie.extratrees.genetics.ModuleGenetics;
|
||||
import binnie.extratrees.item.ModuleItems;
|
||||
import binnie.extratrees.kitchen.ModuleKitchen;
|
||||
import binnie.extratrees.machines.ModuleMachine;
|
||||
import binnie.extratrees.proxy.Proxy;
|
||||
import com.google.common.base.Preconditions;
|
||||
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;
|
||||
@@ -35,18 +37,15 @@ import net.minecraftforge.fml.common.event.FMLInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPostInitializationEvent;
|
||||
import net.minecraftforge.fml.common.event.FMLPreInitializationEvent;
|
||||
import net.minecraftforge.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
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 {
|
||||
|
||||
@@ -203,10 +202,10 @@ public class ExtraTrees extends AbstractMod {
|
||||
Map<String, ETTreeDefinition> map = Arrays.stream(ETTreeDefinition.values()).collect(Collectors.toMap(o -> o.name().toLowerCase(), o -> o));
|
||||
models.forEach(model -> {
|
||||
String species = model.getVariant().split("=")[1];
|
||||
ETTreeDefinition treeSpecies = map.get(species);
|
||||
int primaryColor = treeSpecies.getLeafColor().getRGB();
|
||||
int secondaryColor = treeSpecies.getWoodColor().getRGB();
|
||||
e.getModelRegistry().putObject(model, new DoublePassBakedModel(e.getModelRegistry().getObject(model), primaryColor, secondaryColor));
|
||||
ETTreeDefinition treeSpecies = map.get(species);
|
||||
int primaryColor = treeSpecies.getLeafColor().getRGB();
|
||||
int secondaryColor = treeSpecies.getWoodColor().getRGB();
|
||||
e.getModelRegistry().putObject(model, new DoublePassBakedModel(e.getModelRegistry().getObject(model), primaryColor, secondaryColor));
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IDesignMaterial {
|
||||
ItemStack getStack();
|
||||
|
||||
|
||||
ItemStack getStack(boolean fireproof);
|
||||
|
||||
String getName();
|
||||
|
||||
@@ -1,16 +1,15 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.extratrees.block.property.PropertyETType;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.SoundType;
|
||||
import net.minecraft.block.material.Material;
|
||||
@@ -27,25 +26,17 @@ 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;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import net.minecraftforge.client.model.ModelLoader;
|
||||
import net.minecraftforge.common.IShearable;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
import forestry.api.core.IItemModelRegister;
|
||||
import forestry.api.core.IModelManager;
|
||||
import forestry.api.core.Tabs;
|
||||
import forestry.arboriculture.PluginArboriculture;
|
||||
import forestry.arboriculture.genetics.TreeDefinition;
|
||||
import forestry.core.blocks.IColoredBlock;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
public abstract class BlockETDecorativeLeaves extends Block implements IItemModelRegister, IColoredBlock, IShearable {
|
||||
private static final int VARIANTS_PER_BLOCK = 16;
|
||||
@@ -56,7 +47,7 @@ public abstract class BlockETDecorativeLeaves extends Block implements IItemMode
|
||||
for (int blockNumber = 0; blockNumber < blockCount; blockNumber++) {
|
||||
final PropertyETType variant = PropertyETType.create("variant", blockNumber, VARIANTS_PER_BLOCK);
|
||||
BlockETDecorativeLeaves block = new BlockETDecorativeLeaves(blockNumber) {
|
||||
@Override
|
||||
@Override
|
||||
public PropertyETType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
|
||||
@@ -22,9 +22,6 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
// private IIcon getFlippedIcon(final boolean upper, final boolean flip, final int tileMeta) {
|
||||
// final DoorType type = getDoorType(tileMeta);
|
||||
@@ -212,7 +209,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
// public boolean hasTileEntity(final int meta) {
|
||||
// return true;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
@@ -223,7 +220,7 @@ public class BlockETDoor extends BlockDoor implements IBlockMetadata {
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(IBlockState state, int tileMetadata) {
|
||||
return tileMetadata;
|
||||
|
||||
@@ -66,7 +66,7 @@ public enum EnumETLog implements IWoodType {
|
||||
public String getName() {
|
||||
return name().toLowerCase();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return getName();
|
||||
@@ -76,20 +76,20 @@ public enum EnumETLog implements IWoodType {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void addRecipe() {
|
||||
if (this.plank == null) {
|
||||
return;
|
||||
}
|
||||
ItemStack log = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, false);
|
||||
ItemStack result = plank.getStack(false);
|
||||
result.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(result, log);
|
||||
|
||||
ItemStack logFireproof = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, true);
|
||||
ItemStack resultFireproof = plank.getStack(true);
|
||||
resultFireproof.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(resultFireproof, logFireproof);
|
||||
}
|
||||
public void addRecipe() {
|
||||
if (this.plank == null) {
|
||||
return;
|
||||
}
|
||||
ItemStack log = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, false);
|
||||
ItemStack result = plank.getStack(false);
|
||||
result.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(result, log);
|
||||
|
||||
ItemStack logFireproof = TreeManager.woodAccess.getStack(this, WoodBlockKind.LOG, true);
|
||||
ItemStack resultFireproof = plank.getStack(true);
|
||||
resultFireproof.setCount(4);
|
||||
GameRegistry.addShapelessRecipe(resultFireproof, logFireproof);
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHardness() {
|
||||
@@ -100,14 +100,14 @@ public enum EnumETLog implements IWoodType {
|
||||
public int getCarbonization() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getCharcoalChance(int numberOfCharcoal) {
|
||||
if(numberOfCharcoal == 3){
|
||||
if (numberOfCharcoal == 3) {
|
||||
return 0.75F;
|
||||
}else if(numberOfCharcoal == 4){
|
||||
} else if (numberOfCharcoal == 4) {
|
||||
return 0.5F;
|
||||
}else if(numberOfCharcoal == 5){
|
||||
} else if (numberOfCharcoal == 5) {
|
||||
return 0.25F;
|
||||
}
|
||||
return 0.15F;
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import binnie.core.BinnieCore;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
public enum FruitPod {
|
||||
Cocoa,
|
||||
Banana,
|
||||
@@ -23,7 +23,7 @@ public enum FruitPod {
|
||||
public short[] getTextures() {
|
||||
return this.textures;
|
||||
}
|
||||
|
||||
|
||||
public String getModelName() {
|
||||
return name().toLowerCase(Locale.ENGLISH);
|
||||
}
|
||||
|
||||
@@ -4,9 +4,10 @@ import binnie.extratrees.api.IDesignMaterial;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
|
||||
public interface IPlankType extends IDesignMaterial {
|
||||
// IIcon getIcon();
|
||||
// IIcon getIcon();
|
||||
String getPlankTextureName();
|
||||
|
||||
String getDescription();
|
||||
|
||||
|
||||
IWoodType getWoodType();
|
||||
}
|
||||
@@ -5,6 +5,8 @@ import net.minecraft.block.properties.PropertyEnum;
|
||||
|
||||
public interface IWoodKind {
|
||||
PropertyEnum<EnumETLog> getVariant();
|
||||
|
||||
EnumETLog getWoodType(int meta);
|
||||
|
||||
WoodBlockKind getWoodKind();
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import forestry.api.arboriculture.IFruitProvider;
|
||||
import forestry.api.arboriculture.ITreeGenome;
|
||||
@@ -10,6 +8,8 @@ import forestry.arboriculture.items.ItemBlockLeaves;
|
||||
import forestry.core.items.IColoredItem;
|
||||
import forestry.core.items.ItemBlockForestry;
|
||||
import forestry.core.utils.Translator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
package binnie.extratrees.block;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.Mods;
|
||||
import binnie.core.block.ItemMetadata;
|
||||
import binnie.core.liquid.ILiquidType;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import binnie.extratrees.block.decor.*;
|
||||
import binnie.extratrees.block.decor.BlockHedge;
|
||||
import binnie.extratrees.block.decor.BlockMultiFence;
|
||||
import binnie.extratrees.block.decor.FenceType;
|
||||
import binnie.extratrees.block.decor.MultiFenceRecipeEmbedded;
|
||||
import binnie.extratrees.block.decor.MultiFenceRecipeSize;
|
||||
import binnie.extratrees.block.decor.MultiFenceRecipeSolid;
|
||||
import binnie.extratrees.block.wood.BlockETFence;
|
||||
import binnie.extratrees.block.wood.BlockETLog;
|
||||
import binnie.extratrees.block.wood.BlockETPlank;
|
||||
@@ -44,7 +44,10 @@ import net.minecraftforge.fml.common.registry.GameRegistry;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
public class ModuleBlocks implements IInitializable {
|
||||
@@ -254,8 +257,8 @@ public class ModuleBlocks implements IInitializable {
|
||||
@Override
|
||||
public void postInit() {
|
||||
IWoodAccess woodAccess = TreeManager.woodAccess;
|
||||
for(PlankType.ExtraTreePlanks plankType : PlankType.ExtraTreePlanks.VALUES){
|
||||
for(boolean fireproof : new boolean[]{false, true}){
|
||||
for (PlankType.ExtraTreePlanks plankType : PlankType.ExtraTreePlanks.VALUES) {
|
||||
for (boolean fireproof : new boolean[]{false, true}) {
|
||||
ItemStack planks = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.PLANKS, fireproof);
|
||||
ItemStack slabs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.SLAB, fireproof);
|
||||
ItemStack stairs = woodAccess.getStack(plankType.getWoodType(), WoodBlockKind.STAIRS, fireproof);
|
||||
@@ -306,7 +309,7 @@ public class ModuleBlocks implements IInitializable {
|
||||
this.addSqueezer(log, liquid, amount, 0.5f);
|
||||
}
|
||||
|
||||
private static void addRecipeAtPosition(int position, IRecipe recipe){
|
||||
private static void addRecipeAtPosition(int position, IRecipe recipe) {
|
||||
CraftingManager manager = CraftingManager.getInstance();
|
||||
manager.getRecipeList().add(position, recipe);
|
||||
}
|
||||
|
||||
@@ -68,7 +68,7 @@ public class PlankType {
|
||||
Banana(0);
|
||||
|
||||
public static final ExtraTreePlanks[] VALUES = values();
|
||||
|
||||
|
||||
private EnumETLog woodType;
|
||||
private final int color;
|
||||
//IIcon icon;
|
||||
@@ -77,7 +77,7 @@ public class PlankType {
|
||||
this.color = color;
|
||||
}
|
||||
|
||||
public static void initWoodTypes(){
|
||||
public static void initWoodTypes() {
|
||||
Fir.setWoodType(EnumETLog.Fir);
|
||||
Cedar.setWoodType(EnumETLog.Cedar);
|
||||
Hemlock.setWoodType(EnumETLog.Hemlock);
|
||||
@@ -115,23 +115,23 @@ public class PlankType {
|
||||
PinkIvory.setWoodType(EnumETLog.PinkIvory);
|
||||
Banana.setWoodType(EnumETLog.Banana);
|
||||
}
|
||||
|
||||
|
||||
public void setWoodType(EnumETLog woodType) {
|
||||
this.woodType = woodType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public EnumETLog getWoodType() {
|
||||
return woodType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return ExtraTrees.proxy.localise("block.planks." + this.toString().toLowerCase());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlankTextureName(){
|
||||
public String getPlankTextureName() {
|
||||
return Constants.EXTRA_TREES_MOD_ID + ":blocks/planks/" + name();
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ public class PlankType {
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getStack(boolean fireproof) {
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, fireproof);
|
||||
@@ -197,7 +197,7 @@ public class PlankType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlankTextureName(){
|
||||
public String getPlankTextureName() {
|
||||
return "minecraft:blocks/planks_" + name().toLowerCase();
|
||||
}
|
||||
|
||||
@@ -205,12 +205,12 @@ public class PlankType {
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getStack() {
|
||||
return getStack(true);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IWoodType getWoodType() {
|
||||
return woodType;
|
||||
@@ -272,7 +272,7 @@ public class PlankType {
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getPlankTextureName(){
|
||||
public String getPlankTextureName() {
|
||||
return "forestry:blocks/wood/planks." + name().toLowerCase();
|
||||
}
|
||||
|
||||
@@ -290,12 +290,12 @@ public class PlankType {
|
||||
public int getColour() {
|
||||
return this.color;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public IWoodType getWoodType() {
|
||||
return woodType;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getStack(boolean fireproof) {
|
||||
return TreeManager.woodAccess.getStack(woodType, WoodBlockKind.PLANKS, fireproof);
|
||||
@@ -322,7 +322,7 @@ public class PlankType {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//TODO: extrabiomes 1.10.2
|
||||
/*public enum ExtraBiomesPlank implements IPlankType {
|
||||
Redwood(10185538),
|
||||
|
||||
@@ -15,13 +15,11 @@ import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class WoodManager {
|
||||
public static String getDisplayName(IWoodTyped wood, IWoodType woodType) {
|
||||
WoodBlockKind blockKind = wood.getBlockKind();
|
||||
@@ -48,7 +46,7 @@ public class WoodManager {
|
||||
|
||||
return displayName;
|
||||
}
|
||||
|
||||
|
||||
public static IPlankType getPlankType(final int index) {
|
||||
final IDesignMaterial wood = CarpentryManager.carpentryInterface.getWoodMaterial(index);
|
||||
if (wood instanceof IPlankType) {
|
||||
|
||||
@@ -24,9 +24,6 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public BlockETFenceGate() {
|
||||
super(BlockPlanks.EnumType.OAK);
|
||||
@@ -79,7 +76,7 @@ public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
@@ -90,7 +87,7 @@ public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public int getPlacedMeta(final ItemStack stack, final World world, final BlockPos pos, final EnumFacing clickedBlock) {
|
||||
return TileEntityMetadata.getItemDamage(stack);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getDroppedMeta(IBlockState state, int tileMetadata) {
|
||||
return tileMetadata;
|
||||
@@ -101,7 +98,7 @@ public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
final int meta = TileEntityMetadata.getItemDamage(par1ItemStack);
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodgate.name", WoodManager.getPlankType(meta).getName());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, BlockPos pos, IBlockState state) {
|
||||
super.breakBlock(world, pos, state);
|
||||
@@ -127,19 +124,19 @@ public class BlockETFenceGate extends BlockFenceGate implements IBlockMetadata {
|
||||
public int getFireSpreadSpeed(IBlockAccess world, BlockPos pos, EnumFacing face) {
|
||||
return 5;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
}
|
||||
|
||||
|
||||
// @Override
|
||||
// public ItemStack getPickBlock(final MovingObjectPosition target, final World world, final int x, final int y, final int z) {
|
||||
// return BlockMetadata.getPickBlock(world, x, y, z);
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos){
|
||||
return worldIn.getBlockState(pos).getValue(OPEN);
|
||||
}
|
||||
public boolean isPassable(IBlockAccess worldIn, BlockPos pos) {
|
||||
return worldIn.getBlockState(pos).getValue(OPEN);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,6 @@ import net.minecraft.util.math.RayTraceResult;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockFence extends net.minecraft.block.BlockFence implements IBlockMetadata, IBlockFence {
|
||||
@@ -72,18 +71,18 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
// public int getRenderType() {
|
||||
// return ExtraTrees.fenceID;
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public boolean eventReceived(IBlockState state, World world, BlockPos pos, int id, int param) {
|
||||
TileEntity tileentity = world.getTileEntity(pos);
|
||||
return tileentity != null && tileentity.receiveClientEvent(id, param);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public List<ItemStack> getDrops(IBlockAccess world, BlockPos pos, IBlockState state, int fortune) {
|
||||
return BlockMetadata.getBlockDroppedAsList(this, world, pos);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean removedByPlayer(IBlockState state, World world, BlockPos pos, EntityPlayer player, boolean willHarvest) {
|
||||
return BlockMetadata.breakBlock(this, player, world, pos);
|
||||
@@ -93,7 +92,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
public TileEntity createNewTileEntity(final World var1, final int i) {
|
||||
return new TileEntityMetadata();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean hasTileEntity(IBlockState state) {
|
||||
return true;
|
||||
@@ -119,7 +118,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
public boolean canPlaceTorchOnTop(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean canConnectTo(IBlockAccess worldIn, BlockPos pos) {
|
||||
IBlockState state = worldIn.getBlockState(pos);
|
||||
@@ -145,7 +144,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
super.breakBlock(world, pos, state);
|
||||
world.removeTileEntity(pos);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isWood(final IBlockAccess world, final BlockPos pos) {
|
||||
return true;
|
||||
@@ -170,7 +169,7 @@ public class BlockFence extends net.minecraft.block.BlockFence implements IBlock
|
||||
// @SideOnly(Side.CLIENT)
|
||||
// public void registerBlockIcons(final IIconRegister p_149651_1_) {
|
||||
// }
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(IBlockState state, RayTraceResult target, World world, BlockPos pos, EntityPlayer player) {
|
||||
return BlockMetadata.getPickBlock(world, pos);
|
||||
|
||||
@@ -148,9 +148,9 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
return true;
|
||||
}
|
||||
|
||||
private EnumLeafType getType(int meta) {
|
||||
return EnumLeafType.values()[meta % 8];
|
||||
}
|
||||
private EnumLeafType getType(int meta) {
|
||||
return EnumLeafType.values()[meta % 8];
|
||||
}
|
||||
|
||||
private boolean isFull(final int meta) {
|
||||
return meta / 8 > 0;
|
||||
@@ -182,9 +182,9 @@ public class BlockHedge extends Block implements IBlockFence, IColoredBlock {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static int getColor(int meta) {
|
||||
EnumLeafType type = EnumLeafType.values()[meta % 6];
|
||||
if (type == EnumLeafType.CONIFERS) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
if (type == EnumLeafType.CONIFERS) {
|
||||
return ColorizerFoliage.getFoliageColorPine();
|
||||
}
|
||||
final double d0 = 0.5;
|
||||
final double d2 = 1.0;
|
||||
return ColorizerFoliage.getFoliageColor(d0, d2);
|
||||
|
||||
@@ -12,8 +12,6 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.NonNullList;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class BlockMultiFence extends BlockFence implements IBlockMetadata {
|
||||
public BlockMultiFence() {
|
||||
super("multifence");
|
||||
|
||||
@@ -10,9 +10,6 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class MultiFenceRecipeEmbedded implements IRecipe {
|
||||
private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
|
||||
@@ -10,8 +10,6 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -9,9 +9,6 @@ import net.minecraft.util.NonNullList;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class MultiFenceRecipeSolid implements IRecipe {
|
||||
private ItemStack cached = ItemStack.EMPTY;
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
package binnie.extratrees.block.property;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.PlankType;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
package binnie.extratrees.block.property;
|
||||
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import com.google.common.collect.Collections2;
|
||||
import com.google.common.collect.Lists;
|
||||
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.util.Collection;
|
||||
import net.minecraft.block.properties.PropertyEnum;
|
||||
|
||||
import java.util.Collection;
|
||||
|
||||
public class PropertyETType extends PropertyEnum<ETTreeDefinition> {
|
||||
public static int getBlockCount(int variantsPerBlock) {
|
||||
return (int) Math.ceil((float) ETTreeDefinition.VALUES.length / variantsPerBlock);
|
||||
|
||||
@@ -9,15 +9,16 @@ import forestry.arboriculture.blocks.PropertyWoodType;
|
||||
import java.util.Collection;
|
||||
|
||||
public class PropertyETWoodType extends PropertyWoodType<EnumETLog> {
|
||||
|
||||
|
||||
public static PropertyETWoodType[] create(String name, int variantsPerBlock) {
|
||||
return create(name, variantsPerBlock, false);
|
||||
}
|
||||
|
||||
public static PropertyETWoodType[] create(String name, int variantsPerBlock, boolean isLog) {
|
||||
int length;
|
||||
if(isLog){
|
||||
if (isLog) {
|
||||
length = EnumETLog.VALUES.length;
|
||||
}else{
|
||||
} else {
|
||||
length = PlankType.ExtraTreePlanks.VALUES.length;
|
||||
}
|
||||
final int variantCount = (int) Math.ceil((float) length / variantsPerBlock);
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
package binnie.extratrees.block.property;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class TreeTypePredicate implements Predicate<ETTreeDefinition> {
|
||||
private final int minMeta;
|
||||
|
||||
@@ -20,7 +20,7 @@ public abstract class BlockETFence extends BlockForestryFence<EnumETLog> impleme
|
||||
for (int i = 0; i < variants.length; i++) {
|
||||
PropertyETWoodType variant = variants[i];
|
||||
BlockETFence block = new BlockETFence(fireproof, i) {
|
||||
@Override
|
||||
@Override
|
||||
public PropertyETWoodType getVariant() {
|
||||
return variant;
|
||||
}
|
||||
@@ -33,10 +33,10 @@ public abstract class BlockETFence extends BlockForestryFence<EnumETLog> impleme
|
||||
private BlockETFence(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "fences.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
if (fireproof) {
|
||||
name += "fireproof.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
name += blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.arboriculture.blocks.BlockForestryLog;
|
||||
import forestry.arboriculture.blocks.PropertyWoodType;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -29,10 +30,10 @@ public abstract class BlockETLog extends BlockForestryLog<EnumETLog> {
|
||||
private BlockETLog(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "logs.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
if (fireproof) {
|
||||
name += "fireproof.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
name += blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
@@ -43,5 +44,5 @@ public abstract class BlockETLog extends BlockForestryLog<EnumETLog> {
|
||||
int variantMeta = (meta % variantCount) + getBlockNumber() * VARIANTS_PER_BLOCK;
|
||||
return EnumETLog.byMetadata(variantMeta);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -5,13 +5,13 @@ import binnie.extratrees.block.EnumETLog;
|
||||
import binnie.extratrees.block.property.PropertyETWoodType;
|
||||
import forestry.arboriculture.blocks.BlockForestryPlanks;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
public abstract class BlockETPlank extends BlockForestryPlanks<EnumETLog> {
|
||||
public static final String BLOCK_NAME = "plank";
|
||||
|
||||
|
||||
public static List<BlockETPlank> create(boolean fireproof) {
|
||||
List<BlockETPlank> blocks = new ArrayList<>();
|
||||
PropertyETWoodType[] variants = PropertyETWoodType.create("variant", VARIANTS_PER_BLOCK, false);
|
||||
@@ -31,10 +31,10 @@ public abstract class BlockETPlank extends BlockForestryPlanks<EnumETLog> {
|
||||
private BlockETPlank(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "planks.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
if (fireproof) {
|
||||
name += "fireproof.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
name += blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@@ -34,13 +34,13 @@ public abstract class BlockETSlab extends BlockForestrySlab<EnumETLog> {
|
||||
private BlockETSlab(boolean fireproof, int blockNumber) {
|
||||
super(fireproof, blockNumber);
|
||||
String name = "slabs.";
|
||||
if(fireproof){
|
||||
name+="fireproof.";
|
||||
if (fireproof) {
|
||||
name += "fireproof.";
|
||||
}
|
||||
if(isDouble()){
|
||||
name+="double.";
|
||||
if (isDouble()) {
|
||||
name += "double.";
|
||||
}
|
||||
name+=blockNumber;
|
||||
name += blockNumber;
|
||||
setRegistryName(new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, name));
|
||||
setUnlocalizedName(name);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@ public class ItemBlockETWood<V extends Block & IWoodTyped> extends ItemBlockWood
|
||||
super(block);
|
||||
setRegistryName(block.getRegistryName());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack itemstack) {
|
||||
IWoodTyped wood = getBlock();
|
||||
|
||||
@@ -6,7 +6,7 @@ import net.minecraft.item.ItemSlab;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemETSlab extends ItemSlab {
|
||||
|
||||
|
||||
public ItemETSlab(BlockETSlab block, BlockETSlab slab, BlockETSlab doubleSlab) {
|
||||
super(block, slab, doubleSlab);
|
||||
setRegistryName(block.getRegistryName());
|
||||
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.List;
|
||||
|
||||
public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
public BlockCarpentryPanel() {
|
||||
@@ -28,7 +27,7 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
@Override
|
||||
public void getSubBlocks(final Item itemIn, final CreativeTabs par2CreativeTabs, final NonNullList<ItemStack> itemList) {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getBoundingBox(IBlockState state, IBlockAccess source, BlockPos pos) {
|
||||
final DesignBlock block = this.getCarpentryBlock(source, pos);
|
||||
@@ -65,12 +64,12 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
final DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
return Binnie.LANGUAGE.localise(ExtraTrees.instance, "block.woodenpanel.name", block.getDesign().getName());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isFullCube(IBlockState state) {
|
||||
return false;
|
||||
@@ -89,7 +88,7 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
return state.isSideSolid(world, pos, facing.getOpposite());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getPlacedMeta(ItemStack item, World world, BlockPos pos, EnumFacing clickedBlock) {
|
||||
final DesignBlock block = ModuleCarpentry.getCarpentryPanel(this.getDesignSystem(), TileEntityMetadata.getItemDamage(item));
|
||||
@@ -111,12 +110,12 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
block.setFacing(facing);
|
||||
return block.getBlockMetadata(this.getDesignSystem());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockState base_state, IBlockAccess world, BlockPos pos, EnumFacing side) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onNeighborChange(IBlockAccess blockAccess, BlockPos pos, BlockPos neighbor) {
|
||||
super.onNeighborChange(blockAccess, pos, neighbor);
|
||||
@@ -129,5 +128,5 @@ public class BlockCarpentryPanel extends BlockCarpentry {
|
||||
world.setBlockToAir(pos);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -121,11 +121,11 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int colorMultiplier(IBlockState state, IBlockAccess world, BlockPos pos, int tintIndex) {
|
||||
if(world == null || pos == null){
|
||||
if (world == null || pos == null) {
|
||||
return 0;
|
||||
}
|
||||
DesignBlock block = this.getCarpentryBlock(world, pos);
|
||||
if(tintIndex > 0){
|
||||
if (tintIndex > 0) {
|
||||
return block.getSecondaryColour();
|
||||
}
|
||||
return block.getPrimaryColour();
|
||||
@@ -167,9 +167,9 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public EnumBlockRenderType getRenderType(IBlockState state){
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
public EnumBlockRenderType getRenderType(IBlockState state) {
|
||||
return EnumBlockRenderType.MODEL;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
@@ -188,7 +188,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
manager.registerItemModel(item, new DesignMeshDefinition());
|
||||
}
|
||||
|
||||
private class DesignMeshDefinition implements ItemMeshDefinition{
|
||||
private class DesignMeshDefinition implements ItemMeshDefinition {
|
||||
|
||||
@Override
|
||||
public ModelResourceLocation getModelLocation(ItemStack stack) {
|
||||
@@ -204,7 +204,7 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
|
||||
@Override
|
||||
public IBlockState getExtendedState(IBlockState state, IBlockAccess world, BlockPos pos) {
|
||||
return ((IExtendedBlockState)state).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
return ((IExtendedBlockState) state).withProperty(UnlistedBlockPos.POS, pos).withProperty(UnlistedBlockAccess.BLOCKACCESS, world);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@@ -233,11 +233,11 @@ public abstract class BlockDesign extends BlockMetadata implements IMultipassBlo
|
||||
public TextureAtlasSprite getSprite(Integer key, @Nullable EnumFacing facing, int pass) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(this.getDesignSystem(), key);
|
||||
|
||||
if(facing == null){
|
||||
if (facing == null) {
|
||||
return block.getPrimarySprite(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[0]);
|
||||
}
|
||||
|
||||
if(pass > 0){
|
||||
if (pass > 0) {
|
||||
return block.getSecondarySprite(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[facing.ordinal()]);
|
||||
}
|
||||
return block.getPrimarySprite(getDesignSystem(), BlockDesign.RENDER_DIRECTIONS[facing.ordinal()]);
|
||||
|
||||
@@ -28,7 +28,7 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
public int quantityDropped(final Random p_149745_1_) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube(IBlockState state) {
|
||||
return false;
|
||||
@@ -43,28 +43,28 @@ public class BlockStainedDesign extends BlockDesign {
|
||||
public boolean canRenderInLayer(IBlockState state, BlockRenderLayer layer) {
|
||||
return layer == BlockRenderLayer.TRANSLUCENT;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getRenderPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
|
||||
Block block = iblockstate.getBlock();
|
||||
if (blockState != iblockstate) {
|
||||
return true;
|
||||
}
|
||||
public boolean shouldSideBeRendered(IBlockState blockState, IBlockAccess blockAccess, BlockPos pos, EnumFacing side) {
|
||||
IBlockState iblockstate = blockAccess.getBlockState(pos.offset(side));
|
||||
Block block = iblockstate.getBlock();
|
||||
if (blockState != iblockstate) {
|
||||
return true;
|
||||
}
|
||||
|
||||
if (block == this){
|
||||
return false;
|
||||
}
|
||||
if (block == this) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
}
|
||||
return super.shouldSideBeRendered(blockState, blockAccess, pos, side);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCreativeStack(final IDesign design) {
|
||||
|
||||
@@ -100,7 +100,7 @@ public class CarpentryInterface implements ICarpentryInterface {
|
||||
@Nullable
|
||||
public IDesignMaterial getWoodMaterial(final ItemStack stack) {
|
||||
for (final Map.Entry<Integer, IDesignMaterial> entry : CarpentryInterface.woodMap.entrySet()) {
|
||||
for(boolean fireproof : new boolean[]{true, false}){
|
||||
for (boolean fireproof : new boolean[]{true, false}) {
|
||||
final ItemStack key = entry.getValue().getStack(fireproof);
|
||||
if (key.isItemEqual(stack)) {
|
||||
return entry.getValue();
|
||||
|
||||
@@ -135,249 +135,250 @@ public class DesignBlock {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final int[][] ROTATION_MATRIX = {
|
||||
{0, 1, 4, 5, 3, 2, 6},
|
||||
{0, 1, 5, 4, 2, 3, 6},
|
||||
{5, 4, 2, 3, 0, 1, 6},
|
||||
{4, 5, 2, 3, 1, 0, 6},
|
||||
{2, 3, 1, 0, 4, 5, 6},
|
||||
{3, 2, 0, 1, 4, 5, 6},
|
||||
{0, 1, 2, 3, 4, 5, 6},
|
||||
};
|
||||
|
||||
public EnumFacing getRotation(EnumFacing facing, EnumFacing axis) {
|
||||
return getNewFacing(ROTATION_MATRIX[axis.ordinal()][facing.ordinal()]);
|
||||
}
|
||||
|
||||
private static final int[][] ROTATION_MATRIX = {
|
||||
{0, 1, 4, 5, 3, 2, 6},
|
||||
{0, 1, 5, 4, 2, 3, 6},
|
||||
{5, 4, 2, 3, 0, 1, 6},
|
||||
{4, 5, 2, 3, 1, 0, 6},
|
||||
{2, 3, 1, 0, 4, 5, 6},
|
||||
{3, 2, 0, 1, 4, 5, 6},
|
||||
{0, 1, 2, 3, 4, 5, 6},
|
||||
};
|
||||
|
||||
public EnumFacing getRotation(EnumFacing facing, EnumFacing axis) {
|
||||
return getNewFacing(ROTATION_MATRIX[axis.ordinal()][facing.ordinal()]);
|
||||
}
|
||||
|
||||
public ILayout getLayout(EnumFacing facing) {
|
||||
EnumFacing adjustedFacing;
|
||||
facing = (adjustedFacing = getRotation(facing, EnumFacing.DOWN));
|
||||
switch (this.getFacing()) {
|
||||
case DOWN: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.NORTH);
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
break;
|
||||
}
|
||||
case SOUTH: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.NORTH);
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
break;
|
||||
}
|
||||
case SOUTH: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.EAST);
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.SOUTH);
|
||||
break;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < this.rotation; ++i) {
|
||||
adjustedFacing = getRotation(adjustedFacing, EnumFacing.DOWN);
|
||||
}
|
||||
ILayout layout = null;
|
||||
switch (adjustedFacing) {
|
||||
case EAST: {
|
||||
layout = this.getDesign().getEastPattern();
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = this.getDesign().getNorthPattern();
|
||||
break;
|
||||
}
|
||||
case SOUTH: {
|
||||
layout = this.getDesign().getSouthPattern();
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
layout = this.getDesign().getWestPattern();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = this.getDesign().getBottomPattern();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
layout = this.getDesign().getTopPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
LAYOUTS: {
|
||||
switch (this.getFacing()) {
|
||||
case UP: {
|
||||
if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
switch (facing) {
|
||||
case UP:
|
||||
case DOWN: {
|
||||
layout = layout.flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case WEST: {
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
switch (facing) {
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.rotateLeft().flipHorizontal();
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
layout = layout.flipHorizontal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.EAST) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.WEST) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
switch (facing) {
|
||||
case NORTH: {
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.rotateLeft().flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
layout = this.getDesign().getEastPattern();
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
switch (facing) {
|
||||
case WEST: {
|
||||
layout = layout.rotateLeft();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case EAST: {
|
||||
layout = layout.rotateRight();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.flipHorizontal();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case SOUTH: {
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
case NORTH: {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
default: {
|
||||
break LAYOUTS;
|
||||
}
|
||||
}
|
||||
|
||||
layout = this.getDesign().getNorthPattern();
|
||||
break;
|
||||
}
|
||||
case SOUTH: {
|
||||
switch (facing) {
|
||||
case EAST: {
|
||||
layout = layout.rotateLeft();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case WEST: {
|
||||
layout = layout.rotateRight();
|
||||
break LAYOUTS;
|
||||
}
|
||||
layout = this.getDesign().getSouthPattern();
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
layout = this.getDesign().getWestPattern();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = this.getDesign().getBottomPattern();
|
||||
break;
|
||||
}
|
||||
default: {
|
||||
layout = this.getDesign().getTopPattern();
|
||||
break;
|
||||
}
|
||||
}
|
||||
LAYOUTS:
|
||||
{
|
||||
switch (this.getFacing()) {
|
||||
case UP: {
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break LAYOUTS;
|
||||
if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.flipVertical();
|
||||
break LAYOUTS;
|
||||
switch (facing) {
|
||||
case UP:
|
||||
case DOWN: {
|
||||
layout = layout.flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST:
|
||||
case NORTH:
|
||||
case SOUTH:
|
||||
case WEST: {
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.DOWN || facing == EnumFacing.UP) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
switch (facing) {
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.rotateLeft().flipHorizontal();
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
layout = layout.flipHorizontal();
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.EAST) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
}
|
||||
if (facing == EnumFacing.WEST) {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
switch (facing) {
|
||||
case NORTH: {
|
||||
layout = layout.rotateRight();
|
||||
break;
|
||||
}
|
||||
case SOUTH:
|
||||
case UP: {
|
||||
layout = layout.rotateLeft();
|
||||
break;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.rotateLeft().flipVertical();
|
||||
break;
|
||||
}
|
||||
case EAST: {
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break;
|
||||
}
|
||||
case WEST: {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
switch (facing) {
|
||||
case WEST: {
|
||||
layout = layout.rotateLeft();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case EAST: {
|
||||
layout = layout.rotateRight();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.flipHorizontal();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case SOUTH: {
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
case NORTH: {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
default: {
|
||||
break LAYOUTS;
|
||||
}
|
||||
}
|
||||
break LAYOUTS;
|
||||
|
||||
}
|
||||
case SOUTH: {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
switch (facing) {
|
||||
case EAST: {
|
||||
layout = layout.rotateLeft();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case WEST: {
|
||||
layout = layout.rotateRight();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case UP: {
|
||||
layout = layout.rotateRight().rotateRight();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case DOWN: {
|
||||
layout = layout.flipVertical();
|
||||
break LAYOUTS;
|
||||
}
|
||||
case NORTH: {
|
||||
layout = layout.flipHorizontal();
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateLeft();
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
case SOUTH: {
|
||||
for (int j = 0; j < this.rotation; ++j) {
|
||||
layout = layout.rotateRight();
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
default: {
|
||||
break LAYOUTS;
|
||||
}
|
||||
}
|
||||
break LAYOUTS;
|
||||
}
|
||||
default: {
|
||||
break LAYOUTS;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return layout;
|
||||
@@ -420,15 +421,13 @@ public class DesignBlock {
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
this.setFacing(newFacing);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
if (facing != this.getFacing()) {
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
this.setFacing(facing);
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
++this.rotation;
|
||||
hammerI.onHammerUsed(hammer, player);
|
||||
}
|
||||
@@ -439,14 +438,13 @@ public class DesignBlock {
|
||||
this.rotation = 3;
|
||||
}
|
||||
}
|
||||
|
||||
private EnumFacing getNewFacing(int index){
|
||||
if (index >= 0 && index < EnumFacing.VALUES.length)
|
||||
{
|
||||
return EnumFacing.VALUES[index];
|
||||
}
|
||||
return EnumFacing.DOWN;
|
||||
}
|
||||
|
||||
private EnumFacing getNewFacing(int index) {
|
||||
if (index >= 0 && index < EnumFacing.VALUES.length) {
|
||||
return EnumFacing.VALUES[index];
|
||||
}
|
||||
return EnumFacing.DOWN;
|
||||
}
|
||||
|
||||
public void setFacing(final EnumFacing facing) {
|
||||
this.facing = facing;
|
||||
|
||||
@@ -328,7 +328,7 @@ public enum EnumPattern implements IPattern {
|
||||
protected void setLeftRotation(final EnumPattern pattern, final boolean inverted) {
|
||||
this.leftRotation = Layout.get(pattern, inverted);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerSprites(ITextureManager manager) {
|
||||
}
|
||||
|
||||
@@ -7,17 +7,17 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public class ItemDesign extends ItemMetadata implements IColoredItem{
|
||||
public class ItemDesign extends ItemMetadata implements IColoredItem {
|
||||
|
||||
public ItemDesign(BlockDesign block) {
|
||||
super(block);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public int getColorFromItemstack(ItemStack stack, int tintIndex) {
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(((BlockDesign)this.block).getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if(tintIndex > 0){
|
||||
DesignBlock block = ModuleCarpentry.getDesignBlock(((BlockDesign) this.block).getDesignSystem(), TileEntityMetadata.getItemDamage(stack));
|
||||
if (tintIndex > 0) {
|
||||
return block.getSecondaryColour();
|
||||
}
|
||||
return block.getPrimaryColour();
|
||||
|
||||
@@ -12,11 +12,11 @@ import net.minecraft.util.EnumFacing;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
public class ModuleCarpentry implements IInitializable {
|
||||
|
||||
|
||||
public BlockCarpentry blockCarpentry;
|
||||
public BlockCarpentry blockPanel;
|
||||
public BlockStainedDesign blockStained;
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
blockCarpentry = new BlockCarpentry("carpentry");
|
||||
|
||||
@@ -3,11 +3,11 @@ package binnie.extratrees.gen;
|
||||
import forestry.api.world.ITreeGenData;
|
||||
|
||||
public class WorldGenShrub {
|
||||
public static class Shrub extends WorldGenTree{
|
||||
public static class Shrub extends WorldGenTree {
|
||||
public Shrub(ITreeGenData tree) {
|
||||
super(tree);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void generate() {
|
||||
float leafSpawn = this.height;
|
||||
@@ -30,7 +30,7 @@ public class WorldGenShrub {
|
||||
this.generateCylinder(new Vector(f3, h3, 0.0f), width, 1, this.leaf, false);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void preGenerate() {
|
||||
this.minHeight = 1;
|
||||
|
||||
@@ -29,11 +29,8 @@ 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;
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
@@ -42,7 +39,7 @@ import java.util.Random;
|
||||
|
||||
|
||||
public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IFruitProvider {
|
||||
|
||||
|
||||
/*public static void createAlleles() {
|
||||
List<IAlleleFruit> fruitAlleles = Arrays.asList(
|
||||
fruitNone = new AlleleFruit("none", new FruitProviderNone("for.fruits.none", null)),
|
||||
@@ -352,7 +349,7 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
|
||||
public void addProduct(ItemStack product, float chance) {
|
||||
this.products.put(product, chance);
|
||||
}
|
||||
|
||||
|
||||
private void setFamily(IFruitFamily family) {
|
||||
this.family = family;
|
||||
}
|
||||
@@ -365,8 +362,8 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerSprites() {
|
||||
if(this == Apple){
|
||||
for(FruitSprite sprite : FruitSprite.VALUES){
|
||||
if (this == Apple) {
|
||||
for (FruitSprite sprite : FruitSprite.VALUES) {
|
||||
sprite.registerSprites();
|
||||
}
|
||||
}
|
||||
@@ -399,7 +396,7 @@ 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()){
|
||||
if (this.pod != null && world.rand.nextFloat() <= genome.getSappiness()) {
|
||||
TreeManager.treeRoot.setFruitBlock(world, genome, this, genome.getSappiness(), pos);
|
||||
}
|
||||
return false;
|
||||
@@ -453,7 +450,7 @@ public class AlleleETFruit extends AlleleCategorized implements IAlleleFruit, IF
|
||||
public String getModID() {
|
||||
return Constants.EXTRA_TREES_MOD_ID;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getColour(ITreeGenome genome, IBlockAccess world, BlockPos pos, int ripeningTime) {
|
||||
if (!this.isRipening) {
|
||||
|
||||
@@ -22,9 +22,7 @@ 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;
|
||||
|
||||
@@ -29,5 +29,5 @@ public class ETLeafProvider implements ILeafProvider {
|
||||
}
|
||||
return ModuleBlocks.getDecorativeLeaves(species.getUID());
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -10,8 +10,7 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import java.awt.*;
|
||||
import java.awt.Color;
|
||||
|
||||
public enum EnumSaplingType {
|
||||
Default,
|
||||
@@ -22,7 +21,7 @@ public enum EnumSaplingType {
|
||||
Palm,
|
||||
Shrub;
|
||||
|
||||
public IGermlingModelProvider getGermlingModelProvider(Color leaf, Color wood){
|
||||
public IGermlingModelProvider getGermlingModelProvider(Color leaf, Color wood) {
|
||||
return new DefaultGermlingModelProvider(this, leaf, wood);
|
||||
}
|
||||
|
||||
@@ -52,7 +51,7 @@ public enum EnumSaplingType {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public ModelResourceLocation getModel(EnumGermlingType type) {
|
||||
if (type == EnumGermlingType.SAPLING) {
|
||||
return germlingModel;
|
||||
@@ -65,7 +64,7 @@ public enum EnumSaplingType {
|
||||
|
||||
@Override
|
||||
public int getSpriteColor(EnumGermlingType type, int renderPass) {
|
||||
return type == EnumGermlingType.SAPLING && renderPass==0 ? wood.getRGB() : leaf.getRGB();
|
||||
return type == EnumGermlingType.SAPLING && renderPass == 0 ? wood.getRGB() : leaf.getRGB();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.extratrees.genetics;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import binnie.Constants;
|
||||
import forestry.core.proxy.Proxies;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
@@ -9,7 +7,9 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
import net.minecraftforge.fml.relauncher.SideOnly;
|
||||
|
||||
public enum FruitSprite{
|
||||
import java.util.Locale;
|
||||
|
||||
public enum FruitSprite {
|
||||
TINY,
|
||||
SMALL,
|
||||
AVERAGE,
|
||||
@@ -23,11 +23,11 @@ public enum FruitSprite{
|
||||
private FruitSprite() {
|
||||
location = new ResourceLocation(Constants.EXTRA_TREES_MOD_ID, "blocks/fruit/" + name().toLowerCase(Locale.ENGLISH));
|
||||
}
|
||||
|
||||
|
||||
public ResourceLocation getLocation() {
|
||||
return location;
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerSprites() {
|
||||
TextureMap map = Proxies.common.getClientInstance().getTextureMapBlocks();
|
||||
|
||||
@@ -3,8 +3,6 @@ package binnie.extratrees.genetics;
|
||||
import binnie.Binnie;
|
||||
import binnie.core.BinnieCore;
|
||||
import binnie.core.IInitializable;
|
||||
import forestry.api.genetics.AlleleManager;
|
||||
import forestry.api.genetics.IClassification;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -28,7 +26,7 @@ public class ModuleGenetics implements IInitializable {
|
||||
public void init() {
|
||||
AlleleETFruit.init();
|
||||
ETTreeDefinition.initTrees();
|
||||
ExtraTreeMutation.init();
|
||||
ExtraTreeMutation.init();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -2,6 +2,7 @@ package binnie.extratrees.integration.jei.brewery;
|
||||
|
||||
import binnie.extratrees.machines.brewery.BreweryRecipes;
|
||||
import binnie.extratrees.machines.brewery.IBreweryRecipe;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -12,7 +12,6 @@ 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;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -57,11 +57,11 @@ public class ItemETFood extends ItemFood implements IItemModelRegister {
|
||||
IItemMiscProvider item = this.getItem(stack.getItemDamage());
|
||||
return item.getName(stack);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
for(IItemMiscProvider provider : items){
|
||||
for (IItemMiscProvider provider : items) {
|
||||
manager.registerItemModel(item, provider.ordinal(), "foods/" + provider.getModelPath());
|
||||
}
|
||||
}
|
||||
@@ -69,14 +69,14 @@ public class ItemETFood extends ItemFood implements IItemModelRegister {
|
||||
private Food getFood(final ItemStack par1ItemStack) {
|
||||
return Food.VALUES[par1ItemStack.getItemDamage()];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getHealAmount(ItemStack stack) {
|
||||
return getFood(stack).getHealth();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public float getSaturationModifier(ItemStack stack) {
|
||||
return 3.0f;
|
||||
}
|
||||
public float getSaturationModifier(ItemStack stack) {
|
||||
return 3.0f;
|
||||
}
|
||||
}
|
||||
@@ -22,7 +22,7 @@ public class ItemHammer extends Item implements IToolHammer, IItemModelRegister
|
||||
this.setMaxDamage(durable ? 1562 : 251);
|
||||
setRegistryName(durable ? "durable_hammer" : "hammer");
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
|
||||
@@ -12,7 +12,6 @@ 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;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
@@ -20,7 +20,7 @@ public class ItemSetSquare extends Item implements IToolHammer, IItemModelRegist
|
||||
setRegistryName("setSquare" + mode);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerModel(Item item, IModelManager manager) {
|
||||
|
||||
@@ -22,14 +22,14 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
import net.minecraftforge.oredict.ShapelessOreRecipe;
|
||||
|
||||
public class ModuleItems implements IInitializable {
|
||||
|
||||
|
||||
public Item itemDictionary;
|
||||
public Item itemDictionaryLepi;
|
||||
public ItemMisc itemMisc;
|
||||
public Item itemFood;
|
||||
public Item itemHammer;
|
||||
public Item itemDurableHammer;
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
itemMisc = new ItemMisc(Tabs.tabArboriculture, ExtraTreeItems.values());
|
||||
@@ -65,7 +65,7 @@ public class ModuleItems implements IInitializable {
|
||||
OreDictionary.registerOre("seedCorn", ExtraTreeItems.GrainCorn.get(1));
|
||||
OreDictionary.registerOre("seedRye", ExtraTreeItems.GrainRye.get(1));
|
||||
OreDictionary.registerOre("seedRoasted", ExtraTreeItems.GrainRoasted.get(1));
|
||||
|
||||
|
||||
OreDictionary.registerOre("gearWood", ExtraTreeItems.ProvenGear.get(1));
|
||||
|
||||
Food.CRABAPPLE.addJuice(10, 150, 10);
|
||||
@@ -123,7 +123,7 @@ public class ModuleItems implements IInitializable {
|
||||
@Override
|
||||
public void postInit() {
|
||||
ModuleItems items = ExtraTrees.items();
|
||||
|
||||
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(items.itemDurableHammer, 1, 0), "wiw", " s ", " s ", 'w', Blocks.OBSIDIAN, 'i', Items.GOLD_INGOT, 's', Items.STICK));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(new ItemStack(items.itemHammer, 1, 0), "wiw", " s ", " s ", 'w', "plankWood", 'i', Items.IRON_INGOT, 's', Items.STICK));
|
||||
CraftingManager.getInstance().getRecipeList().add(new ShapedOreRecipe(ExtraTreeItems.Yeast.get(8), " m ", "mbm", 'b', Items.BREAD, 'm', Blocks.BROWN_MUSHROOM));
|
||||
|
||||
@@ -56,7 +56,7 @@ public enum KitchenMachine implements IMachineType {
|
||||
@Override
|
||||
public void register() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
|
||||
@@ -1,16 +1,13 @@
|
||||
package binnie.extratrees.kitchen;
|
||||
|
||||
import binnie.core.IInitializable;
|
||||
import binnie.core.machines.MachineGroup;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
import forestry.api.core.Tabs;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class ModuleKitchen implements IInitializable {
|
||||
|
||||
|
||||
public Block blockKitchen = Blocks.AIR;
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
// TODO implement kitchen
|
||||
|
||||
@@ -164,7 +164,7 @@ public abstract class Designer {
|
||||
|
||||
@Override
|
||||
public void receiveGuiNBTOnClient(EntityPlayer player, String name, NBTTagCompound nbt) {
|
||||
if (name.equals("design")) {
|
||||
if (name.equals("design")) {
|
||||
this.setDesign(CarpentryManager.carpentryInterface.getDesign(nbt.getShort("d")));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,7 +87,7 @@ public enum ExtraTreeMachine implements IMachineType {
|
||||
@Override
|
||||
public void register() {
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void renderMachine(Machine machine, double x, double y, double z, float partialTicks, int destroyStage) {
|
||||
|
||||
@@ -17,9 +17,9 @@ import net.minecraftforge.oredict.ShapedOreRecipe;
|
||||
|
||||
public class ModuleMachine implements IInitializable {
|
||||
public static ValidatorSprite spritePolish;
|
||||
|
||||
|
||||
public Block blockMachine;
|
||||
|
||||
|
||||
@Override
|
||||
public void preInit() {
|
||||
final MachineGroup machineGroup = new MachineGroup(ExtraTrees.instance, "machine", "machine", ExtraTreeMachine.values());
|
||||
|
||||
@@ -24,7 +24,7 @@ public class BreweryCrafting implements INbtWritable {
|
||||
public static BreweryCrafting create(final NBTTagCompound nbt) {
|
||||
FluidStack inputFluid = FluidStack.loadFluidStackFromNBT(nbt.getCompoundTag("fluid"));
|
||||
ItemStack ingredient = new ItemStack(nbt.getCompoundTag("ingr"));
|
||||
ItemStack[] inputGrains = new ItemStack[] {
|
||||
ItemStack[] inputGrains = new ItemStack[]{
|
||||
new ItemStack(nbt.getCompoundTag("in1")),
|
||||
new ItemStack(nbt.getCompoundTag("in2")),
|
||||
new ItemStack(nbt.getCompoundTag("in3"))
|
||||
|
||||
@@ -4,7 +4,6 @@ import binnie.extratrees.item.ExtraTreeItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
@@ -11,8 +11,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
public class ControlRecipeSlot extends ControlSlotBase {
|
||||
public ControlRecipeSlot(final IWidget parent, final int x, final int y) {
|
||||
super(parent, x, y, 50);
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.extratrees.machines.craftgui;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import binnie.Binnie;
|
||||
import binnie.core.AbstractMod;
|
||||
import binnie.core.genetics.TreeBreedingSystem;
|
||||
@@ -26,6 +24,8 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.fml.relauncher.Side;
|
||||
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public class WindowArboristDatabase extends WindowAbstractDatabase {
|
||||
ControlListBox<ItemStack> selectionBoxFruit;
|
||||
ControlListBox<ItemStack> selectionBoxWood;
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package binnie.extratrees.machines.lumbermill;
|
||||
|
||||
import binnie.core.util.OreDictionaryUtil;
|
||||
import binnie.core.util.FakeCraftingWorld;
|
||||
import binnie.core.util.OreDictionaryUtil;
|
||||
import com.google.common.collect.ArrayListMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import forestry.api.arboriculture.IWoodType;
|
||||
@@ -17,8 +17,6 @@ import net.minecraft.item.crafting.CraftingManager;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
|
||||
|
||||
@@ -1,8 +1,5 @@
|
||||
package binnie.extratrees.models;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import binnie.extratrees.block.BlockETDecorativeLeaves;
|
||||
import binnie.extratrees.genetics.ETTreeDefinition;
|
||||
import forestry.api.arboriculture.IAlleleTreeSpecies;
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
package binnie.extratrees.proxy;
|
||||
|
||||
import javax.annotation.Nonnull;
|
||||
|
||||
import binnie.Constants;
|
||||
import binnie.core.models.ModelManager;
|
||||
import binnie.extratrees.ExtraTrees;
|
||||
@@ -29,16 +27,16 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
public void init() {
|
||||
//ForestryAPI.textureManager.registerIconProvider(FruitSprite.Average);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerBlockModel(final BlockModelEntry index) {
|
||||
ModelManager.registerCustomBlockModel(index);
|
||||
if(index.addStateMapper){
|
||||
if (index.addStateMapper) {
|
||||
StateMapperBase ignoreState = new BlockModeStateMapper(index);
|
||||
ModelLoader.setCustomStateMapper(index.block, ignoreState);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerModel(ModelEntry index) {
|
||||
ModelManager.registerCustomModel(index);
|
||||
@@ -74,11 +72,11 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
BlockModelEntry blockModelIndex = new BlockModelEntry(blockModelLocation, itemModeLocation, new ModelETDecorativeLeaves(), leaves);
|
||||
registerBlockModel(blockModelIndex);
|
||||
}
|
||||
|
||||
for(BlockETSlab slab : ExtraTrees.blocks().slabsDouble){
|
||||
|
||||
for (BlockETSlab slab : ExtraTrees.blocks().slabsDouble) {
|
||||
PluginArboriculture.proxy.registerWoodModel(slab, true);
|
||||
}
|
||||
for(BlockETSlab slab : ExtraTrees.blocks().slabsDoubleFireproof){
|
||||
for (BlockETSlab slab : ExtraTrees.blocks().slabsDoubleFireproof) {
|
||||
PluginArboriculture.proxy.registerWoodModel(slab, true);
|
||||
}
|
||||
getModelManager().registerModels();
|
||||
@@ -88,7 +86,7 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
public void registerItemAndBlockColors() {
|
||||
getModelManager().registerItemAndBlockColors();
|
||||
}
|
||||
|
||||
|
||||
class CustomMapper extends StateMapperBase {
|
||||
ResourceLocation rl;
|
||||
|
||||
@@ -101,7 +99,7 @@ public class ProxyClient extends Proxy implements IExtraTreeProxy {
|
||||
return new ModelResourceLocation(rl, this.getPropertyString(state.getProperties()));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
class BlockModeStateMapper extends StateMapperBase {
|
||||
private final BlockModelEntry index;
|
||||
|
||||
|
||||
Reference in new issue
Block a user