Conflict Fixing (hopefully)
commit
6bff96c644
Binary file not shown.
After Width: | Height: | Size: 5.4 KiB |
|
@ -11,29 +11,27 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.core.handler;
|
||||
package common.steamcraft.client.core.handler;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import common.steamcraft.mod.client.gui.GuiChemicalFurnace;
|
||||
import common.steamcraft.mod.client.gui.GuiCompressor;
|
||||
import common.steamcraft.mod.client.gui.GuiGenerator;
|
||||
import common.steamcraft.mod.client.gui.GuiNukeFurnace;
|
||||
import common.steamcraft.mod.client.gui.GuiSteamFurnace;
|
||||
import common.steamcraft.mod.client.lib.GuiIDs;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerChemicalFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerCompressor;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerGenerator;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerNukeFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerSteamFurnace;
|
||||
|
||||
import common.steamcraft.client.gui.GuiChemicalFurnace;
|
||||
import common.steamcraft.client.gui.GuiCompressor;
|
||||
import common.steamcraft.client.gui.GuiGenerator;
|
||||
import common.steamcraft.client.gui.GuiNukeFurnace;
|
||||
import common.steamcraft.client.gui.GuiSteamFurnace;
|
||||
import common.steamcraft.client.lib.GuiIDs;
|
||||
import common.steamcraft.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.common.block.tile.container.ContainerChemicalFurnace;
|
||||
import common.steamcraft.common.block.tile.container.ContainerCompressor;
|
||||
import common.steamcraft.common.block.tile.container.ContainerGenerator;
|
||||
import common.steamcraft.common.block.tile.container.ContainerNukeFurnace;
|
||||
import common.steamcraft.common.block.tile.container.ContainerSteamFurnace;
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
|
||||
/**
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.client.core.handler;
|
||||
package common.steamcraft.client.core.handler;
|
||||
|
||||
import common.steamcraft.mod.client.lib.ClientResources;
|
||||
import common.steamcraft.mod.common.item.ModArmors;
|
||||
import common.steamcraft.client.lib.ClientResources;
|
||||
import common.steamcraft.common.item.ModArmors;
|
||||
import cpw.mods.fml.common.ITickHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
||||
import net.minecraft.client.Minecraft;
|
|
@ -1,7 +1,6 @@
|
|||
package common.steamcraft.mod.client.core.handler;
|
||||
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
package common.steamcraft.client.core.handler;
|
||||
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.client.core.handler;
|
||||
package common.steamcraft.client.core.handler;
|
||||
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry.KeyHandler;
|
||||
import cpw.mods.fml.common.TickType;
|
|
@ -15,10 +15,10 @@
|
|||
*
|
||||
* File created @ [Feb 4, 2014, 5:19:04 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.core.handler;
|
||||
package common.steamcraft.client.core.handler;
|
||||
|
||||
import common.steamcraft.mod.client.lib.ClientResources;
|
||||
import common.steamcraft.mod.common.network.LoggerMod;
|
||||
import common.steamcraft.client.lib.ClientResources;
|
||||
import common.steamcraft.common.network.LoggerMod;
|
||||
import net.minecraftforge.client.event.sound.SoundLoadEvent;
|
||||
import net.minecraftforge.event.ForgeSubscribe;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.core.helper;
|
||||
package common.steamcraft.client.core.helper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -15,10 +15,9 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:16:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.core.helper;
|
||||
|
||||
import common.steamcraft.mod.client.lib.ClientResources;
|
||||
package common.steamcraft.client.core.helper;
|
||||
|
||||
import common.steamcraft.client.lib.ClientResources;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.item.Item;
|
|
@ -9,21 +9,34 @@
|
|||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.core.proxy;
|
||||
package common.steamcraft.client.core.proxy;
|
||||
|
||||
import java.awt.Color;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import common.steamcraft.client.core.handler.HUDHandler;
|
||||
import common.steamcraft.client.core.handler.SoundHandler;
|
||||
import common.steamcraft.client.fx.FXRayGun;
|
||||
import common.steamcraft.client.model.ModelBrassMonocle;
|
||||
import common.steamcraft.client.model.ModelBrassWings;
|
||||
import common.steamcraft.client.model.ModelCape;
|
||||
import common.steamcraft.client.render.RenderBullet;
|
||||
import common.steamcraft.common.block.tile.TileEntityEtheriumCrystalRenderer;
|
||||
import common.steamcraft.common.block.tile.TileEntityLampRenderer;
|
||||
import common.steamcraft.common.block.tile.TileEntityLightningRodRenderer;
|
||||
import common.steamcraft.common.core.proxy.CommonProxy;
|
||||
import common.steamcraft.common.entity.EntityBullet;
|
||||
|
||||
import common.steamcraft.mod.client.core.handler.HUDHandler;
|
||||
import common.steamcraft.mod.client.core.handler.SoundHandler;
|
||||
import common.steamcraft.mod.client.fx.FXRayGun;
|
||||
import common.steamcraft.mod.client.model.ModelBrassMonocle;
|
||||
import common.steamcraft.mod.client.model.ModelBrassWings;
|
||||
import common.steamcraft.mod.client.model.ModelCape;
|
||||
import common.steamcraft.mod.client.render.RenderBullet;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityLampRenderer;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityLightningRodRenderer;
|
||||
import common.steamcraft.mod.common.core.proxy.CommonProxy;
|
||||
import common.steamcraft.mod.common.entity.EntityBullet;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
|
@ -31,28 +44,19 @@ import cpw.mods.fml.common.event.FMLInitializationEvent;
|
|||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.registry.TickRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class ClientProxy extends CommonProxy
|
||||
{
|
||||
public class ClientProxy extends CommonProxy {
|
||||
@Override
|
||||
public void preInit(FMLPreInitializationEvent event)
|
||||
{
|
||||
public void preInit(FMLPreInitializationEvent event) {
|
||||
super.preInit(event);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(FMLInitializationEvent event)
|
||||
{
|
||||
public void init(FMLInitializationEvent event) {
|
||||
super.init(event);
|
||||
// MinecraftForge.EVENT_BUS.register(new SC_GuiOpenEventHandler());
|
||||
TickRegistry.registerTickHandler(new HUDHandler(), Side.CLIENT);
|
||||
|
@ -61,26 +65,25 @@ public class ClientProxy extends CommonProxy
|
|||
}
|
||||
|
||||
@Override
|
||||
public void initEntities()
|
||||
{
|
||||
public void initEntities() {
|
||||
super.initEntities();
|
||||
// Bullet
|
||||
RenderingRegistry.registerEntityRenderingHandler(EntityBullet.class, new RenderBullet());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initTileEntities()
|
||||
{
|
||||
public void initTileEntities() {
|
||||
super.initTileEntities();
|
||||
// Lamp
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(common.steamcraft.mod.common.block.tile.TileEntityLamp.class, new TileEntityLampRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(common.steamcraft.common.block.tile.TileEntityLamp.class, new TileEntityLampRenderer());
|
||||
// Lightning Rod
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(common.steamcraft.mod.common.block.tile.TileEntityLightningRod.class, new TileEntityLightningRodRenderer());
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(common.steamcraft.common.block.tile.TileEntityLightningRod.class, new TileEntityLightningRodRenderer());
|
||||
// Etherium Crystal
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(common.steamcraft.common.block.tile.TileEntityEtheriumCrystal.class, new TileEntityEtheriumCrystalRenderer());
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isClient()
|
||||
{
|
||||
public boolean isClient() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -90,8 +93,7 @@ public class ClientProxy extends CommonProxy
|
|||
private static final ModelBrassMonocle legs = new ModelBrassMonocle(0.5F);
|
||||
|
||||
@Override
|
||||
public ModelBiped getMonocleArmorModel(int id)
|
||||
{
|
||||
public ModelBiped getMonocleArmorModel(int id) {
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
|
@ -109,8 +111,7 @@ public class ClientProxy extends CommonProxy
|
|||
private static final ModelBrassWings legs1 = new ModelBrassWings(0.5F);
|
||||
|
||||
@Override
|
||||
public ModelBiped getWingsArmorModel(int id)
|
||||
{
|
||||
public ModelBiped getWingsArmorModel(int id) {
|
||||
switch (id)
|
||||
{
|
||||
case 0:
|
||||
|
@ -128,8 +129,7 @@ public class ClientProxy extends CommonProxy
|
|||
private static final ModelCape legs2 = new ModelCape(0.5F);
|
||||
|
||||
@Override
|
||||
public ModelBiped getCapeArmorModel(int id)
|
||||
{
|
||||
public ModelBiped getCapeArmorModel(int id) {
|
||||
switch(id)
|
||||
{
|
||||
case 0:
|
||||
|
@ -144,23 +144,20 @@ public class ClientProxy extends CommonProxy
|
|||
}
|
||||
|
||||
@Override
|
||||
public Object rayBeam(World world, EntityPlayer player, double tx, double ty, double tz, int type, /*int color,*/ boolean reverse, float endmod, Object input, int impact)
|
||||
{
|
||||
public Object rayBeam(World world, EntityPlayer player, double tx, double ty, double tz, int type, /*int color,*/ boolean reverse, float endmod, Object input, int impact) {
|
||||
FXRayGun ray = null;
|
||||
//Color c = new Color(color);
|
||||
Color color = Color.GREEN; // Change le color here
|
||||
|
||||
if((input instanceof FXRayGun))
|
||||
ray = (FXRayGun)input;
|
||||
if((ray == null) || (ray.isDead))
|
||||
{
|
||||
if((ray == null) || (ray.isDead)) {
|
||||
ray = new FXRayGun(world, player, tx, ty, tz, color.getRed() / 255.0F, color.getGreen() / 255.0F, color.getBlue() / 255.0F, 9);
|
||||
ray.setType(type);
|
||||
ray.setEndMod(endmod);
|
||||
ray.setReverse(reverse);
|
||||
FMLClientHandler.instance().getClient().effectRenderer.addEffect(ray);
|
||||
} else
|
||||
{
|
||||
} else {
|
||||
ray.updateRay(tx, ty, tz);
|
||||
ray.setEndMod(endmod);
|
||||
ray.impact = impact;
|
|
@ -11,10 +11,9 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.fx;
|
||||
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
package common.steamcraft.client.fx;
|
||||
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.client.FMLClientHandler;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,11 +11,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.gui;
|
||||
package common.steamcraft.client.gui;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerChemicalFurnace;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.common.block.tile.container.ContainerChemicalFurnace;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.client.gui;
|
||||
package common.steamcraft.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -6,9 +6,9 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerCompressor;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.common.block.tile.container.ContainerCompressor;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
|
||||
public class GuiCompressor extends GuiContainer
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.client.gui;
|
||||
package common.steamcraft.client.gui;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -6,9 +6,9 @@ import net.minecraft.util.ResourceLocation;
|
|||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerGenerator;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.common.block.tile.container.ContainerGenerator;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
|
||||
public class GuiGenerator extends GuiContainer
|
||||
{
|
|
@ -11,11 +11,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.gui;
|
||||
package common.steamcraft.client.gui;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerNukeFurnace;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.common.block.tile.container.ContainerNukeFurnace;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -11,11 +11,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.gui;
|
||||
package common.steamcraft.client.gui;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.ContainerSteamFurnace;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.common.block.tile.container.ContainerSteamFurnace;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.model;
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.model;
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* File created @ [Feb 1, 2014, 8:29:28 AM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.model;
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
|
@ -0,0 +1,149 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 10:00:16 AM]
|
||||
*/
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
/**
|
||||
* Etherium Crystal Model
|
||||
*
|
||||
* @author MrArcane111 & Falkok15
|
||||
*
|
||||
*/
|
||||
public class ModelEtheriumCrystal extends ModelBase {
|
||||
/** Renderer Fields */
|
||||
ModelRenderer Shape1;
|
||||
ModelRenderer Shape2;
|
||||
ModelRenderer Shape3;
|
||||
ModelRenderer Shape4;
|
||||
ModelRenderer Shape5;
|
||||
ModelRenderer Shape6;
|
||||
ModelRenderer Shape7;
|
||||
ModelRenderer Shape8;
|
||||
ModelRenderer Shape9;
|
||||
ModelRenderer Shape10;
|
||||
ModelRenderer Shape11;
|
||||
ModelRenderer Shape12;
|
||||
|
||||
public ModelEtheriumCrystal() {
|
||||
this.textureWidth = 64;
|
||||
this.textureHeight = 32;
|
||||
Shape1 = new ModelRenderer(this, 0, 0);
|
||||
Shape1.addBox(0F, 0F, 0F, 6, 7, 6);
|
||||
Shape1.setRotationPoint(-3F, 17F, -3F);
|
||||
Shape1.setTextureSize(64, 32);
|
||||
Shape1.mirror = true;
|
||||
this.setRotation(Shape1, 0F, 0F, 0F);
|
||||
Shape2 = new ModelRenderer(this, 26, 0);
|
||||
Shape2.addBox(0F, 0F, 0F, 5, 5, 5);
|
||||
Shape2.setRotationPoint(-2.5F, 12F, -2.5F);
|
||||
Shape2.setTextureSize(64, 32);
|
||||
Shape2.mirror = true;
|
||||
this.setRotation(Shape2, 0F, 0F, 0F);
|
||||
Shape3 = new ModelRenderer(this, 0, 14);
|
||||
Shape3.addBox(0F, 0F, 0F, 2, 4, 2);
|
||||
Shape3.setRotationPoint(-1F, 8F, -1F);
|
||||
Shape3.setTextureSize(64, 32);
|
||||
Shape3.mirror = true;
|
||||
this.setRotation(Shape3, 0F, 0F, 0F);
|
||||
Shape4 = new ModelRenderer(this, 50, 0);
|
||||
Shape4.addBox(0F, 0F, 0F, 1, 4, 3);
|
||||
Shape4.setRotationPoint(0F, 9F, -1.5F);
|
||||
Shape4.setTextureSize(64, 32);
|
||||
Shape4.mirror = true;
|
||||
this.setRotation(Shape4, 0F, 0F, -0.2617994F);
|
||||
Shape5 = new ModelRenderer(this, 50, 0);
|
||||
Shape5.addBox(-1F, 0F, -3F, 1, 4, 3);
|
||||
Shape5.setRotationPoint(0F, 9F, 1.5F);
|
||||
Shape5.setTextureSize(64, 32);
|
||||
Shape5.mirror = true;
|
||||
this.setRotation(Shape5, 0F, 0F, 0.2617994F);
|
||||
Shape6 = new ModelRenderer(this, 10, 14);
|
||||
Shape6.addBox(0F, 0F, 0F, 3, 4, 1);
|
||||
Shape6.setRotationPoint(-1.5F, 9F, 0.5F);
|
||||
Shape6.setTextureSize(64, 32);
|
||||
Shape6.mirror = true;
|
||||
this.setRotation(Shape6, 0.2617994F, 0F, 0F);
|
||||
Shape7 = new ModelRenderer(this, 10, 14);
|
||||
Shape7.addBox(-3F, 0F, -1F, 3, 4, 1);
|
||||
Shape7.setRotationPoint(1.5F, 9F, -0.5F);
|
||||
Shape7.setTextureSize(64, 32);
|
||||
Shape7.mirror = true;
|
||||
this.setRotation(Shape7, -0.1745329F, 0F, 0F);
|
||||
Shape8 = new ModelRenderer(this, 20, 14);
|
||||
Shape8.addBox(0F, 0F, 0F, 2, 4, 2);
|
||||
Shape8.setRotationPoint(-4.5F, 16F, 3F);
|
||||
Shape8.setTextureSize(64, 32);
|
||||
Shape8.mirror = true;
|
||||
this.setRotation(Shape8, 0F, 0.7853982F, -0.6981317F);
|
||||
Shape9 = new ModelRenderer(this, 0, 22);
|
||||
Shape9.addBox(0F, 0F, 0F, 1, 2, 1);
|
||||
Shape9.setRotationPoint(-4.5F, 15F, 4F);
|
||||
Shape9.setTextureSize(64, 32);
|
||||
Shape9.mirror = true;
|
||||
this.setRotation(Shape9, 0F, 0.7853982F, -0.6981317F);
|
||||
Shape10 = new ModelRenderer(this, 0, 0);
|
||||
Shape10.addBox(0F, 0F, 0F, 1, 3, 1);
|
||||
Shape10.setRotationPoint(3F, 14F, -2F);
|
||||
Shape10.setTextureSize(64, 32);
|
||||
Shape10.mirror = true;
|
||||
this.setRotation(Shape10, 0F, 0.5235988F, 0.5235988F);
|
||||
Shape11 = new ModelRenderer(this, 30, 14);
|
||||
Shape11.addBox(0F, 0F, 0F, 2, 2, 2);
|
||||
Shape11.setRotationPoint(-4.5F, 22F, -2.5F);
|
||||
Shape11.setTextureSize(64, 32);
|
||||
Shape11.mirror = true;
|
||||
this.setRotation(Shape11, 0F, 0F, -0.7853982F);
|
||||
Shape12 = new ModelRenderer(this, 20, 0);
|
||||
Shape12.addBox(0F, 0F, 0F, 1, 1, 1);
|
||||
Shape12.setRotationPoint(-4.5F, 21F, -2F);
|
||||
Shape12.setTextureSize(64, 32);
|
||||
Shape12.mirror = true;
|
||||
this.setRotation(Shape12, 0F, 0F, -0.7853982F);
|
||||
}
|
||||
|
||||
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);
|
||||
this.setRotationAngles(f, f1, f2, f3, f4, f5, entity);
|
||||
Shape1.render(f5);
|
||||
Shape2.render(f5);
|
||||
Shape3.render(f5);
|
||||
Shape4.render(f5);
|
||||
Shape5.render(f5);
|
||||
Shape6.render(f5);
|
||||
Shape7.render(f5);
|
||||
Shape8.render(f5);
|
||||
Shape9.render(f5);
|
||||
Shape10.render(f5);
|
||||
Shape11.render(f5);
|
||||
Shape12.render(f5);
|
||||
}
|
||||
|
||||
// Techne method
|
||||
private void setRotation(ModelRenderer model, float x, float y, float z) {
|
||||
model.rotateAngleX = x;
|
||||
model.rotateAngleY = y;
|
||||
model.rotateAngleZ = z;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.model;
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.model;
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,7 +11,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.model;
|
||||
package common.steamcraft.client.model;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,10 +11,10 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.client.render;
|
||||
package common.steamcraft.client.render;
|
||||
|
||||
import common.steamcraft.mod.client.lib.ClientResources;
|
||||
import common.steamcraft.mod.common.entity.EntityBullet;
|
||||
import common.steamcraft.client.lib.ClientResources;
|
||||
import common.steamcraft.common.entity.EntityBullet;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
|
@ -15,12 +15,11 @@
|
|||
*
|
||||
* File created @ [Feb 4, 2014, 5:19:04 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common;
|
||||
|
||||
import common.steamcraft.mod.common.core.proxy.CommonProxy;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.mod.common.network.PacketHandler;
|
||||
package common.steamcraft.common;
|
||||
|
||||
import common.steamcraft.common.core.proxy.CommonProxy;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import common.steamcraft.common.network.PacketHandler;
|
||||
import cpw.mods.fml.common.Mod;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
import cpw.mods.fml.common.Mod.Instance;
|
|
@ -1,8 +1,7 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -11,10 +11,9 @@
|
|||
*
|
||||
* File created @ [Jan 31, 2014, 3:48:02 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFence;
|
||||
import net.minecraft.block.material.Material;
|
|
@ -1,7 +1,6 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityLamp;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.tile.TileEntityLamp;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -11,11 +11,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 6:11:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.mod.client.lib.RenderIDs;
|
||||
import common.steamcraft.mod.common.block.machines.BlockContainerMod;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityChimney;
|
||||
import common.steamcraft.client.lib.RenderIDs;
|
||||
import common.steamcraft.common.block.machines.BlockContainerMod;
|
||||
import common.steamcraft.common.block.tile.TileEntityChimney;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -0,0 +1,104 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 10:07:13 AM]
|
||||
*/
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import common.steamcraft.common.block.machines.BlockContainerMod;
|
||||
import common.steamcraft.common.block.tile.TileEntityEtheriumCrystal;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class BlockEtheriumCrystal extends BlockContainerMod {
|
||||
public BlockEtheriumCrystal(int id) {
|
||||
super(id, Material.glass);
|
||||
this.setHardness(50.0F);
|
||||
this.setResistance(6000000.0F);
|
||||
this.setCreativeTab(CreativeTabsMod.tabSCBlocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int tickRate(World world) {
|
||||
return 10;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return new TileEntityEtheriumCrystal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return -1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int idDropped(int i, Random random, int j) {
|
||||
return ModItems.etherium.itemID;
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(World world, int i, int j) {
|
||||
if (this.idDropped(i, world.rand, j) != this.blockID) {
|
||||
int randInt = MathHelper.getRandomIntegerInRange(world.rand, 4, 10);
|
||||
return randInt;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int quantity, Random random) {
|
||||
if (quantity > 0 && (this.blockID != this.idDropped(0, random, quantity))) {
|
||||
int randInt = random.nextInt(quantity + 2) - 1;
|
||||
|
||||
if (randInt < 0) {
|
||||
randInt = 0;
|
||||
}
|
||||
|
||||
return this.quantityDropped(random) * (randInt + 1);
|
||||
} else {
|
||||
return this.quantityDropped(random);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -11,11 +11,10 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:51:27 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -15,11 +15,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 6:11:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.mod.client.core.helper.IconHelper;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.client.core.helper.IconHelper;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -75,42 +75,8 @@ public class BlockOreMod extends BlockMod
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int quantity, Random random) {
|
||||
if (this.blockID != ModOres.oreVolucite.blockID) {
|
||||
if (quantity > 0 && this.blockID != this.idDropped(0, random, quantity)) {
|
||||
int randInt = random.nextInt(quantity + 2) - 1;
|
||||
|
||||
if (randInt < 0) {
|
||||
randInt = 0;
|
||||
}
|
||||
|
||||
return this.quantityDropped(random) * (randInt + 1);
|
||||
} else {
|
||||
return this.quantityDropped(random);
|
||||
}
|
||||
} else {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int i, int j, int k, int l, float f, int m) {
|
||||
super.dropBlockAsItemWithChance(world, i, j, k, l, f, m);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getExpDrop(World world, int i, int j) {
|
||||
if (this.idDropped(i, world.rand, j) != this.blockID) {
|
||||
int randInt = 0;
|
||||
|
||||
if (this.blockID == ModOres.oreVolucite.blockID) {
|
||||
randInt = MathHelper.getRandomIntegerInRange(world.rand, 4, 10);
|
||||
}
|
||||
|
||||
return randInt;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
|
@ -15,17 +15,15 @@
|
|||
*
|
||||
* File created @ [Feb 5, 2014, 8:29:30 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.BlockTorch;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
@ -0,0 +1,195 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 2:44:47 PM]
|
||||
*/
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import common.steamcraft.common.block.machines.BlockContainerMod;
|
||||
import common.steamcraft.common.block.tile.TileEntitySteamPipe;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class BlockSteamPipe extends BlockContainerMod {
|
||||
public BlockSteamPipe(int id, Material mat) {
|
||||
super(id, mat.iron);
|
||||
this.setCreativeTab(CreativeTabsMod.tabSCBlocks);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
TileEntitySteamPipe te = (TileEntitySteamPipe)world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if(te != null) {
|
||||
te.cycleConnections(-1); // Maybe add an item to do this?
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world) {
|
||||
return new TileEntitySteamPipe();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int onBlockPlaced(World world, int x, int y, int z, int side, float hitX, float hitY, float hitZ, int metadata) {
|
||||
return side + 1;
|
||||
}
|
||||
|
||||
private double[] getBounds(World world, int x, int y, int z) {
|
||||
double[] result = new double[6];
|
||||
double d1 = (result[2] = 0.25D); result[1] = d1; result[0] = d1;
|
||||
double d2 = (result[5] = 0.75D); result[4] = d1; result[3] = d2;
|
||||
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if ((te != null) && (te instanceof TileEntitySteamPipe)) {
|
||||
TileEntitySteamPipe tePipe = (TileEntitySteamPipe)te;
|
||||
ForgeDirection side1 = ForgeDirection.getOrientation(tePipe.getConnection1());
|
||||
ForgeDirection side2 = ForgeDirection.getOrientation(tePipe.getConnection2());
|
||||
|
||||
if ((side1.offsetX < 0) || (side2.offsetX < 0)) {
|
||||
result[0] = 0.0D;
|
||||
}
|
||||
if ((side1.offsetX > 0) || (side2.offsetX > 0)) {
|
||||
result[3] = 1.0D;
|
||||
}
|
||||
if ((side1.offsetY < 0) || (side2.offsetY < 0)) {
|
||||
result[1] = 0.0D;
|
||||
}
|
||||
if ((side1.offsetY > 0) || (side2.offsetY > 0)) {
|
||||
result[4] = 1.0D;
|
||||
}
|
||||
if ((side1.offsetZ < 0) || (side2.offsetZ < 0)) {
|
||||
result[2] = 0.0D;
|
||||
}
|
||||
if ((side1.offsetZ > 0) || (side2.offsetZ > 0)) {
|
||||
result[5] = 1.0D;
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addCollisionBoxesToList(World world, int x, int y, int z, AxisAlignedBB box, List boxList, Entity entity) {
|
||||
float[] bounds = new float[6];
|
||||
float f1 = (bounds[2] = 0.25F); bounds[1] = f1; bounds[0] = f1;
|
||||
float f2 = (bounds[5] = 0.75F); bounds[4] = f2; bounds[3] = f2;
|
||||
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if ((te != null) && ((te instanceof TileEntitySteamPipe))) {
|
||||
TileEntitySteamPipe pipe = (TileEntitySteamPipe)te;
|
||||
ForgeDirection side = ForgeDirection.getOrientation(pipe.getConnection1());
|
||||
|
||||
if (side.offsetX < 0) {
|
||||
bounds[0] = 0.0F;
|
||||
}
|
||||
if (side.offsetX > 0) {
|
||||
bounds[3] = 1.0F;
|
||||
}
|
||||
if (side.offsetY < 0) {
|
||||
bounds[1] = 0.0F;
|
||||
}
|
||||
if (side.offsetY > 0) {
|
||||
bounds[4] = 1.0F;
|
||||
}
|
||||
if (side.offsetZ < 0) {
|
||||
bounds[2] = 0.0F;
|
||||
}
|
||||
if (side.offsetZ > 0) {
|
||||
bounds[5] = 1.0F;
|
||||
}
|
||||
|
||||
this.setBlockBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
|
||||
super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity);
|
||||
float f3 = (bounds[2] = 0.25F); bounds[1] = f3; bounds[0] = f3;
|
||||
float f4 = (bounds[5] = 0.75F); bounds[4] = f4; bounds[3] = f4;
|
||||
|
||||
side = ForgeDirection.getOrientation(pipe.getConnection2());
|
||||
|
||||
if (side.offsetX < 0) {
|
||||
bounds[0] = 0.0F;
|
||||
}
|
||||
if (side.offsetX > 0) {
|
||||
bounds[3] = 1.0F;
|
||||
}
|
||||
if (side.offsetY < 0) {
|
||||
bounds[1] = 0.0F;
|
||||
}
|
||||
if (side.offsetY > 0) {
|
||||
bounds[4] = 1.0F;
|
||||
}
|
||||
if (side.offsetZ < 0) {
|
||||
bounds[2] = 0.0F;
|
||||
}
|
||||
if (side.offsetZ > 0) {
|
||||
bounds[5] = 1.0F;
|
||||
}
|
||||
|
||||
this.setBlockBounds(bounds[0], bounds[1], bounds[2], bounds[3], bounds[4], bounds[5]);
|
||||
super.addCollisionBoxesToList(world, x, y, z, box, boxList, entity);
|
||||
}
|
||||
|
||||
this.setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
double[] bounds = getBounds(world, x, y, z);
|
||||
return AxisAlignedBB.getAABBPool().getAABB(bounds[0] + x, bounds[1] + y, bounds[2] + z, bounds[3] + x, bounds[4] + y, bounds[5] + z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MovingObjectPosition collisionRayTrace(World world, int x, int y, int z, Vec3 startVec, Vec3 endVec) {
|
||||
double[] bounds = getBounds(world, x, y, z);
|
||||
this.setBlockBounds((float)bounds[0], (float)bounds[1], (float)bounds[2], (float)bounds[3], (float)bounds[4], (float)bounds[5]);
|
||||
MovingObjectPosition result = super.collisionRayTrace(world, x, y, z, startVec, endVec);
|
||||
this.setBlockBounds(0.25F, 0.25F, 0.25F, 0.75F, 0.75F, 0.75F);
|
||||
return result;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -11,10 +11,9 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 6:11:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
|
||||
import common.steamcraft.mod.client.core.helper.IconHelper;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.client.core.helper.IconHelper;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
@ -9,14 +9,18 @@
|
|||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Jan 30, 2014, 5:51:27 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.block.machines.ModMachines;
|
||||
import common.steamcraft.mod.common.lib.BlockIDs;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.machines.ModMachines;
|
||||
import common.steamcraft.common.lib.BlockIDs;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -28,8 +32,7 @@ import net.minecraft.block.material.Material;
|
|||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class ModBlocks
|
||||
{
|
||||
public class ModBlocks {
|
||||
public static Block blockCastIron;
|
||||
public static Block blockVolucite;
|
||||
public static Block blockBrass;
|
||||
|
@ -61,8 +64,9 @@ public class ModBlocks
|
|||
public static Block castIronLampActive;
|
||||
public static Block smog;
|
||||
|
||||
public static void initBlocks()
|
||||
{
|
||||
public static Block etheriumCrystal;
|
||||
|
||||
public static void initBlocks() {
|
||||
blockCastIron = new BlockMod(BlockIDs.blockCastIronID, Material.iron).setHardness(7F).setResistance(20F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("castironblock");
|
||||
blockVolucite = new BlockMod(BlockIDs.blockVoluciteID, Material.rock).setHardness(50F).setResistance(6000000F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("voluciteblock");
|
||||
blockBrass = new BlockMod(BlockIDs.blockBrassID, Material.iron).setHardness(5F).setResistance(10F).setStepSound(Block.soundMetalFootstep).setUnlocalizedName("brassblock");
|
||||
|
@ -97,7 +101,7 @@ public class ModBlocks
|
|||
castIronLampIdle = new BlockCastIronLamp(BlockIDs.castIronLampIdleID, false).setCreativeTab(CreativeTabsMod.tabSCBlocks);
|
||||
castIronLampActive = new BlockCastIronLamp(BlockIDs.castIronLampActiveID, true);
|
||||
smog = new BlockSmog(BlockIDs.smogID, Material.air).setUnlocalizedName("smog");
|
||||
|
||||
etheriumCrystal = new BlockEtheriumCrystal(BlockIDs.etheriumCrystalID);
|
||||
ModMachines.initMachines();
|
||||
ModOres.initOres();
|
||||
ModPowerBlocks.initPowerBlocks();
|
||||
|
@ -105,8 +109,7 @@ public class ModBlocks
|
|||
addNames();
|
||||
}
|
||||
|
||||
public static void registerBlocks()
|
||||
{
|
||||
public static void registerBlocks() {
|
||||
GameRegistry.registerBlock(blockCastIron, "blockcastiron");
|
||||
GameRegistry.registerBlock(blockVolucite, "blockvolucite");
|
||||
GameRegistry.registerBlock(blockBrass, "blockbrass");
|
||||
|
@ -137,11 +140,10 @@ public class ModBlocks
|
|||
GameRegistry.registerBlock(blockBronze, "bronzeblock");
|
||||
GameRegistry.registerBlock(blockSteel, "steelblock");
|
||||
GameRegistry.registerBlock(smog, "smog");
|
||||
GameRegistry.registerBlock(etheriumCrystal, "etheriumCrystal");
|
||||
}
|
||||
|
||||
public static void addNames()
|
||||
{
|
||||
|
||||
public static void addNames() {
|
||||
LanguageRegistry.addName(blockCastIron, "Cast Iron Block");
|
||||
LanguageRegistry.addName(blockVolucite, "Volucite Block");
|
||||
LanguageRegistry.addName(blockBrass, "Brass Block");
|
||||
|
@ -164,5 +166,6 @@ public class ModBlocks
|
|||
LanguageRegistry.addName(blockSlateTile, "Obsidian Slate Tiles");
|
||||
LanguageRegistry.addName(castIronLampIdle, "Cast Iron Lamp");
|
||||
LanguageRegistry.addName(castIronLampActive, "Cast Iron Lamp");
|
||||
LanguageRegistry.addName(etheriumCrystal, "Etherium Crystal");
|
||||
}
|
||||
}
|
|
@ -15,6 +15,8 @@ package common.steamcraft.mod.common.block;
|
|||
|
||||
import common.steamcraft.mod.common.lib.BlockIDs;
|
||||
import common.steamcraft.mod.common.lib.BlockNames;
|
||||
import common.steamcraft.common.lib.BlockIDs;
|
||||
import common.steamcraft.common.lib.BlockNames;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import net.minecraft.block.Block;
|
|
@ -11,10 +11,10 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:51:27 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block;
|
||||
package common.steamcraft.common.block;
|
||||
|
||||
import common.steamcraft.mod.common.block.machines.BlockLightningRod;
|
||||
import common.steamcraft.mod.common.lib.BlockIDs;
|
||||
import common.steamcraft.common.block.machines.BlockLightningRod;
|
||||
import common.steamcraft.common.lib.BlockIDs;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
import net.minecraft.block.Block;
|
|
@ -15,12 +15,12 @@
|
|||
*
|
||||
* File created @ [Feb 4, 2014, 5:19:04 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import common.steamcraft.mod.common.block.BlockMod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.block.BlockMod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
||||
import net.minecraft.tileentity.TileEntityChest;
|
|
@ -1,9 +1,9 @@
|
|||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import common.steamcraft.mod.client.lib.GuiIDs;
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.client.lib.GuiIDs;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -15,12 +15,10 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import common.steamcraft.mod.client.lib.GuiIDs;
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
|
||||
import common.steamcraft.client.lib.GuiIDs;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
@ -15,10 +15,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 6:12:00 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import common.steamcraft.mod.client.core.helper.IconHelper;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.client.core.helper.IconHelper;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.api.IMachine;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
|
@ -15,12 +15,12 @@
|
|||
*
|
||||
* File created @ [Feb 10, 2014, 2:17:44 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import common.steamcraft.mod.common.block.BlockMod;
|
||||
import common.steamcraft.mod.common.util.ConveyorUtils;
|
||||
import common.steamcraft.common.block.BlockMod;
|
||||
import common.steamcraft.common.util.ConveyorUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
@ -46,7 +46,7 @@ public class BlockConveyorBelt extends BlockMod {
|
|||
super(id, Material.iron);
|
||||
this.setTickRandomly(false);
|
||||
this.setUnlocalizedName("conveyor");
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, ConveyorUtils.HEIGHT, 1.0F);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, ConveyorUtil.HEIGHT, 1.0F);
|
||||
//this.timePeriod = 0;
|
||||
this.setStepSound(this.soundClothFootstep);
|
||||
}
|
||||
|
@ -121,21 +121,21 @@ public class BlockConveyorBelt extends BlockMod {
|
|||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int i, int j, int k, Entity entity) {
|
||||
if (ConveyorUtils.isEntityIgnored(entity)) {
|
||||
if (ConveyorUtil.isEntityIgnored(entity)) {
|
||||
return;
|
||||
}
|
||||
if (entity instanceof EntityItem) {
|
||||
ConveyorUtils.packItems(world, i, j, k);
|
||||
ConveyorUtil.packItems(world, i, j, k);
|
||||
}
|
||||
if (entity instanceof EntityItem && !this.hasSpeedBoost) {
|
||||
ConveyorUtils.doSpecialItemAction(world, i, j, k, (EntityItem) entity);
|
||||
ConveyorUtil.doSpecialItemAction(world, i, j, k, (EntityItem) entity);
|
||||
|
||||
if (ConveyorUtils.storeNearby(world, i, j, k, (EntityItem) entity, false)) {
|
||||
if (ConveyorUtil.storeNearby(world, i, j, k, (EntityItem) entity, false)) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
int direction = ConveyorUtils.getRotation(world.getBlockMetadata(i, j, k));
|
||||
int direction = ConveyorUtil.getRotation(world.getBlockMetadata(i, j, k));
|
||||
|
||||
switch (direction) {
|
||||
case 0: // Z--
|
||||
|
@ -152,31 +152,31 @@ public class BlockConveyorBelt extends BlockMod {
|
|||
break;
|
||||
}
|
||||
|
||||
boolean leadsToNowhere = ConveyorUtils.isObstructed(world, i, j, k);
|
||||
leadsToNowhere = leadsToNowhere && ConveyorUtils.isItemBeyondStorageBorder(world, direction, i, j, k, entity, ConveyorUtils.STORAGE_BORDER_LONG);
|
||||
boolean leadsToNowhere = ConveyorUtil.isObstructed(world, i, j, k);
|
||||
leadsToNowhere = leadsToNowhere && ConveyorUtil.isItemBeyondStorageBorder(world, direction, i, j, k, entity, ConveyorUtil.STORAGE_BORDER_LONG);
|
||||
|
||||
if (!leadsToNowhere) {
|
||||
ConveyorUtils.entityPreventDespawning(world, i, j, k, true, entity);
|
||||
ConveyorUtil.entityPreventDespawning(world, i, j, k, true, entity);
|
||||
}
|
||||
|
||||
double speed_max = ConveyorUtils.MAX_HORIZONTAL_SPEED;
|
||||
double speed_max = ConveyorUtil.MAX_HORIZONTAL_SPEED;
|
||||
|
||||
if (this.hasSpeedBoost) {
|
||||
speed_max *= 2.0D;
|
||||
}
|
||||
|
||||
double boost = ConveyorUtils.HORIZONTAL_BOOST;
|
||||
double boost = ConveyorUtil.HORIZONTAL_BOOST;
|
||||
|
||||
if (this.hasSpeedBoost) {
|
||||
boost *= 2.0D;
|
||||
}
|
||||
|
||||
ConveyorUtils.moveEntityOnBelt(world, i, j, k, entity, true, !leadsToNowhere, direction, speed_max, boost);
|
||||
ConveyorUtil.moveEntityOnBelt(world, i, j, k, entity, true, !leadsToNowhere, direction, speed_max, boost);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int i, int j, int k) {
|
||||
return AxisAlignedBB.getBoundingBox(i, 0.0F + j, k, (i + 1), (j + ConveyorUtils.HEIGHT_COLLISION + 0.0F), (k + 1));
|
||||
return AxisAlignedBB.getBoundingBox(i, 0.0F + j, k, (i + 1), (j + ConveyorUtil.HEIGHT_COLLISION + 0.0F), (k + 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -187,13 +187,13 @@ public class BlockConveyorBelt extends BlockMod {
|
|||
@Override
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int i, int j, int k) {
|
||||
float f = 0;
|
||||
f = 0.0F + ConveyorUtils.HEIGHT_SELECTED;
|
||||
f = 0.0F + ConveyorUtil.HEIGHT_SELECTED;
|
||||
return AxisAlignedBB.getBoundingBox(i, 0.0F + j, k, (i + 1), j + f, (float) k + 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setBlockBoundsBasedOnState(IBlockAccess iblockaccess, int i, int j, int k) {
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0F + ConveyorUtils.HEIGHT, 1.0F);
|
||||
this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.0F + ConveyorUtil.HEIGHT, 1.0F);
|
||||
}
|
||||
|
||||
@Override
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
|
@ -15,12 +15,10 @@ import net.minecraft.tileentity.TileEntity;
|
|||
import net.minecraft.util.Icon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import common.steamcraft.mod.client.lib.GuiIDs;
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
|
||||
import common.steamcraft.client.lib.GuiIDs;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
@ -1,8 +1,8 @@
|
|||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import common.steamcraft.mod.common.block.ModBlocks;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityLightningRod;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.block.ModBlocks;
|
||||
import common.steamcraft.common.block.tile.TileEntityLightningRod;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -15,7 +15,7 @@ import net.minecraft.world.World;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
public class BlockLightningRod extends BlockContainer //implements ISimpleBlockRenderingHandler
|
||||
public class BlockLightningRod extends BlockContainerMod //implements ISimpleBlockRenderingHandler
|
||||
{
|
||||
public BlockLightningRod(int id)
|
||||
{
|
|
@ -1,9 +1,9 @@
|
|||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import common.steamcraft.mod.client.lib.GuiIDs;
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.client.lib.GuiIDs;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -11,10 +11,10 @@
|
|||
*
|
||||
* File created @ [Feb 1, 2014, 12:26:32 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityMachine;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.block.tile.TileEntityMachine;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
|
@ -1,9 +1,9 @@
|
|||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import common.steamcraft.mod.client.lib.GuiIDs;
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.client.lib.GuiIDs;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -0,0 +1,65 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 3:30:22 PM]
|
||||
*/
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class MachineConstants {
|
||||
public static final float STEAM_PER_UNIT = 60.0F;
|
||||
|
||||
public static enum MachineTypes {
|
||||
NONE(null, null, false),
|
||||
MACHINE_PENDULUM("machine.pendulum", BlockCompressor.class, true);
|
||||
|
||||
String name;
|
||||
public Class instanceClass;
|
||||
boolean placable;
|
||||
|
||||
private MachineTypes(String name, Class instanceClass, boolean placable) {
|
||||
this.name = name;
|
||||
this.instanceClass = instanceClass;
|
||||
this.placable = placable;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return this.name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public Class getInstanceClass() {
|
||||
return this.instanceClass;
|
||||
}
|
||||
|
||||
public void setInstanceClass(Class instanceClass) {
|
||||
this.instanceClass = instanceClass;
|
||||
}
|
||||
|
||||
public boolean isPlacable() {
|
||||
return this.placable;
|
||||
}
|
||||
|
||||
public void setPlacable(boolean placable) {
|
||||
this.placable = placable;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -15,18 +15,16 @@
|
|||
*
|
||||
* File created @ [Feb 1, 2014, 6:02:89 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.machines;
|
||||
package common.steamcraft.common.block.machines;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.mod.common.lib.BlockIDs;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
|
||||
import common.steamcraft.common.block.tile.TileEntityChemicalFurnace;
|
||||
import common.steamcraft.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.common.block.tile.TileEntitySteamFurnace;
|
||||
import common.steamcraft.common.lib.BlockIDs;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.common.registry.LanguageRegistry;
|
||||
|
|
@ -0,0 +1,536 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 4:01:46 PM]
|
||||
*/
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
import net.minecraftforge.fluids.IFluidTank;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.item.ItemCanister;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import common.steamcraft.common.util.EffectUtil;
|
||||
import common.steamcraft.mod.api.CoupleUtil;
|
||||
import common.steamcraft.mod.api.ISteamConsumer;
|
||||
import common.steamcraft.mod.api.ISteamProvider;
|
||||
import common.steamcraft.mod.api.ISteamStorage;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class TileEntityBasicSteamBoiler extends TileEntityMachine implements ISidedInventory, IInventory, IFluidTank, ISteamProvider {
|
||||
public static final int MAX_CAPACITY = 10000;
|
||||
public static final float STEAM_PRODUCED = 60.0F;
|
||||
private FluidTank[] liquidTank;
|
||||
private ItemStack[] inventoryItems;
|
||||
private int burnTime;
|
||||
private int maxBurnTime;
|
||||
private Random random = new Random();
|
||||
private boolean steaming;
|
||||
private boolean burning;
|
||||
private int particleDelay;
|
||||
|
||||
public TileEntityBasicSteamBoiler() {
|
||||
this.inventoryItems = new ItemStack[3];
|
||||
this.liquidTank = new FluidTank[] { new FluidTank(Block.waterStill.blockID, 10000) };
|
||||
}
|
||||
|
||||
public boolean isSteaming() {
|
||||
return this.steaming;
|
||||
}
|
||||
|
||||
public void setSteaming(boolean steaming) {
|
||||
if (this.steaming != steaming)
|
||||
setMarkedForResend(true);
|
||||
this.steaming = steaming;
|
||||
}
|
||||
|
||||
public boolean isBurning()
|
||||
{
|
||||
return this.burning;
|
||||
}
|
||||
|
||||
public void setBurning(boolean burning)
|
||||
{
|
||||
if (this.burning != burning)
|
||||
setMarkedForResend(true);
|
||||
this.burning = burning;
|
||||
}
|
||||
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityLiving)
|
||||
{
|
||||
int side = MathHelper.floor_double(entityLiving.rotationYaw * 4.0F / 360.0F + 0.5D) & 0x3;
|
||||
|
||||
switch (side)
|
||||
{
|
||||
case 0:
|
||||
side = 2;
|
||||
break;
|
||||
case 1:
|
||||
side = 5;
|
||||
break;
|
||||
case 2:
|
||||
side = 3;
|
||||
break;
|
||||
case 3:
|
||||
side = 4;
|
||||
}
|
||||
|
||||
setFacingDirection(side);
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbtTagCompound)
|
||||
{
|
||||
super.readFromNBT(nbtTagCompound);
|
||||
|
||||
this.inventoryItems = new ItemStack[3];
|
||||
NBTTagList tagList = nbtTagCompound.getTagList("Items");
|
||||
|
||||
for (int i = 0; i < tagList.tagCount(); i++)
|
||||
{
|
||||
NBTTagCompound itemCompound = (NBTTagCompound)tagList.tagAt(i);
|
||||
int slot = itemCompound.getByte("Slot");
|
||||
if ((slot >= 0) && (slot < this.inventoryItems.length)) {
|
||||
this.inventoryItems[slot] = ItemStack.loadItemStackFromNBT(itemCompound);
|
||||
}
|
||||
}
|
||||
NBTTagCompound liquidCompound = (NBTTagCompound)nbtTagCompound.getTag("Liquid");
|
||||
if (liquidCompound != null)
|
||||
{
|
||||
FluidStack fluid = new FluidStack(0, 0);
|
||||
fluid.loadFluidStackFromNBT(liquidCompound);
|
||||
this.liquidTank[0].setFluid(fluid);
|
||||
}
|
||||
else {
|
||||
this.liquidTank[0].setFluid(null);
|
||||
}
|
||||
this.burnTime = nbtTagCompound.getShort("BurnTime");
|
||||
this.maxBurnTime = nbtTagCompound.getShort("MaxBurnTime");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbtTagCompound)
|
||||
{
|
||||
super.writeToNBT(nbtTagCompound);
|
||||
NBTTagList tagList = new NBTTagList();
|
||||
|
||||
for (int i = 0; i < this.inventoryItems.length; i++)
|
||||
{
|
||||
if (this.inventoryItems[i] == null)
|
||||
continue;
|
||||
NBTTagCompound itemCompound = new NBTTagCompound();
|
||||
itemCompound.setByte("Slot", (byte)i);
|
||||
this.inventoryItems[i].writeToNBT(itemCompound);
|
||||
tagList.appendTag(itemCompound);
|
||||
}
|
||||
|
||||
nbtTagCompound.setTag("Items", tagList);
|
||||
|
||||
if (this.liquidTank[0].getFluid() != null)
|
||||
{
|
||||
NBTTagCompound liquidCompound = new NBTTagCompound();
|
||||
this.liquidTank[0].getFluid().writeToNBT(liquidCompound);
|
||||
nbtTagCompound.setTag("Liquid", liquidCompound);
|
||||
}
|
||||
|
||||
nbtTagCompound.setShort("BurnTime", (short)this.burnTime);
|
||||
nbtTagCompound.setShort("MaxBurnTime", (short)this.maxBurnTime);
|
||||
}
|
||||
|
||||
public void writePacket(DataOutputStream dataStream)
|
||||
throws IOException
|
||||
{
|
||||
super.writePacket(dataStream);
|
||||
|
||||
dataStream.writeBoolean(this.steaming);
|
||||
dataStream.writeBoolean(this.burning);
|
||||
}
|
||||
|
||||
public void readPartialPacket(DataInputStream dataStream)
|
||||
throws IOException
|
||||
{
|
||||
this.steaming = dataStream.readBoolean();
|
||||
this.burning = dataStream.readBoolean();
|
||||
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
}
|
||||
|
||||
public void updateEntity()
|
||||
{
|
||||
manageDeletion();
|
||||
|
||||
if (!this.worldObj.isRemote)
|
||||
{
|
||||
boolean currentSteaming = false;
|
||||
boolean currentBurning = false;
|
||||
|
||||
if ((this.liquidTank[0].getFluid() != null) && (this.liquidTank[0].getFluid().amount >= 1))
|
||||
{
|
||||
if ((this.burnTime > 0) || ((this.inventoryItems[0] != null) && (TileEntityFurnace.isItemFuel(this.inventoryItems[0]))))
|
||||
{
|
||||
currentBurning = true;
|
||||
if (this.burnTime == 0) {
|
||||
refuel();
|
||||
}
|
||||
this.liquidTank[0].getFluid().amount -= 1;
|
||||
|
||||
if (this.liquidTank[0].getFluid().amount == 0) {
|
||||
this.liquidTank[0].setFluid(null);
|
||||
}
|
||||
float produced = 60.0F;
|
||||
if ((this.inventoryItems[1] != null) && (this.inventoryItems[1].itemID == ModItems.canisterSteam.itemID) && (!ItemCanister.isFull(this.inventoryItems[1])))
|
||||
{
|
||||
float filled = Math.min(150000.0F - ItemCanister.getSteam(this.inventoryItems[1]), produced);
|
||||
ItemCanister.setSteam(this.inventoryItems[1], ItemCanister.getSteam(this.inventoryItems[1]) + filled);
|
||||
produced -= filled;
|
||||
}
|
||||
|
||||
if (produced > 0.0F)
|
||||
{
|
||||
CoupleUtil connected = TileEntitySteamPipe.findConnectedEntity(this.worldObj, this.xCoord, this.yCoord + 1, this.zCoord, ForgeDirection.UP.ordinal());
|
||||
|
||||
if (connected != null)
|
||||
{
|
||||
if ((connected.getFirstObject() instanceof ISteamConsumer))
|
||||
{
|
||||
((ISteamConsumer)connected.getFirstObject()).addSteam(produced);
|
||||
}
|
||||
else if ((connected.getFirstObject() instanceof ISteamStorage))
|
||||
{
|
||||
((ISteamStorage)connected.getFirstObject()).supplySteam(produced, ((Integer)connected.getSecondObject()).intValue(), new ArrayList());
|
||||
}
|
||||
}
|
||||
else if (this.worldObj.getBlockId(this.xCoord, this.yCoord + 1, this.zCoord) == 0) {
|
||||
currentSteaming = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (this.burnTime > 0)
|
||||
{
|
||||
this.burnTime -= 1;
|
||||
currentBurning = true;
|
||||
}
|
||||
|
||||
if (this.inventoryItems[2] != null)
|
||||
{
|
||||
FluidStack addLiquid = FluidContainerRegistry.getFluidForFilledItem(this.inventoryItems[2]);
|
||||
|
||||
int filled = fill(0, addLiquid, false);
|
||||
if ((filled > 0) && (addLiquid != null) && (filled == addLiquid.amount))
|
||||
{
|
||||
fill(0, addLiquid, true);
|
||||
if (this.inventoryItems[2].stackSize == 1)
|
||||
this.inventoryItems[2] = this.inventoryItems[2].getItem().getContainerItemStack(this.inventoryItems[2]);
|
||||
else {
|
||||
this.inventoryItems[2].stackSize -= 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
setSteaming(currentSteaming);
|
||||
setBurning(currentBurning);
|
||||
}
|
||||
else {
|
||||
if (this.steaming) {
|
||||
EffectUtil.displayFX("smoke", this.worldObj, this.xCoord + 0.5D, this.yCoord + 1, this.zCoord + 0.5D, this.random.nextDouble() / 50.0D, 0.03D, this.random.nextDouble() / 50.0D, 2.5F);
|
||||
}
|
||||
|
||||
if ((this.burning) && (this.particleDelay == 0))
|
||||
{
|
||||
float var7 = this.xCoord + 0.5F;
|
||||
float var8 = this.yCoord + 0.0F + this.random.nextFloat() * 6.0F / 16.0F;
|
||||
float var9 = this.zCoord + 0.5F;
|
||||
float var10 = 0.52F;
|
||||
float var11 = this.random.nextFloat() * 0.6F - 0.3F;
|
||||
|
||||
if (this.facingDirection == 4)
|
||||
{
|
||||
this.worldObj.spawnParticle("smoke", var7 - var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("flame", var7 - var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (this.facingDirection == 5)
|
||||
{
|
||||
this.worldObj.spawnParticle("smoke", var7 + var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("flame", var7 + var10, var8, var9 + var11, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (this.facingDirection == 2)
|
||||
{
|
||||
this.worldObj.spawnParticle("smoke", var7 + var11, var8, var9 - var10, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("flame", var7 + var11, var8, var9 - var10, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
else if (this.facingDirection == 3)
|
||||
{
|
||||
this.worldObj.spawnParticle("smoke", var7 + var11, var8, var9 + var10, 0.0D, 0.0D, 0.0D);
|
||||
this.worldObj.spawnParticle("flame", var7 + var11, var8, var9 + var10, 0.0D, 0.0D, 0.0D);
|
||||
}
|
||||
|
||||
this.particleDelay = 5;
|
||||
}
|
||||
|
||||
if (this.particleDelay > 0) {
|
||||
this.particleDelay -= 1;
|
||||
}
|
||||
}
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
public int getBlockTextureFromSide(int side)
|
||||
{
|
||||
if ((side == this.facingDirection) && (!this.burning))
|
||||
return 10;
|
||||
if ((side == this.facingDirection) && (this.burning))
|
||||
return 13;
|
||||
if (side == 1)
|
||||
return 12;
|
||||
return 11;
|
||||
}
|
||||
|
||||
private void refuel()
|
||||
{
|
||||
if ((this.inventoryItems[0] != null) && (TileEntityFurnace.isItemFuel(this.inventoryItems[0])))
|
||||
{
|
||||
this.burnTime = TileEntityFurnace.getItemBurnTime(this.inventoryItems[0]);
|
||||
this.maxBurnTime = this.burnTime;
|
||||
|
||||
this.inventoryItems[0].stackSize -= 1;
|
||||
|
||||
if (this.inventoryItems[0].stackSize == 0)
|
||||
{
|
||||
this.inventoryItems[0] = this.inventoryItems[0].getItem().getContainerItemStack(this.inventoryItems[0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void onBreak()
|
||||
{
|
||||
for (int i = 0; i < this.inventoryItems.length; i++)
|
||||
{
|
||||
ItemStack stack = this.inventoryItems[i];
|
||||
|
||||
if (stack == null)
|
||||
continue;
|
||||
float randx = this.random.nextFloat() * 0.8F + 0.1F;
|
||||
float randy = this.random.nextFloat() * 0.8F + 0.1F;
|
||||
float randz = this.random.nextFloat() * 0.8F + 0.1F;
|
||||
|
||||
EntityItem entItem = new EntityItem(this.worldObj, this.xCoord + randx, this.yCoord + randy, this.zCoord + randz, new ItemStack(stack.itemID, stack.stackSize, stack.getItemDamage()));
|
||||
|
||||
entItem.motionX = ((float)this.random.nextGaussian() * 0.05F);
|
||||
entItem.motionY = ((float)this.random.nextGaussian() * 0.05F + 0.2F);
|
||||
entItem.motionZ = ((float)this.random.nextGaussian() * 0.05F);
|
||||
|
||||
if (stack.hasTagCompound())
|
||||
{
|
||||
entItem.getEntityItem().setTagCompound((NBTTagCompound)stack.getTagCompound().copy());
|
||||
}
|
||||
this.worldObj.spawnEntityInWorld(entItem);
|
||||
}
|
||||
}
|
||||
|
||||
public int getBurnTime()
|
||||
{
|
||||
return this.burnTime;
|
||||
}
|
||||
|
||||
public void setBurnTime(int burnTime)
|
||||
{
|
||||
this.burnTime = burnTime;
|
||||
}
|
||||
|
||||
public int getMaxBurnTime()
|
||||
{
|
||||
return this.maxBurnTime;
|
||||
}
|
||||
|
||||
public void setMaxBurnTime(int maxBurnTime)
|
||||
{
|
||||
this.maxBurnTime = maxBurnTime;
|
||||
}
|
||||
|
||||
public int getBurnTimeScaled(int maxSize)
|
||||
{
|
||||
if (this.maxBurnTime == 0)
|
||||
{
|
||||
this.maxBurnTime = 200;
|
||||
}
|
||||
|
||||
return this.burnTime * maxSize / this.maxBurnTime;
|
||||
}
|
||||
|
||||
public boolean onActivated(EntityPlayer player, int side, float hitX, float hitY, float hitZ)
|
||||
{
|
||||
if (!player.isSneaking())
|
||||
{
|
||||
if (this.worldObj.isRemote)
|
||||
return true;
|
||||
player.openGui(SC2.instance, 0, this.worldObj, this.xCoord, this.yCoord, this.zCoord);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public int fill(ForgeDirection from, FluidStack resource, boolean doFill)
|
||||
{
|
||||
return fill(0, resource, doFill);
|
||||
}
|
||||
|
||||
public int fill(int tankIndex, FluidStack resource, boolean doFill)
|
||||
{
|
||||
if ((resource == null) || (resource.fluidID != Block.waterStill.blockID)) { // XXX No metadata?
|
||||
return 0;
|
||||
}
|
||||
return this.liquidTank[0].fill(resource, doFill);
|
||||
}
|
||||
|
||||
public FluidStack drain(ForgeDirection from, int maxDrain, boolean doDrain)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public FluidStack drain(int tankIndex, int maxDrain, boolean doDrain)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
public IFluidTank[] getTanks(ForgeDirection direction)
|
||||
{
|
||||
return this.liquidTank;
|
||||
}
|
||||
|
||||
public IFluidTank getTank(ForgeDirection direction, FluidStack type)
|
||||
{
|
||||
return this.liquidTank[0];
|
||||
}
|
||||
|
||||
public int getSizeInventory()
|
||||
{
|
||||
return this.inventoryItems.length;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlot(int var1)
|
||||
{
|
||||
return this.inventoryItems[var1];
|
||||
}
|
||||
|
||||
public ItemStack decrStackSize(int slot, int amount)
|
||||
{
|
||||
if (this.inventoryItems[slot] != null)
|
||||
{
|
||||
if (this.inventoryItems[slot].stackSize <= amount)
|
||||
{
|
||||
ItemStack stack = this.inventoryItems[slot];
|
||||
this.inventoryItems[slot] = null;
|
||||
onInventoryChanged();
|
||||
return stack;
|
||||
}
|
||||
|
||||
ItemStack stack = this.inventoryItems[slot].splitStack(amount);
|
||||
|
||||
if (this.inventoryItems[slot].stackSize == 0)
|
||||
{
|
||||
this.inventoryItems[slot] = null;
|
||||
}
|
||||
|
||||
onInventoryChanged();
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public ItemStack getStackInSlotOnClosing(int slot)
|
||||
{
|
||||
if (this.inventoryItems[slot] != null)
|
||||
{
|
||||
ItemStack stack = this.inventoryItems[slot];
|
||||
this.inventoryItems[slot] = null;
|
||||
return stack;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public void setInventorySlotContents(int slot, ItemStack stack)
|
||||
{
|
||||
this.inventoryItems[slot] = stack;
|
||||
|
||||
if ((stack != null) && (stack.stackSize > getInventoryStackLimit()))
|
||||
{
|
||||
stack.stackSize = getInventoryStackLimit();
|
||||
}
|
||||
|
||||
onInventoryChanged();
|
||||
}
|
||||
|
||||
public String getInvName()
|
||||
{
|
||||
return "container.steamboiler";
|
||||
}
|
||||
|
||||
public int getInventoryStackLimit()
|
||||
{
|
||||
return 64;
|
||||
}
|
||||
|
||||
public boolean isUseableByPlayer(EntityPlayer player)
|
||||
{
|
||||
return this.worldObj.getBlockTileEntity(this.xCoord, this.yCoord, this.zCoord) == this;
|
||||
}
|
||||
|
||||
public void openChest()
|
||||
{
|
||||
}
|
||||
|
||||
public void closeChest()
|
||||
{
|
||||
}
|
||||
|
||||
public int getStartInventorySide(ForgeDirection side)
|
||||
{
|
||||
if (side == ForgeDirection.DOWN)
|
||||
return 0;
|
||||
if ((side == ForgeDirection.UP) || (side.ordinal() == this.facingDirection) || (side.getOpposite().ordinal() == this.facingDirection)) {
|
||||
return 1;
|
||||
}
|
||||
return 2;
|
||||
}
|
||||
|
||||
public int getSizeInventorySide(ForgeDirection side)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
}
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import common.steamcraft.mod.common.block.machines.BlockChemicalFurnace;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
import common.steamcraft.common.block.machines.BlockChemicalFurnace;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
|
@ -11,10 +11,9 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 6:25:21 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.tile;
|
||||
|
||||
import common.steamcraft.mod.common.block.BlockChimney;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import common.steamcraft.common.block.BlockChimney;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -15,26 +15,25 @@
|
|||
*
|
||||
* File created @ [Feb 6, 2014, 7:00:56 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import universalelectricity.api.energy.EnergyStorageHandler;
|
||||
|
||||
import common.steamcraft.mod.common.block.machines.BlockCompressor;
|
||||
import common.steamcraft.mod.common.core.handler.recipe.CompressorHandler;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
|
||||
import common.steamcraft.common.block.machines.BlockCompressor;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* The TileEntity class for the CompresorBlock
|
||||
*
|
||||
* @author MrArcane111
|
||||
* @author MrArcane111 & decabeldecabel
|
||||
*
|
||||
*/
|
||||
public class TileEntityCompressor extends TileEntityElectricMachine implements ISidedInventory
|
||||
|
@ -201,8 +200,7 @@ public class TileEntityCompressor extends TileEntityElectricMachine implements I
|
|||
if (!worldObj.isRemote)
|
||||
{
|
||||
if(inventory[2]!=null && energy.getEmptySpace() > 0)
|
||||
this.discharge(inventory[2]);
|
||||
|
||||
this.discharge(2, this);
|
||||
if (this.canSmelt())
|
||||
{
|
||||
if(this.getEnergy(null)==0)
|
||||
|
@ -220,7 +218,7 @@ public class TileEntityCompressor extends TileEntityElectricMachine implements I
|
|||
}
|
||||
else
|
||||
furnaceBurnTime = 0;
|
||||
|
||||
*/
|
||||
if (var1 != furnaceBurnTime > 0)
|
||||
{
|
||||
var2 = true;
|
||||
|
@ -231,7 +229,7 @@ public class TileEntityCompressor extends TileEntityElectricMachine implements I
|
|||
if (var2)
|
||||
this.onInventoryChanged();
|
||||
}
|
||||
|
||||
/*
|
||||
private boolean canSmelt()
|
||||
{
|
||||
if (inventory[0] == null)
|
||||
|
@ -265,7 +263,7 @@ public class TileEntityCompressor extends TileEntityElectricMachine implements I
|
|||
else
|
||||
--inventory[1].stackSize;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@Override
|
||||
public boolean isUseableByPlayer(EntityPlayer par1EntityPlayer)
|
|
@ -1,4 +1,4 @@
|
|||
/**
|
||||
x/**
|
||||
* This class was created by <MrArcane111> or his SC2 development team.
|
||||
* This class is available as part of the Steamcraft 2 Mod for Minecraft.
|
||||
*
|
||||
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Feb 6, 2014, 7:20:17 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
|
@ -29,7 +29,11 @@ import universalelectricity.api.energy.EnergyStorageHandler;
|
|||
import universalelectricity.api.energy.IEnergyContainer;
|
||||
import universalelectricity.api.energy.IEnergyInterface;
|
||||
import universalelectricity.api.vector.Vector3;
|
||||
|
||||
import universalelectricity.compatibility.Compatibility;
|
||||
import universalelectricity.core.item.ElectricItemHelper;
|
||||
import universalelectricity.core.item.IItemElectric;
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import common.steamcraft.common.core.helper.CompatHelper;
|
||||
/**
|
||||
* @author Decebaldecebal
|
||||
*
|
|
@ -0,0 +1,61 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 10:12:21 AM]
|
||||
*/
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
import net.minecraft.network.packet.Packet;
|
||||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import common.steamcraft.common.network.NetworkTile;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class TileEntityEtheriumCrystal extends NetworkTile {
|
||||
@Override
|
||||
public void writePacket(DataOutputStream dataStream) throws IOException {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readPacket(DataInputStream dataStream) throws IOException {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.readFromNBT(nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readPacketFromClient(DataInputStream dataStream) throws IOException {}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) {
|
||||
this.readFromNBT(packet.data);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 10:15:40 AM]
|
||||
*/
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import common.steamcraft.client.model.ModelEtheriumCrystal;
|
||||
import common.steamcraft.client.model.ModelLightningRod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class TileEntityEtheriumCrystalRenderer extends TileEntitySpecialRenderer {
|
||||
private final ModelEtheriumCrystal model;
|
||||
|
||||
public TileEntityEtheriumCrystalRenderer() {
|
||||
this.model = new ModelEtheriumCrystal();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float scale) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.5F, (float) z + 0.5F);
|
||||
ResourceLocation crystal = (new ResourceLocation(LibInfo.SC2_PREFIX + "textures/models/crystal.png"));
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(crystal);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180F, 0.0F, 0.0F, 1.0F);
|
||||
this.model.render((Entity)null, 0.0F, 0.0F, -0.1F, 0.0F, 0.0F, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
||||
|
@ -10,7 +10,7 @@ import net.minecraft.nbt.NBTTagList;
|
|||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
import universalelectricity.api.energy.EnergyStorageHandler;
|
||||
import common.steamcraft.mod.common.block.machines.BlockCompressor;
|
||||
import common.steamcraft.common.block.machines.BlockCompressor;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.INetworkManager;
|
||||
|
@ -6,21 +6,18 @@ import net.minecraft.network.packet.Packet;
|
|||
import net.minecraft.network.packet.Packet132TileEntityData;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityLamp extends TileEntity
|
||||
{
|
||||
public class TileEntityLamp extends TileEntity {
|
||||
public TileEntityLamp() {}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket()
|
||||
{
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
this.writeToNBT(nbt);
|
||||
return new Packet132TileEntityData(this.xCoord, this.yCoord, this.zCoord, 1, nbt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet)
|
||||
{
|
||||
public void onDataPacket(INetworkManager net, Packet132TileEntityData packet) {
|
||||
this.readFromNBT(packet.data);
|
||||
}
|
||||
}
|
|
@ -1,9 +1,9 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import common.steamcraft.mod.client.model.ModelLampSide;
|
||||
import common.steamcraft.mod.client.model.ModelLampUp;
|
||||
import common.steamcraft.mod.common.block.ModBlocks;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.client.model.ModelLampSide;
|
||||
import common.steamcraft.client.model.ModelLampUp;
|
||||
import common.steamcraft.common.block.ModBlocks;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import common.steamcraft.mod.client.model.ModelLightningRod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.client.model.ModelLightningRod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.entity.Entity;
|
|
@ -0,0 +1,209 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 1, 2014, 12:54:18 PM]
|
||||
*/
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import common.steamcraft.common.block.machines.MachineConstants;
|
||||
import common.steamcraft.common.network.NetworkTile;
|
||||
import common.steamcraft.mod.api.IMachine;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class TileEntityMachine extends NetworkTile implements IMachine {
|
||||
protected int machineType;
|
||||
protected int facingDirection;
|
||||
private boolean markedForDeletion;
|
||||
|
||||
public int getMachineType() {
|
||||
return this.machineType;
|
||||
}
|
||||
|
||||
public void setMachineType(int machineType) {
|
||||
this.machineType = machineType;
|
||||
}
|
||||
|
||||
public boolean isMarkedForDeletion() {
|
||||
return this.markedForDeletion;
|
||||
}
|
||||
|
||||
public void setMarkedForDeletion(boolean markedForDeletion) {
|
||||
this.markedForDeletion = markedForDeletion;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.readFromNBT(nbtTagCompound);
|
||||
int machineType = nbtTagCompound.getInteger("machineType");
|
||||
|
||||
if (machineType != 0) {
|
||||
if (getMachineType() != machineType) {
|
||||
TileEntityMachine newMachine;
|
||||
//TileEntityMachine newMachine;
|
||||
|
||||
if (MachineConstants.MachineTypes.values()[machineType].getInstanceClass().isInstance(this)) {
|
||||
setMachineType(machineType);
|
||||
newMachine = this;
|
||||
} else {
|
||||
newMachine = initMachine(machineType);
|
||||
newMachine.readFromNBT(nbtTagCompound);
|
||||
}
|
||||
|
||||
newMachine.setFacingDirection(nbtTagCompound.getByte("direction"));
|
||||
}
|
||||
} else {
|
||||
setMarkedForDeletion(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTagCompound) {
|
||||
super.writeToNBT(nbtTagCompound);
|
||||
nbtTagCompound.setInteger("machineType", this.machineType);
|
||||
nbtTagCompound.setByte("direction", (byte)this.facingDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writePacket(DataOutputStream dataStream) throws IOException {
|
||||
dataStream.writeInt(this.machineType);
|
||||
dataStream.writeByte(this.facingDirection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readPacket(DataInputStream dataStream) throws IOException {
|
||||
int readType = dataStream.readInt();
|
||||
TileEntityMachine machine;
|
||||
//TileEntityMachine machine;
|
||||
|
||||
if (readType != getMachineType()) {
|
||||
machine = initMachine(readType);
|
||||
} else
|
||||
{
|
||||
machine = this;
|
||||
}
|
||||
|
||||
machine.setFacingDirection(dataStream.readByte());
|
||||
machine.readPartialPacket(dataStream);
|
||||
}
|
||||
|
||||
public void readPartialPacket(DataInputStream dataStream) throws IOException {}
|
||||
|
||||
public TileEntityMachine initMachine(int machineType)
|
||||
{
|
||||
setMachineType(machineType);
|
||||
TileEntityMachine machine = null;
|
||||
|
||||
if (machineType != 0) {
|
||||
try {
|
||||
machine = (TileEntityMachine)MachineConstants.MachineTypes.values()[machineType].instanceClass.getConstructors()[0].newInstance(new Object[0]);
|
||||
this.worldObj.setBlockTileEntity(this.xCoord, this.yCoord, this.zCoord, machine);
|
||||
machine.setMachineType(machineType);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return machine;
|
||||
}
|
||||
|
||||
public void manageDeletion() {
|
||||
if (this.markedForDeletion) {
|
||||
this.worldObj.removeBlockTileEntity(this.xCoord, this.yCoord, this.zCoord);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public double[] getBounds() {
|
||||
return new double[] { 0.0D, 0.0D, 0.0D, 1.0D, 1.0D, 1.0D };
|
||||
}
|
||||
|
||||
public boolean isNormalCube() {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
manageDeletion();
|
||||
super.updateEntity();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getFacingDirection() {
|
||||
return this.facingDirection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFacingDirection(int facingDirection) {
|
||||
this.facingDirection = facingDirection;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSolidOnSide(ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBreak() {}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLiving entityLiving) {}
|
||||
|
||||
@Override
|
||||
public boolean onActivated(EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList getBlockDropped() {
|
||||
ArrayList result = new ArrayList();
|
||||
//result.add(new ItemStack(ModMachines.blockMachine, 1, getMachineType()));
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getHardness() {
|
||||
return 1.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isActive() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void a(NBTTagCompound paramNBTTagCompound) {}
|
||||
|
||||
@Override
|
||||
public void b(NBTTagCompound paramNBTTagCompound) {}
|
||||
|
||||
@Override
|
||||
public void readPacketFromClient(DataInputStream dataStream) throws IOException {}
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Feb 7, 2014, 3:36:22 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import common.steamcraft.mod.common.block.machines.BlockNukeFurnace;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
import common.steamcraft.common.block.machines.BlockNukeFurnace;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.Item;
|
|
@ -1,6 +1,6 @@
|
|||
package common.steamcraft.mod.common.block.tile;
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import common.steamcraft.mod.common.block.machines.BlockSteamFurnace;
|
||||
import common.steamcraft.common.block.machines.BlockSteamFurnace;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -0,0 +1,284 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 17, 2014, 2:46:52 PM]
|
||||
*/
|
||||
package common.steamcraft.common.block.tile;
|
||||
|
||||
import java.io.DataInputStream;
|
||||
import java.io.DataOutputStream;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeDirection;
|
||||
|
||||
import common.steamcraft.common.network.NetworkTile;
|
||||
import common.steamcraft.mod.api.CoupleUtil;
|
||||
import common.steamcraft.mod.api.ISteamConsumer;
|
||||
import common.steamcraft.mod.api.ISteamProvider;
|
||||
import common.steamcraft.mod.api.ISteamStorage;
|
||||
|
||||
import cpw.mods.fml.common.FMLLog;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class TileEntitySteamPipe extends NetworkTile {
|
||||
private int connection;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean loaded;
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbtTag) {
|
||||
super.readFromNBT(nbtTag);
|
||||
this.connection = nbtTag.getByte("Connection");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbtTag) {
|
||||
super.writeToNBT(nbtTag);
|
||||
nbtTag.setByte("Connection", (byte)this.connection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writePacket(DataOutputStream dataStream) throws IOException {
|
||||
dataStream.writeByte(this.connection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readPacket(DataInputStream dataStream) throws IOException {
|
||||
this.connection = dataStream.readByte();
|
||||
this.loaded = true;
|
||||
}
|
||||
|
||||
public static int getConnectionCode(int side1, int side2) {
|
||||
if (side1 == side2) {
|
||||
FMLLog.warning("Incorrect pipe connection", new Object[0]);
|
||||
}
|
||||
if (side1 > side2) {
|
||||
return (side1 << 3) + side2;
|
||||
}
|
||||
|
||||
return (side2 << 3) + side1;
|
||||
}
|
||||
|
||||
public int getConnection1() {
|
||||
return this.connection >> 3;
|
||||
}
|
||||
|
||||
public int getConnection2() {
|
||||
return this.connection & 0x7;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateContainingBlockInfo() {
|
||||
super.updateContainingBlockInfo();
|
||||
|
||||
if (!this.worldObj.isRemote) {
|
||||
int placedSide = this.worldObj.getBlockMetadata(this.xCoord, this.yCoord, this.zCoord) - 1;
|
||||
|
||||
if (placedSide != -1) {
|
||||
boolean isConnected = false;
|
||||
this.worldObj.setBlockMetadataWithNotify(this.xCoord, this.yCoord, this.zCoord, 0, 2);
|
||||
this.connection = getConnectionCode(placedSide, ForgeDirection.OPPOSITES[placedSide]);
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(placedSide);
|
||||
TileEntity te = this.worldObj.getBlockTileEntity(this.xCoord - direction.offsetX, this.yCoord - direction.offsetY, this.zCoord - direction.offsetZ);
|
||||
|
||||
if ((te != null) && ((te instanceof TileEntitySteamPipe))) {
|
||||
TileEntitySteamPipe otherPipe = (TileEntitySteamPipe)te;
|
||||
|
||||
if (otherPipe.connectEmptySide(placedSide)) {
|
||||
isConnected = true;
|
||||
cycleConnections(ForgeDirection.OPPOSITES[placedSide]);
|
||||
}
|
||||
}
|
||||
if (!isConnected) {
|
||||
cycleConnections(-1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean connectEmptySide(int sideToConnect) {
|
||||
int[] sides = new int[2];
|
||||
sides[0] = getConnection1();
|
||||
sides[1] = getConnection2();
|
||||
|
||||
if ((sides[0] == sideToConnect) || (sides[1] == sideToConnect)) {
|
||||
return true;
|
||||
}
|
||||
for (int i = 0; i < 2; i++) {
|
||||
boolean acceptDirection = true;
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(sides[i]);
|
||||
TileEntity te = this.worldObj.getBlockTileEntity(this.xCoord + direction.offsetX, this.yCoord + direction.offsetY, this.zCoord + direction.offsetZ);
|
||||
|
||||
if ((te != null) && ((te instanceof TileEntitySteamPipe))) {
|
||||
TileEntitySteamPipe otherPipe = (TileEntitySteamPipe)te;
|
||||
|
||||
if (ForgeDirection.OPPOSITES[otherPipe.getConnection1()] == sides[i]) {
|
||||
acceptDirection = false;
|
||||
} else if (ForgeDirection.OPPOSITES[otherPipe.getConnection2()] == sides[i]) {
|
||||
acceptDirection = false;
|
||||
}
|
||||
} else if ((te != null) && (((te instanceof ISteamConsumer)) || ((te instanceof ISteamProvider)) || ((te instanceof ISteamStorage)))) {
|
||||
acceptDirection = false;
|
||||
}
|
||||
if (!acceptDirection) {
|
||||
continue;
|
||||
}
|
||||
|
||||
sides[i] = sideToConnect;
|
||||
this.connection = getConnectionCode(sides[0], sides[1]);
|
||||
setMarkedForResend(true);
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public void cycleConnections(int forcedDirection) {
|
||||
if (!this.worldObj.isRemote) {
|
||||
List possibleDirections = new ArrayList();
|
||||
|
||||
for (int side = 0; side < 6; side++) {
|
||||
ForgeDirection direction = ForgeDirection.getOrientation(side);
|
||||
TileEntity otherTile = this.worldObj.getBlockTileEntity(this.xCoord + direction.offsetX, this.yCoord + direction.offsetY, this.zCoord + direction.offsetZ);
|
||||
|
||||
if (otherTile == null) {
|
||||
continue;
|
||||
}
|
||||
if ((!(otherTile instanceof TileEntitySteamPipe)) && (!(otherTile instanceof ISteamConsumer)) && (!(otherTile instanceof ISteamProvider)) && (!(otherTile instanceof ISteamStorage))) {
|
||||
continue;
|
||||
}
|
||||
|
||||
possibleDirections.add(Integer.valueOf(side));
|
||||
}
|
||||
if (possibleDirections.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
List availableConnection = new ArrayList();
|
||||
Integer posDir1;
|
||||
|
||||
for (Iterator iterator = possibleDirections.iterator(); iterator.hasNext();) {
|
||||
posDir1 = (Integer)iterator.next();
|
||||
|
||||
for (Integer posDir2 : possibleDirections) {
|
||||
if ((posDir1 != posDir2) && ((forcedDirection == -1) || (posDir1.intValue() == forcedDirection) || (posDir2.intValue() == forcedDirection))) {
|
||||
int newConnection = getConnectionCode(posDir1.intValue(), posDir2.intValue());
|
||||
|
||||
if (!availableConnection.contains(Integer.valueOf(newConnection))) {
|
||||
availableConnection.add(Integer.valueOf(newConnection));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Integer posDir1;
|
||||
|
||||
if (availableConnection.isEmpty()) {
|
||||
if (forcedDirection != -1) {
|
||||
availableConnection.add(Integer.valueOf(getConnectionCode(forcedDirection, ForgeDirection.OPPOSITES[forcedDirection])));
|
||||
} else {
|
||||
availableConnection.add(Integer.valueOf(getConnectionCode(((Integer)possibleDirections.get(0)).intValue(), ForgeDirection.OPPOSITES[((Integer)possibleDirections.get(0)).intValue()])));
|
||||
}
|
||||
}
|
||||
|
||||
Collections.sort(availableConnection);
|
||||
boolean found = false;
|
||||
|
||||
for (int i = 0; i < availableConnection.size(); i++) {
|
||||
if (((Integer)availableConnection.get(i)).intValue() != this.connection) {
|
||||
continue;
|
||||
}
|
||||
|
||||
found = true;
|
||||
|
||||
if (i == availableConnection.size() - 1) {
|
||||
this.connection = ((Integer)availableConnection.get(0)).intValue(); break;
|
||||
}
|
||||
|
||||
this.connection = ((Integer)availableConnection.get(i + 1)).intValue();
|
||||
break;
|
||||
}
|
||||
if (!found) {
|
||||
this.connection = ((Integer)availableConnection.get(0)).intValue();
|
||||
}
|
||||
|
||||
setMarkedForResend(true);
|
||||
}
|
||||
}
|
||||
|
||||
public static CoupleUtil findConnectedEntity(World world, int startX, int startY, int startZ, int startSide) {
|
||||
int x = startX;
|
||||
int y = startY;
|
||||
int z = startZ;
|
||||
int side = startSide;
|
||||
boolean found = false;
|
||||
|
||||
while (!found) {
|
||||
TileEntity te = world.getBlockTileEntity(x, y, z);
|
||||
|
||||
if (te == null) {
|
||||
return null;
|
||||
}
|
||||
if (((te instanceof ISteamConsumer)) || ((te instanceof ISteamStorage))) {
|
||||
return new CoupleUtil(te, Integer.valueOf(ForgeDirection.OPPOSITES[side]));
|
||||
}
|
||||
if ((te instanceof TileEntitySteamPipe)) {
|
||||
TileEntitySteamPipe nextPipe = (TileEntitySteamPipe)te;
|
||||
ForgeDirection nextDirection = null;
|
||||
|
||||
if (nextPipe.getConnection1() == ForgeDirection.OPPOSITES[side]) {
|
||||
nextDirection = ForgeDirection.getOrientation(nextPipe.getConnection2());
|
||||
} else if (nextPipe.getConnection2() == ForgeDirection.OPPOSITES[side]) {
|
||||
nextDirection = ForgeDirection.getOrientation(nextPipe.getConnection1());
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
|
||||
x += nextDirection.offsetX;
|
||||
y += nextDirection.offsetY;
|
||||
z += nextDirection.offsetZ;
|
||||
side = nextDirection.ordinal();
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
return AxisAlignedBB.getAABBPool().getAABB(this.xCoord, this.yCoord, this.zCoord, this.xCoord + 1.0D, this.yCoord + 1.0D, this.zCoord + 1.0D);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readPacketFromClient(DataInputStream dataStream) throws IOException {
|
||||
}
|
||||
}
|
|
@ -1,7 +1,6 @@
|
|||
package common.steamcraft.mod.common.block.tile.container;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityChemicalFurnace;
|
||||
package common.steamcraft.common.block.tile.container;
|
||||
|
||||
import common.steamcraft.common.block.tile.TileEntityChemicalFurnace;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.tile.container;
|
||||
package common.steamcraft.common.block.tile.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -6,11 +6,9 @@ import net.minecraft.inventory.Container;
|
|||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.mod.common.block.tile.container.slot.SlotBattery;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
|
||||
import common.steamcraft.common.block.tile.TileEntityCompressor;
|
||||
import common.steamcraft.common.block.tile.container.slot.SlotBattery;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.tile.container;
|
||||
package common.steamcraft.common.block.tile.container;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
@ -6,10 +6,8 @@ import net.minecraft.inventory.Container;
|
|||
import net.minecraft.inventory.ICrafting;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.mod.common.block.tile.container.slot.SlotBattery;
|
||||
|
||||
import common.steamcraft.common.block.tile.TileEntityGenerator;
|
||||
import common.steamcraft.common.block.tile.container.slot.SlotBattery;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
|
@ -1,7 +1,7 @@
|
|||
package common.steamcraft.mod.common.block.tile.container;
|
||||
package common.steamcraft.common.block.tile.container;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.mod.common.block.tile.container.slot.SlotNukeFurnace;
|
||||
import common.steamcraft.common.block.tile.TileEntityNukeFurnace;
|
||||
import common.steamcraft.common.block.tile.container.slot.SlotNukeFurnace;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -1,7 +1,6 @@
|
|||
package common.steamcraft.mod.common.block.tile.container;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntitySteamFurnace;
|
||||
package common.steamcraft.common.block.tile.container;
|
||||
|
||||
import common.steamcraft.common.block.tile.TileEntitySteamFurnace;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -1,10 +1,9 @@
|
|||
package common.steamcraft.mod.common.block.tile.container.slot;
|
||||
package common.steamcraft.common.block.tile.container.slot;
|
||||
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import common.steamcraft.mod.common.block.tile.TileEntityElectricMachine;
|
||||
import common.steamcraft.common.block.tile.TileEntityElectricMachine;
|
||||
|
||||
public class SlotBattery extends Slot
|
||||
{
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.block.tile.container.slot;
|
||||
package common.steamcraft.common.block.tile.container.slot;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import net.minecraft.entity.item.EntityXPOrb;
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:33:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler;
|
||||
package common.steamcraft.common.core.handler;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Feb 7, 2014, 4:13:42 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler;
|
||||
package common.steamcraft.common.core.handler;
|
||||
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:33:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler;
|
||||
package common.steamcraft.common.core.handler;
|
||||
|
||||
import net.minecraftforge.common.Configuration;
|
||||
|
|
@ -15,12 +15,11 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:33:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler;
|
||||
|
||||
import common.steamcraft.mod.common.item.ItemBrassWings;
|
||||
import common.steamcraft.mod.common.item.ModArmors;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
package common.steamcraft.common.core.handler;
|
||||
|
||||
import common.steamcraft.common.item.ItemBrassWings;
|
||||
import common.steamcraft.common.item.ModArmors;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
@ -34,7 +33,7 @@ import net.minecraftforge.event.world.BlockEvent.HarvestDropsEvent;
|
|||
* @author MrArcane111 & general3214
|
||||
*
|
||||
*/
|
||||
public class EventHandlerSC2 {
|
||||
public class ModEventHandler {
|
||||
@ForgeSubscribe
|
||||
public void onHarvestDrops(HarvestDropsEvent event) {
|
||||
if (event.block.blockID == Block.tallGrass.blockID) {
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:33:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler;
|
||||
package common.steamcraft.common.core.handler;
|
||||
|
||||
import java.util.EnumSet;
|
||||
|
|
@ -0,0 +1,92 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.common.core.handler;
|
||||
|
||||
import common.steamcraft.common.block.ModOres;
|
||||
import cpw.mods.fml.common.IWorldGenerator;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraft.world.chunk.IChunkProvider;
|
||||
import net.minecraft.world.gen.feature.WorldGenMinable;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
/**
|
||||
* @author MrArcane111
|
||||
*
|
||||
*/
|
||||
public class WorldGenerator implements IWorldGenerator {
|
||||
@Override
|
||||
public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider generator, IChunkProvider chunk) {
|
||||
int blockChunkX = chunkX * 16;
|
||||
int blockChunkZ = chunkZ * 16;
|
||||
|
||||
switch (world.provider.dimensionId) {
|
||||
case -1:
|
||||
generateNether(world, random, blockChunkX, blockChunkZ);
|
||||
break;
|
||||
case 0:
|
||||
generateSurface(world, random, blockChunkX, blockChunkZ);
|
||||
break;
|
||||
case 1:
|
||||
generateEnd(world, random, blockChunkX, blockChunkZ);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void generateSurface(World world, Random random, int chunkX, int chunkZ) {
|
||||
for (int chance = 0; chance < 1; chance++) {
|
||||
int etheriumXCoord = chunkX + random.nextInt(16);
|
||||
int etheriumYCoord = 8 + random.nextInt(12);
|
||||
int etheriumZCoord = chunkZ + random.nextInt(16);
|
||||
|
||||
new WorldGenMinable(ModOres.oreVolucite.blockID, random.nextInt(2)).generate(world, random, etheriumXCoord, etheriumYCoord, etheriumZCoord);
|
||||
}
|
||||
for (int chance = 0; chance < 3; chance++) {
|
||||
int uraniteXCoord = chunkX + random.nextInt(16);
|
||||
int uraniteYCoord = random.nextInt(24);
|
||||
int uraniteZCoord = chunkZ + random.nextInt(16);
|
||||
|
||||
new WorldGenMinable(ModOres.oreUranite.blockID, random.nextInt(5)).generate(world, random, uraniteXCoord, uraniteYCoord, uraniteZCoord);
|
||||
}
|
||||
for (int chance = 0; chance < 10; chance++) {
|
||||
int brimstoneXCoord = chunkX + random.nextInt(16);
|
||||
int brimstoneYCoord = random.nextInt(64);
|
||||
int brimstoneZCoord = chunkZ + random.nextInt(16);
|
||||
|
||||
new WorldGenMinable(ModOres.oreBrimstone.blockID, random.nextInt(8)).generate(world, random, brimstoneXCoord, brimstoneYCoord, brimstoneZCoord);
|
||||
}
|
||||
for (int chance = 0; chance < 20; chance++) {
|
||||
int borniteXCoord = chunkX + random.nextInt(16);
|
||||
int borniteYCoord = random.nextInt(48);
|
||||
int borniteZCoord = chunkZ + random.nextInt(16);
|
||||
|
||||
new WorldGenMinable(ModOres.oreBornite.blockID, random.nextInt(12)).generate(world, random, borniteXCoord, borniteYCoord, borniteZCoord);
|
||||
}
|
||||
for (int chance = 0; chance < 3; chance++) {
|
||||
int phosphateXCoord = chunkX + random.nextInt(16);
|
||||
int phosphateYCoord = random.nextInt(36);
|
||||
int phosphateZCoord = chunkZ + random.nextInt(16);
|
||||
|
||||
new WorldGenMinable(ModOres.orePhosphate.blockID, random.nextInt(6)).generate(world, random, phosphateXCoord, phosphateYCoord, phosphateZCoord);
|
||||
}
|
||||
}
|
||||
|
||||
private void generateEnd(World world, Random random, int i, int j) {}
|
||||
|
||||
private void generateNether(World world, Random random, int i, int j) {}
|
||||
}
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Feb 15, 2014, 1:28:27 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler.recipe;
|
||||
package common.steamcraft.common.core.handler.recipe;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.IInventory;
|
|
@ -15,10 +15,9 @@
|
|||
*
|
||||
* File created @ [Feb 15, 2014, 1:25:18 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.handler.recipe;
|
||||
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
package common.steamcraft.common.core.handler.recipe;
|
||||
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import cpw.mods.fml.common.IFuelHandler;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:51:27 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.helper;
|
||||
package common.steamcraft.common.core.helper;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Feb 6, 2014, 6:57:06 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.helper;
|
||||
package common.steamcraft.common.core.helper;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:53:46 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.helper;
|
||||
package common.steamcraft.common.core.helper;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:44:59 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.helper;
|
||||
package common.steamcraft.common.core.helper;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
|
@ -15,7 +15,7 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 5:19:11 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.core.proxy;
|
||||
package common.steamcraft.common.core.proxy;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
|
@ -29,22 +29,22 @@ import net.minecraftforge.common.MinecraftForge;
|
|||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
|
||||
import common.steamcraft.mod.client.core.handler.GuiHandler;
|
||||
import common.steamcraft.mod.client.core.handler.KeyHandlerMod;
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.block.ModBlocks;
|
||||
import common.steamcraft.mod.common.core.handler.ChestLootGenerator;
|
||||
import common.steamcraft.mod.common.core.handler.CommandHandler;
|
||||
import common.steamcraft.mod.common.core.handler.ConfigHandler;
|
||||
import common.steamcraft.mod.common.core.handler.EventHandlerSC2;
|
||||
import common.steamcraft.mod.common.core.handler.TickHandler;
|
||||
import common.steamcraft.mod.common.core.handler.WorldGenerator;
|
||||
import common.steamcraft.mod.common.core.helper.CompatHelper;
|
||||
import common.steamcraft.mod.common.entity.EntityBullet;
|
||||
import common.steamcraft.mod.common.item.ModItems;
|
||||
import common.steamcraft.mod.common.lib.EntityIDs;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.mod.common.network.PlayerTracker;
|
||||
import common.steamcraft.client.core.handler.GuiHandler;
|
||||
import common.steamcraft.client.core.handler.KeyHandlerMod;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.block.ModBlocks;
|
||||
import common.steamcraft.common.core.handler.ChestLootGenerator;
|
||||
import common.steamcraft.common.core.handler.CommandHandler;
|
||||
import common.steamcraft.common.core.handler.ConfigHandler;
|
||||
import common.steamcraft.common.core.handler.ModEventHandler;
|
||||
import common.steamcraft.common.core.handler.TickHandler;
|
||||
import common.steamcraft.common.core.handler.WorldGenerator;
|
||||
import common.steamcraft.common.core.helper.CompatHelper;
|
||||
import common.steamcraft.common.entity.EntityBullet;
|
||||
import common.steamcraft.common.item.ModItems;
|
||||
import common.steamcraft.common.lib.EntityIDs;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import common.steamcraft.common.network.PlayerTracker;
|
||||
|
||||
import cpw.mods.fml.client.registry.KeyBindingRegistry;
|
||||
import cpw.mods.fml.common.Mod.EventHandler;
|
||||
|
@ -74,7 +74,7 @@ public class CommonProxy {
|
|||
}
|
||||
|
||||
public void init(FMLInitializationEvent event) {
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandlerSC2());
|
||||
MinecraftForge.EVENT_BUS.register(new ModEventHandler());
|
||||
GameRegistry.registerWorldGenerator(new WorldGenerator());
|
||||
NetworkRegistry.instance().registerGuiHandler(SC2.instance, new GuiHandler());
|
||||
GameRegistry.registerPlayerTracker(new PlayerTracker());
|
||||
|
@ -103,9 +103,11 @@ public class CommonProxy {
|
|||
|
||||
public void initTileEntities() {
|
||||
// Lamp
|
||||
GameRegistry.registerTileEntity(common.steamcraft.mod.common.block.tile.TileEntityLamp.class, LibInfo.MOD_ID + "TELamp");
|
||||
GameRegistry.registerTileEntity(common.steamcraft.common.block.tile.TileEntityLamp.class, LibInfo.MOD_ID + "TELamp");
|
||||
// Lightning Rod
|
||||
GameRegistry.registerTileEntity(common.steamcraft.mod.common.block.tile.TileEntityLightningRod.class, LibInfo.MOD_ID + "TELightningRod");
|
||||
GameRegistry.registerTileEntity(common.steamcraft.common.block.tile.TileEntityLightningRod.class, LibInfo.MOD_ID + "TELightningRod");
|
||||
// Ehterium Crystal
|
||||
GameRegistry.registerTileEntity(common.steamcraft.common.block.tile.TileEntityEtheriumCrystal.class, LibInfo.MOD_ID + "TECrystal");
|
||||
}
|
||||
|
||||
public void registerKeyBinds() {
|
|
@ -1,8 +1,8 @@
|
|||
package common.steamcraft.mod.common.entity;
|
||||
package common.steamcraft.common.entity;
|
||||
|
||||
import common.steamcraft.mod.common.item.ModGuns;
|
||||
import common.steamcraft.mod.common.lib.EntityIDs;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
import common.steamcraft.common.item.ModGuns;
|
||||
import common.steamcraft.common.lib.EntityIDs;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
|
@ -1,8 +1,7 @@
|
|||
package common.steamcraft.mod.common.item;
|
||||
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.common.lib.LibInfo;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.lib.LibInfo;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.renderer.texture.IconRegister;
|
|
@ -1,4 +1,4 @@
|
|||
package common.steamcraft.mod.common.item;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
|
@ -15,10 +15,10 @@
|
|||
*
|
||||
* File created @ [Feb 5, 2014, 8:29:30 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.item;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
|
@ -15,10 +15,9 @@
|
|||
*
|
||||
* File created @ [Feb 4, 2014, 5:13:56 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.item;
|
||||
|
||||
import common.steamcraft.mod.client.core.helper.ClientHelper;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import common.steamcraft.client.core.helper.ClientHelper;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatMessageComponent;
|
|
@ -11,10 +11,10 @@
|
|||
*
|
||||
* File created @ [Jan 30, 2014, 6:11:43 PM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.item;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.Minecraft;
|
|
@ -0,0 +1,91 @@
|
|||
/**
|
||||
* This class was created by <MrArcane111> or his SC2 development 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 created by Proloe.
|
||||
* Steamcraft (c) Proloe 2011
|
||||
* (http://www.minecraftforum.net/topic/251532-181-steamcraft-source-code-releasedmlv054wip/)
|
||||
*
|
||||
* Some code is derived from PowerCraft created by MightyPork which is registered
|
||||
* under the MMPL v1.0.
|
||||
* PowerCraft (c) MightyPork 2012
|
||||
*
|
||||
* File created @ [Feb 4, 2014, 5:13:56 PM]
|
||||
*/
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author MrArcane111, EntireCraft & general3214
|
||||
*
|
||||
*/
|
||||
public class ItemCanister extends ItemMod
|
||||
{
|
||||
public String gas;
|
||||
public static final float MAX_STEAM = 150000.0F;
|
||||
public static final int MAX_STEAM_VISIBLE = 2500;
|
||||
|
||||
public ItemCanister(int id, int durability, String energy) {
|
||||
super(id);
|
||||
this.maxStackSize = 1;
|
||||
this.setNoRepair();
|
||||
this.setMaxDamage(2501);
|
||||
//gas = energy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(int itemID, CreativeTabs tab, List list) {
|
||||
list.add(new ItemStack(itemID, 1, getMaxDamage()));
|
||||
list.add(new ItemStack(itemID, 1, 1));
|
||||
}
|
||||
|
||||
private static NBTTagCompound getOrCreateNBT(ItemStack stack) {
|
||||
if (stack.getTagCompound() == null) {
|
||||
stack.setTagCompound(new NBTTagCompound());
|
||||
stack.getTagCompound().setFloat("Steam", (ModItems.canisterSteam.getMaxDamage() - stack.getItemDamage()) * 60.0F);
|
||||
}
|
||||
|
||||
return stack.getTagCompound();
|
||||
}
|
||||
|
||||
public static float getSteam(ItemStack stack) {
|
||||
NBTTagCompound compound = getOrCreateNBT(stack);
|
||||
return compound.getFloat("Steam");
|
||||
}
|
||||
|
||||
public static void setSteam(ItemStack stack, float steam) {
|
||||
NBTTagCompound compound = getOrCreateNBT(stack);
|
||||
float steamToAdd = Math.max(Math.min(steam, 150000.0F), 0.0F);
|
||||
compound.setFloat("Steam", steamToAdd);
|
||||
stack.setItemDamage(ModItems.canisterSteam.getMaxDamage() - Math.round(steamToAdd / 60.0F));
|
||||
}
|
||||
|
||||
public static boolean isFull(ItemStack stack) {
|
||||
NBTTagCompound compound = getOrCreateNBT(stack);
|
||||
return compound.getFloat("Steam") >= 150000.0F;
|
||||
}
|
||||
|
||||
public static boolean isEmpty(ItemStack stack) {
|
||||
NBTTagCompound compound = getOrCreateNBT(stack);
|
||||
return compound.getFloat("Steam") <= 0.0F;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean flag) {
|
||||
list.add(String.format("%d/%d", new Object[] { Integer.valueOf(getMaxDamage() - itemStack.getItemDamage()), Integer.valueOf(2500) }));
|
||||
}
|
||||
}
|
|
@ -11,11 +11,11 @@
|
|||
*
|
||||
* File created @ [Feb 1, 2014, 8:19:17 AM]
|
||||
*/
|
||||
package common.steamcraft.mod.common.item;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import common.steamcraft.mod.common.SC2;
|
||||
import common.steamcraft.mod.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.mod.common.lib.ItemNames;
|
||||
import common.steamcraft.common.SC2;
|
||||
import common.steamcraft.common.lib.CreativeTabsMod;
|
||||
import common.steamcraft.common.lib.ItemNames;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
|
@ -1,7 +1,6 @@
|
|||
package common.steamcraft.mod.common.item;
|
||||
|
||||
import common.steamcraft.mod.common.block.ModBlocks;
|
||||
package common.steamcraft.common.item;
|
||||
|
||||
import common.steamcraft.common.block.ModBlocks;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue