Autocleanup
parent
18edba9a6f
commit
d7ff59ccd2
|
@ -12,11 +12,11 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.api.item;
|
package steamcraft.api.item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Skylar on 8/31/2015.
|
* Created by Skylar on 8/31/2015.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,11 +1,12 @@
|
||||||
package steamcraft.client.gui;
|
package steamcraft.client.gui;
|
||||||
|
|
||||||
import boilerplate.client.BaseContainerGui;
|
|
||||||
import net.minecraft.client.renderer.OpenGlHelper;
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
import net.minecraft.client.renderer.RenderHelper;
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
import net.minecraft.client.renderer.entity.RenderManager;
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
|
|
||||||
|
import boilerplate.client.BaseContainerGui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.opengl.GL12;
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
@ -23,8 +24,8 @@ public abstract class BaseEntityRenderGUI extends BaseContainerGui
|
||||||
{
|
{
|
||||||
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
GL11.glTranslatef((float)startX, (float)startY, 50.0F);
|
GL11.glTranslatef(startX, startY, 50.0F);
|
||||||
GL11.glScalef((float)(-scale), (float)scale, (float)scale);
|
GL11.glScalef((-scale), scale, scale);
|
||||||
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||||
float f2 = entityLiving.renderYawOffset;
|
float f2 = entityLiving.renderYawOffset;
|
||||||
float f3 = entityLiving.rotationYaw;
|
float f3 = entityLiving.rotationYaw;
|
||||||
|
@ -34,10 +35,10 @@ public abstract class BaseEntityRenderGUI extends BaseContainerGui
|
||||||
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
|
||||||
RenderHelper.enableStandardItemLighting();
|
RenderHelper.enableStandardItemLighting();
|
||||||
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
|
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
|
||||||
GL11.glRotatef(-((float)Math.atan((double)(offsetY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
|
GL11.glRotatef(-((float) Math.atan(offsetY / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
|
||||||
entityLiving.renderYawOffset = (float)Math.atan((double)(offsetX / 40.0F)) * 20.0F;
|
entityLiving.renderYawOffset = (float) Math.atan(offsetX / 40.0F) * 20.0F;
|
||||||
entityLiving.rotationYaw = (float)Math.atan((double)(offsetX / 40.0F)) * 40.0F;
|
entityLiving.rotationYaw = (float) Math.atan(offsetX / 40.0F) * 40.0F;
|
||||||
entityLiving.rotationPitch = -((float)Math.atan((double)(offsetY / 40.0F))) * 20.0F;
|
entityLiving.rotationPitch = -((float) Math.atan(offsetY / 40.0F)) * 20.0F;
|
||||||
entityLiving.rotationYawHead = entityLiving.rotationYaw;
|
entityLiving.rotationYawHead = entityLiving.rotationYaw;
|
||||||
entityLiving.prevRotationYawHead = entityLiving.rotationYaw;
|
entityLiving.prevRotationYawHead = entityLiving.rotationYaw;
|
||||||
GL11.glTranslatef(0.0F, entityLiving.yOffset, 0.0F);
|
GL11.glTranslatef(0.0F, entityLiving.yOffset, 0.0F);
|
||||||
|
|
|
@ -14,6 +14,7 @@ package steamcraft.client.gui;
|
||||||
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import steamcraft.common.lib.ModInfo;
|
import steamcraft.common.lib.ModInfo;
|
||||||
import steamcraft.common.tiles.TileArmorEditor;
|
import steamcraft.common.tiles.TileArmorEditor;
|
||||||
|
@ -39,8 +40,8 @@ public class GuiArmorEditor extends BaseEntityRenderGUI
|
||||||
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
public void drawScreen(int p_73863_1_, int p_73863_2_, float p_73863_3_)
|
||||||
{
|
{
|
||||||
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
super.drawScreen(p_73863_1_, p_73863_2_, p_73863_3_);
|
||||||
this.xSizeFloat = (float)p_73863_1_;
|
this.xSizeFloat = p_73863_1_;
|
||||||
this.ySizeFloat = (float)p_73863_2_;
|
this.ySizeFloat = p_73863_2_;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -52,7 +53,6 @@ public class GuiArmorEditor extends BaseEntityRenderGUI
|
||||||
int x = (this.width - this.xSize) / 2;
|
int x = (this.width - this.xSize) / 2;
|
||||||
int y = (this.height - this.ySize) / 2;
|
int y = (this.height - this.ySize) / 2;
|
||||||
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
|
this.drawTexturedModalRect(x, y, 0, 0, this.xSize, this.ySize);
|
||||||
renderEntity(x + 33, y + 75, 30, (float) (x + 33) - this.xSizeFloat, (float) (y + 75 - 50) - this.ySizeFloat,
|
renderEntity(x + 33, y + 75, 30, x + 33 - this.xSizeFloat, (y + 75) - 50 - this.ySizeFloat, this.mc.thePlayer);
|
||||||
this.mc.thePlayer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -22,25 +22,25 @@ import net.minecraft.entity.Entity;
|
||||||
*/
|
*/
|
||||||
public class ModelLightningRod extends ModelBase
|
public class ModelLightningRod extends ModelBase
|
||||||
{
|
{
|
||||||
public final ModelRenderer shape1;
|
public ModelRenderer shape1;
|
||||||
public final ModelRenderer shape2;
|
public ModelRenderer shape2;
|
||||||
public final ModelRenderer shape3;
|
public ModelRenderer shape3;
|
||||||
public final ModelRenderer shape4;
|
public ModelRenderer shape4;
|
||||||
public final ModelRenderer shape5;
|
public ModelRenderer shape5;
|
||||||
public final ModelRenderer shape6;
|
public ModelRenderer shape6;
|
||||||
public final ModelRenderer shape7;
|
public ModelRenderer shape7;
|
||||||
public final ModelRenderer shape8;
|
public ModelRenderer shape8;
|
||||||
public final ModelRenderer shape9;
|
public ModelRenderer shape9;
|
||||||
public final ModelRenderer shape10;
|
public ModelRenderer shape10;
|
||||||
public final ModelRenderer shape11;
|
public ModelRenderer shape11;
|
||||||
public final ModelRenderer shape12;
|
public ModelRenderer shape12;
|
||||||
public final ModelRenderer shape13;
|
public ModelRenderer shape13;
|
||||||
public final ModelRenderer shape14;
|
public ModelRenderer shape14;
|
||||||
public final ModelRenderer shape15;
|
public ModelRenderer shape15;
|
||||||
public final ModelRenderer shape16;
|
public ModelRenderer shape16;
|
||||||
public final ModelRenderer shape17;
|
public ModelRenderer shape17;
|
||||||
public final ModelRenderer shape18;
|
public ModelRenderer shape18;
|
||||||
public final ModelRenderer shape19;
|
public ModelRenderer shape19;
|
||||||
public ModelRenderer shape20;
|
public ModelRenderer shape20;
|
||||||
|
|
||||||
public ModelLightningRod()
|
public ModelLightningRod()
|
||||||
|
@ -136,7 +136,7 @@ public class ModelLightningRod extends ModelBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render(final Entity entity, final float f, final float f1, final float f2, final float f3, final float f4, final float f5)
|
public void render(Entity entity, float f, float f1, float f2, float f3, float f4, float f5)
|
||||||
{
|
{
|
||||||
super.render(entity, f, f1, f2, f3, f4, f5);
|
super.render(entity, f, f1, f2, f3, f4, f5);
|
||||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||||
|
@ -163,7 +163,7 @@ public class ModelLightningRod extends ModelBase
|
||||||
this.shape20.render(f5);
|
this.shape20.render(f5);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void setRotation(final ModelRenderer model, final float x, final float y, final float z)
|
private void setRotation(ModelRenderer model, float x, float y, float z)
|
||||||
{
|
{
|
||||||
model.rotateAngleX = x;
|
model.rotateAngleX = x;
|
||||||
model.rotateAngleY = y;
|
model.rotateAngleY = y;
|
||||||
|
@ -171,7 +171,7 @@ public class ModelLightningRod extends ModelBase
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void setRotationAngles(final float f, final float f1, final float f2, final float f3, final float f4, final float f5, final Entity entity)
|
public void setRotationAngles(float f, float f1, float f2, float f3, float f4, float f5, Entity entity)
|
||||||
{
|
{
|
||||||
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
super.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,31 +12,51 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common;
|
package steamcraft.common;
|
||||||
|
|
||||||
import boilerplate.client.GuiHandler;
|
import java.io.File;
|
||||||
import boilerplate.common.compathandler.FMPCompatHandler;
|
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
||||||
|
|
||||||
import cpw.mods.fml.common.FMLCommonHandler;
|
import cpw.mods.fml.common.FMLCommonHandler;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.Mod;
|
import cpw.mods.fml.common.Mod;
|
||||||
import cpw.mods.fml.common.Mod.EventHandler;
|
import cpw.mods.fml.common.Mod.EventHandler;
|
||||||
import cpw.mods.fml.common.Mod.Instance;
|
import cpw.mods.fml.common.Mod.Instance;
|
||||||
import cpw.mods.fml.common.SidedProxy;
|
import cpw.mods.fml.common.SidedProxy;
|
||||||
import cpw.mods.fml.common.event.*;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
import cpw.mods.fml.common.event.FMLMissingMappingsEvent.MissingMapping;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLServerStartingEvent;
|
||||||
import cpw.mods.fml.common.network.NetworkRegistry;
|
import cpw.mods.fml.common.network.NetworkRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
import cpw.mods.fml.common.registry.GameRegistry.Type;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.world.gen.structure.MapGenStructureIO;
|
|
||||||
import net.minecraftforge.common.DimensionManager;
|
import net.minecraftforge.common.DimensionManager;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
|
import boilerplate.client.GuiHandler;
|
||||||
|
import boilerplate.common.compathandler.FMPCompatHandler;
|
||||||
import steamcraft.common.compat.CompatabilityLayer;
|
import steamcraft.common.compat.CompatabilityLayer;
|
||||||
import steamcraft.common.compat.CompatibilityHandler;
|
import steamcraft.common.compat.CompatibilityHandler;
|
||||||
import steamcraft.common.config.Config;
|
import steamcraft.common.config.Config;
|
||||||
import steamcraft.common.config.ConfigGeneral;
|
import steamcraft.common.config.ConfigGeneral;
|
||||||
import steamcraft.common.config.ConfigWorldGen;
|
import steamcraft.common.config.ConfigWorldGen;
|
||||||
import steamcraft.common.init.*;
|
import steamcraft.common.init.InitAchievements;
|
||||||
import steamcraft.common.lib.*;
|
import steamcraft.common.init.InitBiomes;
|
||||||
|
import steamcraft.common.init.InitBlocks;
|
||||||
|
import steamcraft.common.init.InitEntities;
|
||||||
|
import steamcraft.common.init.InitItems;
|
||||||
|
import steamcraft.common.init.InitMisc;
|
||||||
|
import steamcraft.common.init.InitPackets;
|
||||||
|
import steamcraft.common.init.InitRecipes;
|
||||||
|
import steamcraft.common.lib.BucketHandler;
|
||||||
|
import steamcraft.common.lib.CommandSteamcraft;
|
||||||
|
import steamcraft.common.lib.CreativeTabSteamcraft;
|
||||||
|
import steamcraft.common.lib.LoggerSteamcraft;
|
||||||
|
import steamcraft.common.lib.ModInfo;
|
||||||
import steamcraft.common.lib.events.EventHandlerClient;
|
import steamcraft.common.lib.events.EventHandlerClient;
|
||||||
import steamcraft.common.lib.events.EventHandlerFML;
|
import steamcraft.common.lib.events.EventHandlerFML;
|
||||||
import steamcraft.common.lib.events.EventHandlerForge;
|
import steamcraft.common.lib.events.EventHandlerForge;
|
||||||
|
@ -46,8 +66,6 @@ import steamcraft.common.worldgen.structure.MapGenCustomScatteredFeature;
|
||||||
import steamcraft.common.worldgen.structure.StructureUndercityPieces;
|
import steamcraft.common.worldgen.structure.StructureUndercityPieces;
|
||||||
import steamcraft.common.worldgen.structure.StructureUndercityStart;
|
import steamcraft.common.worldgen.structure.StructureUndercityStart;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Surseance
|
* @author Surseance
|
||||||
* @commentary by Arnold
|
* @commentary by Arnold
|
||||||
|
|
|
@ -41,9 +41,9 @@ public class BlockCapacitor extends BaseContainerBlock
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @Override public int getRenderType() { return RenderIDs.blockBatteryRI; }
|
* @Override public int getRenderType() { return RenderIDs.blockBatteryRI; }
|
||||||
*
|
*
|
||||||
* @Override public boolean isOpaqueCube() { return false; }
|
* @Override public boolean isOpaqueCube() { return false; }
|
||||||
*
|
*
|
||||||
* @Override public boolean renderAsNormalBlock() { return false; }
|
* @Override public boolean renderAsNormalBlock() { return false; }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
package steamcraft.common.compat;
|
package steamcraft.common.compat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
import steamcraft.common.compat.chisel.ChiselCompat;
|
import steamcraft.common.compat.chisel.ChiselCompat;
|
||||||
import steamcraft.common.lib.LoggerSteamcraft;
|
import steamcraft.common.lib.LoggerSteamcraft;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Skylar on 9/2/2015.
|
* Created by Skylar on 9/2/2015.
|
||||||
*/
|
*/
|
||||||
|
@ -15,8 +16,10 @@ public class CompatibilityHandler
|
||||||
{
|
{
|
||||||
private static ArrayList<ModCompat> MODCOMPAT_ENABLED = new ArrayList<ModCompat>();
|
private static ArrayList<ModCompat> MODCOMPAT_ENABLED = new ArrayList<ModCompat>();
|
||||||
|
|
||||||
public static ArrayList<ModCompat> getModCompat() {
|
public static ArrayList<ModCompat> getModCompat()
|
||||||
if(MODCOMPAT_ENABLED.isEmpty()) {
|
{
|
||||||
|
if (MODCOMPAT_ENABLED.isEmpty())
|
||||||
|
{
|
||||||
MODCOMPAT_ENABLED.add(new ChiselCompat());
|
MODCOMPAT_ENABLED.add(new ChiselCompat());
|
||||||
}
|
}
|
||||||
return MODCOMPAT_ENABLED;
|
return MODCOMPAT_ENABLED;
|
||||||
|
@ -24,40 +27,40 @@ public class CompatibilityHandler
|
||||||
|
|
||||||
public static void preInit(FMLPreInitializationEvent event)
|
public static void preInit(FMLPreInitializationEvent event)
|
||||||
{
|
{
|
||||||
for(ModCompat modCompat : getModCompat())
|
for (ModCompat modCompat : getModCompat())
|
||||||
{
|
{
|
||||||
if(!modCompat.areRequirementsMet() && modCompat.getIsActive())
|
if (!modCompat.areRequirementsMet() && modCompat.getIsActive())
|
||||||
{
|
{
|
||||||
modCompat.setIsActive(false);
|
modCompat.setIsActive(false);
|
||||||
LoggerSteamcraft.error("Requirements are not met for " + modCompat.getName() + ". Deactivating");
|
LoggerSteamcraft.error("Requirements are not met for " + modCompat.getName() + ". Deactivating");
|
||||||
}
|
}
|
||||||
if(modCompat.getIsActive())
|
if (modCompat.getIsActive())
|
||||||
{
|
{
|
||||||
LoggerSteamcraft.info("Loading " + modCompat.getName() + " module");
|
LoggerSteamcraft.info("Loading " + modCompat.getName() + " module");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(ModCompat modCompat : getModCompat())
|
for (ModCompat modCompat : getModCompat())
|
||||||
{
|
{
|
||||||
if(modCompat.getIsActive())
|
if (modCompat.getIsActive())
|
||||||
modCompat.preInit(event);
|
modCompat.preInit(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void init(FMLInitializationEvent event)
|
public static void init(FMLInitializationEvent event)
|
||||||
{
|
{
|
||||||
for(ModCompat modCompat : getModCompat())
|
for (ModCompat modCompat : getModCompat())
|
||||||
{
|
{
|
||||||
if(modCompat.getIsActive())
|
if (modCompat.getIsActive())
|
||||||
modCompat.init(event);
|
modCompat.init(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void postInit(FMLPostInitializationEvent event)
|
public static void postInit(FMLPostInitializationEvent event)
|
||||||
{
|
{
|
||||||
for(ModCompat modCompat : getModCompat())
|
for (ModCompat modCompat : getModCompat())
|
||||||
{
|
{
|
||||||
if(modCompat.getIsActive())
|
if (modCompat.getIsActive())
|
||||||
modCompat.postInit(event);
|
modCompat.postInit(event);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,12 +13,11 @@ public abstract class ModCompat
|
||||||
|
|
||||||
public abstract String getName();
|
public abstract String getName();
|
||||||
|
|
||||||
public boolean areRequirementsMet() {
|
public boolean areRequirementsMet()
|
||||||
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public String dependencies()
|
public String dependencies()
|
||||||
{
|
{
|
||||||
return "";
|
return "";
|
||||||
|
@ -46,6 +45,6 @@ public abstract class ModCompat
|
||||||
|
|
||||||
public Boolean getIsActive()
|
public Boolean getIsActive()
|
||||||
{
|
{
|
||||||
return isActive;
|
return this.isActive;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,6 +3,7 @@ package steamcraft.common.compat.chisel;
|
||||||
import cpw.mods.fml.common.Loader;
|
import cpw.mods.fml.common.Loader;
|
||||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
import cpw.mods.fml.common.registry.GameRegistry;
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
import steamcraft.common.compat.ModCompat;
|
import steamcraft.common.compat.ModCompat;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -27,7 +28,7 @@ public class ChiselCompat extends ModCompat
|
||||||
@Override
|
@Override
|
||||||
public void preInit(FMLPreInitializationEvent event)
|
public void preInit(FMLPreInitializationEvent event)
|
||||||
{
|
{
|
||||||
itemSteamChisel = new ItemSteamChisel();
|
this.itemSteamChisel = new ItemSteamChisel();
|
||||||
GameRegistry.registerItem(itemSteamChisel, itemSteamChisel.getUnlocalizedName());
|
GameRegistry.registerItem(this.itemSteamChisel, this.itemSteamChisel.getUnlocalizedName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,11 +1,7 @@
|
||||||
package steamcraft.common.compat.chisel;
|
package steamcraft.common.compat.chisel;
|
||||||
|
|
||||||
import boilerplate.common.baseclasses.items.BaseSteamItem;
|
import java.util.List;
|
||||||
import com.cricketcraft.chisel.api.IChiselItem;
|
|
||||||
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
|
||||||
import cpw.mods.fml.common.Optional;
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
@ -13,14 +9,21 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.IFluidContainerItem;
|
import net.minecraftforge.fluids.IFluidContainerItem;
|
||||||
|
|
||||||
|
import boilerplate.common.baseclasses.items.BaseSteamItem;
|
||||||
|
import com.cricketcraft.chisel.api.IChiselItem;
|
||||||
|
import com.cricketcraft.chisel.api.carving.ICarvingVariation;
|
||||||
import steamcraft.common.Steamcraft;
|
import steamcraft.common.Steamcraft;
|
||||||
import steamcraft.common.lib.ModInfo;
|
import steamcraft.common.lib.ModInfo;
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Skylar on 9/2/2015.
|
* Created by Skylar on 9/2/2015.
|
||||||
*/
|
*/
|
||||||
|
@ -44,14 +47,16 @@ public class ItemSteamChisel extends BaseSteamItem implements IChiselItem
|
||||||
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + "tools/" + this.getUnlocalizedName().substring(5));
|
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + "tools/" + this.getUnlocalizedName().substring(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
public void getSubItems(Item item, CreativeTabs creativeTabs, List list) {
|
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
|
||||||
|
{
|
||||||
list.add(new ItemStack(item, 1));
|
list.add(new ItemStack(item, 1));
|
||||||
if(item instanceof IFluidContainerItem)
|
if (item instanceof IFluidContainerItem)
|
||||||
{
|
{
|
||||||
ItemStack itemStack = new ItemStack(item, 1);
|
ItemStack itemStack = new ItemStack(item, 1);
|
||||||
IFluidContainerItem iFluidContainerItem = (IFluidContainerItem)item;
|
IFluidContainerItem iFluidContainerItem = (IFluidContainerItem) item;
|
||||||
iFluidContainerItem.fill(itemStack, FluidRegistry.getFluidStack("steam", iFluidContainerItem.getCapacity(itemStack)), true);
|
iFluidContainerItem.fill(itemStack, FluidRegistry.getFluidStack("steam", iFluidContainerItem.getCapacity(itemStack)), true);
|
||||||
list.add(itemStack);
|
list.add(itemStack);
|
||||||
}
|
}
|
||||||
|
@ -73,26 +78,25 @@ public class ItemSteamChisel extends BaseSteamItem implements IChiselItem
|
||||||
list.add("Empty");
|
list.add("Empty");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "chisel")
|
@Optional.Method(modid = "chisel")
|
||||||
public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel)
|
public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel)
|
||||||
{
|
{
|
||||||
return getFluidLevel(chisel) > 100;
|
return this.getFluidLevel(chisel) > 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "chisel")
|
@Optional.Method(modid = "chisel")
|
||||||
public boolean onChisel(World world, ItemStack chisel, ICarvingVariation target)
|
public boolean onChisel(World world, ItemStack chisel, ICarvingVariation target)
|
||||||
{
|
{
|
||||||
return consumeSteamFromCanister(chisel, 100);
|
return this.consumeSteamFromCanister(chisel, 100);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "chisel")
|
@Optional.Method(modid = "chisel")
|
||||||
public boolean canChisel(World world, ItemStack chisel, ICarvingVariation target)
|
public boolean canChisel(World world, ItemStack chisel, ICarvingVariation target)
|
||||||
{
|
{
|
||||||
return getFluidLevel(chisel) > 100;
|
return this.getFluidLevel(chisel) > 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -100,7 +104,7 @@ public class ItemSteamChisel extends BaseSteamItem implements IChiselItem
|
||||||
public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata)
|
public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata)
|
||||||
{
|
{
|
||||||
ItemStack currentItem = player.getCurrentEquippedItem();
|
ItemStack currentItem = player.getCurrentEquippedItem();
|
||||||
return getFluidLevel(currentItem) > 100;
|
return this.getFluidLevel(currentItem) > 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -112,7 +116,7 @@ public class ItemSteamChisel extends BaseSteamItem implements IChiselItem
|
||||||
|
|
||||||
private int getFluidLevel(ItemStack chisel)
|
private int getFluidLevel(ItemStack chisel)
|
||||||
{
|
{
|
||||||
if (chisel != null && chisel.getItem() instanceof IFluidContainerItem)
|
if ((chisel != null) && (chisel.getItem() instanceof IFluidContainerItem))
|
||||||
{
|
{
|
||||||
FluidStack fluidStack = ((IFluidContainerItem) chisel.getItem()).getFluid(chisel);
|
FluidStack fluidStack = ((IFluidContainerItem) chisel.getItem()).getFluid(chisel);
|
||||||
return fluidStack != null ? fluidStack.amount : 0;
|
return fluidStack != null ? fluidStack.amount : 0;
|
||||||
|
|
|
@ -12,10 +12,10 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.items.armor;
|
package steamcraft.common.items.armor;
|
||||||
|
|
||||||
import boilerplate.common.baseclasses.items.BaseArmor;
|
import java.util.ArrayList;
|
||||||
import cpw.mods.fml.common.Optional;
|
import java.util.Collections;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import java.util.List;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
@ -25,27 +25,32 @@ import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.DamageSource;
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import net.minecraftforge.common.ISpecialArmor;
|
import net.minecraftforge.common.ISpecialArmor;
|
||||||
import steamcraft.api.item.*;
|
|
||||||
|
import boilerplate.common.baseclasses.items.BaseArmor;
|
||||||
|
import steamcraft.api.item.IArmorModule;
|
||||||
import steamcraft.api.item.IArmorModule.EnumArmorEffectType;
|
import steamcraft.api.item.IArmorModule.EnumArmorEffectType;
|
||||||
|
import steamcraft.api.item.IDefensiveArmorModule;
|
||||||
|
import steamcraft.api.item.IModule;
|
||||||
|
import steamcraft.api.item.IModuleContainer;
|
||||||
|
import steamcraft.api.item.ModuleRegistry;
|
||||||
import steamcraft.common.Steamcraft;
|
import steamcraft.common.Steamcraft;
|
||||||
import steamcraft.common.init.InitItems;
|
import steamcraft.common.init.InitItems;
|
||||||
import steamcraft.common.lib.ModInfo;
|
import steamcraft.common.lib.ModInfo;
|
||||||
import thaumcraft.api.IGoggles;
|
import thaumcraft.api.IGoggles;
|
||||||
import thaumcraft.api.nodes.IRevealer;
|
import thaumcraft.api.nodes.IRevealer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author warlordjones
|
* @author warlordjones
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
@Optional.InterfaceList({
|
@Optional.InterfaceList({ @Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
||||||
@Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
@Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft") })
|
||||||
@Optional.Interface(iface = "thaumcraft.api.nodes.IRevealer", modid = "Thaumcraft")
|
|
||||||
})
|
|
||||||
public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles, IRevealer, IModuleContainer
|
public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles, IRevealer, IModuleContainer
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -176,8 +181,8 @@ public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public String getArmorTexture(ItemStack is, Entity entity, int slot, String type)
|
public String getArmorTexture(ItemStack is, Entity entity, int slot, String type)
|
||||||
{
|
{
|
||||||
return slot == 2 ? ModInfo.PREFIX + "textures/models/armor/" + "brass" + "_2.png" : ModInfo.PREFIX +
|
return slot == 2 ? ModInfo.PREFIX + "textures/models/armor/" + "brass" + "_2.png"
|
||||||
"textures/models/armor/" + "brass" + "_1.png";
|
: ModInfo.PREFIX + "textures/models/armor/" + "brass" + "_1.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -225,19 +230,19 @@ public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles
|
||||||
public boolean isModuleAllowed(IModule iModule, ItemStack itemStack)
|
public boolean isModuleAllowed(IModule iModule, ItemStack itemStack)
|
||||||
{
|
{
|
||||||
boolean allowed = false;
|
boolean allowed = false;
|
||||||
if(itemStack.getItem() instanceof ItemBrassArmor)
|
if (itemStack.getItem() instanceof ItemBrassArmor)
|
||||||
{
|
{
|
||||||
ItemBrassArmor brassArmor = (ItemBrassArmor)itemStack.getItem();
|
ItemBrassArmor brassArmor = (ItemBrassArmor) itemStack.getItem();
|
||||||
if (iModule instanceof IArmorModule)
|
if (iModule instanceof IArmorModule)
|
||||||
{
|
{
|
||||||
IArmorModule iArmorModule = (IArmorModule)iModule;
|
IArmorModule iArmorModule = (IArmorModule) iModule;
|
||||||
if(iArmorModule.getApplicablePiece() == -1 || iArmorModule.getApplicablePiece() == brassArmor.armorType)
|
if ((iArmorModule.getApplicablePiece() == -1) || (iArmorModule.getApplicablePiece() == brassArmor.armorType))
|
||||||
{
|
{
|
||||||
ArrayList<IModule> moduleIncompatibilities = ModuleRegistry.getModuleIncompatibilities(iModule.getModuleId());
|
ArrayList<IModule> moduleIncompatibilities = ModuleRegistry.getModuleIncompatibilities(iModule.getModuleId());
|
||||||
if(moduleIncompatibilities == null ||
|
if ((moduleIncompatibilities == null)
|
||||||
Collections.disjoint(IModuleContainer.Helper.getAllModulesEquipped(itemStack), moduleIncompatibilities))
|
|| Collections.disjoint(IModuleContainer.Helper.getAllModulesEquipped(itemStack), moduleIncompatibilities))
|
||||||
{
|
{
|
||||||
if(!IModuleContainer.Helper.getAllModulesEquipped(itemStack).contains(iModule))
|
if (!IModuleContainer.Helper.getAllModulesEquipped(itemStack).contains(iModule))
|
||||||
{
|
{
|
||||||
allowed = true;
|
allowed = true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ public class ItemSuperFreezeBoots extends BaseArmorModule
|
||||||
int pX = (int) Math.round(player.posX);
|
int pX = (int) Math.round(player.posX);
|
||||||
int pY = (int) Math.round(player.posY) - 2;
|
int pY = (int) Math.round(player.posY) - 2;
|
||||||
int pZ = (int) Math.round(player.posZ);
|
int pZ = (int) Math.round(player.posZ);
|
||||||
if (world.getBlock(pX, pY, pZ).getMaterial() == Material.air && !player.isSneaking())
|
if ((world.getBlock(pX, pY, pZ).getMaterial() == Material.air) && !player.isSneaking())
|
||||||
{
|
{
|
||||||
world.setBlock(pX, pY, pZ, InitBlocks.blockGhostIce);
|
world.setBlock(pX, pY, pZ, InitBlocks.blockGhostIce);
|
||||||
}
|
}
|
||||||
|
|
|
@ -123,7 +123,7 @@ public class EventHandlerClient
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @SubscribeEvent
|
* @SubscribeEvent
|
||||||
*
|
*
|
||||||
* @SideOnly(Side.CLIENT) // hacky hack to make the texture work in BC
|
* @SideOnly(Side.CLIENT) // hacky hack to make the texture work in BC
|
||||||
* tanks. public void textureHook(TextureStitchEvent.Post event) {
|
* tanks. public void textureHook(TextureStitchEvent.Post event) {
|
||||||
* if(event.map.getTextureType() == 0) {
|
* if(event.map.getTextureType() == 0) {
|
||||||
|
|
|
@ -12,15 +12,19 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.tiles;
|
package steamcraft.common.tiles;
|
||||||
|
|
||||||
import boilerplate.api.IOpenableGUI;
|
import java.util.ArrayList;
|
||||||
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
import java.util.Iterator;
|
||||||
import boilerplate.common.tiles.IOnSlotChanged;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import boilerplate.api.IOpenableGUI;
|
||||||
|
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
||||||
|
import boilerplate.common.tiles.IOnSlotChanged;
|
||||||
import steamcraft.api.item.IArmorModule;
|
import steamcraft.api.item.IArmorModule;
|
||||||
import steamcraft.api.item.IModule;
|
import steamcraft.api.item.IModule;
|
||||||
import steamcraft.api.item.IModuleContainer;
|
import steamcraft.api.item.IModuleContainer;
|
||||||
|
@ -28,9 +32,6 @@ import steamcraft.client.gui.GuiArmorEditor;
|
||||||
import steamcraft.common.tiles.container.ContainerArmorEditor;
|
import steamcraft.common.tiles.container.ContainerArmorEditor;
|
||||||
import steamcraft.common.tiles.container.slot.SlotModuleContainer;
|
import steamcraft.common.tiles.container.slot.SlotModuleContainer;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author warlordjones
|
* @author warlordjones
|
||||||
*
|
*
|
||||||
|
@ -72,31 +73,33 @@ public class TileArmorEditor extends BaseTileWithInventory implements IInventory
|
||||||
{
|
{
|
||||||
this.setInventorySlotContents(slotNumber, null);
|
this.setInventorySlotContents(slotNumber, null);
|
||||||
}
|
}
|
||||||
} else if (slotItemStack.getItem() instanceof IModuleContainer)
|
}
|
||||||
|
else if (slotItemStack.getItem() instanceof IModuleContainer)
|
||||||
{
|
{
|
||||||
ArrayList<IModule> iModules = IModuleContainer.Helper.getAllModulesEquipped(slotItemStack);
|
ArrayList<IModule> iModules = IModuleContainer.Helper.getAllModulesEquipped(slotItemStack);
|
||||||
Iterator<IModule> iModuleIterator = iModules.iterator();
|
Iterator<IModule> iModuleIterator = iModules.iterator();
|
||||||
int slotNumber = 1;
|
int slotNumber = 1;
|
||||||
while(iModuleIterator.hasNext())
|
while (iModuleIterator.hasNext())
|
||||||
{
|
{
|
||||||
this.setInventorySlotContents(slotNumber, new ItemStack((Item)iModuleIterator.next()));
|
this.setInventorySlotContents(slotNumber, new ItemStack((Item) iModuleIterator.next()));
|
||||||
slotNumber++;
|
slotNumber++;
|
||||||
iModuleIterator.remove();
|
iModuleIterator.remove();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
ItemStack slotItemStack;
|
ItemStack slotItemStack;
|
||||||
ArrayList<IModule> iModules = new ArrayList<IModule>();
|
ArrayList<IModule> iModules = new ArrayList<IModule>();
|
||||||
for (int slotNumber = 1; slotNumber < this.getSizeInventory(); slotNumber++)
|
for (int slotNumber = 1; slotNumber < this.getSizeInventory(); slotNumber++)
|
||||||
{
|
{
|
||||||
slotItemStack = this.getStackInSlot(slotNumber);
|
slotItemStack = this.getStackInSlot(slotNumber);
|
||||||
if (slotItemStack != null && slotItemStack.getItem() instanceof IModule)
|
if ((slotItemStack != null) && (slotItemStack.getItem() instanceof IModule))
|
||||||
{
|
{
|
||||||
iModules.add((IModule)slotItemStack.getItem());
|
iModules.add((IModule) slotItemStack.getItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.getStackInSlot(0) != null)
|
if (this.getStackInSlot(0) != null)
|
||||||
{
|
{
|
||||||
IModuleContainer.Helper.setModulesEquipped(iModules, this.getStackInSlot(0));
|
IModuleContainer.Helper.setModulesEquipped(iModules, this.getStackInSlot(0));
|
||||||
}
|
}
|
||||||
|
|
|
@ -104,13 +104,13 @@ public abstract class TileBaseBoiler extends BaseTileWithInventory implements IF
|
||||||
{
|
{
|
||||||
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(this.inventory[1]);
|
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(this.inventory[1]);
|
||||||
|
|
||||||
if ((liquid != null) && liquid.getFluid() == FluidRegistry.WATER)
|
if ((liquid != null) && (liquid.getFluid() == FluidRegistry.WATER))
|
||||||
{
|
{
|
||||||
ItemStack emptyContainer = FluidUtils.drainFluidContainer(this.waterTank, this.inventory[1]);
|
ItemStack emptyContainer = FluidUtils.drainFluidContainer(this.waterTank, this.inventory[1]);
|
||||||
if (inventory[2] != null && OreDictionary.itemMatches(inventory[2], emptyContainer, true))
|
if ((this.inventory[2] != null) && OreDictionary.itemMatches(this.inventory[2], emptyContainer, true))
|
||||||
inventory[2].stackSize += emptyContainer.stackSize;
|
this.inventory[2].stackSize += emptyContainer.stackSize;
|
||||||
else if (inventory[2] == null)
|
else if (this.inventory[2] == null)
|
||||||
inventory[2] = emptyContainer.copy();
|
this.inventory[2] = emptyContainer.copy();
|
||||||
this.decrStackSize(1, emptyContainer.stackSize);
|
this.decrStackSize(1, emptyContainer.stackSize);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -127,21 +127,21 @@ public abstract class TileBaseBoiler extends BaseTileWithInventory implements IF
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ItemStack filledContainer = FluidUtils.fillFluidContainer(steamTank, this.inventory[3]);
|
ItemStack filledContainer = FluidUtils.fillFluidContainer(this.steamTank, this.inventory[3]);
|
||||||
if (filledContainer != null)
|
if (filledContainer != null)
|
||||||
{
|
{
|
||||||
if (inventory[3] != null && OreDictionary.itemMatches(inventory[3], filledContainer, true))
|
if ((this.inventory[3] != null) && OreDictionary.itemMatches(this.inventory[3], filledContainer, true))
|
||||||
inventory[3].stackSize += filledContainer.stackSize;
|
this.inventory[3].stackSize += filledContainer.stackSize;
|
||||||
else if (inventory[3] == null)
|
else if (this.inventory[3] == null)
|
||||||
inventory[3] = filledContainer.copy();
|
this.inventory[3] = filledContainer.copy();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((this.getItemBurnTime(inventory[0]) > 0) && (this.furnaceBurnTime == 0) && (this.waterTank.getFluidAmount() >= waterPerTick)
|
if ((this.getItemBurnTime(this.inventory[0]) > 0) && (this.furnaceBurnTime == 0) && (this.waterTank.getFluidAmount() >= waterPerTick)
|
||||||
&& (this.steamTank.fill(new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), false) > 0))
|
&& (this.steamTank.fill(new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), false) > 0))
|
||||||
{
|
{
|
||||||
this.currentFuelBurnTime = this.furnaceBurnTime = this.getItemBurnTime(inventory[0]) / 4;
|
this.currentFuelBurnTime = this.furnaceBurnTime = this.getItemBurnTime(this.inventory[0]) / 4;
|
||||||
|
|
||||||
if (this.inventory[0].stackSize == 1)
|
if (this.inventory[0].stackSize == 1)
|
||||||
this.inventory[0] = this.inventory[0].getItem().getContainerItem(this.inventory[0]);
|
this.inventory[0] = this.inventory[0].getItem().getContainerItem(this.inventory[0]);
|
||||||
|
|
|
@ -58,11 +58,11 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
this.fuelTank = new FluidTank(5000);
|
this.fuelTank = new FluidTank(5000);
|
||||||
this.fuels.put(FluidRegistry.LAVA, defaultFuelValue * 2);
|
this.fuels.put(FluidRegistry.LAVA, this.defaultFuelValue * 2);
|
||||||
this.fuels.put(FluidRegistry.getFluid("whaleoil"), defaultFuelValue);
|
this.fuels.put(FluidRegistry.getFluid("whaleoil"), this.defaultFuelValue);
|
||||||
this.fuels.put(FluidRegistry.getFluid("oil"), defaultFuelValue / 2);
|
this.fuels.put(FluidRegistry.getFluid("oil"), this.defaultFuelValue / 2);
|
||||||
this.fuels.put(FluidRegistry.getFluid("biodisel"), defaultFuelValue);
|
this.fuels.put(FluidRegistry.getFluid("biodisel"), this.defaultFuelValue);
|
||||||
this.fuels.put(FluidRegistry.getFluid("fuel"), defaultFuelValue);
|
this.fuels.put(FluidRegistry.getFluid("fuel"), this.defaultFuelValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -122,10 +122,10 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
|
||||||
{
|
{
|
||||||
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(this.inventory[1]);
|
FluidStack fluid = FluidContainerRegistry.getFluidForFilledItem(this.inventory[1]);
|
||||||
|
|
||||||
if ((fluid != null) && (this.fuelTank.fill(fluid, false) == fluid.amount) && fuels.containsKey(fluid.getFluid()))
|
if ((fluid != null) && (this.fuelTank.fill(fluid, false) == fluid.amount) && this.fuels.containsKey(fluid.getFluid()))
|
||||||
{
|
{
|
||||||
this.fuelTank.fill(new FluidStack(fluid, fluid.amount), true);
|
this.fuelTank.fill(new FluidStack(fluid, fluid.amount), true);
|
||||||
FMLLog.info("" + fuelTank.getFluid().getUnlocalizedName(), "");
|
FMLLog.info("" + this.fuelTank.getFluid().getUnlocalizedName(), "");
|
||||||
|
|
||||||
if (this.inventory[1].stackSize > 1)
|
if (this.inventory[1].stackSize > 1)
|
||||||
this.inventory[1].stackSize--;
|
this.inventory[1].stackSize--;
|
||||||
|
@ -181,7 +181,7 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
|
||||||
@Override
|
@Override
|
||||||
public boolean canInsertItem(int par1, ItemStack itemstack, int par3)
|
public boolean canInsertItem(int par1, ItemStack itemstack, int par3)
|
||||||
{
|
{
|
||||||
return ((par1 == 0 || par1 == 1) && FluidContainerRegistry.isContainer(itemstack));
|
return (((par1 == 0) || (par1 == 1)) && FluidContainerRegistry.isContainer(itemstack));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -251,6 +251,6 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
|
||||||
|
|
||||||
public int getFuelBurnTime(Fluid fluid)
|
public int getFuelBurnTime(Fluid fluid)
|
||||||
{
|
{
|
||||||
return fuels.get(fluid);
|
return this.fuels.get(fluid);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.tiles.container;
|
package steamcraft.common.tiles.container;
|
||||||
|
|
||||||
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
|
|
||||||
|
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
||||||
import steamcraft.common.tiles.TileArmorEditor;
|
import steamcraft.common.tiles.TileArmorEditor;
|
||||||
import steamcraft.common.tiles.container.slot.SlotArmor;
|
import steamcraft.common.tiles.container.slot.SlotArmor;
|
||||||
import steamcraft.common.tiles.container.slot.SlotModule;
|
import steamcraft.common.tiles.container.slot.SlotModule;
|
||||||
|
@ -33,30 +34,30 @@ public class ContainerArmorEditor extends BaseContainer
|
||||||
this.tileent = tile;
|
this.tileent = tile;
|
||||||
this.setTile(this.tileent);
|
this.setTile(this.tileent);
|
||||||
|
|
||||||
for(int i = 0; i < 4; ++i)
|
for (int i = 0; i < 4; ++i)
|
||||||
{
|
{
|
||||||
this.addSlotToContainer(new SlotArmor(player, player.getSizeInventory() - 1 - i, 62, 8 + i * 18, i));
|
this.addSlotToContainer(new SlotArmor(player, player.getSizeInventory() - 1 - i, 62, 8 + (i * 18), i));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotModuleContainer(this.tileent, 0, 89, 26));
|
this.addSlotToContainer(new SlotModuleContainer(this.tileent, 0, 89, 26));
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
for(int j = 0; j < 3; j++)
|
for (int j = 0; j < 3; j++)
|
||||||
{
|
{
|
||||||
this.addSlotToContainer(new SlotModule(this.tileent, j + (i * 4) + 1, 116 + j * 18, 8 + (i * 18)));
|
this.addSlotToContainer(new SlotModule(this.tileent, j + (i * 4) + 1, 116 + (j * 18), 8 + (i * 18)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int var3 = 0; var3 < 3; ++var3)
|
for (int var3 = 0; var3 < 3; ++var3)
|
||||||
{
|
{
|
||||||
for(int var4 = 0; var4 < 9; ++var4)
|
for (int var4 = 0; var4 < 9; ++var4)
|
||||||
{
|
{
|
||||||
this.addSlotToContainer(new Slot(player, var4 + (var3 * 9) + 9, 8 + (var4 * 18), 84 + (var3 * 18)));
|
this.addSlotToContainer(new Slot(player, var4 + (var3 * 9) + 9, 8 + (var4 * 18), 84 + (var3 * 18)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for(int var3 = 0; var3 < 9; ++var3)
|
for (int var3 = 0; var3 < 9; ++var3)
|
||||||
{
|
{
|
||||||
this.addSlotToContainer(new Slot(player, var3, 8 + (var3 * 18), 142));
|
this.addSlotToContainer(new Slot(player, var3, 8 + (var3 * 18), 142));
|
||||||
}
|
}
|
||||||
|
|
|
@ -130,7 +130,7 @@ public class ContainerLiquidBoiler extends BaseContainer
|
||||||
this.tileent.furnaceBurnTime = par2;
|
this.tileent.furnaceBurnTime = par2;
|
||||||
else if (par1 == 1)
|
else if (par1 == 1)
|
||||||
this.tileent.steamTank.setFluid(new FluidStack(FluidRegistry.getFluid("steam"), par2));
|
this.tileent.steamTank.setFluid(new FluidStack(FluidRegistry.getFluid("steam"), par2));
|
||||||
else if (par1 == 2 && this.tileent.fuelTank.getFluid() != null)
|
else if ((par1 == 2) && (this.tileent.fuelTank.getFluid() != null))
|
||||||
this.tileent.fuelTank.setFluid(new FluidStack(this.tileent.fuelTank.getFluid().getFluid(), par2));
|
this.tileent.fuelTank.setFluid(new FluidStack(this.tileent.fuelTank.getFluid().getFluid(), par2));
|
||||||
else if (par1 == 3)
|
else if (par1 == 3)
|
||||||
this.tileent.waterTank.setFluid(new FluidStack(FluidRegistry.getFluid("water"), par2));
|
this.tileent.waterTank.setFluid(new FluidStack(FluidRegistry.getFluid("water"), par2));
|
||||||
|
|
|
@ -12,14 +12,15 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.tiles.container.slot;
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.inventory.Slot;
|
import net.minecraft.inventory.Slot;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created by Skylar on 8/29/2015.
|
* Created by Skylar on 8/29/2015.
|
||||||
*/
|
*/
|
||||||
|
@ -42,17 +43,17 @@ public class SlotArmor extends Slot
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack itemStack)
|
public boolean isItemValid(ItemStack itemStack)
|
||||||
{
|
{
|
||||||
if(itemStack == null)
|
if (itemStack == null)
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return itemStack.getItem().isValidArmor(itemStack, armortype, ((InventoryPlayer) inventory).player);
|
return itemStack.getItem().isValidArmor(itemStack, this.armortype, ((InventoryPlayer) this.inventory).player);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getBackgroundIconIndex()
|
public IIcon getBackgroundIconIndex()
|
||||||
{
|
{
|
||||||
return ItemArmor.func_94602_b(armortype);
|
return ItemArmor.func_94602_b(this.armortype);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.tiles.container.slot;
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
import boilerplate.common.containers.slots.SlotChanged;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import boilerplate.common.containers.slots.SlotChanged;
|
||||||
import steamcraft.api.item.IModule;
|
import steamcraft.api.item.IModule;
|
||||||
import steamcraft.api.item.IModuleContainer;
|
import steamcraft.api.item.IModuleContainer;
|
||||||
|
|
||||||
|
@ -32,13 +33,13 @@ public class SlotModule extends SlotChanged
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack stack)
|
public boolean isItemValid(ItemStack stack)
|
||||||
{
|
{
|
||||||
if (stack == null || !(stack.getItem() instanceof IModule) || this.inventory.getStackInSlot(0) == null ||
|
if ((stack == null) || !(stack.getItem() instanceof IModule) || (this.inventory.getStackInSlot(0) == null)
|
||||||
!(this.inventory.getStackInSlot(0).getItem() instanceof IModuleContainer))
|
|| !(this.inventory.getStackInSlot(0).getItem() instanceof IModuleContainer))
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
IModule iModule = (IModule)stack.getItem();
|
IModule iModule = (IModule) stack.getItem();
|
||||||
IModuleContainer iModuleContainer = (IModuleContainer)this.inventory.getStackInSlot(0).getItem();
|
IModuleContainer iModuleContainer = (IModuleContainer) this.inventory.getStackInSlot(0).getItem();
|
||||||
return iModuleContainer.isModuleAllowed(iModule, this.inventory.getStackInSlot(0));
|
return iModuleContainer.isModuleAllowed(iModule, this.inventory.getStackInSlot(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,10 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.tiles.container.slot;
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
import boilerplate.common.containers.slots.SlotChanged;
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import boilerplate.common.containers.slots.SlotChanged;
|
||||||
import steamcraft.api.item.IModuleContainer;
|
import steamcraft.api.item.IModuleContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -92,13 +92,13 @@ public class TileBattery extends BaseTileWithInventory implements IEnergyHandler
|
||||||
* short outputEnergy = (short)
|
* short outputEnergy = (short)
|
||||||
* this.extractEnergy(ForgeDirection.UNKNOWN, this.transferRate,
|
* this.extractEnergy(ForgeDirection.UNKNOWN, this.transferRate,
|
||||||
* true);
|
* true);
|
||||||
*
|
*
|
||||||
* if(outputEnergy > 0) for(ForgeDirection direction :
|
* if(outputEnergy > 0) for(ForgeDirection direction :
|
||||||
* EnumSet.allOf(ForgeDirection.class)) if(outputEnergy > 0) {
|
* EnumSet.allOf(ForgeDirection.class)) if(outputEnergy > 0) {
|
||||||
* TileEntity tileEntity = this.worldObj.getTileEntity(this.xCoord -
|
* TileEntity tileEntity = this.worldObj.getTileEntity(this.xCoord -
|
||||||
* direction.offsetX, this.yCoord - direction.offsetY, this.zCoord -
|
* direction.offsetX, this.yCoord - direction.offsetY, this.zCoord -
|
||||||
* direction.offsetZ);
|
* direction.offsetZ);
|
||||||
*
|
*
|
||||||
* if(tileEntity instanceof IEnergyReceiver) outputEnergy -=
|
* if(tileEntity instanceof IEnergyReceiver) outputEnergy -=
|
||||||
* this.extractEnergy(ForgeDirection.UNKNOWN, ((IEnergyReceiver)
|
* this.extractEnergy(ForgeDirection.UNKNOWN, ((IEnergyReceiver)
|
||||||
* tileEntity).receiveEnergy(direction.getOpposite(), outputEnergy,
|
* tileEntity).receiveEnergy(direction.getOpposite(), outputEnergy,
|
||||||
|
|
|
@ -72,13 +72,13 @@ public class TileCapacitor extends BaseTileWithInventory implements IEnergyHandl
|
||||||
* short outputEnergy = (short)
|
* short outputEnergy = (short)
|
||||||
* this.extractEnergy(ForgeDirection.UNKNOWN, this.transferRate,
|
* this.extractEnergy(ForgeDirection.UNKNOWN, this.transferRate,
|
||||||
* true);
|
* true);
|
||||||
*
|
*
|
||||||
* if(outputEnergy > 0) for(ForgeDirection direction :
|
* if(outputEnergy > 0) for(ForgeDirection direction :
|
||||||
* EnumSet.allOf(ForgeDirection.class)) if(outputEnergy > 0) {
|
* EnumSet.allOf(ForgeDirection.class)) if(outputEnergy > 0) {
|
||||||
* TileEntity tileEntity = this.worldObj.getTileEntity(this.xCoord +
|
* TileEntity tileEntity = this.worldObj.getTileEntity(this.xCoord +
|
||||||
* direction.offsetX, this.yCoord + direction.offsetY, this.zCoord +
|
* direction.offsetX, this.yCoord + direction.offsetY, this.zCoord +
|
||||||
* direction.offsetZ);
|
* direction.offsetZ);
|
||||||
*
|
*
|
||||||
* if(tileEntity instanceof IEnergyReceiver) outputEnergy -=
|
* if(tileEntity instanceof IEnergyReceiver) outputEnergy -=
|
||||||
* this.extractEnergy(ForgeDirection.UNKNOWN, ((IEnergyReceiver)
|
* this.extractEnergy(ForgeDirection.UNKNOWN, ((IEnergyReceiver)
|
||||||
* tileEntity).receiveEnergy(direction.getOpposite(), outputEnergy,
|
* tileEntity).receiveEnergy(direction.getOpposite(), outputEnergy,
|
||||||
|
|
|
@ -107,7 +107,7 @@ public class WorldProviderDeeps extends WorldProvider
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* @Override
|
* @Override
|
||||||
*
|
*
|
||||||
* @SideOnly(Side.CLIENT) public IRenderHandler getSkyRenderer() { return
|
* @SideOnly(Side.CLIENT) public IRenderHandler getSkyRenderer() { return
|
||||||
* new DeepsSkyRenderer(); }
|
* new DeepsSkyRenderer(); }
|
||||||
*/
|
*/
|
||||||
|
|
Loading…
Reference in New Issue