Merge branch 'dev'
|
@ -32,6 +32,10 @@ repositories {
|
||||||
name "RX14"
|
name "RX14"
|
||||||
url "http://mvn.rx14.co.uk/repo/"
|
url "http://mvn.rx14.co.uk/repo/"
|
||||||
}
|
}
|
||||||
|
maven {
|
||||||
|
name "Tterrag"
|
||||||
|
url "http://maven.tterrag.com"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
apply plugin: 'forge'
|
apply plugin: 'forge'
|
||||||
|
@ -55,7 +59,9 @@ dependencies {
|
||||||
compile 'com.mod-buildcraft:buildcraft:6.4.16:dev'
|
compile 'com.mod-buildcraft:buildcraft:6.4.16:dev'
|
||||||
compile 'net.industrial-craft:industrialcraft-2:2.2.727-experimental:api'
|
compile 'net.industrial-craft:industrialcraft-2:2.2.727-experimental:api'
|
||||||
compile 'Azanor:Thaumcraft:4.2.3.5:deobf@jar'
|
compile 'Azanor:Thaumcraft:4.2.3.5:deobf@jar'
|
||||||
compile name: "Botania" , group: "vazkii.botania", version: "r1.6-190.6", classifier: "deobf"
|
compile 'team.chisel:Chisel:2.9.0.3:deobf'
|
||||||
|
compile 'team.chisel.ctmlib:CTMLib:MC1.7.10-1.3.0.2:deobf'
|
||||||
|
compile name: "Botania", group: "vazkii.botania", version: "r1.6-190.6", classifier: "deobf"
|
||||||
|
|
||||||
compile files("libs/Railcraft_1.7.10-9.7.0.0-dev.jar")
|
compile files("libs/Railcraft_1.7.10-9.7.0.0-dev.jar")
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,25 @@
|
||||||
|
package steamcraft.api;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
|
||||||
|
public class RecipeAPI
|
||||||
|
{
|
||||||
|
public static HashMap<Fluid, Integer> addedFuels = new HashMap();
|
||||||
|
public static Map<ItemStack[], ItemStack> addedRecipeList = new HashMap<ItemStack[], ItemStack>();
|
||||||
|
|
||||||
|
public void addLiquidBoilerFuel(Fluid fluid, int value)
|
||||||
|
{
|
||||||
|
if (fluid != null)
|
||||||
|
addedFuels.put(fluid, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void addBloomeryRecipe(ItemStack input, ItemStack input2, ItemStack result)
|
||||||
|
{
|
||||||
|
addedRecipeList.put(new ItemStack[] { input, input2 }, result);
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,6 @@ package steamcraft.api.item;
|
||||||
/**
|
/**
|
||||||
* The Interface IFistModule.
|
* The Interface IFistModule.
|
||||||
*/
|
*/
|
||||||
@Deprecated
|
|
||||||
public interface IFistModule extends IModule
|
public interface IFistModule extends IModule
|
||||||
{
|
{
|
||||||
// The type of effect (see below)
|
// The type of effect (see below)
|
||||||
|
@ -24,15 +23,14 @@ public interface IFistModule extends IModule
|
||||||
*
|
*
|
||||||
* @return the module effect type
|
* @return the module effect type
|
||||||
*/
|
*/
|
||||||
public EnumModuleEffectType getModuleEffectType();
|
EnumModuleEffectType getModuleEffectType();
|
||||||
|
|
||||||
//
|
//
|
||||||
/**
|
/**
|
||||||
* The Enum EnumModuleEffectType.
|
* The Enum EnumModuleEffectType.
|
||||||
*/
|
*/
|
||||||
public static enum EnumModuleEffectType
|
enum EnumModuleEffectType
|
||||||
{
|
{
|
||||||
|
|
||||||
/** The rightclick. */
|
/** The rightclick. */
|
||||||
RIGHTCLICK, /** The attack. */
|
RIGHTCLICK, /** The attack. */
|
||||||
ATTACK
|
ATTACK
|
||||||
|
|
|
@ -0,0 +1,70 @@
|
||||||
|
/**
|
||||||
|
* This class was created by BrassGoggledCoders modding team.
|
||||||
|
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is open-source and is distributed under the MMPL v1.0 License.
|
||||||
|
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is based on the original Steamcraft Mod created by Proloe.
|
||||||
|
* Steamcraft (c) Proloe 2011
|
||||||
|
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package steamcraft.api.item;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 8/31/2015.
|
||||||
|
*/
|
||||||
|
public interface IModuleContainer
|
||||||
|
{
|
||||||
|
boolean isModuleAllowed(IModule iModule, ItemStack itemStack);
|
||||||
|
|
||||||
|
final class Helper
|
||||||
|
{
|
||||||
|
public static ArrayList<IModule> getAllModulesEquipped(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
NBTTagCompound nbtTagCompound = getOrCreateTagCompound(itemStack);
|
||||||
|
|
||||||
|
ArrayList<IModule> moduleList = new ArrayList<IModule>();
|
||||||
|
|
||||||
|
for (int i = 0; i < nbtTagCompound.getInteger("moduleCount"); i++)
|
||||||
|
{
|
||||||
|
IModule module = ModuleRegistry.getModule(nbtTagCompound.getString("module" + i));
|
||||||
|
|
||||||
|
if (module != null)
|
||||||
|
{
|
||||||
|
moduleList.add(module);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return moduleList;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void setModulesEquipped(ArrayList<IModule> iModules, ItemStack itemStack)
|
||||||
|
{
|
||||||
|
NBTTagCompound nbtTagCompound = getOrCreateTagCompound(itemStack);
|
||||||
|
|
||||||
|
nbtTagCompound.setInteger("moduleCount", iModules.size());
|
||||||
|
for (int i = 0; i < iModules.size(); i++)
|
||||||
|
{
|
||||||
|
nbtTagCompound.setString("module" + i, iModules.get(i).getModuleId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static NBTTagCompound getOrCreateTagCompound(ItemStack is)
|
||||||
|
{
|
||||||
|
if (!is.hasTagCompound())
|
||||||
|
{
|
||||||
|
is.setTagCompound(new NBTTagCompound());
|
||||||
|
is.getTagCompound().setInteger("moduleCount", 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
return is.getTagCompound();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -1,96 +0,0 @@
|
||||||
/**
|
|
||||||
* This class was created by BrassGoggledCoders modding team.
|
|
||||||
* This class is available as part of the BoilerCraft Mod for Minecraft.
|
|
||||||
*
|
|
||||||
* BoilerCraft is open-source and is distributed under the MMPL v1.0 License.
|
|
||||||
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
package steamcraft.api.item;
|
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.item.EntityMinecart;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.Optional;
|
|
||||||
|
|
||||||
import boilerplate.common.baseclasses.items.RootItem;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @author decebaldecebal
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public abstract class UniversalWrench extends RootItem implements IUniversalWrench
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "BuildCraft|Core")
|
|
||||||
public boolean canWrench(EntityPlayer player, int x, int y, int z)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "BuildCraft|Core")
|
|
||||||
public void wrenchUsed(EntityPlayer player, int x, int y, int z)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public boolean isUsable(ItemStack item, EntityLivingBase user, int x, int y, int z)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z)
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "Railcraft")
|
|
||||||
public boolean canWhack(EntityPlayer player, ItemStack crowbar, int x, int y, int z)
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "Railcraft")
|
|
||||||
public void onWhack(EntityPlayer player, ItemStack crowbar, int x, int y, int z)
|
|
||||||
{
|
|
||||||
crowbar.damageItem(2, player);
|
|
||||||
player.swingItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "Railcraft")
|
|
||||||
public boolean canLink(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
|
||||||
{
|
|
||||||
return player.isSneaking();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "Railcraft")
|
|
||||||
public void onLink(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
|
||||||
{
|
|
||||||
crowbar.damageItem(2, player);
|
|
||||||
player.swingItem();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "Railcraft")
|
|
||||||
public boolean canBoost(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
|
||||||
{
|
|
||||||
return !this.canLink(player, crowbar, cart);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@Optional.Method(modid = "Railcraft")
|
|
||||||
public void onBoost(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
|
||||||
{
|
|
||||||
crowbar.damageItem(2, player);
|
|
||||||
player.swingItem();
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
package steamcraft.client.gui;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
|
import net.minecraft.client.renderer.RenderHelper;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
|
|
||||||
|
import boilerplate.client.BaseContainerGui;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import org.lwjgl.opengl.GL12;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 8/29/2015.
|
||||||
|
*/
|
||||||
|
public abstract class BaseEntityRenderGUI extends BaseContainerGui
|
||||||
|
{
|
||||||
|
public BaseEntityRenderGUI(Container container)
|
||||||
|
{
|
||||||
|
super(container);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void renderEntity(int startX, int startY, int scale, float offsetX, float offsetY, EntityLivingBase entityLiving)
|
||||||
|
{
|
||||||
|
GL11.glEnable(GL11.GL_COLOR_MATERIAL);
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
GL11.glTranslatef(startX, startY, 50.0F);
|
||||||
|
GL11.glScalef((-scale), scale, scale);
|
||||||
|
GL11.glRotatef(180.0F, 0.0F, 0.0F, 1.0F);
|
||||||
|
float f2 = entityLiving.renderYawOffset;
|
||||||
|
float f3 = entityLiving.rotationYaw;
|
||||||
|
float f4 = entityLiving.rotationPitch;
|
||||||
|
float f5 = entityLiving.prevRotationYawHead;
|
||||||
|
float f6 = entityLiving.rotationYawHead;
|
||||||
|
GL11.glRotatef(135.0F, 0.0F, 1.0F, 0.0F);
|
||||||
|
RenderHelper.enableStandardItemLighting();
|
||||||
|
GL11.glRotatef(-135.0F, 0.0F, 1.0F, 0.0F);
|
||||||
|
GL11.glRotatef(-((float) Math.atan(offsetY / 40.0F)) * 20.0F, 1.0F, 0.0F, 0.0F);
|
||||||
|
entityLiving.renderYawOffset = (float) Math.atan(offsetX / 40.0F) * 20.0F;
|
||||||
|
entityLiving.rotationYaw = (float) Math.atan(offsetX / 40.0F) * 40.0F;
|
||||||
|
entityLiving.rotationPitch = -((float) Math.atan(offsetY / 40.0F)) * 20.0F;
|
||||||
|
entityLiving.rotationYawHead = entityLiving.rotationYaw;
|
||||||
|
entityLiving.prevRotationYawHead = entityLiving.rotationYaw;
|
||||||
|
GL11.glTranslatef(0.0F, entityLiving.yOffset, 0.0F);
|
||||||
|
RenderManager.instance.playerViewY = 180.0F;
|
||||||
|
RenderManager.instance.renderEntityWithPosYaw(entityLiving, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
|
||||||
|
entityLiving.renderYawOffset = f2;
|
||||||
|
entityLiving.rotationYaw = f3;
|
||||||
|
entityLiving.rotationPitch = f4;
|
||||||
|
entityLiving.prevRotationYawHead = f5;
|
||||||
|
entityLiving.rotationYawHead = f6;
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
RenderHelper.disableStandardItemLighting();
|
||||||
|
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||||
|
OpenGlHelper.setActiveTexture(OpenGlHelper.lightmapTexUnit);
|
||||||
|
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||||
|
OpenGlHelper.setActiveTexture(OpenGlHelper.defaultTexUnit);
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,7 +15,6 @@ 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 boilerplate.client.BaseContainerGui;
|
|
||||||
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;
|
||||||
|
@ -25,9 +24,11 @@ import steamcraft.common.tiles.container.ContainerArmorEditor;
|
||||||
* @author warlordjones
|
* @author warlordjones
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class GuiArmorEditor extends BaseContainerGui
|
public class GuiArmorEditor extends BaseEntityRenderGUI
|
||||||
{
|
{
|
||||||
private static ResourceLocation guitexture = new ResourceLocation(ModInfo.PREFIX + "textures/gui/armoreditor.png");
|
private static ResourceLocation guitexture = new ResourceLocation(ModInfo.PREFIX + "textures/gui/armoreditor.png");
|
||||||
|
private float xSizeFloat;
|
||||||
|
private float ySizeFloat;
|
||||||
|
|
||||||
public GuiArmorEditor(InventoryPlayer player, TileArmorEditor tile)
|
public GuiArmorEditor(InventoryPlayer player, TileArmorEditor tile)
|
||||||
{
|
{
|
||||||
|
@ -35,6 +36,14 @@ public class GuiArmorEditor extends BaseContainerGui
|
||||||
this.tile = tile;
|
this.tile = tile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
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_);
|
||||||
|
this.xSizeFloat = p_73863_1_;
|
||||||
|
this.ySizeFloat = p_73863_2_;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||||
{
|
{
|
||||||
|
@ -44,11 +53,6 @@ public class GuiArmorEditor extends BaseContainerGui
|
||||||
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, x + 33 - this.xSizeFloat, (y + 75) - 50 - this.ySizeFloat, this.mc.thePlayer);
|
||||||
|
|
||||||
@Override
|
|
||||||
protected void mouseMovedOrUp(int mouseX, int mouseY, int which)
|
|
||||||
{
|
|
||||||
super.mouseMovedOrUp(mouseX, mouseY, which);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,60 @@
|
||||||
|
/**
|
||||||
|
* This class was created by BrassGoggledCoders modding team.
|
||||||
|
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is open-source and is distributed under the MMPL v1.0 License.
|
||||||
|
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is based on the original Steamcraft Mod created by Proloe.
|
||||||
|
* Steamcraft (c) Proloe 2011
|
||||||
|
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package steamcraft.client.gui;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
import boilerplate.client.BaseContainerGui;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
import steamcraft.common.lib.ModInfo;
|
||||||
|
import steamcraft.common.tiles.TileInjector;
|
||||||
|
import steamcraft.common.tiles.container.ContainerInjector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author decebaldecebal
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class GuiInjector extends BaseContainerGui
|
||||||
|
{
|
||||||
|
private static ResourceLocation guitexture = new ResourceLocation(ModInfo.PREFIX + "textures/gui/injector.png");
|
||||||
|
|
||||||
|
private TileInjector tile;
|
||||||
|
|
||||||
|
public GuiInjector(InventoryPlayer player, TileInjector tile)
|
||||||
|
{
|
||||||
|
super(new ContainerInjector(player, tile));
|
||||||
|
|
||||||
|
this.tile = tile;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3)
|
||||||
|
{
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
|
||||||
|
this.mc.renderEngine.bindTexture(guitexture);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft, this.guiTop, 0, 0, this.xSize, this.ySize);
|
||||||
|
|
||||||
|
this.mc.renderEngine.bindTexture(guitexture);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 15, 176, 14, 20, 49);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + 40, this.guiTop + 15, 176, 14, 20, 49);
|
||||||
|
this.drawTexturedModalRect(this.guiLeft + 74, this.guiTop + 15, 176, 14, 20, 49);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int x, int y)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
|
@ -15,8 +15,9 @@ 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 cpw.mods.fml.common.FMLLog;
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import boilerplate.client.BaseContainerGui;
|
import boilerplate.client.BaseContainerGui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -55,13 +56,14 @@ public class GuiLiquidBoiler extends BaseContainerGui
|
||||||
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48) - burnTime, 176, 12 - burnTime, 14, burnTime + 2);
|
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48) - burnTime, 176, 12 - burnTime, 14, burnTime + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("water"), 0), this.boiler.getScaledWaterLevel(60), this.guiLeft + 8, this.guiTop + 8, 20,
|
this.drawFluid(FluidRegistry.getFluid("water"), this.boiler.getScaledWaterLevel(60), this.guiLeft + 8, this.guiTop + 8, 20, 60);
|
||||||
60);
|
|
||||||
if (this.boiler.fuelTank.getFluid() != null)
|
if (this.boiler.fuelTank.getFluid() != null)
|
||||||
this.drawFluid(new FluidStack(this.boiler.fuelTank.getFluid().getFluid(), 0), this.boiler.getScaledFuelLevel(60), this.guiLeft + 20,
|
{
|
||||||
this.guiTop + 8, 20, 60);
|
this.drawFluid(this.boiler.fuelTank.getFluid().getFluid(), this.boiler.getScaledFuelLevel(60), this.guiLeft + 20, this.guiTop + 8, 20,
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("steam"), 0), this.boiler.getScaledSteamLevel(60), this.guiLeft + 74, this.guiTop + 8,
|
60);
|
||||||
32, 60);
|
FMLLog.info("" + this.boiler.getScaledFuelLevel(60), "" + this.boiler.getScaledFuelLevel(60));
|
||||||
|
}
|
||||||
|
this.drawFluid(FluidRegistry.getFluid("steam"), this.boiler.getScaledSteamLevel(60), this.guiLeft + 74, this.guiTop + 8, 32, 60);
|
||||||
|
|
||||||
this.mc.renderEngine.bindTexture(guitexture);
|
this.mc.renderEngine.bindTexture(guitexture);
|
||||||
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 15, 176, 14, 20, 49);
|
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 15, 176, 14, 20, 49);
|
||||||
|
|
|
@ -16,7 +16,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import boilerplate.client.BaseContainerGui;
|
import boilerplate.client.BaseContainerGui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -55,10 +54,8 @@ public class GuiNuclearBoiler extends BaseContainerGui
|
||||||
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48) - burnTime, 176, 12 - burnTime, 14, burnTime + 2);
|
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48) - burnTime, 176, 12 - burnTime, 14, burnTime + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("water"), 0), this.boiler.getScaledWaterLevel(60), this.guiLeft + 8, this.guiTop + 18,
|
this.drawFluid(FluidRegistry.getFluid("water"), this.boiler.getScaledWaterLevel(60), this.guiLeft + 8, this.guiTop + 18, 20, 60);
|
||||||
20, 60);
|
this.drawFluid(FluidRegistry.getFluid("steam"), this.boiler.getScaledSteamLevel(60), this.guiLeft + 74, this.guiTop + 18, 32, 60);
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("steam"), 0), this.boiler.getScaledSteamLevel(60), this.guiLeft + 74, this.guiTop + 18,
|
|
||||||
32, 60);
|
|
||||||
|
|
||||||
this.mc.renderEngine.bindTexture(guitexture);
|
this.mc.renderEngine.bindTexture(guitexture);
|
||||||
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 24, 176, 14, 20, 49);
|
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 24, 176, 14, 20, 49);
|
||||||
|
|
|
@ -18,7 +18,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
import net.minecraftforge.fluids.FluidTank;
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
|
|
||||||
import boilerplate.client.BaseContainerGui;
|
import boilerplate.client.BaseContainerGui;
|
||||||
|
@ -64,8 +63,7 @@ public class GuiRefinery extends BaseContainerGui
|
||||||
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48), 176, 50, cookTime + 1, 16);
|
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48), 176, 50, cookTime + 1, 16);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("whaleoil"), 0), this.refinery.getScaledWhaleOilLevel(60), this.guiLeft + 74,
|
this.drawFluid(FluidRegistry.getFluid("whaleoil"), this.refinery.getScaledWhaleOilLevel(60), this.guiLeft + 74, this.guiTop + 18, 32, 60);
|
||||||
this.guiTop + 18, 32, 60);
|
|
||||||
|
|
||||||
this.mc.renderEngine.bindTexture(guitexture);
|
this.mc.renderEngine.bindTexture(guitexture);
|
||||||
this.drawTexturedModalRect(this.guiLeft + 74, this.guiTop + 24, 176, 14, 20, 49);
|
this.drawTexturedModalRect(this.guiLeft + 74, this.guiTop + 24, 176, 14, 20, 49);
|
||||||
|
|
|
@ -16,7 +16,6 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
|
||||||
|
|
||||||
import boilerplate.client.BaseContainerGui;
|
import boilerplate.client.BaseContainerGui;
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
@ -55,10 +54,8 @@ public class GuiSteamBoiler extends BaseContainerGui
|
||||||
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48) - burnTime, 176, 12 - burnTime, 14, burnTime + 2);
|
this.drawTexturedModalRect(this.guiLeft + 43, (this.guiTop + 48) - burnTime, 176, 12 - burnTime, 14, burnTime + 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("water"), 0), this.boiler.getScaledWaterLevel(60), this.guiLeft + 8, this.guiTop + 18,
|
this.drawFluid(FluidRegistry.getFluid("water"), this.boiler.getScaledWaterLevel(60), this.guiLeft + 8, this.guiTop + 18, 20, 60);
|
||||||
20, 60);
|
this.drawFluid(FluidRegistry.getFluid("steam"), this.boiler.getScaledSteamLevel(60), this.guiLeft + 74, this.guiTop + 18, 32, 60);
|
||||||
this.drawFluid(new FluidStack(FluidRegistry.getFluid("steam"), 0), this.boiler.getScaledSteamLevel(60), this.guiLeft + 74, this.guiTop + 18,
|
|
||||||
32, 60);
|
|
||||||
|
|
||||||
this.mc.renderEngine.bindTexture(guitexture);
|
this.mc.renderEngine.bindTexture(guitexture);
|
||||||
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 24, 176, 14, 20, 49);
|
this.drawTexturedModalRect(this.guiLeft + 8, this.guiTop + 24, 176, 14, 20, 49);
|
||||||
|
|
|
@ -32,4 +32,5 @@ public class GuiIDs
|
||||||
public static final int REFINERY = 11;
|
public static final int REFINERY = 11;
|
||||||
public static final int CAPACITOR = 12;
|
public static final int CAPACITOR = 12;
|
||||||
public static final int LIQUID_BOILER = 13;
|
public static final int LIQUID_BOILER = 13;
|
||||||
|
public static final int INJECTOR = 14;
|
||||||
}
|
}
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,7 +39,9 @@ import net.minecraftforge.common.MinecraftForge;
|
||||||
|
|
||||||
import boilerplate.client.GuiHandler;
|
import boilerplate.client.GuiHandler;
|
||||||
import boilerplate.common.compathandler.FMPCompatHandler;
|
import boilerplate.common.compathandler.FMPCompatHandler;
|
||||||
|
import boilerplate.common.utils.handlers.BucketHandler;
|
||||||
import steamcraft.common.compat.CompatabilityLayer;
|
import steamcraft.common.compat.CompatabilityLayer;
|
||||||
|
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;
|
||||||
|
@ -51,7 +53,6 @@ import steamcraft.common.init.InitItems;
|
||||||
import steamcraft.common.init.InitMisc;
|
import steamcraft.common.init.InitMisc;
|
||||||
import steamcraft.common.init.InitPackets;
|
import steamcraft.common.init.InitPackets;
|
||||||
import steamcraft.common.init.InitRecipes;
|
import steamcraft.common.init.InitRecipes;
|
||||||
import steamcraft.common.lib.BucketHandler;
|
|
||||||
import steamcraft.common.lib.CommandSteamcraft;
|
import steamcraft.common.lib.CommandSteamcraft;
|
||||||
import steamcraft.common.lib.CreativeTabSteamcraft;
|
import steamcraft.common.lib.CreativeTabSteamcraft;
|
||||||
import steamcraft.common.lib.LoggerSteamcraft;
|
import steamcraft.common.lib.LoggerSteamcraft;
|
||||||
|
@ -96,6 +97,7 @@ public class Steamcraft
|
||||||
MinecraftForge.EVENT_BUS.register(new BucketHandler());
|
MinecraftForge.EVENT_BUS.register(new BucketHandler());
|
||||||
|
|
||||||
CompatabilityLayer.initCompatItems();
|
CompatabilityLayer.initCompatItems();
|
||||||
|
CompatibilityHandler.preInit(event);
|
||||||
|
|
||||||
LoggerSteamcraft.info("Finished Preinit");
|
LoggerSteamcraft.info("Finished Preinit");
|
||||||
}
|
}
|
||||||
|
@ -134,6 +136,7 @@ public class Steamcraft
|
||||||
InitBiomes.init();
|
InitBiomes.init();
|
||||||
|
|
||||||
FMPCompatHandler.doRegister();
|
FMPCompatHandler.doRegister();
|
||||||
|
CompatibilityHandler.init(event);
|
||||||
|
|
||||||
LoggerSteamcraft.info("Finished Init");
|
LoggerSteamcraft.info("Finished Init");
|
||||||
}
|
}
|
||||||
|
@ -158,6 +161,7 @@ public class Steamcraft
|
||||||
if (Loader.isModLoaded("ImmersiveEngineering"))
|
if (Loader.isModLoaded("ImmersiveEngineering"))
|
||||||
LoggerSteamcraft.info("Evening to the distingushed ladies and gentlemen of the ImmersiveEngineering club!");
|
LoggerSteamcraft.info("Evening to the distingushed ladies and gentlemen of the ImmersiveEngineering club!");
|
||||||
|
|
||||||
|
CompatibilityHandler.postInit(event);
|
||||||
/*
|
/*
|
||||||
* if(event.getSide() == Side.CLIENT) { // Autopopulate item/block lists
|
* if(event.getSide() == Side.CLIENT) { // Autopopulate item/block lists
|
||||||
* from creative tab Iterator iterator = Item.itemRegistry.iterator();
|
* from creative tab Iterator iterator = Item.itemRegistry.iterator();
|
||||||
|
|
|
@ -109,13 +109,13 @@ public class BlockSteamcraftOre extends BaseMetadataBlock implements IHammerable
|
||||||
switch (metadata)
|
switch (metadata)
|
||||||
{
|
{
|
||||||
case 4:
|
case 4:
|
||||||
drop.add(new ItemStack(InitItems.itemResource, 1, 4));
|
drop.add(new ItemStack(InitItems.itemResource, 1, 3));
|
||||||
break;
|
break;
|
||||||
case 5:
|
case 5:
|
||||||
drop.add(new ItemStack(InitItems.itemResource, 2 + world.rand.nextInt(3), 1));
|
drop.add(new ItemStack(InitItems.itemResource, 2 + world.rand.nextInt(3), 0));
|
||||||
break;
|
break;
|
||||||
case 6:
|
case 6:
|
||||||
drop.add(new ItemStack(InitItems.itemResource, 2 + world.rand.nextInt(3), 3));
|
drop.add(new ItemStack(InitItems.itemResource, 2 + world.rand.nextInt(3), 1));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
drop.add(0, new ItemStack(InitBlocks.blockCustomOre, 1, metadata));
|
drop.add(0, new ItemStack(InitBlocks.blockCustomOre, 1, metadata));
|
||||||
|
|
|
@ -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; }
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,105 @@
|
||||||
|
/**
|
||||||
|
* This class was created by BrassGoggledCoders modding team.
|
||||||
|
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is open-source and is distributed under the MMPL v1.0 License.
|
||||||
|
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is based on the original Steamcraft Mod created by Proloe.
|
||||||
|
* Steamcraft (c) Proloe 2011
|
||||||
|
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package steamcraft.common.blocks.machines;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import steamcraft.client.lib.GuiIDs;
|
||||||
|
import steamcraft.common.Steamcraft;
|
||||||
|
import steamcraft.common.tiles.TileInjector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author decebaldecebal
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class BlockInjector extends BlockBaseBoiler
|
||||||
|
{
|
||||||
|
public BlockInjector()
|
||||||
|
{
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerBlockIcons(IIconRegister icon)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int par2, int par3, int par4, EntityPlayer player, int par6, float par7, float par8, float par9)
|
||||||
|
{
|
||||||
|
if (world.isRemote)
|
||||||
|
return true;
|
||||||
|
else
|
||||||
|
{
|
||||||
|
TileInjector tile = (TileInjector) world.getTileEntity(par2, par3, par4);
|
||||||
|
|
||||||
|
if ((tile == null) || player.isSneaking())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
player.openGui(Steamcraft.instance, GuiIDs.INJECTOR, world, par2, par3, par4);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void randomDisplayTick(World world, int par2, int par3, int par4, Random par5Random)
|
||||||
|
{
|
||||||
|
int l = world.getBlockMetadata(par2, par3, par4);
|
||||||
|
if (l >= 7)
|
||||||
|
{
|
||||||
|
float f = par2 + 0.5F;
|
||||||
|
float f1 = par3 + 0.0F + ((par5Random.nextFloat() * 6.0F) / 16.0F);
|
||||||
|
float f2 = par4 + 0.5F;
|
||||||
|
float f3 = 0.52F;
|
||||||
|
float f4 = (par5Random.nextFloat() * 0.6F) - 0.3F;
|
||||||
|
|
||||||
|
if ((l == 4) || (l == 11))
|
||||||
|
{
|
||||||
|
world.spawnParticle("smoke", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||||
|
world.spawnParticle("flame", f - f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
else if ((l == 5) || (l == 12))
|
||||||
|
{
|
||||||
|
world.spawnParticle("smoke", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||||
|
world.spawnParticle("flame", f + f3, f1, f2 + f4, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
else if ((l == 2) || (l == 9))
|
||||||
|
{
|
||||||
|
world.spawnParticle("smoke", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||||
|
world.spawnParticle("flame", f + f4, f1, f2 - f3, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
else if ((l == 3) || (l == 10))
|
||||||
|
{
|
||||||
|
world.spawnParticle("smoke", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||||
|
world.spawnParticle("flame", f + f4, f1, f2 + f3, 0.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World par1World, int metadata)
|
||||||
|
{
|
||||||
|
return new TileInjector();
|
||||||
|
}
|
||||||
|
}
|
|
@ -218,14 +218,10 @@ public class CompatabilityLayer
|
||||||
|
|
||||||
for (int i = 0; i < partType.length; i++)
|
for (int i = 0; i < partType.length; i++)
|
||||||
{
|
{
|
||||||
OreDictHelper.registerOreWithAlts(InitItems.itemCopperParts, i, "partCopper" + partType[i], partType[i].toLowerCase() + "Copper");
|
OreDictHelper.registerOreWithAlts(InitItems.itemIronParts, i, "partIron", partType[i], partType[i].toLowerCase() + "Iron");
|
||||||
OreDictHelper.registerOreWithAlts(InitItems.itemIronParts, i, "partIron" + partType[i], partType[i].toLowerCase() + "Iron");
|
OreDictHelper.registerOreWithAlts(InitItems.itemSteelParts, i, "partSteel", partType[i], partType[i].toLowerCase() + "Steel");
|
||||||
OreDictHelper.registerOreWithAlts(InitItems.itemBrassParts, i, "partBrass" + partType[i], partType[i].toLowerCase() + "Brass");
|
|
||||||
OreDictHelper.registerOreWithAlts(InitItems.itemSteelParts, i, "partSteel" + partType[i], partType[i].toLowerCase() + "Steel");
|
|
||||||
|
|
||||||
OreDictHelper.registerOre("partTierOne", InitItems.itemCopperParts, i);
|
|
||||||
OreDictHelper.registerOre("partTierOne", InitItems.itemIronParts, i);
|
OreDictHelper.registerOre("partTierOne", InitItems.itemIronParts, i);
|
||||||
OreDictHelper.registerOre("partTierTwo", InitItems.itemBrassParts, i);
|
|
||||||
OreDictHelper.registerOre("partTierTwo", InitItems.itemSteelParts, i);
|
OreDictHelper.registerOre("partTierTwo", InitItems.itemSteelParts, i);
|
||||||
}
|
}
|
||||||
OreDictionary.registerOre("logWood", InitBlocks.blockRedwoodLog);
|
OreDictionary.registerOre("logWood", InitBlocks.blockRedwoodLog);
|
||||||
|
|
|
@ -0,0 +1,67 @@
|
||||||
|
package steamcraft.common.compat;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
|
import steamcraft.common.compat.chisel.ChiselCompat;
|
||||||
|
import steamcraft.common.lib.LoggerSteamcraft;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 9/2/2015.
|
||||||
|
*/
|
||||||
|
public class CompatibilityHandler
|
||||||
|
{
|
||||||
|
private static ArrayList<ModCompat> MODCOMPAT_ENABLED = new ArrayList<ModCompat>();
|
||||||
|
|
||||||
|
public static ArrayList<ModCompat> getModCompat()
|
||||||
|
{
|
||||||
|
if (MODCOMPAT_ENABLED.isEmpty())
|
||||||
|
{
|
||||||
|
MODCOMPAT_ENABLED.add(new ChiselCompat());
|
||||||
|
}
|
||||||
|
return MODCOMPAT_ENABLED;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void preInit(FMLPreInitializationEvent event)
|
||||||
|
{
|
||||||
|
for (ModCompat modCompat : getModCompat())
|
||||||
|
{
|
||||||
|
if (!modCompat.areRequirementsMet() && modCompat.getIsActive())
|
||||||
|
{
|
||||||
|
modCompat.setIsActive(false);
|
||||||
|
LoggerSteamcraft.error("Requirements are not met for " + modCompat.getName() + ". Deactivating");
|
||||||
|
}
|
||||||
|
if (modCompat.getIsActive())
|
||||||
|
{
|
||||||
|
LoggerSteamcraft.info("Loading " + modCompat.getName() + " module");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for (ModCompat modCompat : getModCompat())
|
||||||
|
{
|
||||||
|
if (modCompat.getIsActive())
|
||||||
|
modCompat.preInit(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void init(FMLInitializationEvent event)
|
||||||
|
{
|
||||||
|
for (ModCompat modCompat : getModCompat())
|
||||||
|
{
|
||||||
|
if (modCompat.getIsActive())
|
||||||
|
modCompat.init(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void postInit(FMLPostInitializationEvent event)
|
||||||
|
{
|
||||||
|
for (ModCompat modCompat : getModCompat())
|
||||||
|
{
|
||||||
|
if (modCompat.getIsActive())
|
||||||
|
modCompat.postInit(event);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -30,8 +30,6 @@ public class ForgeHooks
|
||||||
{
|
{
|
||||||
for (int i = 0; i < 10; i++)
|
for (int i = 0; i < 10; i++)
|
||||||
{
|
{
|
||||||
FishingHooks.addJunk(new WeightedRandomFishable(new ItemStack(InitItems.itemBrassParts, 1, i), 25));
|
|
||||||
FishingHooks.addJunk(new WeightedRandomFishable(new ItemStack(InitItems.itemCopperParts, 1, i), 25));
|
|
||||||
FishingHooks.addJunk(new WeightedRandomFishable(new ItemStack(InitItems.itemSteelParts, 1, i), 25));
|
FishingHooks.addJunk(new WeightedRandomFishable(new ItemStack(InitItems.itemSteelParts, 1, i), 25));
|
||||||
FishingHooks.addJunk(new WeightedRandomFishable(new ItemStack(InitItems.itemIronParts, 1, i), 25));
|
FishingHooks.addJunk(new WeightedRandomFishable(new ItemStack(InitItems.itemIronParts, 1, i), 25));
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package steamcraft.common.compat;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.event.FMLInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 9/2/2015.
|
||||||
|
*/
|
||||||
|
public abstract class ModCompat
|
||||||
|
{
|
||||||
|
boolean isActive = true;
|
||||||
|
|
||||||
|
public abstract String getName();
|
||||||
|
|
||||||
|
public boolean areRequirementsMet()
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public String dependencies()
|
||||||
|
{
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public void preInit(FMLPreInitializationEvent fmlPreInitializationEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void init(FMLInitializationEvent fmlInitializationEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void postInit(FMLPostInitializationEvent fmlPostInitializationEvent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setIsActive(Boolean isActive)
|
||||||
|
{
|
||||||
|
this.isActive = isActive;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean getIsActive()
|
||||||
|
{
|
||||||
|
return this.isActive;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,34 @@
|
||||||
|
package steamcraft.common.compat.chisel;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Loader;
|
||||||
|
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||||
|
import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
|
|
||||||
|
import steamcraft.common.compat.ModCompat;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 9/2/2015.
|
||||||
|
*/
|
||||||
|
public class ChiselCompat extends ModCompat
|
||||||
|
{
|
||||||
|
public ItemSteamChisel itemSteamChisel;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getName()
|
||||||
|
{
|
||||||
|
return "Chisel";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean areRequirementsMet()
|
||||||
|
{
|
||||||
|
return Loader.isModLoaded("chisel");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void preInit(FMLPreInitializationEvent event)
|
||||||
|
{
|
||||||
|
this.itemSteamChisel = new ItemSteamChisel();
|
||||||
|
GameRegistry.registerItem(this.itemSteamChisel, this.itemSteamChisel.getUnlocalizedName());
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,126 @@
|
||||||
|
package steamcraft.common.compat.chisel;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
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.FluidStack;
|
||||||
|
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.lib.ModInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 9/2/2015.
|
||||||
|
*/
|
||||||
|
@Optional.Interface(iface = "com.cricketcraft.chisel.api.IChiselItem", modid = "chisel")
|
||||||
|
public class ItemSteamChisel extends BaseSteamItem implements IChiselItem
|
||||||
|
{
|
||||||
|
|
||||||
|
public ItemSteamChisel()
|
||||||
|
{
|
||||||
|
super(32000);
|
||||||
|
this.setCreativeTab(Steamcraft.tabSC2);
|
||||||
|
this.setUnlocalizedName("itemChiselSteam");
|
||||||
|
this.setFull3D();
|
||||||
|
this.setNoRepair();
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@Override
|
||||||
|
public void registerIcons(IIconRegister par1IconRegister)
|
||||||
|
{
|
||||||
|
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + "tools/" + this.getUnlocalizedName().substring(5));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
public void getSubItems(Item item, CreativeTabs creativeTabs, List list)
|
||||||
|
{
|
||||||
|
list.add(new ItemStack(item, 1));
|
||||||
|
if (item instanceof IFluidContainerItem)
|
||||||
|
{
|
||||||
|
ItemStack itemStack = new ItemStack(item, 1);
|
||||||
|
IFluidContainerItem iFluidContainerItem = (IFluidContainerItem) item;
|
||||||
|
iFluidContainerItem.fill(itemStack, FluidRegistry.getFluidStack("steam", iFluidContainerItem.getCapacity(itemStack)), true);
|
||||||
|
list.add(itemStack);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("all")
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean flag)
|
||||||
|
{
|
||||||
|
if ((this.getFluidAmount(stack) > 0))
|
||||||
|
{
|
||||||
|
String str = this.getFluid(stack).getFluid().getName();
|
||||||
|
int amount = this.getFluidAmount(stack);
|
||||||
|
|
||||||
|
list.add("Holding " + amount + "mB of " + str);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
list.add("Empty");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "chisel")
|
||||||
|
public boolean canOpenGui(World world, EntityPlayer player, ItemStack chisel)
|
||||||
|
{
|
||||||
|
return this.getFluidLevel(chisel) > 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "chisel")
|
||||||
|
public boolean onChisel(World world, ItemStack chisel, ICarvingVariation target)
|
||||||
|
{
|
||||||
|
return this.consumeSteamFromCanister(chisel, 100);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "chisel")
|
||||||
|
public boolean canChisel(World world, ItemStack chisel, ICarvingVariation target)
|
||||||
|
{
|
||||||
|
return this.getFluidLevel(chisel) > 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "chisel")
|
||||||
|
public boolean canChiselBlock(World world, EntityPlayer player, int x, int y, int z, Block block, int metadata)
|
||||||
|
{
|
||||||
|
ItemStack currentItem = player.getCurrentEquippedItem();
|
||||||
|
return this.getFluidLevel(currentItem) > 100;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "chisel")
|
||||||
|
public boolean hasModes(ItemStack chisel)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
private int getFluidLevel(ItemStack chisel)
|
||||||
|
{
|
||||||
|
if ((chisel != null) && (chisel.getItem() instanceof IFluidContainerItem))
|
||||||
|
{
|
||||||
|
FluidStack fluidStack = ((IFluidContainerItem) chisel.getItem()).getFluid(chisel);
|
||||||
|
return fluidStack != null ? fluidStack.amount : 0;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
|
@ -86,6 +86,7 @@ import steamcraft.common.blocks.machines.BlockCopperPipe;
|
||||||
import steamcraft.common.blocks.machines.BlockCopperTank;
|
import steamcraft.common.blocks.machines.BlockCopperTank;
|
||||||
import steamcraft.common.blocks.machines.BlockCopperWire;
|
import steamcraft.common.blocks.machines.BlockCopperWire;
|
||||||
import steamcraft.common.blocks.machines.BlockDropHammerAnvil;
|
import steamcraft.common.blocks.machines.BlockDropHammerAnvil;
|
||||||
|
import steamcraft.common.blocks.machines.BlockInjector;
|
||||||
import steamcraft.common.blocks.machines.BlockIntake;
|
import steamcraft.common.blocks.machines.BlockIntake;
|
||||||
import steamcraft.common.blocks.machines.BlockLightningRod;
|
import steamcraft.common.blocks.machines.BlockLightningRod;
|
||||||
import steamcraft.common.blocks.machines.BlockLiquidBoiler;
|
import steamcraft.common.blocks.machines.BlockLiquidBoiler;
|
||||||
|
@ -103,6 +104,7 @@ import steamcraft.common.tiles.TileArmorEditor;
|
||||||
import steamcraft.common.tiles.TileBloomery;
|
import steamcraft.common.tiles.TileBloomery;
|
||||||
import steamcraft.common.tiles.TileCopperPipe;
|
import steamcraft.common.tiles.TileCopperPipe;
|
||||||
import steamcraft.common.tiles.TileCopperTank;
|
import steamcraft.common.tiles.TileCopperTank;
|
||||||
|
import steamcraft.common.tiles.TileInjector;
|
||||||
import steamcraft.common.tiles.TileIntake;
|
import steamcraft.common.tiles.TileIntake;
|
||||||
import steamcraft.common.tiles.TileLiquidBoiler;
|
import steamcraft.common.tiles.TileLiquidBoiler;
|
||||||
import steamcraft.common.tiles.TileNuclearBoiler;
|
import steamcraft.common.tiles.TileNuclearBoiler;
|
||||||
|
@ -213,6 +215,8 @@ public class InitBlocks
|
||||||
public static Block blockTeaPlant, blockHatch;
|
public static Block blockTeaPlant, blockHatch;
|
||||||
public static Block blockTimeBomb;
|
public static Block blockTimeBomb;
|
||||||
|
|
||||||
|
public static Block blockInjector;
|
||||||
|
|
||||||
public static Block blockTintedRock;
|
public static Block blockTintedRock;
|
||||||
|
|
||||||
public static Block blockTrunk;
|
public static Block blockTrunk;
|
||||||
|
@ -322,6 +326,9 @@ public class InitBlocks
|
||||||
blockIntake = new BlockIntake().setBlockName("blockIntake");
|
blockIntake = new BlockIntake().setBlockName("blockIntake");
|
||||||
RegistryHelper.registerContainerBlockWithDesc(blockIntake, TileIntake.class, "BlockIntake");
|
RegistryHelper.registerContainerBlockWithDesc(blockIntake, TileIntake.class, "BlockIntake");
|
||||||
|
|
||||||
|
blockInjector = new BlockInjector().setBlockName("blockInjector");
|
||||||
|
RegistryHelper.registerContainerBlockWithDesc(blockInjector, TileInjector.class, "BlockInjector");
|
||||||
|
|
||||||
// Energy related
|
// Energy related
|
||||||
blockTurbine = new BlockTurbine().setBlockName("blockTurbine");
|
blockTurbine = new BlockTurbine().setBlockName("blockTurbine");
|
||||||
blockBattery = new BlockBattery().setBlockName("blockBattery");
|
blockBattery = new BlockBattery().setBlockName("blockBattery");
|
||||||
|
|
|
@ -23,7 +23,9 @@ import cpw.mods.fml.common.registry.GameRegistry;
|
||||||
import net.minecraftforge.common.MinecraftForge;
|
import net.minecraftforge.common.MinecraftForge;
|
||||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
import net.minecraftforge.fluids.FluidRegistry;
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
import boilerplate.common.utils.handlers.BucketHandler;
|
||||||
import boilerplate.common.utils.helpers.RegistryHelper;
|
import boilerplate.common.utils.helpers.RegistryHelper;
|
||||||
import steamcraft.common.Steamcraft;
|
import steamcraft.common.Steamcraft;
|
||||||
import steamcraft.common.items.BaseItem;
|
import steamcraft.common.items.BaseItem;
|
||||||
|
@ -101,7 +103,6 @@ import steamcraft.common.items.tools.steam.ItemSteamPickaxe;
|
||||||
import steamcraft.common.items.tools.steam.ItemSteamShovel;
|
import steamcraft.common.items.tools.steam.ItemSteamShovel;
|
||||||
import steamcraft.common.items.tools.steam.ItemSteamSword;
|
import steamcraft.common.items.tools.steam.ItemSteamSword;
|
||||||
import steamcraft.common.items.vanity.ItemTopHat;
|
import steamcraft.common.items.vanity.ItemTopHat;
|
||||||
import steamcraft.common.lib.BucketHandler;
|
|
||||||
import steamcraft.common.lib.ModInfo;
|
import steamcraft.common.lib.ModInfo;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -145,7 +146,7 @@ public class InitItems
|
||||||
|
|
||||||
public static Item itemColdKettle, itemHotKettle, itemEmptyKettle, itemTeapot;
|
public static Item itemColdKettle, itemHotKettle, itemEmptyKettle, itemTeapot;
|
||||||
|
|
||||||
public static Item itemCopperParts, itemBrassParts, itemSteelParts, itemIronParts;
|
public static Item itemIronParts, itemSteelParts;
|
||||||
|
|
||||||
public static Item itemCraftingChip;
|
public static Item itemCraftingChip;
|
||||||
|
|
||||||
|
@ -320,16 +321,12 @@ public class InitItems
|
||||||
|
|
||||||
itemMachinePart = new ItemMachinePart().setUnlocalizedName("itemMachinePart");
|
itemMachinePart = new ItemMachinePart().setUnlocalizedName("itemMachinePart");
|
||||||
itemGunPart = new ItemGunPart().setUnlocalizedName("itemGunPart");
|
itemGunPart = new ItemGunPart().setUnlocalizedName("itemGunPart");
|
||||||
itemCopperParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsCopper")).setMaterial("Copper");
|
|
||||||
itemIronParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsIron")).setMaterial("Iron");
|
itemIronParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsIron")).setMaterial("Iron");
|
||||||
itemBrassParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsBrass")).setMaterial("Brass");
|
|
||||||
itemSteelParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsSteel")).setMaterial("Steel");
|
itemSteelParts = ((ItemParts) new ItemParts().setUnlocalizedName("itemPartsSteel")).setMaterial("Steel");
|
||||||
|
|
||||||
registerItem(itemMachinePart, "ItemMachinePart");
|
registerItem(itemMachinePart, "ItemMachinePart");
|
||||||
registerItem(itemGunPart, "ItemGunPart");
|
registerItem(itemGunPart, "ItemGunPart");
|
||||||
registerItem(itemCopperParts, "ItemCopperParts");
|
|
||||||
registerItem(itemIronParts, "ItemIronParts");
|
registerItem(itemIronParts, "ItemIronParts");
|
||||||
registerItem(itemBrassParts, "ItemBrassParts");
|
|
||||||
registerItem(itemSteelParts, "ItemSteelParts");
|
registerItem(itemSteelParts, "ItemSteelParts");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -348,9 +345,13 @@ public class InitItems
|
||||||
// Containers
|
// Containers
|
||||||
itemCanisterSteam = new ItemCanister(10000, 20).setUnlocalizedName("itemCanisterSteam");
|
itemCanisterSteam = new ItemCanister(10000, 20).setUnlocalizedName("itemCanisterSteam");
|
||||||
registerItem(itemCanisterSteam, "ItemCanisterSteam");
|
registerItem(itemCanisterSteam, "ItemCanisterSteam");
|
||||||
|
FluidContainerRegistry.registerFluidContainer(new FluidStack(FluidRegistry.getFluid("steam"), 10000),
|
||||||
|
((ItemCanister) itemCanisterSteam).getFilledCanister(), new ItemStack(itemCanisterSteam));
|
||||||
|
|
||||||
itemReinforcedCanisterSteam = new ItemCanister(20000, 40).setUnlocalizedName("itemReinforcedCanisterSteam");
|
itemReinforcedCanisterSteam = new ItemCanister(20000, 40).setUnlocalizedName("itemReinforcedCanisterSteam");
|
||||||
registerItem(itemReinforcedCanisterSteam, "ItemReinforcedCanisterSteam");
|
registerItem(itemReinforcedCanisterSteam, "ItemReinforcedCanisterSteam");
|
||||||
|
FluidContainerRegistry.registerFluidContainer(new FluidStack(FluidRegistry.getFluid("steam"), 20000),
|
||||||
|
((ItemCanister) itemReinforcedCanisterSteam).getFilledCanister(), new ItemStack(itemReinforcedCanisterSteam));
|
||||||
|
|
||||||
itemElectricJarSmall = new ElectricItem(80, 80, 40).setUnlocalizedName("itemElectricJarSmall");
|
itemElectricJarSmall = new ElectricItem(80, 80, 40).setUnlocalizedName("itemElectricJarSmall");
|
||||||
itemElectricJarMedium = new ElectricItem(400, 400, 125).setUnlocalizedName("itemElectricJarMedium");
|
itemElectricJarMedium = new ElectricItem(400, 400, 125).setUnlocalizedName("itemElectricJarMedium");
|
||||||
|
@ -510,10 +511,10 @@ public class InitItems
|
||||||
new ItemStack(itemBoilingMudBucket), new ItemStack(Items.bucket));
|
new ItemStack(itemBoilingMudBucket), new ItemStack(Items.bucket));
|
||||||
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("whaleoil", FluidContainerRegistry.BUCKET_VOLUME),
|
FluidContainerRegistry.registerFluidContainer(FluidRegistry.getFluidStack("whaleoil", FluidContainerRegistry.BUCKET_VOLUME),
|
||||||
new ItemStack(itemWhaleOilBucket), new ItemStack(Items.bucket));
|
new ItemStack(itemWhaleOilBucket), new ItemStack(Items.bucket));
|
||||||
BucketHandler.INSTANCE.buckets.put(InitBlocks.blockBoilingWater, itemBoilingWaterBucket);
|
BucketHandler.getInstance().bucketMap.put(InitBlocks.blockBoilingWater, itemBoilingWaterBucket);
|
||||||
BucketHandler.INSTANCE.buckets.put(InitBlocks.blockBoilingMud, itemBoilingMudBucket);
|
BucketHandler.getInstance().bucketMap.put(InitBlocks.blockBoilingMud, itemBoilingMudBucket);
|
||||||
BucketHandler.INSTANCE.buckets.put(InitBlocks.blockWhaleOil, itemWhaleOilBucket);
|
BucketHandler.getInstance().bucketMap.put(InitBlocks.blockWhaleOil, itemWhaleOilBucket);
|
||||||
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
|
MinecraftForge.EVENT_BUS.register(BucketHandler.getInstance());
|
||||||
|
|
||||||
itemWhalebone = new BaseItem().setUnlocalizedName("itemWhalebone");
|
itemWhalebone = new BaseItem().setUnlocalizedName("itemWhalebone");
|
||||||
registerItem(itemWhalebone, "ItemWhalebone");
|
registerItem(itemWhalebone, "ItemWhalebone");
|
||||||
|
|
|
@ -393,18 +393,14 @@ public class InitRecipes
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSteelParts, 1, 1), " P ", "P P", " P ", 'P', "plateSteel"));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemSteelParts, 1, 1), " P ", "P P", " P ", 'P', "plateSteel"));
|
||||||
GameRegistry.addRecipe(
|
GameRegistry.addRecipe(
|
||||||
new ShapedOreRecipe(new ItemStack(InitItems.itemSteelParts, 1, 2), "PPP", " I ", "PPP", 'P', "plateSteel", 'I', "ingotSteel"));
|
new ShapedOreRecipe(new ItemStack(InitItems.itemSteelParts, 1, 2), "PPP", " I ", "PPP", 'P', "plateSteel", 'I', "ingotSteel"));
|
||||||
GameRegistry.addRecipe(
|
|
||||||
new ShapedOreRecipe(new ItemStack(InitItems.itemCopperParts, 1, 0), " P ", "PIP", " P ", 'P', "plateCopper", 'I', "ingotCopper"));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemCopperParts, 1, 1), " P ", "P P", " P ", 'P', "plateCopper"));
|
|
||||||
GameRegistry.addRecipe(
|
GameRegistry.addRecipe(
|
||||||
new ShapedOreRecipe(new ItemStack(InitItems.itemIronParts, 1, 0), " P ", "PIP", " P ", 'I', "ingotIron", 'P', "plateIron"));
|
new ShapedOreRecipe(new ItemStack(InitItems.itemIronParts, 1, 0), " P ", "PIP", " P ", 'I', "ingotIron", 'P', "plateIron"));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemIronParts, 1, 1), " P ", "P P", " P ", 'P', "plateIron"));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemIronParts, 1, 1), " P ", "P P", " P ", 'P', "plateIron"));
|
||||||
|
|
||||||
GameRegistry.addRecipe(
|
GameRegistry.addRecipe(
|
||||||
new ShapedOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 0), " X ", "X ", 'X', new ItemStack(InitItems.itemIngot, 1, 7)));
|
new ShapedOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 0), " X ", "X ", 'X', new ItemStack(InitItems.itemIngot, 1, 7)));
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 1), "CPC", "S G", "CPC", 'P',
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 1), "CPC", "G G", "CPC", 'P',
|
||||||
new ItemStack(InitItems.itemSheet, 1, 4), 'G', "gearIron", 'S', new ItemStack(InitItems.itemCopperParts, 1, 1), 'C',
|
new ItemStack(InitItems.itemSheet, 1, 4), 'G', "gearIron", 'C', new ItemStack(InitItems.itemMachinePart, 1, 0)));
|
||||||
new ItemStack(InitItems.itemMachinePart, 1, 0)));
|
|
||||||
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 2), "P P", " P ", "P P", 'P', "plateIron"));
|
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 2), "P P", " P ", "P P", 'P', "plateIron"));
|
||||||
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 3), new ItemStack(Items.water_bucket), "ingotIron",
|
GameRegistry.addRecipe(new ShapelessOreRecipe(new ItemStack(InitItems.itemMachinePart, 1, 3), new ItemStack(Items.water_bucket), "ingotIron",
|
||||||
"ingotCopper", "ingotZinc"));
|
"ingotCopper", "ingotZinc"));
|
||||||
|
|
|
@ -14,14 +14,17 @@ package steamcraft.common.items;
|
||||||
|
|
||||||
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.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.item.EntityMinecart;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
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.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
import steamcraft.api.item.UniversalWrench;
|
import steamcraft.api.item.IUniversalWrench;
|
||||||
import steamcraft.common.Steamcraft;
|
import steamcraft.common.Steamcraft;
|
||||||
import steamcraft.common.init.InitBlocks;
|
import steamcraft.common.init.InitBlocks;
|
||||||
import steamcraft.common.lib.ModInfo;
|
import steamcraft.common.lib.ModInfo;
|
||||||
|
@ -32,7 +35,7 @@ import steamcraft.common.tiles.energy.TileCopperWire;
|
||||||
* @author warlordjones
|
* @author warlordjones
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class ItemSpanner extends UniversalWrench
|
public class ItemSpanner extends BaseItem implements IUniversalWrench
|
||||||
{
|
{
|
||||||
public ItemSpanner()
|
public ItemSpanner()
|
||||||
{
|
{
|
||||||
|
@ -71,4 +74,75 @@ public class ItemSpanner extends UniversalWrench
|
||||||
{
|
{
|
||||||
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + this.getUnlocalizedName().substring(5));
|
this.itemIcon = par1IconRegister.registerIcon(ModInfo.PREFIX + this.getUnlocalizedName().substring(5));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "BuildCraft|Core")
|
||||||
|
public boolean canWrench(EntityPlayer player, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "BuildCraft|Core")
|
||||||
|
public void wrenchUsed(EntityPlayer player, int x, int y, int z)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isUsable(ItemStack item, EntityLivingBase user, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void toolUsed(ItemStack item, EntityLivingBase user, int x, int y, int z)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "Railcraft")
|
||||||
|
public boolean canWhack(EntityPlayer player, ItemStack crowbar, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "Railcraft")
|
||||||
|
public void onWhack(EntityPlayer player, ItemStack crowbar, int x, int y, int z)
|
||||||
|
{
|
||||||
|
crowbar.damageItem(2, player);
|
||||||
|
player.swingItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "Railcraft")
|
||||||
|
public boolean canLink(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
||||||
|
{
|
||||||
|
return player.isSneaking();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "Railcraft")
|
||||||
|
public void onLink(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
||||||
|
{
|
||||||
|
crowbar.damageItem(2, player);
|
||||||
|
player.swingItem();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "Railcraft")
|
||||||
|
public boolean canBoost(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
||||||
|
{
|
||||||
|
return !this.canLink(player, crowbar, cart);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "Railcraft")
|
||||||
|
public void onBoost(EntityPlayer player, ItemStack crowbar, EntityMinecart cart)
|
||||||
|
{
|
||||||
|
crowbar.damageItem(2, player);
|
||||||
|
player.swingItem();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,9 +12,12 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.items.armor;
|
package steamcraft.common.items.armor;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.client.gui.ScaledResolution;
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemArmor;
|
import net.minecraft.item.ItemArmor;
|
||||||
|
@ -33,6 +36,8 @@ import boilerplate.common.baseclasses.items.BaseArmor;
|
||||||
import steamcraft.api.item.IArmorModule;
|
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.IDefensiveArmorModule;
|
||||||
|
import steamcraft.api.item.IModule;
|
||||||
|
import steamcraft.api.item.IModuleContainer;
|
||||||
import steamcraft.api.item.ModuleRegistry;
|
import steamcraft.api.item.ModuleRegistry;
|
||||||
import steamcraft.common.Steamcraft;
|
import steamcraft.common.Steamcraft;
|
||||||
import steamcraft.common.init.InitItems;
|
import steamcraft.common.init.InitItems;
|
||||||
|
@ -46,7 +51,7 @@ import thaumcraft.api.nodes.IRevealer;
|
||||||
*/
|
*/
|
||||||
@Optional.InterfaceList({ @Optional.Interface(iface = "thaumcraft.api.IGoggles", modid = "Thaumcraft"),
|
@Optional.InterfaceList({ @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
|
public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles, IRevealer, IModuleContainer
|
||||||
{
|
{
|
||||||
|
|
||||||
public ItemBrassArmor(ItemArmor.ArmorMaterial armorMat, int renderIndex, int armorType)
|
public ItemBrassArmor(ItemArmor.ArmorMaterial armorMat, int renderIndex, int armorType)
|
||||||
|
@ -172,6 +177,14 @@ public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public String getArmorTexture(ItemStack is, Entity entity, int slot, String type)
|
||||||
|
{
|
||||||
|
return slot == 2 ? ModInfo.PREFIX + "textures/models/armor/" + "brass" + "_2.png"
|
||||||
|
: ModInfo.PREFIX + "textures/models/armor/" + "brass" + "_1.png";
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
|
public void damageArmor(EntityLivingBase entity, ItemStack stack, DamageSource source, int damage, int slot)
|
||||||
{
|
{
|
||||||
|
@ -212,4 +225,32 @@ public class ItemBrassArmor extends BaseArmor implements ISpecialArmor, IGoggles
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isModuleAllowed(IModule iModule, ItemStack itemStack)
|
||||||
|
{
|
||||||
|
boolean allowed = false;
|
||||||
|
if (itemStack.getItem() instanceof ItemBrassArmor)
|
||||||
|
{
|
||||||
|
ItemBrassArmor brassArmor = (ItemBrassArmor) itemStack.getItem();
|
||||||
|
if (iModule instanceof IArmorModule)
|
||||||
|
{
|
||||||
|
IArmorModule iArmorModule = (IArmorModule) iModule;
|
||||||
|
if ((iArmorModule.getApplicablePiece() == -1) || (iArmorModule.getApplicablePiece() == brassArmor.armorType))
|
||||||
|
{
|
||||||
|
ArrayList<IModule> moduleIncompatibilities = ModuleRegistry.getModuleIncompatibilities(iModule.getModuleId());
|
||||||
|
if ((moduleIncompatibilities == null)
|
||||||
|
|| Collections.disjoint(IModuleContainer.Helper.getAllModulesEquipped(itemStack), moduleIncompatibilities))
|
||||||
|
{
|
||||||
|
if (!IModuleContainer.Helper.getAllModulesEquipped(itemStack).contains(iModule))
|
||||||
|
{
|
||||||
|
allowed = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return allowed;
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -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);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,59 +0,0 @@
|
||||||
package steamcraft.common.lib;
|
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.item.Item;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
|
||||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
|
||||||
|
|
||||||
import net.minecraftforge.event.entity.player.FillBucketEvent;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* From Buildcraft :D
|
|
||||||
*/
|
|
||||||
public final class BucketHandler
|
|
||||||
{
|
|
||||||
public static BucketHandler INSTANCE = new BucketHandler();
|
|
||||||
public Map<Block, Item> buckets = new HashMap<Block, Item>();
|
|
||||||
|
|
||||||
public BucketHandler()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@SubscribeEvent
|
|
||||||
public void onBucketFill(FillBucketEvent event)
|
|
||||||
{
|
|
||||||
ItemStack result = this.fillCustomBucket(event.world, event.target);
|
|
||||||
|
|
||||||
if (result == null)
|
|
||||||
{
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
event.result = result;
|
|
||||||
event.setResult(Result.ALLOW);
|
|
||||||
}
|
|
||||||
|
|
||||||
private ItemStack fillCustomBucket(World world, MovingObjectPosition pos)
|
|
||||||
{
|
|
||||||
Block block = world.getBlock(pos.blockX, pos.blockY, pos.blockZ);
|
|
||||||
|
|
||||||
Item bucket = this.buckets.get(block);
|
|
||||||
|
|
||||||
if ((bucket != null) && (world.getBlockMetadata(pos.blockX, pos.blockY, pos.blockZ) == 0))
|
|
||||||
{
|
|
||||||
world.setBlockToAir(pos.blockX, pos.blockY, pos.blockZ);
|
|
||||||
return new ItemStack(bucket);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -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) {
|
||||||
|
|
|
@ -13,33 +13,34 @@
|
||||||
package steamcraft.common.tiles;
|
package steamcraft.common.tiles;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Collections;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
|
||||||
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.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
import boilerplate.api.IOpenableGUI;
|
import boilerplate.api.IOpenableGUI;
|
||||||
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
||||||
|
import boilerplate.common.tiles.IOnSlotChanged;
|
||||||
import steamcraft.api.item.IArmorModule;
|
import steamcraft.api.item.IArmorModule;
|
||||||
import steamcraft.api.item.ModuleRegistry;
|
import steamcraft.api.item.IModule;
|
||||||
|
import steamcraft.api.item.IModuleContainer;
|
||||||
import steamcraft.client.gui.GuiArmorEditor;
|
import steamcraft.client.gui.GuiArmorEditor;
|
||||||
import steamcraft.common.items.armor.ItemBrassArmor;
|
|
||||||
import steamcraft.common.tiles.container.ContainerArmorEditor;
|
import steamcraft.common.tiles.container.ContainerArmorEditor;
|
||||||
|
import steamcraft.common.tiles.container.slot.SlotModuleContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author warlordjones
|
* @author warlordjones
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class TileArmorEditor extends BaseTileWithInventory implements IInventory, IOpenableGUI
|
public class TileArmorEditor extends BaseTileWithInventory implements IInventory, IOpenableGUI, IOnSlotChanged
|
||||||
{
|
{
|
||||||
public TileArmorEditor()
|
public TileArmorEditor()
|
||||||
{
|
{
|
||||||
super(3);
|
super(17);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -61,88 +62,47 @@ public class TileArmorEditor extends BaseTileWithInventory implements IInventory
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void updateEntity()
|
public void onSlotChanged(Slot slot)
|
||||||
{
|
{
|
||||||
ArrayList<String> installedModules = new ArrayList<String>();
|
if (slot instanceof SlotModuleContainer)
|
||||||
|
|
||||||
if (this.worldObj.isRemote)
|
|
||||||
return;
|
|
||||||
// Addition
|
|
||||||
if ((this.inventory[0] != null) && (this.inventory[0].getItem() instanceof ItemBrassArmor) && (this.inventory[2] != null))
|
|
||||||
{
|
{
|
||||||
NBTTagCompound tagCompound = ItemBrassArmor.getOrCreateTagCompound(this.inventory[0]);
|
ItemStack slotItemStack = this.getStackInSlot(slot.getSlotIndex());
|
||||||
Item armor = this.inventory[0].getItem();
|
if (slotItemStack == null)
|
||||||
ItemBrassArmor brassarmor = (ItemBrassArmor) armor;
|
|
||||||
|
|
||||||
for (int f = 0; f < tagCompound.getInteger("moduleCount"); f++)
|
|
||||||
{
|
{
|
||||||
installedModules.add(tagCompound.getString("module" + f));
|
for (int slotNumber = 1; slotNumber < this.getSizeInventory(); slotNumber++)
|
||||||
tagCompound.removeTag("module" + f);
|
|
||||||
}
|
|
||||||
if ((this.inventory[2] != null) && (this.inventory[2].getItem() instanceof IArmorModule))
|
|
||||||
{
|
|
||||||
IArmorModule module = (IArmorModule) this.inventory[2].getItem();
|
|
||||||
ArrayList moduleIncompatibilities = ModuleRegistry.getModuleIncompatibilities(module.getModuleId());
|
|
||||||
if (!installedModules.contains(module.getModuleId()))
|
|
||||||
{
|
{
|
||||||
if (moduleIncompatibilities == null)
|
this.setInventorySlotContents(slotNumber, null);
|
||||||
{
|
|
||||||
if (module.getApplicablePiece() == -1)
|
|
||||||
{
|
|
||||||
this.installModule(installedModules, module);
|
|
||||||
}
|
|
||||||
else if (module.getApplicablePiece() == brassarmor.armorType)
|
|
||||||
{
|
|
||||||
this.installModule(installedModules, module);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else if (Collections.disjoint(installedModules, moduleIncompatibilities))
|
|
||||||
{
|
|
||||||
if (module.getApplicablePiece() == -1)
|
|
||||||
{
|
|
||||||
this.installModule(installedModules, module);
|
|
||||||
}
|
|
||||||
else if (module.getApplicablePiece() == brassarmor.armorType)
|
|
||||||
{
|
|
||||||
this.installModule(installedModules, module);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterator<String> iterator = installedModules.iterator();
|
else if (slotItemStack.getItem() instanceof IModuleContainer)
|
||||||
int objects = 0;
|
|
||||||
while (iterator.hasNext())
|
|
||||||
{
|
{
|
||||||
tagCompound.setString("module" + objects, iterator.next());
|
ArrayList<IModule> iModules = IModuleContainer.Helper.getAllModulesEquipped(slotItemStack);
|
||||||
objects++;
|
Iterator<IModule> iModuleIterator = iModules.iterator();
|
||||||
|
int slotNumber = 1;
|
||||||
|
while (iModuleIterator.hasNext())
|
||||||
|
{
|
||||||
|
this.setInventorySlotContents(slotNumber, new ItemStack((Item) iModuleIterator.next()));
|
||||||
|
slotNumber++;
|
||||||
|
iModuleIterator.remove();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
tagCompound.setInteger("moduleCount", objects);
|
|
||||||
}
|
}
|
||||||
// Removal
|
else
|
||||||
if ((this.inventory[1] != null) && (this.inventory[1].getItem() instanceof ItemBrassArmor))
|
|
||||||
{
|
{
|
||||||
NBTTagCompound tagCompound = ItemBrassArmor.getOrCreateTagCompound(this.inventory[1]);
|
ItemStack slotItemStack;
|
||||||
for (int f = 0; f < tagCompound.getInteger("moduleCount"); f++)
|
ArrayList<IModule> iModules = new ArrayList<IModule>();
|
||||||
|
for (int slotNumber = 1; slotNumber < this.getSizeInventory(); slotNumber++)
|
||||||
{
|
{
|
||||||
installedModules.add(tagCompound.getString("module" + f));
|
slotItemStack = this.getStackInSlot(slotNumber);
|
||||||
tagCompound.removeTag("module" + f);
|
if ((slotItemStack != null) && (slotItemStack.getItem() instanceof IModule))
|
||||||
}
|
|
||||||
for (int i = 0; i < installedModules.size(); i++)
|
|
||||||
{
|
|
||||||
Item module = (Item) ModuleRegistry.getModule(installedModules.get(i));
|
|
||||||
if ((this.inventory[2] == null) && (module != null))
|
|
||||||
{
|
{
|
||||||
this.removeModule(installedModules, (IArmorModule) module, i);
|
iModules.add((IModule) slotItemStack.getItem());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Iterator<String> iterator = installedModules.iterator();
|
if (this.getStackInSlot(0) != null)
|
||||||
int objects = 0;
|
|
||||||
while (iterator.hasNext())
|
|
||||||
{
|
{
|
||||||
tagCompound.setString("module" + objects, iterator.next());
|
IModuleContainer.Helper.setModulesEquipped(iModules, this.getStackInSlot(0));
|
||||||
objects++;
|
|
||||||
}
|
}
|
||||||
tagCompound.setInteger("moduleCount", objects);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -24,8 +24,10 @@ import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTank;
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
import net.minecraftforge.fluids.IFluidHandler;
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
||||||
|
import boilerplate.common.utils.FluidUtils;
|
||||||
import steamcraft.common.blocks.machines.BlockBaseBoiler;
|
import steamcraft.common.blocks.machines.BlockBaseBoiler;
|
||||||
import steamcraft.common.items.ItemCanister;
|
import steamcraft.common.items.ItemCanister;
|
||||||
|
|
||||||
|
@ -47,7 +49,7 @@ public abstract class TileBaseBoiler extends BaseTileWithInventory implements IF
|
||||||
|
|
||||||
public TileBaseBoiler()
|
public TileBaseBoiler()
|
||||||
{
|
{
|
||||||
super(3);
|
super(4);
|
||||||
|
|
||||||
this.waterTank = new FluidTank(new FluidStack(FluidRegistry.WATER, 0), 5000);
|
this.waterTank = new FluidTank(new FluidStack(FluidRegistry.WATER, 0), 5000);
|
||||||
this.steamTank = new FluidTank(new FluidStack(FluidRegistry.getFluid("steam"), 0), 10000);
|
this.steamTank = new FluidTank(new FluidStack(FluidRegistry.getFluid("steam"), 0), 10000);
|
||||||
|
@ -102,31 +104,44 @@ 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) && (this.waterTank.fill(new FluidStack(FluidRegistry.getFluid("water"), liquid.amount), false) == liquid.amount))
|
if ((liquid != null) && (liquid.getFluid() == FluidRegistry.WATER))
|
||||||
if (liquid.getFluid() == FluidRegistry.WATER)
|
|
||||||
{
|
|
||||||
this.waterTank.fill(new FluidStack(FluidRegistry.getFluid("water"), liquid.amount), true);
|
|
||||||
|
|
||||||
if (this.inventory[1].stackSize > 1)
|
|
||||||
this.inventory[1].stackSize--;
|
|
||||||
else
|
|
||||||
this.inventory[1] = this.inventory[1].getItem().getContainerItem(this.inventory[1]);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ((this.inventory[2] != null) && (this.inventory[2].getItem() instanceof ItemCanister))
|
|
||||||
{
|
|
||||||
ItemCanister canister = (ItemCanister) this.inventory[2].getItem();
|
|
||||||
if ((this.steamTank.getFluidAmount() >= steamPerTick) && (canister.getFluidAmount(this.inventory[2]) != canister.maxSteam))
|
|
||||||
{
|
{
|
||||||
canister.fill(this.inventory[2], new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), true);
|
ItemStack emptyContainer = FluidUtils.drainFluidContainer(this.waterTank, this.inventory[1]);
|
||||||
this.steamTank.drain(steamPerTick, true);
|
if ((this.inventory[2] != null) && OreDictionary.itemMatches(this.inventory[2], emptyContainer, true))
|
||||||
|
this.inventory[2].stackSize += emptyContainer.stackSize;
|
||||||
|
else if (this.inventory[2] == null)
|
||||||
|
this.inventory[2] = emptyContainer.copy();
|
||||||
|
this.decrStackSize(1, emptyContainer.stackSize);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if ((this.inventory[3] != null))
|
||||||
|
{
|
||||||
|
if ((this.inventory[3].getItem() instanceof ItemCanister))
|
||||||
|
{
|
||||||
|
ItemCanister canister = (ItemCanister) this.inventory[3].getItem();
|
||||||
|
if ((this.steamTank.getFluidAmount() >= steamPerTick) && (canister.getFluidAmount(this.inventory[3]) != canister.maxSteam))
|
||||||
|
{
|
||||||
|
canister.fill(this.inventory[3], new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), true);
|
||||||
|
this.steamTank.drain(steamPerTick, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ItemStack filledContainer = FluidUtils.fillFluidContainer(this.steamTank, this.inventory[3]);
|
||||||
|
if (filledContainer != null)
|
||||||
|
{
|
||||||
|
if ((this.inventory[3] != null) && OreDictionary.itemMatches(this.inventory[3], filledContainer, true))
|
||||||
|
this.inventory[3].stackSize += filledContainer.stackSize;
|
||||||
|
else if (this.inventory[3] == null)
|
||||||
|
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]);
|
||||||
|
|
|
@ -0,0 +1,153 @@
|
||||||
|
/**
|
||||||
|
* This class was created by BrassGoggledCoders modding team.
|
||||||
|
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is open-source and is distributed under the MMPL v1.0 License.
|
||||||
|
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is based on the original Steamcraft Mod created by Proloe.
|
||||||
|
* Steamcraft (c) Proloe 2011
|
||||||
|
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package steamcraft.common.tiles;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
import net.minecraftforge.fluids.Fluid;
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
|
import net.minecraftforge.fluids.IFluidHandler;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
|
import boilerplate.api.IOpenableGUI;
|
||||||
|
import boilerplate.common.baseclasses.BaseTileWithInventory;
|
||||||
|
import boilerplate.common.utils.FluidUtils;
|
||||||
|
import steamcraft.client.gui.GuiInjector;
|
||||||
|
import steamcraft.common.tiles.container.ContainerInjector;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Decebaldecebal
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class TileInjector extends BaseTileWithInventory implements IOpenableGUI, IFluidHandler
|
||||||
|
{
|
||||||
|
|
||||||
|
public FluidTank buffer;
|
||||||
|
|
||||||
|
public TileInjector()
|
||||||
|
{
|
||||||
|
super(2);
|
||||||
|
this.buffer = new FluidTank(10000);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
super.readFromNBT(tag);
|
||||||
|
this.buffer.readFromNBT(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound tag)
|
||||||
|
{
|
||||||
|
super.writeToNBT(tag);
|
||||||
|
this.buffer.writeToNBT(tag);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity()
|
||||||
|
{
|
||||||
|
super.updateEntity();
|
||||||
|
|
||||||
|
if (!this.worldObj.isRemote)
|
||||||
|
{
|
||||||
|
if (this.inventory[0] != null)
|
||||||
|
{
|
||||||
|
ItemStack stack = FluidUtils.drainFluidContainer(buffer, this.inventory[0]);
|
||||||
|
if ((this.inventory[0] != null) && OreDictionary.itemMatches(this.inventory[0], stack, true))
|
||||||
|
this.inventory[0].stackSize += stack.stackSize;
|
||||||
|
else if (this.inventory[0] == null)
|
||||||
|
this.inventory[0] = stack.copy();
|
||||||
|
this.decrStackSize(0, stack.stackSize);
|
||||||
|
}
|
||||||
|
if (this.inventory[1] != null)
|
||||||
|
{
|
||||||
|
ItemStack stack = FluidUtils.fillFluidContainer(buffer, this.inventory[1]);
|
||||||
|
if (stack != null)
|
||||||
|
{
|
||||||
|
if ((this.inventory[1] != null) && OreDictionary.itemMatches(this.inventory[1], stack, true))
|
||||||
|
this.inventory[1].stackSize += stack.stackSize;
|
||||||
|
else if (this.inventory[1] == null)
|
||||||
|
this.inventory[1] = stack.copy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInsertItem(int par1, ItemStack itemstack, int par3)
|
||||||
|
{
|
||||||
|
return FluidContainerRegistry.isContainer(itemstack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValidForSlot(int i, ItemStack itemstack)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||||
|
{
|
||||||
|
return this.buffer.fill(resource, doFill);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidStack drain(ForgeDirection from, FluidStack resource, boolean doDrain)
|
||||||
|
{
|
||||||
|
return this.buffer.drain(resource.amount, doDrain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
||||||
|
{
|
||||||
|
return this.buffer.drain(maxDrain, doDrain);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canFill(ForgeDirection from, Fluid fluid)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canDrain(ForgeDirection from, Fluid fluid)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public FluidTankInfo[] getTankInfo(ForgeDirection from)
|
||||||
|
{
|
||||||
|
return new FluidTankInfo[] { this.buffer.getInfo() };
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return new GuiInjector(player.inventory, (TileInjector) world.getTileEntity(x, y, z));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z)
|
||||||
|
{
|
||||||
|
return new ContainerInjector(player.inventory, (TileInjector) world.getTileEntity(x, y, z));
|
||||||
|
}
|
||||||
|
}
|
|
@ -28,8 +28,11 @@ import net.minecraftforge.fluids.FluidRegistry;
|
||||||
import net.minecraftforge.fluids.FluidStack;
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
import net.minecraftforge.fluids.FluidTank;
|
import net.minecraftforge.fluids.FluidTank;
|
||||||
import net.minecraftforge.fluids.FluidTankInfo;
|
import net.minecraftforge.fluids.FluidTankInfo;
|
||||||
|
import net.minecraftforge.oredict.OreDictionary;
|
||||||
|
|
||||||
import boilerplate.api.IOpenableGUI;
|
import boilerplate.api.IOpenableGUI;
|
||||||
|
import boilerplate.common.utils.FluidUtils;
|
||||||
|
import steamcraft.api.RecipeAPI;
|
||||||
import steamcraft.client.gui.GuiLiquidBoiler;
|
import steamcraft.client.gui.GuiLiquidBoiler;
|
||||||
import steamcraft.common.blocks.machines.BlockBaseBoiler;
|
import steamcraft.common.blocks.machines.BlockBaseBoiler;
|
||||||
import steamcraft.common.items.ItemCanister;
|
import steamcraft.common.items.ItemCanister;
|
||||||
|
@ -51,16 +54,18 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
|
||||||
public FluidTank fuelTank;
|
public FluidTank fuelTank;
|
||||||
|
|
||||||
// TODO Allow things to be added to this via imc
|
// TODO Allow things to be added to this via imc
|
||||||
public HashMap<Fluid, Integer> fuels = new HashMap();
|
public HashMap<Fluid, Integer> fuels = RecipeAPI.addedFuels;
|
||||||
public int defaultFuelValue = 500;
|
public int defaultFuelValue = 500;
|
||||||
|
|
||||||
public TileLiquidBoiler()
|
public TileLiquidBoiler()
|
||||||
{
|
{
|
||||||
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);
|
this.fuels.put(FluidRegistry.getFluid("oil"), this.defaultFuelValue / 2);
|
||||||
|
this.fuels.put(FluidRegistry.getFluid("biodisel"), this.defaultFuelValue);
|
||||||
|
this.fuels.put(FluidRegistry.getFluid("fuel"), this.defaultFuelValue);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -120,10 +125,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--;
|
||||||
|
@ -132,13 +137,27 @@ public class TileLiquidBoiler extends TileBaseBoiler implements IOpenableGUI
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Steam Draining
|
// Steam Draining
|
||||||
if ((this.inventory[2] != null) && (this.inventory[2].getItem() instanceof ItemCanister))
|
if ((this.inventory[2] != null))
|
||||||
{
|
{
|
||||||
ItemCanister canister = (ItemCanister) this.inventory[2].getItem();
|
if ((this.inventory[2].getItem() instanceof ItemCanister))
|
||||||
if ((this.steamTank.getFluidAmount() >= steamPerTick) && (canister.getFluidAmount(this.inventory[2]) != canister.maxSteam))
|
|
||||||
{
|
{
|
||||||
canister.fill(this.inventory[2], new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), true);
|
ItemCanister canister = (ItemCanister) this.inventory[2].getItem();
|
||||||
this.steamTank.drain(steamPerTick, true);
|
if ((this.steamTank.getFluidAmount() >= steamPerTick) && (canister.getFluidAmount(this.inventory[2]) != canister.maxSteam))
|
||||||
|
{
|
||||||
|
canister.fill(this.inventory[2], new FluidStack(FluidRegistry.getFluid("steam"), steamPerTick), true);
|
||||||
|
this.steamTank.drain(steamPerTick, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ItemStack filledContainer = FluidUtils.fillFluidContainer(this.steamTank, this.inventory[2]);
|
||||||
|
if (filledContainer != null)
|
||||||
|
{
|
||||||
|
if ((this.inventory[2] != null) && OreDictionary.itemMatches(this.inventory[2], filledContainer, true))
|
||||||
|
this.inventory[2].stackSize += filledContainer.stackSize;
|
||||||
|
else if (this.inventory[2] == null)
|
||||||
|
this.inventory[2] = filledContainer.copy();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// Burn fuel
|
// Burn fuel
|
||||||
|
@ -179,7 +198,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
|
||||||
|
@ -249,6 +268,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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,9 @@ import net.minecraft.inventory.Slot;
|
||||||
|
|
||||||
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
||||||
import steamcraft.common.tiles.TileArmorEditor;
|
import steamcraft.common.tiles.TileArmorEditor;
|
||||||
import steamcraft.common.tiles.container.slot.SlotBrassArmor;
|
import steamcraft.common.tiles.container.slot.SlotArmor;
|
||||||
import steamcraft.common.tiles.container.slot.SlotModule;
|
import steamcraft.common.tiles.container.slot.SlotModule;
|
||||||
|
import steamcraft.common.tiles.container.slot.SlotModuleContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author warlordjones
|
* @author warlordjones
|
||||||
|
@ -32,18 +33,33 @@ public class ContainerArmorEditor extends BaseContainer
|
||||||
{
|
{
|
||||||
this.tileent = tile;
|
this.tileent = tile;
|
||||||
this.setTile(this.tileent);
|
this.setTile(this.tileent);
|
||||||
int var3;
|
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotBrassArmor(this.tileent, 0, 62, 12));
|
for (int i = 0; i < 4; ++i)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new SlotArmor(player, player.getSizeInventory() - 1 - i, 62, 8 + (i * 18), i));
|
||||||
|
}
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotBrassArmor(this.tileent, 1, 62, 48));
|
this.addSlotToContainer(new SlotModuleContainer(this.tileent, 0, 89, 26));
|
||||||
|
|
||||||
this.addSlotToContainer(new SlotModule(this.tileent, 2, 100, 30));
|
for (int i = 0; i < 4; i++)
|
||||||
|
{
|
||||||
|
for (int j = 0; j < 3; j++)
|
||||||
|
{
|
||||||
|
this.addSlotToContainer(new SlotModule(this.tileent, j + (i * 4) + 1, 116 + (j * 18), 8 + (i * 18)));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
for (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 (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));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,160 @@
|
||||||
|
/**
|
||||||
|
* This class was created by BrassGoggledCoders modding team.
|
||||||
|
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is open-source and is distributed under the MMPL v1.0 License.
|
||||||
|
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is based on the original Steamcraft Mod created by Proloe.
|
||||||
|
* Steamcraft (c) Proloe 2011
|
||||||
|
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package steamcraft.common.tiles.container;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.ICrafting;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.tileentity.TileEntityFurnace;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidRegistry;
|
||||||
|
import net.minecraftforge.fluids.FluidStack;
|
||||||
|
|
||||||
|
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
||||||
|
import steamcraft.common.items.ItemCanister;
|
||||||
|
import steamcraft.common.tiles.TileInjector;
|
||||||
|
import steamcraft.common.tiles.container.slot.SlotFluidContainer;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Decebaldecebal
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
public class ContainerInjector extends BaseContainer
|
||||||
|
{
|
||||||
|
private TileInjector tileent;
|
||||||
|
|
||||||
|
private int lastFluidLevel = 0;
|
||||||
|
|
||||||
|
public ContainerInjector(InventoryPlayer player, TileInjector tile)
|
||||||
|
{
|
||||||
|
this.tileent = tile;
|
||||||
|
this.setTile(this.tileent);
|
||||||
|
|
||||||
|
this.addSlotToContainer(new SlotFluidContainer(tile, 0, 116, 61));
|
||||||
|
this.addSlotToContainer(new SlotFluidContainer(tile, 1, 135, 61));
|
||||||
|
|
||||||
|
int var3;
|
||||||
|
|
||||||
|
for (var3 = 0; var3 < 3; ++var3)
|
||||||
|
for (int var4 = 0; var4 < 9; ++var4)
|
||||||
|
this.addSlotToContainer(new Slot(player, var4 + (var3 * 9) + 9, 8 + (var4 * 18), 84 + (var3 * 18)));
|
||||||
|
|
||||||
|
for (var3 = 0; var3 < 9; ++var3)
|
||||||
|
this.addSlotToContainer(new Slot(player, var3, 8 + (var3 * 18), 142));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addCraftingToCrafters(ICrafting par1ICrafting)
|
||||||
|
{
|
||||||
|
super.addCraftingToCrafters(par1ICrafting);
|
||||||
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.tileent.buffer.getFluidAmount());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void detectAndSendChanges()
|
||||||
|
{
|
||||||
|
super.detectAndSendChanges();
|
||||||
|
|
||||||
|
for (Object obj : this.crafters)
|
||||||
|
{
|
||||||
|
ICrafting var2 = (ICrafting) obj;
|
||||||
|
if (this.lastFluidLevel != this.tileent.buffer.getFluidAmount())
|
||||||
|
var2.sendProgressBarUpdate(this, 2, this.tileent.buffer.getFluidAmount());
|
||||||
|
}
|
||||||
|
this.lastFluidLevel = this.tileent.buffer.getFluidAmount();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void updateProgressBar(int par1, int par2)
|
||||||
|
{
|
||||||
|
if (par1 == 0)
|
||||||
|
this.tileent.buffer.getFluid().amount = par2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer par1EntityPlayer)
|
||||||
|
{
|
||||||
|
return this.tileent.isUseableByPlayer(par1EntityPlayer);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer par1EntityPlayer, int par2)
|
||||||
|
{
|
||||||
|
ItemStack var3 = null;
|
||||||
|
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||||
|
|
||||||
|
if ((var4 != null) && var4.getHasStack())
|
||||||
|
{
|
||||||
|
ItemStack var5 = var4.getStack();
|
||||||
|
var3 = var5.copy();
|
||||||
|
|
||||||
|
if (par2 > 2)
|
||||||
|
{
|
||||||
|
FluidStack liquid = FluidContainerRegistry.getFluidForFilledItem(var5);
|
||||||
|
|
||||||
|
if ((liquid != null) && (liquid.getFluid() == FluidRegistry.WATER))
|
||||||
|
{
|
||||||
|
if (!this.mergeItemStack(var5, 1, 2, false))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else if (TileEntityFurnace.getItemBurnTime(var5) > 0)
|
||||||
|
{
|
||||||
|
if (!this.mergeItemStack(var5, 0, 1, false))
|
||||||
|
if ((par2 >= 3) && (par2 < 30))
|
||||||
|
{
|
||||||
|
if (!this.mergeItemStack(var5, 30, 39, false))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else if ((par2 >= 30) && (par2 < 39) && !this.mergeItemStack(var5, 3, 30, false))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else if (var5.getItem() instanceof ItemCanister)
|
||||||
|
{
|
||||||
|
if (!this.mergeItemStack(var5, 2, 3, false))
|
||||||
|
if ((par2 >= 3) && (par2 < 30))
|
||||||
|
{
|
||||||
|
if (!this.mergeItemStack(var5, 30, 39, false))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else if ((par2 >= 30) && (par2 < 39) && !this.mergeItemStack(var5, 3, 30, false))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else if ((par2 >= 3) && (par2 < 30) && !this.mergeItemStack(var5, 30, 39, false))
|
||||||
|
return null;
|
||||||
|
else if ((par2 >= 30) && (par2 < 39) && !this.mergeItemStack(var5, 3, 30, false))
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
else if (!this.mergeItemStack(var5, 3, 39, false))
|
||||||
|
return null;
|
||||||
|
|
||||||
|
if (var5.stackSize == 0)
|
||||||
|
var4.putStack(null);
|
||||||
|
else
|
||||||
|
var4.onSlotChanged();
|
||||||
|
|
||||||
|
if (var5.stackSize == var3.stackSize)
|
||||||
|
return null;
|
||||||
|
|
||||||
|
var4.onPickupFromSlot(par1EntityPlayer, var5);
|
||||||
|
}
|
||||||
|
|
||||||
|
return var3;
|
||||||
|
}
|
||||||
|
}
|
|
@ -89,9 +89,9 @@ public class ContainerLiquidBoiler extends BaseContainer
|
||||||
{
|
{
|
||||||
super.addCraftingToCrafters(par1ICrafting);
|
super.addCraftingToCrafters(par1ICrafting);
|
||||||
par1ICrafting.sendProgressBarUpdate(this, 0, this.tileent.furnaceBurnTime);
|
par1ICrafting.sendProgressBarUpdate(this, 0, this.tileent.furnaceBurnTime);
|
||||||
par1ICrafting.sendProgressBarUpdate(this, 2, this.tileent.steamTank.getFluidAmount());
|
par1ICrafting.sendProgressBarUpdate(this, 1, this.tileent.steamTank.getFluidAmount());
|
||||||
par1ICrafting.sendProgressBarUpdate(this, 3, this.tileent.fuelTank.getFluidAmount());
|
par1ICrafting.sendProgressBarUpdate(this, 2, this.tileent.fuelTank.getFluidAmount());
|
||||||
par1ICrafting.sendProgressBarUpdate(this, 4, this.tileent.waterTank.getFluidAmount());
|
par1ICrafting.sendProgressBarUpdate(this, 3, this.tileent.waterTank.getFluidAmount());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -131,7 +131,7 @@ public class ContainerLiquidBoiler extends BaseContainer
|
||||||
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.getFluid().amount = 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));
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,8 @@ import net.minecraftforge.fluids.FluidStack;
|
||||||
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
import boilerplate.common.baseclasses.blocks.BaseContainer;
|
||||||
import steamcraft.common.items.ItemCanister;
|
import steamcraft.common.items.ItemCanister;
|
||||||
import steamcraft.common.tiles.TileSteamBoiler;
|
import steamcraft.common.tiles.TileSteamBoiler;
|
||||||
|
import steamcraft.common.tiles.container.slot.SlotFluidContainer;
|
||||||
|
import steamcraft.common.tiles.container.slot.SlotOutput;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author Decebaldecebal
|
* @author Decebaldecebal
|
||||||
|
@ -49,22 +51,9 @@ public class ContainerSteamBoiler extends BaseContainer
|
||||||
this.setTile(this.tileent);
|
this.setTile(this.tileent);
|
||||||
|
|
||||||
this.addSlotToContainer(new Slot(tile, 0, 42, 52));
|
this.addSlotToContainer(new Slot(tile, 0, 42, 52));
|
||||||
this.addSlotToContainer(new Slot(tile, 1, 132, 57)
|
this.addSlotToContainer(new SlotFluidContainer(tile, 1, 115, 57));
|
||||||
{
|
this.addSlotToContainer(new SlotOutput(tile, 2, 149, 57));
|
||||||
@Override
|
this.addSlotToContainer(new SlotFluidContainer(tile, 3, 149, 21));
|
||||||
public boolean isItemValid(ItemStack stack)
|
|
||||||
{
|
|
||||||
return FluidContainerRegistry.isContainer(stack);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
this.addSlotToContainer(new Slot(tile, 2, 132, 21)
|
|
||||||
{
|
|
||||||
@Override
|
|
||||||
public boolean isItemValid(ItemStack stack)
|
|
||||||
{
|
|
||||||
return stack.getItem() instanceof ItemCanister;
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
int var3;
|
int var3;
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,59 @@
|
||||||
|
/**
|
||||||
|
* This class was created by BrassGoggledCoders modding team.
|
||||||
|
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is open-source and is distributed under the MMPL v1.0 License.
|
||||||
|
* (http://www.mod-buildcraft.com/MMPL-1.0.txt)
|
||||||
|
*
|
||||||
|
* Steamcraft 2 is based on the original Steamcraft Mod created by Proloe.
|
||||||
|
* Steamcraft (c) Proloe 2011
|
||||||
|
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemArmor;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Created by Skylar on 8/29/2015.
|
||||||
|
*/
|
||||||
|
public class SlotArmor extends Slot
|
||||||
|
{
|
||||||
|
int armortype;
|
||||||
|
|
||||||
|
public SlotArmor(InventoryPlayer player, int slotIndex, int x, int y, int armorType)
|
||||||
|
{
|
||||||
|
super(player, slotIndex, x, y);
|
||||||
|
this.armortype = armorType;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getSlotStackLimit()
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack itemStack)
|
||||||
|
{
|
||||||
|
if (itemStack == null)
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return itemStack.getItem().isValidArmor(itemStack, this.armortype, ((InventoryPlayer) this.inventory).player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getBackgroundIconIndex()
|
||||||
|
{
|
||||||
|
return ItemArmor.func_94602_b(this.armortype);
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,22 @@
|
||||||
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||||
|
|
||||||
|
public class SlotFluidContainer extends Slot
|
||||||
|
{
|
||||||
|
public SlotFluidContainer(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_);
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isItemValid(ItemStack stack)
|
||||||
|
{
|
||||||
|
return FluidContainerRegistry.isContainer(stack) || FluidContainerRegistry.isBucket(stack);
|
||||||
|
}
|
||||||
|
}
|
|
@ -13,16 +13,17 @@
|
||||||
package steamcraft.common.tiles.container.slot;
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import steamcraft.api.item.IArmorModule;
|
import boilerplate.common.containers.slots.SlotChanged;
|
||||||
|
import steamcraft.api.item.IModule;
|
||||||
|
import steamcraft.api.item.IModuleContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author decebaldecebal
|
* @author decebaldecebal
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SlotModule extends Slot
|
public class SlotModule extends SlotChanged
|
||||||
{
|
{
|
||||||
public SlotModule(IInventory inv, int par2, int par3, int par4)
|
public SlotModule(IInventory inv, int par2, int par3, int par4)
|
||||||
{
|
{
|
||||||
|
@ -32,12 +33,13 @@ public class SlotModule extends Slot
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack stack)
|
public boolean isItemValid(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack.getItem() instanceof IArmorModule;
|
if ((stack == null) || !(stack.getItem() instanceof IModule) || (this.inventory.getStackInSlot(0) == null)
|
||||||
}
|
|| !(this.inventory.getStackInSlot(0).getItem() instanceof IModuleContainer))
|
||||||
|
{
|
||||||
@Override
|
return false;
|
||||||
public void onSlotChange(ItemStack stack1, ItemStack stack2)
|
}
|
||||||
{
|
IModule iModule = (IModule) stack.getItem();
|
||||||
super.onSlotChange(stack1, stack2);
|
IModuleContainer iModuleContainer = (IModuleContainer) this.inventory.getStackInSlot(0).getItem();
|
||||||
|
return iModuleContainer.isModuleAllowed(iModule, this.inventory.getStackInSlot(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,19 +13,18 @@
|
||||||
package steamcraft.common.tiles.container.slot;
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
import net.minecraft.inventory.IInventory;
|
import net.minecraft.inventory.IInventory;
|
||||||
import net.minecraft.inventory.Slot;
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
import steamcraft.common.items.armor.ItemBrassArmor;
|
import boilerplate.common.containers.slots.SlotChanged;
|
||||||
|
import steamcraft.api.item.IModuleContainer;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author decebaldecebal
|
* @author decebaldecebal
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class SlotBrassArmor extends Slot
|
public class SlotModuleContainer extends SlotChanged
|
||||||
{
|
{
|
||||||
|
public SlotModuleContainer(IInventory inv, int par2, int par3, int par4)
|
||||||
public SlotBrassArmor(IInventory inv, int par2, int par3, int par4)
|
|
||||||
{
|
{
|
||||||
super(inv, par2, par3, par4);
|
super(inv, par2, par3, par4);
|
||||||
}
|
}
|
||||||
|
@ -33,12 +32,6 @@ public class SlotBrassArmor extends Slot
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValid(ItemStack stack)
|
public boolean isItemValid(ItemStack stack)
|
||||||
{
|
{
|
||||||
return stack.getItem() instanceof ItemBrassArmor;
|
return stack.getItem() instanceof IModuleContainer;
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onSlotChange(ItemStack stack1, ItemStack stack2)
|
|
||||||
{
|
|
||||||
super.onSlotChange(stack1, stack2);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -0,0 +1,19 @@
|
||||||
|
package steamcraft.common.tiles.container.slot;
|
||||||
|
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class SlotOutput extends Slot
|
||||||
|
{
|
||||||
|
public SlotOutput(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 false;
|
||||||
|
}
|
||||||
|
}
|
|
@ -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,
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
*/
|
*/
|
||||||
package steamcraft.common.tiles.recipes;
|
package steamcraft.common.tiles.recipes;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
@ -20,6 +19,7 @@ import java.util.Map.Entry;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
import steamcraft.api.RecipeAPI;
|
||||||
import steamcraft.common.init.InitItems;
|
import steamcraft.common.init.InitItems;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -29,7 +29,7 @@ import steamcraft.common.init.InitItems;
|
||||||
public class BloomeryRecipes
|
public class BloomeryRecipes
|
||||||
{
|
{
|
||||||
private static final BloomeryRecipes instance = new BloomeryRecipes();
|
private static final BloomeryRecipes instance = new BloomeryRecipes();
|
||||||
private final Map<ItemStack[], ItemStack> recipeList = new HashMap<ItemStack[], ItemStack>();
|
private final Map<ItemStack[], ItemStack> recipeList = RecipeAPI.addedRecipeList;
|
||||||
|
|
||||||
public static BloomeryRecipes getInstance()
|
public static BloomeryRecipes getInstance()
|
||||||
{
|
{
|
||||||
|
|
|
@ -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(); }
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -156,6 +156,8 @@ tile.blockSteamBoiler.name=Combustion Boiler
|
||||||
tile.blockSteamBoiler.desc=Uses fuel to heat water into steam.|Generates 20 mb steam/tick, consumes 5 mb water/tick.
|
tile.blockSteamBoiler.desc=Uses fuel to heat water into steam.|Generates 20 mb steam/tick, consumes 5 mb water/tick.
|
||||||
tile.blockNuclearBoiler.name=Nuclear-Fired Boiler
|
tile.blockNuclearBoiler.name=Nuclear-Fired Boiler
|
||||||
tile.blockNuclearBoiler.desc=Uses uranium pellets to heat water into steam.|Generates 20 mb steam/tick, consumes 5 mb water/tick.
|
tile.blockNuclearBoiler.desc=Uses uranium pellets to heat water into steam.|Generates 20 mb steam/tick, consumes 5 mb water/tick.
|
||||||
|
tile.blockLiquidBoiler.name=Liquid-Fired Boiler
|
||||||
|
tile.blockLiquidBoiler.desc=Uses liquid fuel such as (whale) oil or lava to heat water into steam.|Generates 20mb steam/tick, consumes 5 mb water/tick
|
||||||
tile.blockLightningRod.name=Lightning Rod
|
tile.blockLightningRod.name=Lightning Rod
|
||||||
tile.blockLightningRod.desc=Attracts lightning during a storm. Generate huge amounts of power, FOR SCIENCE!|Holds 100k RF.Transfer (out): 10000 RF/t
|
tile.blockLightningRod.desc=Attracts lightning during a storm. Generate huge amounts of power, FOR SCIENCE!|Holds 100k RF.Transfer (out): 10000 RF/t
|
||||||
tile.blockDropHammer.name=Drop Hammer Anvil
|
tile.blockDropHammer.name=Drop Hammer Anvil
|
||||||
|
@ -193,9 +195,9 @@ fluid.boilingmudFluid=Boiling Mud
|
||||||
#Items
|
#Items
|
||||||
item.itemResource.0.name=Sulfur
|
item.itemResource.0.name=Sulfur
|
||||||
item.itemResource.1.name=Phosphorus
|
item.itemResource.1.name=Phosphorus
|
||||||
item.itemResource.2.name=Uranium
|
item.itemResource.2.name=Sulfuric Acid
|
||||||
item.itemResource.3.name=Uranium Pellets
|
item.itemResource.3.name=Uranium
|
||||||
item.itemResource.4.name=Sulfuric Acid
|
item.itemResource.4.name=Uranium Pellets
|
||||||
item.itemTeaLeaves.name=Tea Leaf
|
item.itemTeaLeaves.name=Tea Leaf
|
||||||
item.itemTeaSeed.name=Tea Seeds
|
item.itemTeaSeed.name=Tea Seeds
|
||||||
item.itemTeaSeed.desc=Obtained from breaking grass
|
item.itemTeaSeed.desc=Obtained from breaking grass
|
||||||
|
@ -523,6 +525,7 @@ item.itemAutofeeder.desc=Automatically consume food from your inventory. Fairly
|
||||||
item.itemSteamcraftCluster.0.name=Native Aluminum Cluster
|
item.itemSteamcraftCluster.0.name=Native Aluminum Cluster
|
||||||
item.itemSteamcraftCluster.1.name=Native Zinc Cluster
|
item.itemSteamcraftCluster.1.name=Native Zinc Cluster
|
||||||
item.itemThaumicMonocle.name=Thaumic Monocle
|
item.itemThaumicMonocle.name=Thaumic Monocle
|
||||||
|
item.itemChiselSteam.name=Steam-Powered Chisel
|
||||||
|
|
||||||
#Tabs
|
#Tabs
|
||||||
itemGroup.steamcraft2=Steamcraft 2
|
itemGroup.steamcraft2=Steamcraft 2
|
||||||
|
|
|
@ -511,6 +511,7 @@ item.itemFreezeBoots.desc=将你脚下的水冻成冰
|
||||||
item.itemSteamcraftCluster.0.name=Native Aluminum Cluster
|
item.itemSteamcraftCluster.0.name=Native Aluminum Cluster
|
||||||
item.itemSteamcraftCluster.1.name=Native Zinc Cluster
|
item.itemSteamcraftCluster.1.name=Native Zinc Cluster
|
||||||
item.itemThaumicMonocle.name=Thaumic Monocle
|
item.itemThaumicMonocle.name=Thaumic Monocle
|
||||||
|
item.itemChiselSteam.name=Steam-Powered Chisel
|
||||||
|
|
||||||
#Tabs
|
#Tabs
|
||||||
itemGroup.steamcraft=蒸汽工艺 2
|
itemGroup.steamcraft=蒸汽工艺 2
|
||||||
|
|
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 8.2 KiB |
Before Width: | Height: | Size: 4.8 KiB |
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 4.6 KiB |
Before Width: | Height: | Size: 4.5 KiB After Width: | Height: | Size: 4.8 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.1 KiB |
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.0 KiB |
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.4 KiB |
After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.0 KiB |
Before Width: | Height: | Size: 3.4 KiB After Width: | Height: | Size: 3.0 KiB |
BIN
src/main/resources/assets/steamcraft/textures/misc/divinghelmet.png
Normal file → Executable file
Before Width: | Height: | Size: 19 KiB After Width: | Height: | Size: 4.4 KiB |