Moved to RebornCore

This commit is contained in:
modmuss50 2015-11-08 12:15:45 +00:00
parent 50a830a101
commit 8abf6e5282
313 changed files with 3987 additions and 16508 deletions

View file

@ -11,10 +11,13 @@ import cpw.mods.fml.common.event.FMLServerStartingEvent;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.network.NetworkRegistry;
import cpw.mods.fml.common.registry.GameRegistry;
import erogenousbeef.coreTR.multiblock.MultiblockEventHandler;
import erogenousbeef.coreTR.multiblock.MultiblockServerTickHandler;
import net.minecraftforge.common.MinecraftForge;
import org.apache.commons.lang3.time.StopWatch;
import reborncore.common.multiblock.MultiblockEventHandler;
import reborncore.common.multiblock.MultiblockServerTickHandler;
import reborncore.common.packets.AddDiscriminatorEvent;
import reborncore.common.util.LogHelper;
import reborncore.common.util.VersionChecker;
import techreborn.achievement.TRAchievements;
import techreborn.api.recipe.RecipeHandler;
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
@ -26,12 +29,10 @@ import techreborn.config.ConfigTechReborn;
import techreborn.events.TRTickHandler;
import techreborn.init.*;
import techreborn.lib.ModInfo;
import techreborn.packets.PacketHandler;
import techreborn.packets.PacketPipeline;
import techreborn.packets.PacketAesu;
import techreborn.packets.PacketIdsu;
import techreborn.proxies.CommonProxy;
import techreborn.tiles.idsu.IDSUManager;
import techreborn.util.LogHelper;
import techreborn.util.VersionChecker;
import techreborn.world.TROreGen;
import java.io.File;
@ -46,14 +47,17 @@ public class Core {
@Mod.Instance
public static Core INSTANCE;
public static final PacketPipeline packetPipeline = new PacketPipeline();
public VersionChecker versionChecker;
public static LogHelper logHelper = new LogHelper(new ModInfo());
@Mod.EventHandler
public void preinit(FMLPreInitializationEvent event) {
event.getModMetadata().version = ModInfo.MOD_VERSION;
INSTANCE = this;
FMLCommonHandler.instance().bus().register(this);
MinecraftForge.EVENT_BUS.register(this);
String path = event.getSuggestedConfigurationFile().getAbsolutePath()
.replace(ModInfo.MOD_ID, "TechReborn");
@ -64,9 +68,9 @@ public class Core {
}
RecipeConfigManager.load(event.getModConfigurationDirectory());
versionChecker = new VersionChecker("TechReborn");
versionChecker = new VersionChecker("TechReborn", new ModInfo());
versionChecker.checkVersionThreaded();
LogHelper.info("PreInitialization Complete");
logHelper.info("PreInitialization Complete");
}
@Mod.EventHandler
@ -83,7 +87,7 @@ public class Core {
StopWatch watch = new StopWatch();
watch.start();
ModRecipes.init();
LogHelper.all(watch + " : main recipes");
logHelper.all(watch + " : main recipes");
watch.stop();
//Client only init, needs to be done before parts system
proxy.init();
@ -96,9 +100,7 @@ public class Core {
// DungeonLoot.init();
// Register Gui Handler
NetworkRegistry.INSTANCE.registerGuiHandler(INSTANCE, new GuiHandler());
// packets
PacketHandler.setChannels(NetworkRegistry.INSTANCE.newChannel(
ModInfo.MOD_ID + "_packets", new PacketHandler()));
// Achievements
TRAchievements.init();
// Multiblock events
@ -108,8 +110,7 @@ public class Core {
MinecraftForge.EVENT_BUS.register(IDSUManager.INSTANCE);
FMLCommonHandler.instance().bus().register(new MultiblockServerTickHandler());
FMLCommonHandler.instance().bus().register(new TRTickHandler());
packetPipeline.initalise();
LogHelper.info("Initialization Complete");
logHelper.info("Initialization Complete");
}
@Mod.EventHandler
@ -118,8 +119,7 @@ public class Core {
for (ICompatModule compatModule : CompatManager.INSTANCE.compatModules) {
compatModule.postInit(event);
}
packetPipeline.postInitialise();
LogHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
logHelper.info(RecipeHandler.recipeList.size() + " recipes loaded");
// RecipeHandler.scanForDupeRecipes();
@ -140,4 +140,11 @@ public class Core {
ConfigTechReborn.Configs();
}
}
@SubscribeEvent
public void addDiscriminator(AddDiscriminatorEvent event) {
event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketAesu.class);
event.getPacketHandler().addDiscriminator(event.getPacketHandler().nextDiscriminator, PacketIdsu.class);
}
}

View file

@ -5,6 +5,8 @@ import cpw.mods.fml.common.gameevent.PlayerEvent.ItemCraftedEvent;
import cpw.mods.fml.common.gameevent.PlayerEvent.ItemPickupEvent;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
import reborncore.common.achievement.ICraftAchievement;
import reborncore.common.achievement.IPickupAchievement;
public class AchievementTriggerer {

View file

@ -1,13 +0,0 @@
package techreborn.achievement;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.IInventory;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
public interface ICraftAchievement {
public Achievement getAchievementOnCraft(ItemStack stack,
EntityPlayer player, IInventory matrix);
}

View file

@ -1,13 +0,0 @@
package techreborn.achievement;
import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.stats.Achievement;
public interface IPickupAchievement {
public Achievement getAchievementOnPickup(ItemStack stack,
EntityPlayer player, EntityItem item);
}

View file

@ -1,9 +0,0 @@
package techreborn.api;
import java.util.List;
public interface IListInfoProvider {
void addInfo(List<String> info, boolean isRealTile);
}

View file

@ -5,10 +5,10 @@ import net.minecraft.block.Block;
public class TechRebornBlocks {
public static Block getBlock(String name){
public static Block getBlock(String name) {
try {
Object e = Class.forName("techreborn.init.ModBlocks").getField(name).get(null);
return e instanceof Block ?(Block)e:null;
return e instanceof Block ? (Block) e : null;
} catch (NoSuchFieldException e1) {
e1.printStackTrace();
return null;

View file

@ -4,10 +4,10 @@ import net.minecraft.item.Item;
public class TechRebornItems {
public static Item getItem(String name){
public static Item getItem(String name) {
try {
Object e = Class.forName("techreborn.init.ModItems").getField(name).get(null);
return e instanceof Item ?(Item)e:null;
return e instanceof Item ? (Item) e : null;
} catch (NoSuchFieldException e1) {
e1.printStackTrace();
return null;

View file

@ -1,14 +0,0 @@
package techreborn.api.fuel;
import net.minecraftforge.fluids.Fluid;
import java.util.HashMap;
public class FluidPowerManager {
/**
* Use this to register a fluid with a power value
*/
public static HashMap<Fluid, Double> fluidPowerValues = new HashMap<Fluid, Double>();
}

View file

@ -1,4 +0,0 @@
@API(apiVersion = "@MODVERSION@", owner = "techreborn", provides = "techrebornAPI") package techreborn.api.fuel;
import cpw.mods.fml.common.API;

View file

@ -77,7 +77,7 @@ public interface IEnergyInterfaceItem {
/**
* @return if it can provide energy
*/
public boolean canProvideEnergy(ItemStack stack );
public boolean canProvideEnergy(ItemStack stack);
public double getMaxTransfer(ItemStack stack);

View file

@ -2,13 +2,10 @@ package techreborn.api.recipe;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.network.Packet;
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
import reborncore.common.util.Inventory;
import reborncore.common.util.ItemUtils;
import techreborn.api.power.IEnergyInterfaceTile;
import techreborn.packets.PacketHandler;
import techreborn.tiles.TileMachineBase;
import techreborn.util.Inventory;
import techreborn.util.ItemUtils;
import java.util.ArrayList;
@ -283,7 +280,7 @@ public class RecipeCrafter {
private boolean isActive() {
return currentRecipe != null && energy.getEnergy() >= currentRecipe.euPerTick();
}
}
public void addSpeedMulti(double amount) {
if (speedMultiplier + amount <= 0.99) {
@ -319,11 +316,11 @@ public class RecipeCrafter {
public void setIsActive() {
if(isActive()){
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 1, 2);
} else {
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 0, 2);
}
if (isActive()) {
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 1, 2);
} else {
parentTile.getWorldObj().setBlockMetadataWithNotify(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord, 0, 2);
}
parentTile.getWorldObj().markBlockForUpdate(parentTile.xCoord, parentTile.yCoord, parentTile.zCoord);
}

View file

@ -2,9 +2,9 @@ package techreborn.api.recipe;
import net.minecraft.item.ItemStack;
import org.apache.commons.lang3.time.StopWatch;
import reborncore.common.util.ItemUtils;
import techreborn.Core;
import techreborn.api.recipe.recipeConfig.RecipeConfigManager;
import techreborn.util.ItemUtils;
import techreborn.util.LogHelper;
import java.util.ArrayList;
import java.util.HashMap;
@ -89,14 +89,14 @@ public class RecipeHandler {
for (ItemStack inputs : baseRecipeType.getInputs()) {
itemInfo.append(":" + inputs.getItem().getUnlocalizedName() + "," + inputs.getDisplayName() + "," + inputs.stackSize);
}
LogHelper.all(stackMap.get(baseRecipeType));
Core.logHelper.all(stackMap.get(baseRecipeType));
// throw new Exception("Found a duplicate recipe for " + baseRecipeType.getRecipeName() + " with inputs " + itemInfo.toString());
}
}
}
}
}
LogHelper.all(watch + " : Scanning dupe recipes");
Core.logHelper.all(watch + " : Scanning dupe recipes");
watch.stop();
}

View file

@ -1,8 +1,8 @@
package techreborn.api.upgrade;
import net.minecraft.item.ItemStack;
import reborncore.common.util.Inventory;
import techreborn.api.recipe.RecipeCrafter;
import techreborn.util.Inventory;
import java.util.ArrayList;

View file

@ -1,129 +0,0 @@
package techreborn.asm;
import cpw.mods.fml.common.Loader;
import net.minecraft.launchwrapper.IClassTransformer;
import org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassWriter;
import org.objectweb.asm.Type;
import org.objectweb.asm.tree.AnnotationNode;
import org.objectweb.asm.tree.ClassNode;
import org.objectweb.asm.tree.FieldNode;
import org.objectweb.asm.tree.MethodNode;
import java.util.Iterator;
import java.util.List;
public class ClassTransformation implements IClassTransformer {
private static final String[] emptyList = {};
static String strippableDesc;
public ClassTransformation() {
strippableDesc = Type.getDescriptor(Strippable.class);
}
static boolean strip(ClassNode cn) {
boolean altered = false;
if (cn.methods != null) {
Iterator<MethodNode> iter = cn.methods.iterator();
while (iter.hasNext()) {
MethodNode mn = iter.next();
if (mn.visibleAnnotations != null) {
for (AnnotationNode node : mn.visibleAnnotations) {
if (checkRemove(parseAnnotation(node, strippableDesc), iter)) {
altered = true;
break;
}
}
}
}
}
if (cn.fields != null) {
Iterator<FieldNode> iter = cn.fields.iterator();
while (iter.hasNext()) {
FieldNode fn = iter.next();
if (fn.visibleAnnotations != null) {
for (AnnotationNode node : fn.visibleAnnotations) {
if (checkRemove(parseAnnotation(node, strippableDesc), iter)) {
altered = true;
break;
}
}
}
}
}
return altered;
}
static AnnotationInfo parseAnnotation(AnnotationNode node, String desc) {
AnnotationInfo info = null;
if (node.desc.equals(desc)) {
info = new AnnotationInfo();
if (node.values != null) {
List<Object> values = node.values;
for (int i = 0, e = values.size(); i < e; ) {
Object k = values.get(i++);
Object v = values.get(i++);
if ("value".equals(k)) {
if (!(v instanceof List && ((List<?>) v).size() > 0 && ((List<?>) v).get(0) instanceof String)) {
continue;
}
info.values = ((List<?>) v).toArray(emptyList);
}
}
}
}
return info;
}
static boolean checkRemove(AnnotationInfo node, Iterator<? extends Object> iter) {
if (node != null) {
boolean needsRemoved = false;
String[] value = node.values;
for (int j = 0, l = value.length; j < l; ++j) {
String clazz = value[j];
String mod = clazz.substring(4);
if (clazz.startsWith("mod:")) {
int i = mod.indexOf('@');
if (i > 0) {
mod = mod.substring(0, i);
}
if (!Loader.isModLoaded(mod)) {
needsRemoved = true;
}
}
if (needsRemoved) {
break;
}
}
if (needsRemoved) {
iter.remove();
return true;
}
}
return false;
}
@Override
public byte[] transform(String name, String transformedName, byte[] bytes) {
if (bytes == null) {
return null;
}
ClassReader cr = new ClassReader(bytes);
ClassNode cn = new ClassNode();
cr.accept(cn, 0);
if (strip(cn)) {
ClassWriter cw = new ClassWriter(0);
cn.accept(cw);
bytes = cw.toByteArray();
LoadingPlugin.stripedClases++;
}
return bytes;
}
static class AnnotationInfo {
public String side = "NONE";
public String[] values = emptyList;
}
}

View file

@ -1,63 +0,0 @@
package techreborn.asm;
import cpw.mods.fml.common.DummyModContainer;
import cpw.mods.fml.common.ModMetadata;
import cpw.mods.fml.relauncher.IFMLCallHook;
import cpw.mods.fml.relauncher.IFMLLoadingPlugin;
import techreborn.lib.ModInfo;
import java.util.Map;
@IFMLLoadingPlugin.MCVersion("1.7.10")
public class LoadingPlugin implements IFMLLoadingPlugin {
public static boolean runtimeDeobfEnabled = false;
public static int stripedClases = 0;
@Override
public String[] getASMTransformerClass() {
return new String[]{"techreborn.asm.ClassTransformation"};
}
@Override
public String getModContainerClass() {
return DummyMod.class.getName();
}
@Override
public String getSetupClass() {
return DummyMod.class.getName();
}
@Override
public void injectData(Map<String, Object> data) {
runtimeDeobfEnabled = (Boolean) data.get("runtimeDeobfuscationEnabled");
}
@Override
public String getAccessTransformerClass() {
return null;
}
public static class DummyMod extends DummyModContainer implements IFMLCallHook {
public DummyMod() {
super(new ModMetadata());
ModMetadata md = getMetadata();
md.autogenerated = true;
md.modId = ModInfo.MOD_ID + "asm";
md.name = md.description = "Techreborn-ASM";
md.parent = ModInfo.MOD_ID;
md.version = "000";
}
@Override
public void injectData(Map<String, Object> data) {
}
@Override
public Void call() throws Exception {
return null;
}
}
}

View file

@ -1,18 +0,0 @@
package techreborn.asm;
import java.lang.annotation.*;
/**
* When used on a class, methods from referenced interfaces will not be removed <br>
* When using this annotation on methods, ensure you do not switch on an enum inside that method. JavaC implementation details means this will cause crashes.
* <p/>
* Can also strip on modid using "mod:<MODID>" as a value <br>
*/
@Documented
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD, ElementType.CONSTRUCTOR, ElementType.FIELD, ElementType.TYPE})
public @interface Strippable {
public String[] value();
}

View file

@ -6,7 +6,6 @@ import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
public class BlockComputerCube extends BlockMachineBase {

View file

@ -2,7 +2,10 @@ package techreborn.blocks;
import cpw.mods.fml.common.Loader;
import ic2.api.item.IC2Items;
import net.minecraft.block.*;
import net.minecraft.block.Block;
import net.minecraft.block.BlockContainer;
import net.minecraft.block.BlockDynamicLiquid;
import net.minecraft.block.BlockStaticLiquid;
import net.minecraft.block.material.Material;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.EnumCreatureType;
@ -20,7 +23,6 @@ import net.minecraftforge.common.util.ForgeDirection;
import net.minecraftforge.fluids.BlockFluidBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.init.ModBlocks;
import techreborn.lib.Functions;
import techreborn.tiles.TileMachineBase;
import java.util.ArrayList;
@ -149,48 +151,48 @@ public class BlockMachineBase extends BlockContainer {
}
}
public void setTileRotation(World world, int x, int y, int z, int meta){
if(world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileMachineBase){
public void setTileRotation(World world, int x, int y, int z, int meta) {
if (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileMachineBase) {
((TileMachineBase) world.getTileEntity(x, y, z)).setRotation(meta);
}
}
public int getTileRotation(World world, int x, int y, int z){
if(world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileMachineBase){
public int getTileRotation(World world, int x, int y, int z) {
if (world.getTileEntity(x, y, z) != null && world.getTileEntity(x, y, z) instanceof TileMachineBase) {
return ((TileMachineBase) world.getTileEntity(x, y, z)).getRotation();
}
return 0;
}
public int getTileRotation(IBlockAccess blockAccess, int x, int y, int z){
public int getTileRotation(IBlockAccess blockAccess, int x, int y, int z) {
return blockAccess.getTileEntity(x, y, z) != null ? getTileRotation(blockAccess.getTileEntity(x, y, z).getWorldObj(), x, y, z) : 0;
}
@Override
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
ArrayList<ItemStack> items = new ArrayList<ItemStack>();
if(Loader.isModLoaded("IC2")){
if (Loader.isModLoaded("IC2")) {
ItemStack stack = IC2Items.getItem(isAdvanced() ? "advancedMachine" : "machine").copy();
stack.stackSize = 1;
items.add(stack);
} else {
items.add(isAdvanced()? new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 2) : new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 0));
items.add(isAdvanced() ? new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 2) : new ItemStack(Item.getItemFromBlock(ModBlocks.MachineCasing), 1, 0));
}
System.out.println(items.toString());
return items;
}
public boolean isAdvanced(){
public boolean isAdvanced() {
return false;
}
@Override
public boolean rotateBlock(World worldObj, int x, int y, int z, ForgeDirection axis) {
if(axis == ForgeDirection.UNKNOWN){
if (axis == ForgeDirection.UNKNOWN) {
return false;
} else {
TileEntity tile = worldObj.getTileEntity(x, y, z);
if(tile != null && tile instanceof TileMachineBase){
if (tile != null && tile instanceof TileMachineBase) {
TileMachineBase machineBase = (TileMachineBase) tile;
machineBase.setRotation(ForgeDirection.getOrientation(machineBase.getRotation()).getRotation(axis).ordinal());
return true;

View file

@ -2,7 +2,6 @@ package techreborn.blocks;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import erogenousbeef.coreTR.multiblock.BlockMultiblockBase;
import net.minecraft.block.Block;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
@ -13,8 +12,9 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import reborncore.client.texture.ConnectedTexture;
import reborncore.common.multiblock.BlockMultiblockBase;
import techreborn.client.TechRebornCreativeTab;
import techreborn.client.texture.ConnectedTexture;
import techreborn.client.texture.CasingConnectedTextureGenerator;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.TileMachineCasing;
@ -69,7 +69,7 @@ public class BlockMachineCasing extends BlockMultiblockBase {
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.icons = new IIcon[types.length][16];
if(!ConfigTechReborn.useConnectedTextures){
if (!ConfigTechReborn.useConnectedTextures) {
for (int i = 0; i < types.length; i++) {
for (int j = 0; j < 15; j++) {
icons[i][j] = iconRegister.registerIcon("techreborn:" + "machine/casing"
@ -79,7 +79,7 @@ public class BlockMachineCasing extends BlockMultiblockBase {
return;
}
for (int i = 0; i < types.length; i++) {
// up down left right
// up down left right
icons[i][0] = CasingConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, true, true), iconRegister, 0, i, types);
icons[i][1] = CasingConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, true, true), iconRegister, 1, i, types);
icons[i][2] = CasingConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, true, true), iconRegister, 2, i, types);
@ -120,501 +120,301 @@ public class BlockMachineCasing extends BlockMultiblockBase {
/**
* This is taken from https://github.com/SlimeKnights/TinkersConstruct/blob/a7405a3d10318bb5c486ec75fb62897a8149d1a6/src/main/java/tconstruct/smeltery/blocks/GlassBlockConnected.java
*/
public IIcon getConnectedBlockTexture (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, IIcon[] icons)
{
public IIcon getConnectedBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, IIcon[] icons) {
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
switch (par5)
{
switch (par5) {
case 0:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[11];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[12];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[13];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[14];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[5];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[6];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[8];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[9];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[3];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[4];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[2];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[1];
}
break;
case 1:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[11];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[12];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[13];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[14];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[5];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[6];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[8];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[9];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[3];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[4];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[2];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[1];
}
break;
case 2:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[13];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[14];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[9];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[8];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[4];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[3];
}
break;
case 3:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[14];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[13];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[10];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[9];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[8];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[7];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[3];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[4];
}
break;
case 4:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[14];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[13];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[10];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[9];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[8];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[7];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[3];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[4];
}
break;
case 5:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[13];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[14];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[9];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[8];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[4];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[3];
}
break;
@ -624,8 +424,7 @@ public class BlockMachineCasing extends BlockMultiblockBase {
}
@Override
public boolean shouldSideBeRendered (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5)
{
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
Block b = par1IBlockAccess.getBlock(par2, par3, par4);
return b == (Block) this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
}

View file

@ -15,12 +15,13 @@ import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
import reborncore.common.util.OreDrop;
import reborncore.common.util.OreDropSet;
import techreborn.client.TechRebornCreativeTabMisc;
import techreborn.config.ConfigTechReborn;
import techreborn.init.ModBlocks;
import techreborn.items.ItemDusts;
import techreborn.items.ItemGems;
import techreborn.util.OreDrop;
import techreborn.util.OreDropSet;
import java.util.ArrayList;
import java.util.List;
@ -60,7 +61,7 @@ public class BlockOre extends Block {
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
//Ruby
if (metadata == 2) {
OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"));
OreDrop ruby = new OreDrop(ItemGems.getGemByName("ruby"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
OreDrop redGarnet = new OreDrop(ItemGems.getGemByName("redGarnet"), 0.02);
OreDropSet set = new OreDropSet(ruby, redGarnet);
return set.drop(fortune, world.rand);
@ -68,7 +69,7 @@ public class BlockOre extends Block {
//Sapphire
if (metadata == 3) {
OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"));
OreDrop sapphire = new OreDrop(ItemGems.getGemByName("sapphire"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
OreDrop peridot = new OreDrop(ItemGems.getGemByName("peridot"), 0.03);
OreDropSet set = new OreDropSet(sapphire, peridot);
return set.drop(fortune, world.rand);
@ -76,14 +77,14 @@ public class BlockOre extends Block {
//Pyrite
if (metadata == 5) {
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"));
OreDrop pyriteDust = new OreDrop(ItemDusts.getDustByName("pyrite"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
OreDropSet set = new OreDropSet(pyriteDust);
return set.drop(fortune, world.rand);
}
//Sodolite
if (metadata == 11) {
OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6));
OreDrop sodalite = new OreDrop(ItemDusts.getDustByName("sodalite", 6), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
OreDrop aluminum = new OreDrop(ItemDusts.getDustByName("aluminum"), 0.50);
OreDropSet set = new OreDropSet(sodalite, aluminum);
return set.drop(fortune, world.rand);
@ -91,7 +92,7 @@ public class BlockOre extends Block {
//Cinnabar
if (metadata == 6) {
OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"));
OreDrop cinnabar = new OreDrop(ItemDusts.getDustByName("cinnabar"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
OreDrop redstone = new OreDrop(new ItemStack(Items.redstone), 0.25);
OreDropSet set = new OreDropSet(cinnabar, redstone);
return set.drop(fortune, world.rand);
@ -99,7 +100,7 @@ public class BlockOre extends Block {
//Sphalerite 1, 1/8 yellow garnet
if (metadata == 7) {
OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"));
OreDrop sphalerite = new OreDrop(ItemDusts.getDustByName("sphalerite"), ConfigTechReborn.FortuneSecondaryOreMultiplierPerLevel);
OreDrop yellowGarnet = new OreDrop(ItemGems.getGemByName("yellowGarnet"), 0.125);
OreDropSet set = new OreDropSet(sphalerite, yellowGarnet);
return set.drop(fortune, world.rand);

View file

@ -2,11 +2,9 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -15,8 +13,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileDieselGenerator;
import java.util.Random;
public class BlockDieselGenerator extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,18 +2,14 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import techreborn.blocks.BlockMachineBase;
import techreborn.tiles.TileDragonEggSiphoner;
import java.util.Random;
public class BlockDragonEggSiphoner extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,11 +2,9 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -15,8 +13,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileGasTurbine;
import java.util.Random;
public class BlockGasTurbine extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,18 +2,14 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
import techreborn.blocks.BlockMachineBase;
import techreborn.tiles.TileHeatGenerator;
import java.util.Random;
public class BlockHeatGenerator extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,15 +2,11 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
public class BlockLightningRod extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,15 +2,11 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
public class BlockMagicEnergyAbsorber extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,15 +2,11 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
public class BlockMagicEnergyConverter extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,15 +2,11 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
public class BlockPlasmaGenerator extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,11 +2,9 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -15,8 +13,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileSemifluidGenerator;
import java.util.Random;
public class BlockSemiFluidGenerator extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,11 +2,9 @@ package techreborn.blocks.generator;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.World;
@ -15,8 +13,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileThermalGenerator;
import java.util.Random;
public class BlockThermalGenerator extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -72,9 +72,9 @@ public class BlockAlloyFurnace extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileAlloySmelter;
import java.util.Random;
public class BlockAlloySmelter extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -76,9 +72,9 @@ public class BlockAlloySmelter extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileAssemblingMachine;
import java.util.Random;
public class BlockAssemblingMachine extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -76,9 +72,9 @@ public class BlockAssemblingMachine extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileBlastFurnace;
import java.util.Random;
public class BlockBlastFurnace extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -81,9 +77,9 @@ public class BlockBlastFurnace extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileCentrifuge;
import java.util.Random;
public class BlockCentrifuge extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -69,31 +65,31 @@ public class BlockCentrifuge extends BlockMachineBase {
public IIcon getIcon(IBlockAccess blockAccess, int x, int y, int z, int side) {
int metadata = getTileRotation(blockAccess, x, y, z);
if (blockAccess.getBlockMetadata(x, y, z) == 1) {
if(side == 1){
return this.iconTopOn;
} else if(side == 0){
return this.iconBottom;
}
return this.iconFrontOn;
if (side == 1) {
return this.iconTopOn;
} else if (side == 0) {
return this.iconBottom;
}
return this.iconFrontOn;
} else {
if(side == 1){
return this.iconTop;
} else if(side == 0){
return this.iconBottom;
}
return this.iconFront;
}
if (side == 1) {
return this.iconTop;
} else if (side == 0) {
return this.iconBottom;
}
return this.iconFront;
}
}
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.iconFront;
return this.iconFront;
}
}

View file

@ -71,9 +71,9 @@ public class BlockChargeBench extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileChemicalReactor;
import java.util.Random;
public class BlockChemicalReactor extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -76,9 +72,9 @@ public class BlockChemicalReactor extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,16 +2,12 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
public class BlockDistillationTower extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -50,9 +46,9 @@ public class BlockDistillationTower extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileGrinder;
import java.util.Random;
public class BlockGrinder extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -80,9 +76,9 @@ public class BlockGrinder extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileImplosionCompressor;
import java.util.Random;
public class BlockImplosionCompressor extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -81,9 +77,9 @@ public class BlockImplosionCompressor extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileIndustrialElectrolyzer;
import java.util.Random;
public class BlockIndustrialElectrolyzer extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -78,9 +74,9 @@ public class BlockIndustrialElectrolyzer extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileIndustrialSawmill;
import java.util.Random;
public class BlockIndustrialSawmill extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -81,9 +77,9 @@ public class BlockIndustrialSawmill extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileMatterFabricator;
import java.util.Random;
public class BlockMatterFabricator extends BlockMachineBase {
@SideOnly(Side.CLIENT)

View file

@ -2,11 +2,9 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
@ -16,8 +14,6 @@ import techreborn.blocks.BlockMachineBase;
import techreborn.client.GuiHandler;
import techreborn.tiles.TileRollingMachine;
import java.util.Random;
public class BlockRollingMachine extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -69,9 +65,9 @@ public class BlockRollingMachine extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -2,16 +2,12 @@ package techreborn.blocks.machine;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import ic2.api.item.IC2Items;
import net.minecraft.block.material.Material;
import net.minecraft.client.renderer.texture.IIconRegister;
import net.minecraft.item.Item;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import techreborn.blocks.BlockMachineBase;
import java.util.Random;
public class BlockVacuumFreezer extends BlockMachineBase {
@SideOnly(Side.CLIENT)
@ -54,9 +50,9 @@ public class BlockVacuumFreezer extends BlockMachineBase {
@Override
public IIcon getIcon(int side, int meta) {
if(side == 1){
if (side == 1) {
return this.iconTop;
} else if(side == 3){
} else if (side == 3) {
return this.iconFront;
} else {
return this.blockIcon;

View file

@ -11,8 +11,8 @@ import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.IIcon;
import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World;
import reborncore.client.texture.ConnectedTexture;
import techreborn.blocks.BlockMachineBase;
import techreborn.client.texture.ConnectedTexture;
import techreborn.client.texture.LesuConnectedTextureGenerator;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesuStorage;
@ -30,8 +30,8 @@ public class BlockLesuStorage extends BlockMachineBase {
@SideOnly(Side.CLIENT)
public void registerBlockIcons(IIconRegister iconRegister) {
this.icons = new IIcon[1][16];
// up down left right
if(!ConfigTechReborn.useConnectedTextures){
// up down left right
if (!ConfigTechReborn.useConnectedTextures) {
for (int j = 0; j < 15; j++) {
icons[0][j] = iconRegister.registerIcon("techreborn:" + "machine/lesu_block");
}
@ -39,22 +39,22 @@ public class BlockLesuStorage extends BlockMachineBase {
}
int i = 0;
icons[i][0] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, true, true), iconRegister, 0, i);
icons[i][1] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, true, true), iconRegister, 1, i);
icons[i][2] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, true, true), iconRegister, 2, i);
icons[i][3] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, true, false), iconRegister, 3, i);
icons[i][4] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, false, true), iconRegister, 4, i);
icons[i][5] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, false, false), iconRegister, 5, i);
icons[i][6] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, true, true), iconRegister, 6, i);
icons[i][7] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, false, true), iconRegister, 7, i);
icons[i][8] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, true, false), iconRegister, 8, i);
icons[i][9] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, false, true), iconRegister, 9, i);
icons[i][10] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, true, false), iconRegister, 10, i);
icons[i][11] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, false, false), iconRegister, 11, i);
icons[i][12] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, false, false), iconRegister, 12, i);
icons[i][13] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, false, true), iconRegister, 13, i);
icons[i][14] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, true, false), iconRegister, 14, i);
icons[i][15] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, false, false), iconRegister, 15, i);
icons[i][0] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, true, true), iconRegister, 0, i);
icons[i][1] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, true, true), iconRegister, 1, i);
icons[i][2] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, true, true), iconRegister, 2, i);
icons[i][3] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, true, false), iconRegister, 3, i);
icons[i][4] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, false, true), iconRegister, 4, i);
icons[i][5] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, true, false, false), iconRegister, 5, i);
icons[i][6] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, true, true), iconRegister, 6, i);
icons[i][7] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, false, true), iconRegister, 7, i);
icons[i][8] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, true, false), iconRegister, 8, i);
icons[i][9] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, false, true), iconRegister, 9, i);
icons[i][10] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, true, false), iconRegister, 10, i);
icons[i][11] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, true, false, false), iconRegister, 11, i);
icons[i][12] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(true, false, false, false), iconRegister, 12, i);
icons[i][13] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, false, true), iconRegister, 13, i);
icons[i][14] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, true, false), iconRegister, 14, i);
icons[i][15] = LesuConnectedTextureGenerator.genIcon(new ConnectedTexture(false, false, false, false), iconRegister, 15, i);
}
@Override
@ -69,8 +69,6 @@ public class BlockLesuStorage extends BlockMachineBase {
}
@Override
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemstack) {
super.onBlockPlacedBy(world, x, y, z, player, itemstack);
@ -97,501 +95,301 @@ public class BlockLesuStorage extends BlockMachineBase {
/**
* This is taken from https://github.com/SlimeKnights/TinkersConstruct/blob/a7405a3d10318bb5c486ec75fb62897a8149d1a6/src/main/java/tconstruct/smeltery/blocks/GlassBlockConnected.java
*/
public IIcon getConnectedBlockTexture (IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, IIcon[] icons)
{
public IIcon getConnectedBlockTexture(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5, IIcon[] icons) {
boolean isOpenUp = false, isOpenDown = false, isOpenLeft = false, isOpenRight = false;
switch (par5)
{
switch (par5) {
case 0:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[11];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[12];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[13];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[14];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[5];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[6];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[8];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[9];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[3];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[4];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[2];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[1];
}
break;
case 1:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[11];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[12];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[13];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[14];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[5];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[6];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[8];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[9];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[3];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[4];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[2];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[1];
}
break;
case 2:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[13];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[14];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[9];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[8];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[4];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[3];
}
break;
case 3:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 - 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 - 1, par3, par4))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2 + 1, par3, par4), par1IBlockAccess.getBlockMetadata(par2 + 1, par3, par4))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[14];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[13];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[10];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[9];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[8];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[7];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[3];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[4];
}
break;
case 4:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[14];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[13];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[10];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[9];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[8];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[7];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[3];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[4];
}
break;
case 5:
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 - 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 - 1, par4))) {
isOpenDown = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3 + 1, par4), par1IBlockAccess.getBlockMetadata(par2, par3 + 1, par4))) {
isOpenUp = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 - 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 - 1))) {
isOpenLeft = true;
}
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1)))
{
if (shouldConnectToBlock(par1IBlockAccess, par2, par3, par4, par1IBlockAccess.getBlock(par2, par3, par4 + 1), par1IBlockAccess.getBlockMetadata(par2, par3, par4 + 1))) {
isOpenRight = true;
}
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight)
{
if (isOpenUp && isOpenDown && isOpenLeft && isOpenRight) {
return icons[15];
}
else if (isOpenUp && isOpenDown && isOpenLeft)
{
} else if (isOpenUp && isOpenDown && isOpenLeft) {
return icons[13];
}
else if (isOpenUp && isOpenDown && isOpenRight)
{
} else if (isOpenUp && isOpenDown && isOpenRight) {
return icons[14];
}
else if (isOpenUp && isOpenLeft && isOpenRight)
{
} else if (isOpenUp && isOpenLeft && isOpenRight) {
return icons[11];
}
else if (isOpenDown && isOpenLeft && isOpenRight)
{
} else if (isOpenDown && isOpenLeft && isOpenRight) {
return icons[12];
}
else if (isOpenDown && isOpenUp)
{
} else if (isOpenDown && isOpenUp) {
return icons[6];
}
else if (isOpenLeft && isOpenRight)
{
} else if (isOpenLeft && isOpenRight) {
return icons[5];
}
else if (isOpenDown && isOpenLeft)
{
} else if (isOpenDown && isOpenLeft) {
return icons[9];
}
else if (isOpenDown && isOpenRight)
{
} else if (isOpenDown && isOpenRight) {
return icons[10];
}
else if (isOpenUp && isOpenLeft)
{
} else if (isOpenUp && isOpenLeft) {
return icons[7];
}
else if (isOpenUp && isOpenRight)
{
} else if (isOpenUp && isOpenRight) {
return icons[8];
}
else if (isOpenDown)
{
} else if (isOpenDown) {
return icons[1];
}
else if (isOpenUp)
{
} else if (isOpenUp) {
return icons[2];
}
else if (isOpenLeft)
{
} else if (isOpenLeft) {
return icons[4];
}
else if (isOpenRight)
{
} else if (isOpenRight) {
return icons[3];
}
break;

View file

@ -6,7 +6,6 @@ import net.minecraft.world.World;
import techreborn.client.container.*;
import techreborn.client.gui.*;
import techreborn.pda.GuiManual;
import techreborn.pda.pages.BasePage;
import techreborn.tiles.*;
import techreborn.tiles.idsu.TileIDSU;
import techreborn.tiles.lesu.TileLesu;
@ -89,7 +88,7 @@ public class GuiHandler implements IGuiHandler {
} else if (ID == assemblingmachineID) {
return new ContainerAssemblingMachine(
(TileAssemblingMachine) world.getTileEntity(x, y, z), player);
}else if (ID == dieselGeneratorID) {
} else if (ID == dieselGeneratorID) {
return new ContainerDieselGenerator(
(TileDieselGenerator) world.getTileEntity(x, y, z), player);
} else if (ID == industrialElectrolyzerID) {
@ -171,7 +170,7 @@ public class GuiHandler implements IGuiHandler {
} else if (ID == assemblingmachineID) {
return new GuiAssemblingMachine(player,
(TileAssemblingMachine) world.getTileEntity(x, y, z));
}else if (ID == dieselGeneratorID) {
} else if (ID == dieselGeneratorID) {
return new GuiDieselGenerator(player,
(TileDieselGenerator) world.getTileEntity(x, y, z));
} else if (ID == industrialElectrolyzerID) {

View file

@ -1,60 +0,0 @@
package techreborn.client;
import net.minecraft.client.gui.Gui;
import net.minecraft.client.renderer.Tessellator;
import net.minecraft.util.IIcon;
public class GuiUtil {
public static void drawRepeated(IIcon icon, double x, double y, double width, double height, double z) {
double iconWidthStep = (icon.getMaxU() - icon.getMinU()) / 16.0D;
double iconHeightStep = (icon.getMaxV() - icon.getMinV()) / 16.0D;
Tessellator tessellator = Tessellator.instance;
tessellator.startDrawingQuads();
for (double cy = y; cy < y + height; cy += 16.0D) {
double quadHeight = Math.min(16.0D, height + y - cy);
double maxY = cy + quadHeight;
double maxV = icon.getMinV() + iconHeightStep * quadHeight;
for (double cx = x; cx < x + width; cx += 16.0D) {
double quadWidth = Math.min(16.0D, width + x - cx);
double maxX = cx + quadWidth;
double maxU = icon.getMinU() + iconWidthStep * quadWidth;
tessellator.addVertexWithUV(cx, maxY, z, icon.getMinU(), maxV);
tessellator.addVertexWithUV(maxX, maxY, z, maxU, maxV);
tessellator.addVertexWithUV(maxX, cy, z, maxU, icon.getMinV());
tessellator.addVertexWithUV(cx, cy, z, icon.getMinU(), icon.getMinV());
}
}
tessellator.draw();
}
public static void drawTooltipBox(int x, int y, int w, int h) {
int bg = 0xf0100010;
drawGradientRect(x + 1, y, w - 1, 1, bg, bg);
drawGradientRect(x + 1, y + h, w - 1, 1, bg, bg);
drawGradientRect(x + 1, y + 1, w - 1, h - 1, bg, bg);//center
drawGradientRect(x, y + 1, 1, h - 1, bg, bg);
drawGradientRect(x + w, y + 1, 1, h - 1, bg, bg);
int grad1 = 0x505000ff;
int grad2 = 0x5028007F;
drawGradientRect(x + 1, y + 2, 1, h - 3, grad1, grad2);
drawGradientRect(x + w - 1, y + 2, 1, h - 3, grad1, grad2);
drawGradientRect(x + 1, y + 1, w - 1, 1, grad1, grad1);
drawGradientRect(x + 1, y + h - 1, w - 1, 1, grad2, grad2);
}
public static void drawGradientRect(int x, int y, int w, int h, int colour1, int colour2) {
new GuiHook().drawGradientRect(x, y, x + w, y + h, colour1, colour2);
}
public static class GuiHook extends Gui {
@Override
public void drawGradientRect(int par1, int par2, int par3, int par4, int par5, int par6) {
super.drawGradientRect(par1, par2, par3, par4, par5, par6);
}
}
}

View file

@ -1,36 +0,0 @@
package techreborn.client;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotFake extends Slot {
public boolean mCanInsertItem;
public boolean mCanStackItem;
public int mMaxStacksize = 127;
public SlotFake(IInventory par1iInventory, int par2, int par3, int par4,
boolean aCanInsertItem, boolean aCanStackItem, int aMaxStacksize) {
super(par1iInventory, par2, par3, par4);
this.mCanInsertItem = aCanInsertItem;
this.mCanStackItem = aCanStackItem;
this.mMaxStacksize = aMaxStacksize;
}
public boolean isItemValid(ItemStack par1ItemStack) {
return this.mCanInsertItem;
}
public int getSlotStackLimit() {
return this.mMaxStacksize;
}
public boolean getHasStack() {
return false;
}
public ItemStack decrStackSize(int par1) {
return !this.mCanStackItem ? null : super.decrStackSize(par1);
}
}

View file

@ -1,37 +0,0 @@
package techreborn.client;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class SlotFilteredVoid extends Slot {
private List<ItemStack> filter = new ArrayList<ItemStack>();
public SlotFilteredVoid(IInventory par1iInventory, int id, int x, int y) {
super(par1iInventory, id, x, y);
}
public SlotFilteredVoid(IInventory par1iInventory, int id, int x, int y, ItemStack[] filterList) {
super(par1iInventory, id, x, y);
for (ItemStack itemStack : filterList)
this.filter.add(itemStack);
}
@Override
public boolean isItemValid(ItemStack stack) {
for (ItemStack itemStack : filter)
if (itemStack.getItem().equals(stack.getItem()) && itemStack.getItemDamage() == stack.getItemDamage())
return false;
return super.isItemValid(stack);
}
@Override
public void putStack(ItemStack arg0) {
}
}

View file

@ -1,21 +0,0 @@
package techreborn.client;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import net.minecraftforge.fluids.FluidContainerRegistry;
import net.minecraftforge.fluids.IFluidContainerItem;
public class SlotFluid extends Slot {
public SlotFluid(IInventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) {
super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_);
}
@Override
public boolean isItemValid(ItemStack stack) {
return FluidContainerRegistry.isContainer(stack) || (stack != null && stack.getItem() instanceof IFluidContainerItem);
}
}

View file

@ -1,20 +0,0 @@
package techreborn.client;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotInput extends Slot {
public SlotInput(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4);
}
public boolean isItemValid(ItemStack par1ItemStack) {
return false;
}
public int getSlotStackLimit() {
return 64;
}
}

View file

@ -1,20 +0,0 @@
package techreborn.client;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class SlotOutput extends Slot {
public SlotOutput(IInventory par1iInventory, int par2, int par3, int par4) {
super(par1iInventory, par2, par3, par4);
}
public boolean isItemValid(ItemStack par1ItemStack) {
return false;
}
public int getSlotStackLimit() {
return 64;
}
}

View file

@ -8,9 +8,9 @@ import net.minecraft.client.Minecraft;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.event.entity.player.ItemTooltipEvent;
import org.lwjgl.input.Keyboard;
import techreborn.api.IListInfoProvider;
import reborncore.api.IListInfoProvider;
import reborncore.common.util.Color;
import techreborn.api.power.IEnergyInterfaceItem;
import techreborn.util.Color;
public class StackToolTipEvent {

View file

@ -4,6 +4,7 @@ import cpw.mods.fml.client.GuiModList;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.event.GuiScreenEvent;
import reborncore.client.gui.GuiUtil;
import techreborn.Core;
import java.awt.*;

View file

@ -5,9 +5,10 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAesu;
public class ContainerAesu extends TechRebornContainer {
public class ContainerAesu extends RebornContainer {
EntityPlayer player;
@ -29,7 +30,7 @@ public class ContainerAesu extends TechRebornContainer {
// input
//this.addSlotToContainer(new Slot(tileaesu.inventory, 0, 116, 23));
// this.addSlotToContainer(new Slot(tileaesu.inventory, 1, 116, 59));
// this.addSlotToContainer(new Slot(tileaesu.inventory, 1, 116, 59));
int i;

View file

@ -3,10 +3,11 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAlloyFurnace;
public class ContainerAlloyFurnace extends TechRebornContainer {
public class ContainerAlloyFurnace extends RebornContainer {
EntityPlayer player;
@ -69,7 +70,7 @@ public class ContainerAlloyFurnace extends TechRebornContainer {
if (this.burnTime != tile.burnTime) {
crafting.sendProgressBarUpdate(this, 1, tile.burnTime);
}
if (this.cookTime != tile.cookTime) {
if (this.cookTime != tile.cookTime) {
crafting.sendProgressBarUpdate(this, 2, tile.cookTime);
}
}
@ -79,11 +80,11 @@ public class ContainerAlloyFurnace extends TechRebornContainer {
@Override
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if(id == 0){
if (id == 0) {
this.currentItemBurnTime = value;
} else if(id ==1){
} else if (id == 1) {
this.burnTime = value;
} else if(id == 2){
} else if (id == 2) {
this.cookTime = value;
}
this.tile.currentItemBurnTime = this.currentItemBurnTime;

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileAlloySmelter;
public class ContainerAlloySmelter extends ContainerCrafting {

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileAssemblingMachine;
public class ContainerAssemblingMachine extends ContainerCrafting {

View file

@ -3,7 +3,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileBlastFurnace;
public class ContainerBlastFurnace extends ContainerCrafting {

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileCentrifuge;
public class ContainerCentrifuge extends ContainerCrafting {
@ -19,8 +19,8 @@ public class ContainerCentrifuge extends ContainerCrafting {
}
public ContainerCentrifuge(TileCentrifuge tileCentrifuge, EntityPlayer player) {
super(tileCentrifuge.crafter);
tile = tileCentrifuge;
super(tileCentrifuge.crafter);
tile = tileCentrifuge;
this.player = player;
// input

View file

@ -2,9 +2,10 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileChargeBench;
public class ContainerChargeBench extends TechRebornContainer {
public class ContainerChargeBench extends RebornContainer {
EntityPlayer player;

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileChemicalReactor;
public class ContainerChemicalReactor extends ContainerCrafting {

View file

@ -2,9 +2,10 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileChunkLoader;
public class ContainerChunkloader extends TechRebornContainer {
public class ContainerChunkloader extends RebornContainer {
EntityPlayer player;

View file

@ -3,9 +3,10 @@ package techreborn.client.container;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.inventory.ICrafting;
import reborncore.common.container.RebornContainer;
import techreborn.api.recipe.RecipeCrafter;
public abstract class ContainerCrafting extends TechRebornContainer {
public abstract class ContainerCrafting extends RebornContainer {
RecipeCrafter crafter;

View file

@ -3,11 +3,12 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import techreborn.client.SlotFilteredVoid;
import reborncore.client.gui.SlotFilteredVoid;
import reborncore.common.container.RebornContainer;
import reborncore.common.util.Inventory;
import techreborn.init.ModItems;
import techreborn.util.Inventory;
public class ContainerDestructoPack extends TechRebornContainer {
public class ContainerDestructoPack extends RebornContainer {
private EntityPlayer player;
private Inventory inv;

View file

@ -5,11 +5,12 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileDieselGenerator;
public class ContainerDieselGenerator extends TechRebornContainer {
public class ContainerDieselGenerator extends RebornContainer {
public TileDieselGenerator tiledieselGenerator;
public EntityPlayer player;
public int energy;
@ -74,8 +75,7 @@ public class ContainerDieselGenerator extends TechRebornContainer {
public void updateProgressBar(int id, int value) {
if (id == 0) {
this.energy = value;
}else
if (id == 1) {
} else if (id == 1) {
this.fluid = value;
}
}

View file

@ -2,11 +2,12 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileDigitalChest;
public class ContainerDigitalChest extends TechRebornContainer {
public class ContainerDigitalChest extends RebornContainer {
public TileDigitalChest tileDigitalChest;
public EntityPlayer player;

View file

@ -2,11 +2,12 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileGasTurbine;
public class ContainerGasTurbine extends TechRebornContainer {
public class ContainerGasTurbine extends RebornContainer {
public TileGasTurbine tileGasTurbine;
public EntityPlayer player;

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileGrinder;
public class ContainerGrinder extends ContainerCrafting {

View file

@ -5,10 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.idsu.TileIDSU;
public class ContainerIDSU extends TechRebornContainer {
public class ContainerIDSU extends RebornContainer {
EntityPlayer player;

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileImplosionCompressor;
public class ContainerImplosionCompressor extends ContainerCrafting {

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileIndustrialElectrolyzer;
public class ContainerIndustrialElectrolyzer extends ContainerCrafting {

View file

@ -2,7 +2,7 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import techreborn.tiles.TileIndustrialSawmill;
public class ContainerIndustrialSawmill extends ContainerCrafting {

View file

@ -5,10 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import reborncore.common.container.RebornContainer;
import techreborn.config.ConfigTechReborn;
import techreborn.tiles.lesu.TileLesu;
public class ContainerLesu extends TechRebornContainer {
public class ContainerLesu extends RebornContainer {
EntityPlayer player;

View file

@ -5,10 +5,11 @@ import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileMatterFabricator;
public class ContainerMatterFabricator extends TechRebornContainer {
public class ContainerMatterFabricator extends RebornContainer {
EntityPlayer player;

View file

@ -1,8 +1,9 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import reborncore.common.container.RebornContainer;
public class ContainerPda extends TechRebornContainer {
public class ContainerPda extends RebornContainer {
EntityPlayer player;

View file

@ -2,11 +2,12 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileQuantumChest;
public class ContainerQuantumChest extends TechRebornContainer {
public class ContainerQuantumChest extends RebornContainer {
public TileQuantumChest tileQuantumChest;
public EntityPlayer player;

View file

@ -2,12 +2,13 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotFluid;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotFluid;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileQuantumTank;
public class ContainerQuantumTank extends TechRebornContainer {
public class ContainerQuantumTank extends RebornContainer {
public TileQuantumTank tileQuantumTank;
public EntityPlayer player;

View file

@ -5,12 +5,13 @@ import net.minecraft.inventory.ICrafting;
import net.minecraft.inventory.IInventory;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.api.RollingMachineRecipe;
import techreborn.client.SlotFake;
import techreborn.client.SlotOutput;
import techreborn.tiles.TileRollingMachine;
public class ContainerRollingMachine extends TechRebornContainer {
public class ContainerRollingMachine extends RebornContainer {
EntityPlayer player;
TileRollingMachine tile;
@ -85,7 +86,7 @@ public class ContainerRollingMachine extends TechRebornContainer {
if (this.burnTime != tile.tickTime) {
crafting.sendProgressBarUpdate(this, 1, tile.tickTime);
}
if (this.energy != (int) tile.getEnergy()) {
if (this.energy != (int) tile.getEnergy()) {
crafting.sendProgressBarUpdate(this, 2, (int) tile.getEnergy());
}
}
@ -95,11 +96,11 @@ public class ContainerRollingMachine extends TechRebornContainer {
@Override
public void updateProgressBar(int id, int value) {
super.updateProgressBar(id, value);
if(id == 0){
if (id == 0) {
this.currentItemBurnTime = value;
} else if(id ==1){
} else if (id == 1) {
this.burnTime = value;
} else if(id == 2){
} else if (id == 2) {
this.energy = value;
}
this.tile.runTime = this.currentItemBurnTime;
@ -107,9 +108,8 @@ public class ContainerRollingMachine extends TechRebornContainer {
this.tile.setEnergy(this.energy);
}
public int getBurnTimeRemainingScaled(int scale)
{
if(burnTime == 0 || this.currentItemBurnTime == 0){
public int getBurnTimeRemainingScaled(int scale) {
if (burnTime == 0 || this.currentItemBurnTime == 0) {
return 0;
}
return this.burnTime * scale / this.currentItemBurnTime;

View file

@ -2,11 +2,12 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileSemifluidGenerator;
public class ContainerSemifluidGenerator extends TechRebornContainer {
public class ContainerSemifluidGenerator extends RebornContainer {
public TileSemifluidGenerator tileSemifluidGenerator;
public EntityPlayer player;

View file

@ -2,12 +2,13 @@ package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Slot;
import techreborn.client.SlotFake;
import techreborn.client.SlotFluid;
import techreborn.client.SlotOutput;
import reborncore.client.gui.SlotFake;
import reborncore.client.gui.SlotFluid;
import reborncore.client.gui.SlotOutput;
import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileThermalGenerator;
public class ContainerThermalGenerator extends TechRebornContainer {
public class ContainerThermalGenerator extends RebornContainer {
public TileThermalGenerator tileThermalGenerator;
public EntityPlayer player;

View file

@ -1,114 +0,0 @@
package techreborn.client.container;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
import techreborn.client.SlotFake;
public abstract class TechRebornContainer extends Container {
@Override
public ItemStack transferStackInSlot(EntityPlayer player, int slotIndex) {
ItemStack originalStack = null;
Slot slot = (Slot) inventorySlots.get(slotIndex);
int numSlots = inventorySlots.size();
if (slot != null && slot.getHasStack()) {
ItemStack stackInSlot = slot.getStack();
originalStack = stackInSlot.copy();
if (slotIndex >= numSlots - 9 * 4 && tryShiftItem(stackInSlot, numSlots)) {
// NOOP
} else if (slotIndex >= numSlots - 9 * 4 && slotIndex < numSlots - 9) {
if (!shiftItemStack(stackInSlot, numSlots - 9, numSlots)) {
return null;
}
} else if (slotIndex >= numSlots - 9 && slotIndex < numSlots) {
if (!shiftItemStack(stackInSlot, numSlots - 9 * 4, numSlots - 9)) {
return null;
}
} else if (!shiftItemStack(stackInSlot, numSlots - 9 * 4, numSlots)) {
return null;
}
slot.onSlotChange(stackInSlot, originalStack);
if (stackInSlot.stackSize <= 0) {
slot.putStack(null);
} else {
slot.onSlotChanged();
}
if (stackInSlot.stackSize == originalStack.stackSize) {
return null;
}
slot.onPickupFromSlot(player, stackInSlot);
}
return originalStack;
}
protected boolean shiftItemStack(ItemStack stackToShift, int start, int end) {
boolean changed = false;
if (stackToShift.isStackable()) {
for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < end; slotIndex++) {
Slot slot = (Slot) inventorySlots.get(slotIndex);
ItemStack stackInSlot = slot.getStack();
if (stackInSlot != null && canStacksMerge(stackInSlot, stackToShift)) {
int resultingStackSize = stackInSlot.stackSize + stackToShift.stackSize;
int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
if (resultingStackSize <= max) {
stackToShift.stackSize = 0;
stackInSlot.stackSize = resultingStackSize;
slot.onSlotChanged();
changed = true;
} else if (stackInSlot.stackSize < max) {
stackToShift.stackSize -= max - stackInSlot.stackSize;
stackInSlot.stackSize = max;
slot.onSlotChanged();
changed = true;
}
}
}
}
if (stackToShift.stackSize > 0) {
for (int slotIndex = start; stackToShift.stackSize > 0 && slotIndex < end; slotIndex++) {
Slot slot = (Slot) inventorySlots.get(slotIndex);
ItemStack stackInSlot = slot.getStack();
if (stackInSlot == null) {
int max = Math.min(stackToShift.getMaxStackSize(), slot.getSlotStackLimit());
stackInSlot = stackToShift.copy();
stackInSlot.stackSize = Math.min(stackToShift.stackSize, max);
stackToShift.stackSize -= stackInSlot.stackSize;
slot.putStack(stackInSlot);
slot.onSlotChanged();
changed = true;
}
}
}
return changed;
}
private boolean tryShiftItem(ItemStack stackToShift, int numSlots) {
for (int machineIndex = 0; machineIndex < numSlots - 9 * 4; machineIndex++) {
Slot slot = (Slot) inventorySlots.get(machineIndex);
if (slot instanceof SlotFake) {
continue;
}
if (!slot.isItemValid(stackToShift))
continue;
if (shiftItemStack(stackToShift, machineIndex, machineIndex + 1))
return true;
}
return false;
}
public static boolean canStacksMerge(ItemStack stack1, ItemStack stack2) {
if (stack1 == null || stack2 == null) {
return false;
}
if (!stack1.isItemEqual(stack2)) {
return false;
}
if (!ItemStack.areItemStackTagsEqual(stack1, stack2)) {
return false;
}
return true;
}
}

View file

@ -5,9 +5,9 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import reborncore.common.packets.PacketHandler;
import techreborn.client.container.ContainerAesu;
import techreborn.packets.PacketAesu;
import techreborn.packets.PacketHandler;
import techreborn.tiles.TileAesu;
import java.awt.*;

View file

@ -41,8 +41,7 @@ public class GuiAlloyFurnace extends GuiContainer {
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
if (this.alloyfurnace.isBurning())
{
if (this.alloyfurnace.isBurning()) {
int i1 = this.alloyfurnace.getBurnTimeRemainingScaled(13);
this.drawTexturedModalRect(k + 56, l + 36 + 12 - i1, 176, 12 - i1, 14, i1 + 1);
i1 = this.alloyfurnace.getCookProgressScaled(24);
@ -51,7 +50,6 @@ public class GuiAlloyFurnace extends GuiContainer {
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
String name = StatCollector.translateToLocal("tile.techreborn.alloyfurnace.name");

View file

@ -8,10 +8,10 @@ import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import net.minecraftforge.common.util.ForgeDirection;
import techreborn.client.GuiUtil;
import reborncore.client.gui.GuiUtil;
import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockSet;
import techreborn.client.container.ContainerBlastFurnace;
import techreborn.client.multiblock.Multiblock;
import techreborn.client.multiblock.MultiblockSet;
import techreborn.init.ModBlocks;
import techreborn.lib.ModInfo;
import techreborn.proxies.ClientProxy;
@ -38,8 +38,8 @@ public class GuiBlastFurnace extends GuiContainer {
public void initGui() {
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
buttonList.add(button);
GuiButton button = new GuiButton(212, k + 4, l + 6, 20, 20, "");
buttonList.add(button);
super.initGui();
}
@ -78,60 +78,60 @@ public class GuiBlastFurnace extends GuiContainer {
}
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
}
@Override
public void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if(button.id == 212){
if(ClientProxy.multiblockRenderEvent.currentMultiblock == null){
{//This code here makes a basic multiblock and then sets to the selected one.
Multiblock multiblock = new Multiblock();
multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0);
MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(blastfurnace.xCoord - (ForgeDirection.getOrientation(blastfurnace.getRotation()).offsetX * 2), blastfurnace.yCoord - 1, blastfurnace.zCoord - (ForgeDirection.getOrientation(blastfurnace.getRotation()).offsetZ * 2));
}
button.displayString = "A";
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B";
}
}
}
@Override
public void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if (button.id == 212) {
if (ClientProxy.multiblockRenderEvent.currentMultiblock == null) {
{//This code here makes a basic multiblock and then sets to the selected one.
Multiblock multiblock = new Multiblock();
multiblock.addComponent(0, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 0, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 1, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 2, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 0, ModBlocks.MachineCasing, 0);
multiblock.addComponent(0, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(-1, 3, 1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, -1, ModBlocks.MachineCasing, 0);
multiblock.addComponent(1, 3, 1, ModBlocks.MachineCasing, 0);
MultiblockSet set = new MultiblockSet(multiblock);
ClientProxy.multiblockRenderEvent.setMultiblock(set);
ClientProxy.multiblockRenderEvent.anchor = new ChunkCoordinates(blastfurnace.xCoord - (ForgeDirection.getOrientation(blastfurnace.getRotation()).offsetX * 2), blastfurnace.yCoord - 1, blastfurnace.zCoord - (ForgeDirection.getOrientation(blastfurnace.getRotation()).offsetZ * 2));
}
button.displayString = "A";
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);
button.displayString = "B";
}
}
}
}

View file

@ -58,6 +58,6 @@ public class GuiCentrifuge extends GuiContainer {
this.fontRendererObj.drawString(namePt1, 98, 6, 4210752);
this.fontRendererObj.drawString(namePt2, 98, 14, 4210752);
this.fontRendererObj.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString(centrifuge.getProgressScaled(100) + "%", 98, this.ySize - 96 + 2, 4210752);
}
}

View file

@ -8,7 +8,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import techreborn.client.GuiUtil;
import reborncore.client.gui.GuiUtil;
import techreborn.client.container.ContainerGrinder;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileGrinder;

View file

@ -1,30 +1,27 @@
package techreborn.client.gui;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import techreborn.Core;
import reborncore.common.packets.PacketHandler;
import techreborn.client.container.ContainerIDSU;
import techreborn.cofhLib.gui.GuiBase;
import techreborn.cofhLib.gui.element.ElementListBox;
import techreborn.cofhLib.gui.element.ElementTextField;
import techreborn.cofhLib.gui.element.ElementTextFieldLimited;
import techreborn.packets.PacketIdsu;
import techreborn.tiles.idsu.TileIDSU;
import techreborn.util.LogHelper;
public class GuiIDSU extends GuiBase {
import java.awt.*;
public class GuiIDSU extends GuiContainer {
private static final ResourceLocation texture = new ResourceLocation(
"techreborn", "textures/gui/aesu.png");
TileIDSU idsu;
ContainerIDSU containerIDSU;
public static ElementListBox listBox = new ElementListBox(null, 10, 28, 100, 40);
ElementTextFieldLimited idFeild;
ElementTextField nameFeild;
public GuiIDSU(EntityPlayer player, TileIDSU tileIDSU) {
super(new ContainerIDSU(tileIDSU, player));
@ -32,10 +29,6 @@ public class GuiIDSU extends GuiBase {
this.ySize = 165;
idsu = tileIDSU;
this.containerIDSU = (ContainerIDSU) this.inventorySlots;
texture = new ResourceLocation("techreborn", "textures/gui/aesu.png");
drawTitle = false;
drawInventory = false;
name = StatCollector.translateToLocal("tile.techreborn.aesu.name");
}
@Override
@ -49,36 +42,29 @@ public class GuiIDSU extends GuiBase {
this.buttonList.add(new GuiButton(2, k + 128, l + 5 + (20 * 2), 15, 15, "-"));
this.buttonList.add(new GuiButton(3, k + 128, l + 5 + (20 * 3), 15, 15, "--"));
this.buttonList.add(new GuiButton(4, k + 40, l + 10, 10, 10, "+"));
}
listBox.gui = this;
listBox.setSelectedIndex(containerIDSU.channel);
// listBox.borderColor = new GuiColor(120, 120, 120, 0).getColor();
// listBox.backgroundColor = new GuiColor(0, 0, 0, 32).getColor();
addElement(listBox);
idFeild = new ElementTextFieldLimited(this, 10, 10, 30, 10, (short) 4);
idFeild.setFilter("1234567890", false);
addElement(idFeild);
nameFeild = new ElementTextField(this, 70, 10, 50, 10);
addElement(nameFeild);
// tabs.add(new TabIDConfig(this));
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_,
int p_146976_2_, int p_146976_3_) {
this.mc.getTextureManager().bindTexture(texture);
int k = (this.width - this.xSize) / 2;
int l = (this.height - this.ySize) / 2;
this.drawTexturedModalRect(k, l, 0, 0, this.xSize, this.ySize);
}
protected void drawGuiContainerForegroundLayer(int p_146979_1_,
int p_146979_2_) {
this.fontRendererObj.drawString(StatCollector.translateToLocal("tile.techreborn.idsu.name"), 40, 10, Color.WHITE.getRGB());
this.fontRendererObj.drawString(containerIDSU.euOut + " eu/tick", 10, 20, Color.WHITE.getRGB());
this.fontRendererObj.drawString(containerIDSU.storedEu + " eu", 10, 30, Color.WHITE.getRGB());
this.fontRendererObj.drawString(containerIDSU.euChange + " eu change", 10, 40, Color.WHITE.getRGB());
}
@Override
protected void actionPerformed(GuiButton button) {
super.actionPerformed(button);
if (isInteger(idFeild.getText())) {
Core.packetPipeline.sendToServer(new PacketIdsu(button.id, idsu, Integer.parseInt(idFeild.getText()), nameFeild.getText()));
} else {
LogHelper.info("There was an issue in the gui!, Please report this to the TechReborn Devs");
}
PacketHandler.sendPacketToServer(new PacketIdsu(button.id, idsu));
}

View file

@ -7,7 +7,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.IIcon;
import net.minecraft.util.ResourceLocation;
import net.minecraft.util.StatCollector;
import techreborn.client.GuiUtil;
import reborncore.client.gui.GuiUtil;
import techreborn.client.container.ContainerIndustrialSawmill;
import techreborn.lib.ModInfo;
import techreborn.tiles.TileIndustrialSawmill;

View file

@ -39,7 +39,7 @@ public class GuiQuantumChest extends GuiContainer {
I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752);
this.fontRendererObj.drawString("Amount", 10, 20, 16448255);
if (tile.storedItem != null && tile.getStackInSlot(1) !=null)
if (tile.storedItem != null && tile.getStackInSlot(1) != null)
this.fontRendererObj.drawString(tile.storedItem.stackSize + tile.getStackInSlot(1).stackSize + "", 10,
30, 16448255);
}

View file

@ -1,44 +0,0 @@
package techreborn.client.gui.componets;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.FontRenderer;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.renderer.OpenGlHelper;
import org.lwjgl.opengl.GL11;
public class GuiHiddenButton extends GuiButton {
public GuiHiddenButton(int id, int xPosition, int yPosition, String displayString) {
super(id, xPosition, yPosition, displayString);
}
public GuiHiddenButton(int id, int xPosition, int yPosition, int width, int height, String displayString) {
super(id, xPosition, yPosition, width, height, displayString);
}
@Override
public void drawButton(Minecraft p_146112_1_, int p_146112_2_, int p_146112_3_) {
if (this.visible) {
FontRenderer fontrenderer = p_146112_1_.fontRenderer;
p_146112_1_.getTextureManager().bindTexture(buttonTextures);
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
this.field_146123_n = p_146112_2_ >= this.xPosition && p_146112_3_ >= this.yPosition && p_146112_2_ < this.xPosition + this.width && p_146112_3_ < this.yPosition + this.height;
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
this.mouseDragged(p_146112_1_, p_146112_2_, p_146112_3_);
int l = 14737632;
if (packedFGColour != 0) {
l = packedFGColour;
} else if (!this.enabled) {
l = 10526880;
} else if (this.field_146123_n) {
l = 16777120;
}
this.drawCenteredString(fontrenderer, this.displayString, this.xPosition + this.width / 2, this.yPosition + (this.height - 8) / 2, l);
}
}
}

View file

@ -1,13 +0,0 @@
package techreborn.client.gui.componets;
import techreborn.cofhLib.gui.GuiBase;
import techreborn.cofhLib.gui.element.TabBase;
/**
* Created by mark on 18/06/15.
*/
public class TabIDConfig extends TabBase {
public TabIDConfig(GuiBase gui) {
super(gui);
}
}

View file

@ -13,10 +13,10 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import org.lwjgl.opengl.GL11;
import reborncore.common.util.Color;
import techreborn.api.power.IEnergyInterfaceItem;
import techreborn.client.keybindings.KeyBindings;
import techreborn.config.ConfigTechReborn;
import techreborn.util.Color;
public class ChargeHud {
public static final ChargeHud instance = new ChargeHud();

View file

@ -2,8 +2,8 @@ package techreborn.client.keybindings;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
import cpw.mods.fml.common.gameevent.InputEvent;
import techreborn.Core;
import techreborn.lib.Key;
import techreborn.util.LogHelper;
public class KeyInputEventHandler {
private static Key getPressedKeybinding() {
@ -16,7 +16,7 @@ public class KeyInputEventHandler {
@SubscribeEvent
public void handleKeyInputEvent(InputEvent.KeyInputEvent event) {
LogHelper.info(getPressedKeybinding());
Core.logHelper.info(getPressedKeybinding());
}
}

View file

@ -1,28 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package techreborn.client.multiblock;
import java.util.HashMap;
import java.util.Map;
import net.minecraft.block.Block;
import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.world.IBlockAccess;
/**
* A hook for rendering blocks in the multiblock display.
*/
public interface IMultiblockRenderHook {
public static Map<Block, IMultiblockRenderHook> renderHooks = new HashMap();
public void renderBlockForMultiblock(IBlockAccess world, Multiblock mb, Block block, int meta, RenderBlocks renderBlocks);
}

View file

@ -1,152 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package techreborn.client.multiblock;
import java.util.ArrayList;
import java.util.List;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import techreborn.client.multiblock.component.MultiblockComponent;
/**
* This class describes a Mutiblock object. It's used to display a
* multiblock in the pda and to show the player in a ghost-like
* look in the world.
*/
public class Multiblock {
public List<MultiblockComponent> components = new ArrayList();
public List<ItemStack> materials = new ArrayList();
public int minX, minY, minZ, maxX, maxY, maxZ, offX, offY, offZ;
/**
* Adds a multiblock component to this multiblock. The component's x y z
* coords should be pivoted to the center of the structure.
*/
public void addComponent(MultiblockComponent component) {
components.add(component);
changeAxisForNewComponent(component.relPos.posX, component.relPos.posY, component.relPos.posZ);
calculateCostForNewComponent(component);
}
/**
* Constructs and adds a multiblock component to this multiblock. The x y z
* coords should be pivoted to the center of the structure.
*/
public void addComponent(int x, int y, int z, Block block, int meta) {
addComponent(new MultiblockComponent(new ChunkCoordinates(x, y, z), block, meta));
}
private void changeAxisForNewComponent(int x, int y, int z) {
if(x < minX)
minX = x;
else if(x > maxX)
maxX = x;
if(y < minY)
minY = y;
else if(y > maxY)
maxY = y;
if(z < minZ)
minZ = z;
else if(z > maxZ)
maxZ = z;
}
private void calculateCostForNewComponent(MultiblockComponent comp) {
ItemStack[] materials = comp.getMaterials();
if(materials != null)
for(ItemStack stack : materials)
addStack(stack);
}
private void addStack(ItemStack stack) {
if(stack == null)
return;
for(ItemStack oStack : materials)
if(oStack.isItemEqual(stack) && ItemStack.areItemStackTagsEqual(oStack, stack)) {
oStack.stackSize += stack.stackSize;
return;
}
materials.add(stack);
}
public void setRenderOffset(int x, int y, int z) {
offX = x;
offY = y;
offZ = z;
}
public List<MultiblockComponent> getComponents() {
return components;
}
/**
* Rotates this multiblock by the angle passed in. For the best results, use
* only multiples of pi/2.
*/
public void rotate(double angle) {
for(MultiblockComponent comp : getComponents())
comp.rotate(angle);
}
public Multiblock copy() {
Multiblock mb = new Multiblock();
for(MultiblockComponent comp : getComponents())
mb.addComponent(comp.copy());
return mb;
}
/**
* Creates a length 4 array of all the rotations multiple of pi/2 required
* to render this multiblock in the world relevant to the 4 cardinal
* orientations.
*/
public Multiblock[] createRotations() {
Multiblock[] blocks = new Multiblock[4];
blocks[0] = this;
blocks[1] = blocks[0].copy();
blocks[1].rotate(Math.PI / 2);
blocks[2] = blocks[1].copy();
blocks[2].rotate(Math.PI / 2);
blocks[3] = blocks[2].copy();
blocks[3].rotate(Math.PI / 2);
return blocks;
}
/**
* Makes a MultiblockSet from this Multiblock and its rotations using
* createRotations().
*/
public MultiblockSet makeSet() {
return new MultiblockSet(this);
}
public int getXSize() {
return Math.abs(minX) + Math.abs(maxX) + 1;
}
public int getYSize() {
return Math.abs(minY) + Math.abs(maxY) + 1;
}
public int getZSize() {
return Math.abs(minZ) + Math.abs(maxZ) + 1;
}
}

View file

@ -1,42 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package techreborn.client.multiblock;
import net.minecraft.entity.Entity;
import net.minecraft.util.MathHelper;
/**
* A set of Multiblock objects for various rotations.
*/
public class MultiblockSet {
private final Multiblock[] mbs;
public MultiblockSet(Multiblock[] mbs) {
this.mbs = mbs;
}
public MultiblockSet(Multiblock mb) {
this(mb.createRotations());
}
public Multiblock getForEntity(Entity e) {
return getForRotation(e.rotationYaw);
}
public Multiblock getForRotation(double rotation) {
int facing = MathHelper.floor_double(rotation * 4.0 / 360.0 + 0.5) & 3;
return getForIndex(facing);
}
public Multiblock getForIndex(int index) {
return mbs[index];
}
}

View file

@ -1,67 +0,0 @@
/**
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package techreborn.client.multiblock.component;
import net.minecraft.block.Block;
import net.minecraft.item.ItemStack;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.world.World;
/**
* A component of a multiblock, the normal one
* is just a block.
*/
public class MultiblockComponent {
public ChunkCoordinates relPos;
public final Block block;
public final int meta;
public MultiblockComponent(ChunkCoordinates relPos, Block block, int meta) {
this.relPos = relPos;
this.block = block;
this.meta = meta;
}
public ChunkCoordinates getRelativePosition() {
return relPos;
}
public Block getBlock() {
return block;
}
public int getMeta() {
return meta;
}
public boolean matches(World world, int x, int y, int z) {
return world.getBlock(x, y, z) == getBlock() && (meta == -1 || world.getBlockMetadata(x, y, z) == meta);
}
public ItemStack[] getMaterials() {
return new ItemStack[] { new ItemStack(block, 1, meta) };
}
public void rotate(double angle) {
double x = relPos.posX;
double z = relPos.posZ;
double sin = Math.sin(angle);
double cos = Math.cos(angle);
double xn = x * cos - z * sin;
double zn = x * sin + z * cos;
relPos = new ChunkCoordinates((int) Math.round(xn), relPos.posY, (int) Math.round(zn));
}
public MultiblockComponent copy() {
return new MultiblockComponent(relPos, block, meta);
}
}

View file

@ -2,10 +2,9 @@
* This class was created by <Vazkii>. It's distributed as
* part of the Botania Mod. Get the Source Code in github:
* https://github.com/Vazkii/Botania
*
* <p/>
* Botania is Open Source and distributed under the
* Botania License: http://botaniamod.net/license.php
*
*/
package techreborn.client.render;
@ -16,97 +15,91 @@ import net.minecraft.client.renderer.RenderBlocks;
import net.minecraft.client.renderer.entity.RenderManager;
import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ChatComponentText;
import net.minecraft.util.ChatStyle;
import net.minecraft.util.ChunkCoordinates;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.MathHelper;
import net.minecraft.util.MovingObjectPosition;
import net.minecraft.util.*;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderWorldLastEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent;
import net.minecraftforge.event.entity.player.PlayerInteractEvent.Action;
import org.lwjgl.opengl.GL11;
import techreborn.client.multiblock.IMultiblockRenderHook;
import techreborn.client.multiblock.Multiblock;
import techreborn.client.multiblock.MultiblockSet;
import techreborn.client.multiblock.component.MultiblockComponent;
import reborncore.client.multiblock.IMultiblockRenderHook;
import reborncore.client.multiblock.Multiblock;
import reborncore.client.multiblock.MultiblockSet;
import reborncore.client.multiblock.component.MultiblockComponent;
public class MultiblockRenderEvent {
public static boolean rendering = false;
public static boolean rendering = false;
private static RenderBlocks blockRender = RenderBlocks.getInstance();
public MultiblockSet currentMultiblock;
public static ChunkCoordinates anchor;
public static int angle;
private static RenderBlocks blockRender = RenderBlocks.getInstance();
public MultiblockSet currentMultiblock;
public static ChunkCoordinates anchor;
public static int angle;
public void setMultiblock(MultiblockSet set) {
currentMultiblock = set;
anchor = null;
angle = 0;
}
public void setMultiblock(MultiblockSet set) {
currentMultiblock = set;
anchor = null;
angle = 0;
}
@SubscribeEvent
public void onWorldRenderLast(RenderWorldLastEvent event) {
Minecraft mc = Minecraft.getMinecraft();
if(mc.thePlayer != null && mc.objectMouseOver != null && !mc.thePlayer.isSneaking()) {
mc.thePlayer.getCurrentEquippedItem();
renderPlayerLook(mc.thePlayer, mc.objectMouseOver);
}
}
@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent event) {
if(currentMultiblock != null && anchor == null && event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer == Minecraft.getMinecraft().thePlayer) {
anchor = new ChunkCoordinates(event.x, event.y, event.z);
angle = MathHelper.floor_double(event.entityPlayer.rotationYaw * 4.0 / 360.0 + 0.5) & 3;
event.setCanceled(true);
}
}
@SubscribeEvent
public void onWorldRenderLast(RenderWorldLastEvent event) {
Minecraft mc = Minecraft.getMinecraft();
if (mc.thePlayer != null && mc.objectMouseOver != null && !mc.thePlayer.isSneaking()) {
mc.thePlayer.getCurrentEquippedItem();
renderPlayerLook(mc.thePlayer, mc.objectMouseOver);
}
}
private void renderPlayerLook(EntityPlayer player, MovingObjectPosition src) {
if(currentMultiblock != null) {
int anchorX = anchor != null ? anchor.posX : src.blockX;
int anchorY = anchor != null ? anchor.posY +1 : src.blockY + 1;
int anchorZ = anchor != null ? anchor.posZ : src.blockZ;
@SubscribeEvent
public void onPlayerInteract(PlayerInteractEvent event) {
if (currentMultiblock != null && anchor == null && event.action == Action.RIGHT_CLICK_BLOCK && event.entityPlayer == Minecraft.getMinecraft().thePlayer) {
anchor = new ChunkCoordinates(event.x, event.y, event.z);
angle = MathHelper.floor_double(event.entityPlayer.rotationYaw * 4.0 / 360.0 + 0.5) & 3;
event.setCanceled(true);
}
}
rendering = true;
Multiblock mb =currentMultiblock.getForEntity(player);
boolean didAny = false;
for(MultiblockComponent comp : mb.getComponents())
if(renderComponent(player.worldObj, mb, comp, anchorX, anchorY, anchorZ))
didAny = true;
rendering = false;
private void renderPlayerLook(EntityPlayer player, MovingObjectPosition src) {
if (currentMultiblock != null) {
int anchorX = anchor != null ? anchor.posX : src.blockX;
int anchorY = anchor != null ? anchor.posY + 1 : src.blockY + 1;
int anchorZ = anchor != null ? anchor.posZ : src.blockZ;
if(!didAny) {
setMultiblock(null);
player.addChatComponentMessage(new ChatComponentText("Structure Complete!").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
}
}
}
rendering = true;
Multiblock mb = currentMultiblock.getForEntity(player);
boolean didAny = false;
for (MultiblockComponent comp : mb.getComponents())
if (renderComponent(player.worldObj, mb, comp, anchorX, anchorY, anchorZ))
didAny = true;
rendering = false;
private boolean renderComponent(World world, Multiblock mb, MultiblockComponent comp, int anchorX, int anchorY, int anchorZ) {
ChunkCoordinates pos = comp.getRelativePosition();
int x = pos.posX + anchorX;
int y = pos.posY + anchorY;
int z = pos.posZ + anchorZ;
if (!didAny) {
setMultiblock(null);
player.addChatComponentMessage(new ChatComponentText("Structure Complete!").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.GREEN)));
}
}
}
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glColor4f(1F, 1F, 1F, 0.4F);
GL11.glTranslated(x + 0.5 - RenderManager.renderPosX, y + 0.5 - RenderManager.renderPosY, z + 0.5 - RenderManager.renderPosZ);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
private boolean renderComponent(World world, Multiblock mb, MultiblockComponent comp, int anchorX, int anchorY, int anchorZ) {
ChunkCoordinates pos = comp.getRelativePosition();
int x = pos.posX + anchorX;
int y = pos.posY + anchorY;
int z = pos.posZ + anchorZ;
blockRender.useInventoryTint = false;
Block block = comp.getBlock();
if(IMultiblockRenderHook.renderHooks.containsKey(block))
IMultiblockRenderHook.renderHooks.get(block).renderBlockForMultiblock(world, mb, block, comp.getMeta(), blockRender);
else blockRender.renderBlockAsItem(comp.getBlock(), comp.getMeta(), 1F);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopMatrix();
return true;
}
GL11.glPushMatrix();
GL11.glEnable(GL11.GL_BLEND);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
GL11.glDisable(GL11.GL_DEPTH_TEST);
GL11.glColor4f(1F, 1F, 1F, 0.4F);
GL11.glTranslated(x + 0.5 - RenderManager.renderPosX, y + 0.5 - RenderManager.renderPosY, z + 0.5 - RenderManager.renderPosZ);
Minecraft.getMinecraft().renderEngine.bindTexture(TextureMap.locationBlocksTexture);
blockRender.useInventoryTint = false;
Block block = comp.getBlock();
if (IMultiblockRenderHook.renderHooks.containsKey(block))
IMultiblockRenderHook.renderHooks.get(block).renderBlockForMultiblock(world, mb, block, comp.getMeta(), blockRender);
else blockRender.renderBlockAsItem(comp.getBlock(), comp.getMeta(), 1F);
GL11.glEnable(GL11.GL_DEPTH_TEST);
GL11.glPopMatrix();
return true;
}
}

Some files were not shown because too many files have changed in this diff Show more