generated from tilera/1710mod
feat: implement generator
This commit is contained in:
parent
684d9e9c9f
commit
72408a15c7
21
build.gradle
21
build.gradle
|
@ -34,12 +34,29 @@ minecraft {
|
|||
|
||||
repositories {
|
||||
maven { url = "https://maven.tilera.xyz" }
|
||||
maven {
|
||||
name = "ic2"
|
||||
url = "https://maven.ic2.player.to/"
|
||||
metadataSources {
|
||||
artifact()
|
||||
}
|
||||
}
|
||||
maven {
|
||||
name 'central'
|
||||
url 'https://maven.thorfusion.com/artifactory/central/'
|
||||
}
|
||||
}
|
||||
|
||||
dependencies {
|
||||
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
|
||||
implementation "dev.tilera:auracore:1.9.0:deobf"
|
||||
//implementation "codechicken:CodeChickenCore:1.7.10-1.0.7.48:dev"
|
||||
//implementation "codechicken:CodeChickenLib:1.7.10-1.1.3.141:dev"
|
||||
//implementation "codechicken:NotEnoughItems:1.7.10-1.0.5.120:dev"
|
||||
//implementation "com.eloraam.redpower:redpower:2.0pr10-dirty:deobf"
|
||||
implementation "com.github.tox1cozZ:mixin-booter-legacy:1.1.2"
|
||||
implementation "dev.tilera:auracore:1.9.0:deobf"
|
||||
implementation "net.industrial-craft:industrialcraft-2:2.2.660-experimental:dev"
|
||||
implementation "thaumcraft:Thaumcraft:1.7.10-4.2.3.5:deobf"
|
||||
implementation "universalelectricity:universalelectricity:5.2.2:deobf"
|
||||
}
|
||||
|
||||
processResources {
|
||||
|
|
|
@ -9,6 +9,7 @@ import net.anvilcraft.thaummach.gui.GuiArcaneFurnace;
|
|||
import net.anvilcraft.thaummach.gui.GuiBore;
|
||||
import net.anvilcraft.thaummach.gui.GuiCondenser;
|
||||
import net.anvilcraft.thaummach.gui.GuiCrystallizer;
|
||||
import net.anvilcraft.thaummach.gui.GuiGenerator;
|
||||
import net.anvilcraft.thaummach.gui.GuiRepairer;
|
||||
import net.anvilcraft.thaummach.gui.GuiSoulBrazier;
|
||||
import net.anvilcraft.thaummach.gui.GuiVoidChest;
|
||||
|
@ -19,6 +20,7 @@ import net.anvilcraft.thaummach.render.tile.TileBoreRenderer;
|
|||
import net.anvilcraft.thaummach.render.tile.TileCondenserRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileConduitPumpRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileCrystallizerRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileGeneratorRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileRepairerRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileSealRenderer;
|
||||
import net.anvilcraft.thaummach.render.tile.TileVoidChestRenderer;
|
||||
|
@ -34,6 +36,7 @@ import net.anvilcraft.thaummach.tiles.TileConduitValveAdvanced;
|
|||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrystallizer;
|
||||
import net.anvilcraft.thaummach.tiles.TileFilter;
|
||||
import net.anvilcraft.thaummach.tiles.TileGenerator;
|
||||
import net.anvilcraft.thaummach.tiles.TilePurifier;
|
||||
import net.anvilcraft.thaummach.tiles.TileRepairer;
|
||||
import net.anvilcraft.thaummach.tiles.TileSeal;
|
||||
|
@ -79,6 +82,7 @@ public class ClientProxy extends CommonProxy {
|
|||
ClientRegistry.registerTileEntity(TileCondenser.class, "condenser", new TileCondenserRenderer());
|
||||
ClientRegistry.registerTileEntity(TileConduitPump.class, "conduit_pump", new TileConduitPumpRenderer());
|
||||
ClientRegistry.registerTileEntity(TileCrystallizer.class, "crystallizer", new TileCrystallizerRenderer());
|
||||
ClientRegistry.registerTileEntity(TileGenerator.class, "generator", new TileGeneratorRenderer());
|
||||
ClientRegistry.registerTileEntity(TileRepairer.class, "repairer", new TileRepairerRenderer());
|
||||
ClientRegistry.registerTileEntity(TileSeal.class, "seal", new TileSealRenderer());
|
||||
ClientRegistry.registerTileEntity(TileVoidChest.class, "voidChest", new TileVoidChestRenderer());
|
||||
|
@ -103,6 +107,9 @@ public class ClientProxy extends CommonProxy {
|
|||
case CRYSTALLIZER:
|
||||
return new GuiCrystallizer(player.inventory, (TileCrystallizer) te);
|
||||
|
||||
case GENERATOR:
|
||||
return new GuiGenerator((TileGenerator) te);
|
||||
|
||||
case REPAIRER:
|
||||
return new GuiRepairer(player.inventory, (TileRepairer) te);
|
||||
|
||||
|
|
|
@ -21,13 +21,16 @@ import net.anvilcraft.thaummach.tiles.TileConduitValveAdvanced;
|
|||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrystallizer;
|
||||
import net.anvilcraft.thaummach.tiles.TileFilter;
|
||||
import net.anvilcraft.thaummach.tiles.TileGenerator;
|
||||
import net.anvilcraft.thaummach.tiles.TilePurifier;
|
||||
import net.anvilcraft.thaummach.tiles.TileRepairer;
|
||||
import net.anvilcraft.thaummach.tiles.TileSeal;
|
||||
import net.anvilcraft.thaummach.tiles.TileSoulBrazier;
|
||||
import net.anvilcraft.thaummach.tiles.TileVoidChest;
|
||||
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
|
@ -49,6 +52,7 @@ public class CommonProxy implements IGuiHandler {
|
|||
GameRegistry.registerTileEntity(TileCrucible.class, "crucible");
|
||||
GameRegistry.registerTileEntity(TileCrystallizer.class, "crystallizer");
|
||||
GameRegistry.registerTileEntity(TileFilter.class, "filter");
|
||||
GameRegistry.registerTileEntity(TileGenerator.class, "generator");
|
||||
GameRegistry.registerTileEntity(TilePurifier.class, "purifier");
|
||||
GameRegistry.registerTileEntity(TileRepairer.class, "repairer");
|
||||
GameRegistry.registerTileEntity(TileSeal.class, "seal");
|
||||
|
@ -91,6 +95,15 @@ public class CommonProxy implements IGuiHandler {
|
|||
player.inventory, (TileVoidInterface) te
|
||||
);
|
||||
|
||||
// GUIs with no meaningful container
|
||||
case GENERATOR:
|
||||
return new Container() {
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
default:
|
||||
throw new IllegalArgumentException("ALEC");
|
||||
}
|
||||
|
|
|
@ -5,6 +5,7 @@ public enum GuiID {
|
|||
BORE,
|
||||
CONDENSER,
|
||||
CRYSTALLIZER,
|
||||
GENERATOR,
|
||||
REPAIRER,
|
||||
SOUL_BRAZIER,
|
||||
VOID_CHEST,
|
||||
|
|
|
@ -1,5 +1,13 @@
|
|||
package net.anvilcraft.thaummach;
|
||||
|
||||
/**
|
||||
* Implemented by Apparatus {@link net.minecraft.tileentity.TileEntity}s which have a GUI that's
|
||||
* opened on right-click.
|
||||
*/
|
||||
public interface ITileGui {
|
||||
/**
|
||||
* Get the GUI ID {@link net.anvilcraft.thaummach.blocks.BlockApparatus}
|
||||
* will use to determine a GUI to open on right-click.
|
||||
*/
|
||||
public GuiID getGuiID();
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@ package net.anvilcraft.thaummach.blocks;
|
|||
|
||||
import java.util.Random;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import net.anvilcraft.thaummach.AuraUtils;
|
||||
import net.anvilcraft.thaummach.GuiID;
|
||||
import net.anvilcraft.thaummach.ITileGui;
|
||||
|
@ -19,6 +20,7 @@ import net.minecraft.item.ItemStack;
|
|||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.MinecraftForgeClient;
|
||||
|
||||
public abstract class BlockApparatus extends BlockContainer {
|
||||
protected int currentPass;
|
||||
|
@ -74,6 +76,7 @@ public abstract class BlockApparatus extends BlockContainer {
|
|||
if (te instanceof ITileGui) {
|
||||
if (world.isRemote)
|
||||
return true;
|
||||
|
||||
GuiID id = ((ITileGui) te).getGuiID();
|
||||
|
||||
entityplayer.openGui(
|
||||
|
|
|
@ -5,13 +5,13 @@ import java.util.Random;
|
|||
import java.util.stream.IntStream;
|
||||
|
||||
import dev.tilera.auracore.client.FXSparkle;
|
||||
import net.anvilcraft.thaummach.AuraUtils;
|
||||
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.ArcaneFurnaceApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.BoreApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.CrucibleApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.CrystallizerApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.GeneratorApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.SoulBrazierApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.TankApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.metal.VoidChestApparatusRenderer;
|
||||
|
@ -21,6 +21,7 @@ import net.anvilcraft.thaummach.tiles.TileBore;
|
|||
import net.anvilcraft.thaummach.tiles.TileConduitTank;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrucible;
|
||||
import net.anvilcraft.thaummach.tiles.TileCrystallizer;
|
||||
import net.anvilcraft.thaummach.tiles.TileGenerator;
|
||||
import net.anvilcraft.thaummach.tiles.TileSoulBrazier;
|
||||
import net.anvilcraft.thaummach.tiles.TileVoidChest;
|
||||
import net.anvilcraft.thaummach.tiles.TileVoidInterface;
|
||||
|
@ -62,6 +63,7 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
public IIcon iconGenerator1;
|
||||
public IIcon iconGenerator2;
|
||||
public IIcon iconGenerator3;
|
||||
public IIcon iconGenerator4;
|
||||
public IIcon iconSoulBrazierBottom;
|
||||
public IIcon iconSoulBrazierSide;
|
||||
public IIcon iconSoulCrucibleBottom;
|
||||
|
@ -108,6 +110,7 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
this.iconGenerator1 = reg.registerIcon("thaummach:generator_1");
|
||||
this.iconGenerator2 = reg.registerIcon("thaummach:generator_2");
|
||||
this.iconGenerator3 = reg.registerIcon("thaummach:generator_3");
|
||||
this.iconGenerator4 = reg.registerIcon("thaummach:generator_4");
|
||||
this.iconSoulBrazierBottom = reg.registerIcon("thaummach:soul_brazier_bottom");
|
||||
this.iconSoulBrazierSide = reg.registerIcon("thaummach:soul_brazier_side");
|
||||
this.iconSoulCrucibleBottom = reg.registerIcon("thaummach:soul_crucible_bottom");
|
||||
|
@ -168,6 +171,9 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
case BORE:
|
||||
return BoreApparatusRenderer.INSTANCE;
|
||||
|
||||
case GENERATOR:
|
||||
return GeneratorApparatusRenderer.INSTANCE;
|
||||
|
||||
case VOID_CHEST:
|
||||
return VoidChestApparatusRenderer.INSTANCE;
|
||||
|
||||
|
@ -181,7 +187,7 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
return TankApparatusRenderer.INSTANCE;
|
||||
|
||||
default:
|
||||
return null;
|
||||
throw new IllegalArgumentException("ALEC");
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -195,7 +201,7 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
} else if (md == MetaVals.ARCANE_FURNACE) {
|
||||
return new TileArcaneFurnace();
|
||||
} else if (md == MetaVals.GENERATOR) {
|
||||
//return new TileGenerator();
|
||||
return new TileGenerator();
|
||||
} else if (md == MetaVals.CRYSTALLIZER) {
|
||||
return new TileCrystallizer();
|
||||
} else if (md == MetaVals.BORE) {
|
||||
|
@ -327,11 +333,9 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
} else if (meta == MetaVals.SOUL_BRAZIER) {
|
||||
return side == 0 || side == 1 ? this.iconSoulBrazierBottom
|
||||
: this.iconSoulBrazierSide;
|
||||
}
|
||||
//else if (meta == 5) {
|
||||
// return 144;
|
||||
//}
|
||||
else if (meta == MetaVals.CRYSTALLIZER) {
|
||||
} else if (meta == MetaVals.GENERATOR) {
|
||||
return this.iconGenerator1;
|
||||
} else if (meta == MetaVals.CRYSTALLIZER) {
|
||||
if (side == 1) {
|
||||
return this.iconCrystallizerTop;
|
||||
} else if (side == 0) {
|
||||
|
@ -652,33 +656,27 @@ public class BlockApparatusMetal extends BlockApparatus {
|
|||
}
|
||||
|
||||
if (meta == MetaVals.GENERATOR) {
|
||||
// TODO: generator
|
||||
//TileGenerator tg = (TileGenerator) w.getTileEntity(i, j, k);
|
||||
//int arcs = 20;
|
||||
//if (!ModLoader.getMinecraftInstance().gameSettings.fancyGraphics
|
||||
// || Config.lowGfx) {
|
||||
// arcs = 10;
|
||||
//}
|
||||
TileGenerator tg = (TileGenerator) w.getTileEntity(i, j, k);
|
||||
arcs = 20;
|
||||
|
||||
//arcs = arcs * tg.storedEnergy / tg.energyMax;
|
||||
//if (w.rand.nextInt(20) < arcs) {
|
||||
// LightningBolt bolt = new LightningBolt(
|
||||
// w,
|
||||
// (double) i + 0.5,
|
||||
// (double) j + 0.5,
|
||||
// (double) k + 0.5,
|
||||
// (double) i + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
// (double) j + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
// (double) k + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
// w.rand.nextLong(),
|
||||
// 6,
|
||||
// 9.0F
|
||||
// );
|
||||
// bolt.defaultFractal();
|
||||
// bolt.setType(0);
|
||||
// bolt.setNonLethal();
|
||||
// bolt.finalizeBolt();
|
||||
//}
|
||||
arcs = arcs * tg.storedEnergy / tg.energyMax;
|
||||
if (w.rand.nextInt(20) < arcs) {
|
||||
FXLightningBolt bolt = new FXLightningBolt(
|
||||
w,
|
||||
(double) i + 0.5,
|
||||
(double) j + 0.5,
|
||||
(double) k + 0.5,
|
||||
(double) i + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
(double) j + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
(double) k + 0.1 + (double) w.rand.nextFloat() * 0.8,
|
||||
w.rand.nextLong(),
|
||||
6,
|
||||
9.0F
|
||||
);
|
||||
bolt.defaultFractal();
|
||||
bolt.setType(0);
|
||||
bolt.finalizeBolt();
|
||||
}
|
||||
}
|
||||
|
||||
if (meta == MetaVals.CRYSTALLIZER) {
|
||||
|
|
|
@ -11,7 +11,7 @@ import net.anvilcraft.thaummach.particles.FXWisp;
|
|||
import net.anvilcraft.thaummach.render.BlockApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.wood.CondenserApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.wood.RepairerAparatusRenderer;
|
||||
import net.anvilcraft.thaummach.render.apparatus.apparati.wood.RepairerApparatusRenderer;
|
||||
import net.anvilcraft.thaummach.tiles.TileCondenser;
|
||||
import net.anvilcraft.thaummach.tiles.TileRepairer;
|
||||
import net.minecraft.block.Block;
|
||||
|
@ -96,7 +96,7 @@ public class BlockApparatusWood extends BlockApparatus {
|
|||
return CondenserApparatusRenderer.INSTANCE;
|
||||
|
||||
case REPAIRER:
|
||||
return RepairerAparatusRenderer.INSTANCE;
|
||||
return RepairerApparatusRenderer.INSTANCE;
|
||||
|
||||
default:
|
||||
return null;
|
||||
|
|
|
@ -0,0 +1,50 @@
|
|||
package net.anvilcraft.thaummach.gui;
|
||||
|
||||
import net.anvilcraft.thaummach.tiles.TileGenerator;
|
||||
import net.anvilcraft.thaummach.utils.UtilsFX;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.client.renderer.texture.TextureMap;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class GuiGenerator extends GuiScreen {
|
||||
private TileGenerator generator;
|
||||
|
||||
public GuiGenerator(TileGenerator tileGenerator) {
|
||||
this.generator = tileGenerator;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int i, int j, float f) {
|
||||
super.drawScreen(i, j, f);
|
||||
int xSize = 176;
|
||||
int ySize = 82;
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
super.mc.renderEngine.bindTexture(
|
||||
new ResourceLocation("thaummach", "textures/guis/generator.png")
|
||||
);
|
||||
int l = (super.width - xSize) / 2;
|
||||
int i1 = (super.height - ySize) / 2;
|
||||
this.drawTexturedModalRect(l, i1, 0, 0, xSize, ySize);
|
||||
int k1 = (int
|
||||
) (46.0F * (float) this.generator.storedEnergy / (float) this.generator.energyMax
|
||||
);
|
||||
this.drawTexturedModalRect(l + 84, i1 + 68 - k1, 176, 46 - k1, 9, k1);
|
||||
int moon = super.mc.theWorld.getMoonPhase();
|
||||
this.drawTexturedModalRect(l + 108, i1 + 41, 192, moon * 8, 8, 8);
|
||||
|
||||
super.mc.renderEngine.bindTexture(TextureMap.locationItemsTexture);
|
||||
for (int k = 0; k <= 1; k++) {
|
||||
UtilsFX.renderUpgradeIntoGUI(
|
||||
this, (int)this.generator.getUpgrades()[k], l + 56, i1 + 25 + 22 * k
|
||||
);
|
||||
}
|
||||
|
||||
super.fontRendererObj.drawString("Thaumic Generator", l + 42, i1 + 5, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doesGuiPauseGame() {
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,95 @@
|
|||
package net.anvilcraft.thaummach.render.apparatus.apparati.metal;
|
||||
|
||||
import net.anvilcraft.thaummach.blocks.BlockApparatusMetal;
|
||||
import net.anvilcraft.thaummach.render.apparatus.ApparatusRenderingHelper;
|
||||
import net.anvilcraft.thaummach.render.apparatus.IApparatusRenderer;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class GeneratorApparatusRenderer implements IApparatusRenderer {
|
||||
public static final GeneratorApparatusRenderer INSTANCE
|
||||
= new GeneratorApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
||||
IBlockAccess w,
|
||||
RenderBlocks rb,
|
||||
int x,
|
||||
int y,
|
||||
int z,
|
||||
Block block_,
|
||||
int meta,
|
||||
boolean inv
|
||||
) {
|
||||
BlockApparatusMetal block = (BlockApparatusMetal) block_;
|
||||
float w2 = 0.125F;
|
||||
float w4 = 0.25F;
|
||||
if (block.getRenderBlockPass() == 0 || inv) {
|
||||
rb.setRenderBounds(w4, 0.0F, w4, 1.0F - w4, w2, 1.0F - w4);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator1, true);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(w4, 1.0F - w2, w4, 1.0F - w4, 1.0F, 1.0F - w4);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator1, true);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(
|
||||
1.0F - w2, 0.5F - w4, 0.5F - w4, 1.0F, 0.5F + w4, 0.5F + w4
|
||||
);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator1, true);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(0.0F, 0.5F - w4, 0.5F - w4, w2, 0.5F + w4, 0.5F + w4);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator1, true);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(
|
||||
0.5F - w4, 0.5F - w4, 1.0F - w2, 0.5F + w4, 0.5F + w4, 1.0F
|
||||
);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator1, true);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
rb.setRenderBounds(0.5F - w4, 0.5F - w4, 0.0F, 0.5F + w4, 0.5F + w4, w2);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator1, true);
|
||||
} else {
|
||||
rb.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
}
|
||||
|
||||
if (block.getRenderBlockPass() == 1 || inv) {
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(w2, w2, w2, 1.0F - w2, 1.0F - w2, 1.0F - w2);
|
||||
if (inv) {
|
||||
ApparatusRenderingHelper.drawFaces(rb, block, block.iconGenerator4, true);
|
||||
} else {
|
||||
rb.renderFaceYNeg(block, x, y, z, block.iconGenerator4);
|
||||
rb.renderFaceYPos(block, x, y, z, block.iconGenerator4);
|
||||
rb.renderFaceXNeg(block, x, y, z, block.iconGenerator4);
|
||||
rb.renderFaceXPos(block, x, y, z, block.iconGenerator4);
|
||||
rb.renderFaceZNeg(block, x, y, z, block.iconGenerator4);
|
||||
rb.renderFaceZPos(block, x, y, z, block.iconGenerator4);
|
||||
}
|
||||
}
|
||||
|
||||
rb.overrideBlockTexture = null;
|
||||
rb.setRenderBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
|
@ -9,9 +9,9 @@ import net.minecraft.block.Block;
|
|||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RepairerAparatusRenderer implements IApparatusRenderer {
|
||||
public static final RepairerAparatusRenderer INSTANCE
|
||||
= new RepairerAparatusRenderer();
|
||||
public class RepairerApparatusRenderer implements IApparatusRenderer {
|
||||
public static final RepairerApparatusRenderer INSTANCE
|
||||
= new RepairerApparatusRenderer();
|
||||
|
||||
@Override
|
||||
public void renderApparatus(
|
|
@ -0,0 +1,38 @@
|
|||
package net.anvilcraft.thaummach.render.model;
|
||||
|
||||
import net.minecraft.client.model.ModelBase;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.entity.Entity;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class ModelGenCore extends ModelBase {
|
||||
private ModelRenderer cube;
|
||||
private ModelRenderer outer = new ModelRenderer(this, "glass");
|
||||
|
||||
public ModelGenCore(float f) {
|
||||
this.outer.setTextureOffset(0, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
|
||||
this.cube = new ModelRenderer(this, "cube");
|
||||
this.cube.setTextureOffset(32, 0).addBox(-4.0F, -4.0F, -4.0F, 8, 8, 8);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
render(Entity e, float f, float f1, float f2, float f3, float f4, float f5) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(0.8F, 0.8F, 0.8F);
|
||||
GL11.glTranslatef(0.0F, -1.0F, 0.0F);
|
||||
GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
|
||||
this.outer.render(f5);
|
||||
float f6 = 0.75F;
|
||||
GL11.glScalef(f6, f6, f6);
|
||||
GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
|
||||
GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
|
||||
this.outer.render(f5);
|
||||
GL11.glScalef(f6, f6, f6);
|
||||
GL11.glRotatef(60.0F, 0.7071F, 0.0F, 0.7071F);
|
||||
GL11.glRotatef(f1, 0.0F, 1.0F, 0.0F);
|
||||
this.cube.render(f5);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
|
@ -0,0 +1,37 @@
|
|||
package net.anvilcraft.thaummach.render.tile;
|
||||
|
||||
import net.anvilcraft.thaummach.render.model.ModelGenCore;
|
||||
import net.anvilcraft.thaummach.tiles.TileGenerator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
public class TileGeneratorRenderer extends TileEntitySpecialRenderer {
|
||||
private int modelLoaded = -1;
|
||||
private ModelGenCore model;
|
||||
|
||||
public void renderCore(TileGenerator gen, double x, double y, double z, float f) {
|
||||
if (this.modelLoaded != 1) {
|
||||
this.model = new ModelGenCore(0.0F);
|
||||
this.modelLoaded = 1;
|
||||
}
|
||||
|
||||
float f2 = gen.rotation + f;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x + 0.5F, (float) y + 1.3F, (float) z + 0.5F);
|
||||
this.bindTexture(new ResourceLocation("thaummach", "textures/models/gencore.png")
|
||||
);
|
||||
float f3 = MathHelper.sin(f2 * 0.2F) / 2.0F + 0.5F;
|
||||
f3 += f3 * f3;
|
||||
this.model.render(null, 0.0F, f2 * 1.0F, f3 * 0.01F, 0.0F, 0.0F, 0.0625F);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void
|
||||
renderTileEntityAt(TileEntity tileentity, double x, double y, double z, float f) {
|
||||
this.renderCore((TileGenerator) tileentity, x, y, z, f);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,457 @@
|
|||
package net.anvilcraft.thaummach.tiles;
|
||||
|
||||
import dev.tilera.auracore.api.machine.IUpgradable;
|
||||
import dev.tilera.auracore.api.machine.TileVisUser;
|
||||
import dev.tilera.auracore.aura.AuraManager;
|
||||
import ic2.api.energy.event.EnergyTileLoadEvent;
|
||||
import ic2.api.energy.event.EnergyTileUnloadEvent;
|
||||
import ic2.api.energy.tile.IEnergySource;
|
||||
import net.anvilcraft.thaummach.GuiID;
|
||||
import net.anvilcraft.thaummach.ITileGui;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
public class TileGenerator
|
||||
extends TileVisUser implements IEnergySource, IUpgradable, ITileGui {
|
||||
public float rotation = 0.0F;
|
||||
public int storedEnergy = 0;
|
||||
|
||||
public int energyMax = 5000;
|
||||
private int genloop;
|
||||
private byte[] upgrades = new byte[] { -1, -1 };
|
||||
private boolean emitPower = false;
|
||||
|
||||
private boolean isInit = false;
|
||||
|
||||
@Override
|
||||
public GuiID getGuiID() {
|
||||
return GuiID.GENERATOR;
|
||||
}
|
||||
|
||||
public void updateEntity() {
|
||||
super.updateEntity();
|
||||
if (!super.worldObj.isRemote) {
|
||||
if (!this.isInit) {
|
||||
this.isInit = true;
|
||||
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileLoadEvent(this));
|
||||
}
|
||||
|
||||
if (this.hasUpgrade((byte) 5)) {
|
||||
this.energyMax = 10000;
|
||||
}
|
||||
|
||||
int emit;
|
||||
int ret;
|
||||
if (!this.gettingPower()) {
|
||||
if (this.storedEnergy < this.energyMax) {
|
||||
float moon = (float) (2 + Math.abs(super.worldObj.getMoonPhase() - 4))
|
||||
* 0.2F;
|
||||
if (this.hasUpgrade((byte) 0)) {
|
||||
moon += 0.2F;
|
||||
}
|
||||
|
||||
float mod = this.hasUpgrade((byte) 1) ? 0.8F : 1.0F;
|
||||
float visperunit = 6.6666666E-4F * mod;
|
||||
float suck = visperunit
|
||||
* Math.min(
|
||||
75.0F * moon, (float) (this.energyMax - this.storedEnergy)
|
||||
);
|
||||
if (suck > 0.006666667F && this.getExactPureVis(suck)) {
|
||||
float add = suck * 150.0F;
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.storedEnergy += Math.round(add);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.storedEnergy > this.energyMax) {
|
||||
this.storedEnergy = this.energyMax;
|
||||
}
|
||||
|
||||
emit = 2;
|
||||
|
||||
// === BUILDCRAFT ===
|
||||
//int arcs;
|
||||
//FXLightningBolt bolt;
|
||||
//Position ourbp;
|
||||
//for (ret = 0; ret < 6; ++ret) {
|
||||
// Orientations o = Orientations.values()[ret];
|
||||
// ourbp = new Position(this);
|
||||
// Position bp = new Position(ourbp);
|
||||
// bp.orientation = o;
|
||||
// bp.moveForwards(1.0);
|
||||
// TileEntity te = super.worldObj.getBlockTileEntity(
|
||||
// (int) bp.x, (int) bp.y, (int) bp.z
|
||||
// );
|
||||
// if (te != null && te instanceof IPowerReceptor) {
|
||||
// PowerProvider pp = ((IPowerReceptor) te).getPowerProvider();
|
||||
// if (pp != null && pp.preConditions((IPowerReceptor) te)
|
||||
// && pp.minEnergyReceived <= this.storedEnergy / 3) {
|
||||
// int energyUsed = Math.min(
|
||||
// (int) Math.min(
|
||||
// (float) Math.min(
|
||||
// pp.maxEnergyReceived, this.storedEnergy / 3
|
||||
// ),
|
||||
// (float) pp.maxEnergyStored - pp.energyStored
|
||||
// ),
|
||||
// emit
|
||||
// );
|
||||
// pp.receiveEnergy((float) energyUsed, o);
|
||||
// this.storedEnergy -= energyUsed * 3;
|
||||
// emitpower = true;
|
||||
// arcs = energyUsed / 2;
|
||||
// if (!ModLoader.getMinecraftInstance()
|
||||
// .gameSettings.fancyGraphics
|
||||
// || Config.lowGfx) {
|
||||
// arcs = energyUsed / 3;
|
||||
// }
|
||||
|
||||
// if (super.worldObj.rand.nextInt(6) < arcs && energyUsed > 0)
|
||||
// {
|
||||
// bolt = new LightningBolt(
|
||||
// super.worldObj,
|
||||
// (double) super.xCoord + 0.5,
|
||||
// (double) super.yCoord + 0.5,
|
||||
// (double) super.zCoord + 0.5,
|
||||
// (double) te.xCoord + 0.5,
|
||||
// (double) te.yCoord + 0.5,
|
||||
// (double) te.zCoord + 0.5,
|
||||
// super.worldObj.rand.nextLong(),
|
||||
// 6,
|
||||
// 9.0F
|
||||
// );
|
||||
// bolt.defaultFractal();
|
||||
// bolt.setType(0);
|
||||
// bolt.setNonLethal();
|
||||
// bolt.finalizeBolt();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// }
|
||||
//}
|
||||
|
||||
// TODO: IC2
|
||||
//try {
|
||||
// if (!this.isAddedToEnergyNet) {
|
||||
// EnergyNet.getForWorld(super.worldObj).addTileEntity(this);
|
||||
// this.isAddedToEnergyNet = true;
|
||||
// }
|
||||
|
||||
// emit = 15;
|
||||
// if (this.storedEnergy >= emit) {
|
||||
// this.storedEnergy -= emit;
|
||||
// } else {
|
||||
// emit = this.storedEnergy;
|
||||
// this.storedEnergy = 0;
|
||||
// }
|
||||
|
||||
// ret = EnergyNet.getForWorld(super.worldObj)
|
||||
// .emitEnergyFrom(this, emit);
|
||||
// this.storedEnergy += ret;
|
||||
// emit -= ret;
|
||||
// Position ourbp = new Position(this);
|
||||
|
||||
// for (int i = 0; i < 6; ++i) {
|
||||
// Orientations o = Orientations.values()[i];
|
||||
// Position bp = new Position(ourbp);
|
||||
// bp.orientation = o;
|
||||
// bp.moveForwards(1.0);
|
||||
// TileEntity te = super.worldObj.getBlockTileEntity(
|
||||
// (int) bp.x, (int) bp.y, (int) bp.z
|
||||
// );
|
||||
// if (te != null && te instanceof IEnergyAcceptor) {
|
||||
// IEnergyAcceptor es = (IEnergyAcceptor) te;
|
||||
// if (es.isAddedToEnergyNet()) {
|
||||
// if (emit > 0) {
|
||||
// emitpower = true;
|
||||
// }
|
||||
|
||||
// arcs = emit;
|
||||
// if (!ModLoader.getMinecraftInstance()
|
||||
// .gameSettings.fancyGraphics
|
||||
// || Config.lowGfx) {
|
||||
// arcs = emit / 2;
|
||||
// }
|
||||
|
||||
// if (super.worldObj.rand.nextInt(45) < arcs) {
|
||||
// bolt = new LightningBolt(
|
||||
// super.worldObj,
|
||||
// (double) super.xCoord + 0.5,
|
||||
// (double) super.yCoord + 0.5,
|
||||
// (double) super.zCoord + 0.5,
|
||||
// (double) te.xCoord + 0.5,
|
||||
// (double) te.yCoord + 0.5,
|
||||
// (double) te.zCoord + 0.5,
|
||||
// super.worldObj.rand.nextLong(),
|
||||
// 6,
|
||||
// 9.0F
|
||||
// );
|
||||
// bolt.defaultFractal();
|
||||
// bolt.setType(0);
|
||||
// bolt.setNonLethal();
|
||||
// bolt.finalizeBolt();
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
//} catch (Exception var17) {}
|
||||
|
||||
// _____ ___ ____ ___ __ _______ _____
|
||||
// |_ _/ _ \| _ \ / _ \ _ \ \ / /_ _| ___|
|
||||
// | || | | | | | | | | (_) \ \ /\ / / | | | |_
|
||||
// | || |_| | |_| | |_| |_ \ V V / | | | _|
|
||||
// |_| \___/|____/ \___/(_) \_/\_/ |_| |_|
|
||||
//try {
|
||||
// Class cls = Class.forName("eloraam.core.IBluePowerConnectable");
|
||||
// Class bpc = Class.forName("eloraam.core.BluePowerConductor");
|
||||
// ourbp = new Position(this);
|
||||
|
||||
// for (int i = 0; i < 6; ++i) {
|
||||
// Orientations o = Orientations.values()[i];
|
||||
// Position bp = new Position(ourbp);
|
||||
// bp.orientation = o;
|
||||
// bp.moveForwards(1.0);
|
||||
// TileEntity te = super.worldObj.getBlockTileEntity(
|
||||
// (int) bp.x, (int) bp.y, (int) bp.z
|
||||
// );
|
||||
// if (te != null) {
|
||||
// arcs = Math.min(this.storedEnergy, 8);
|
||||
// if (arcs < 1) {
|
||||
// break;
|
||||
// }
|
||||
|
||||
// try {
|
||||
// double voltage = (Double
|
||||
// ) ((Double) bpc.getMethod("getVoltage", (Class[]) null)
|
||||
// .invoke(
|
||||
// bpc.cast(
|
||||
// cls.getMethod(
|
||||
// "getBlueConductor", (Class[]) null
|
||||
// )
|
||||
// .invoke(cls.cast(te), (Object[])
|
||||
// null)
|
||||
// ),
|
||||
// (Object[]) null
|
||||
// ));
|
||||
// if (!(voltage > 100.0)) {
|
||||
// bpc.getMethod("applyDirect", Double.TYPE)
|
||||
// .invoke(
|
||||
// bpc.cast(
|
||||
// cls.getMethod(
|
||||
// "getBlueConductor", (Class[])
|
||||
// null
|
||||
// )
|
||||
// .invoke(cls.cast(te), (Object[])
|
||||
// null)
|
||||
// ),
|
||||
// (double) arcs
|
||||
// );
|
||||
// this.storedEnergy -= arcs;
|
||||
// emitpower = true;
|
||||
// int arcs = 2;
|
||||
// if (!ModLoader.getMinecraftInstance()
|
||||
// .gameSettings.fancyGraphics
|
||||
// || Config.lowGfx) {
|
||||
// arcs = 1;
|
||||
// }
|
||||
|
||||
// if (super.worldObj.rand.nextInt(45) < arcs) {
|
||||
// LightningBolt bolt = new LightningBolt(
|
||||
// super.worldObj,
|
||||
// (double) super.xCoord + 0.5,
|
||||
// (double) super.yCoord + 0.5,
|
||||
// (double) super.zCoord + 0.5,
|
||||
// (double) te.xCoord + 0.5,
|
||||
// (double) te.yCoord + 0.5,
|
||||
// (double) te.zCoord + 0.5,
|
||||
// super.worldObj.rand.nextLong(),
|
||||
// 6,
|
||||
// 9.0F
|
||||
// );
|
||||
// bolt.defaultFractal();
|
||||
// bolt.setType(0);
|
||||
// bolt.setNonLethal();
|
||||
// bolt.finalizeBolt();
|
||||
// }
|
||||
// break;
|
||||
// }
|
||||
// } catch (Exception var15) {}
|
||||
// }
|
||||
// }
|
||||
//} catch (Exception var16) {}
|
||||
}
|
||||
|
||||
if (this.genloop == 0 && this.emitPower) {
|
||||
this.emitPower = false;
|
||||
super.worldObj.playSoundEffect(
|
||||
(double) ((float) super.xCoord + 0.5F),
|
||||
(double) ((float) super.yCoord + 0.5F),
|
||||
(double) ((float) super.zCoord + 0.5F),
|
||||
"thaummach:alecloop",
|
||||
0.05F,
|
||||
1.0F
|
||||
);
|
||||
|
||||
AuraManager.addFluxToClosest(
|
||||
this.worldObj,
|
||||
this.xCoord,
|
||||
this.yCoord,
|
||||
this.zCoord,
|
||||
new AspectList().add(Aspect.ENERGY, 2)
|
||||
);
|
||||
}
|
||||
|
||||
++this.genloop;
|
||||
if (this.genloop >= 70) {
|
||||
this.genloop = 0;
|
||||
}
|
||||
} else {
|
||||
if (this.rotation == -1.0F) {
|
||||
this.rotation = (float) super.worldObj.rand.nextInt(360);
|
||||
}
|
||||
|
||||
++this.rotation;
|
||||
if (this.rotation > 360.0F) {
|
||||
this.rotation -= 360.0F;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
MinecraftForge.EVENT_BUS.post(new EnergyTileUnloadEvent(this));
|
||||
}
|
||||
|
||||
public void readFromNBT(NBTTagCompound nbttagcompound) {
|
||||
super.readFromNBT(nbttagcompound);
|
||||
this.storedEnergy = nbttagcompound.getShort("Energy");
|
||||
this.upgrades = nbttagcompound.getByteArray("upgrades");
|
||||
}
|
||||
|
||||
public void writeToNBT(NBTTagCompound nbttagcompound) {
|
||||
super.writeToNBT(nbttagcompound);
|
||||
nbttagcompound.setShort("Energy", (short) this.storedEnergy);
|
||||
nbttagcompound.setByteArray("upgrades", this.upgrades);
|
||||
}
|
||||
|
||||
public boolean emitsEnergyTo(TileEntity receiver, Direction direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public int getMaxEnergyOutput() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
public boolean getConnectable(ForgeDirection face) {
|
||||
return true;
|
||||
}
|
||||
|
||||
public boolean canAcceptUpgrade(byte upgrade) {
|
||||
if (upgrade != 0 && upgrade != 1 && upgrade != 5) {
|
||||
return false;
|
||||
} else {
|
||||
return !this.hasUpgrade(upgrade);
|
||||
}
|
||||
}
|
||||
|
||||
public int getUpgradeLimit() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public byte[] getUpgrades() {
|
||||
return this.upgrades;
|
||||
}
|
||||
|
||||
public boolean hasUpgrade(byte upgrade) {
|
||||
if (this.upgrades.length < 1) {
|
||||
return false;
|
||||
} else {
|
||||
for (int a = 0; a < this.getUpgradeLimit(); ++a) {
|
||||
if (this.upgrades[a] == upgrade) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
public boolean setUpgrade(byte upgrade) {
|
||||
for (int a = 0; a < this.getUpgradeLimit(); ++a) {
|
||||
if (this.upgrades[a] < 0 && this.canAcceptUpgrade(upgrade)) {
|
||||
this.upgrades[a] = upgrade;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean clearUpgrade(int index) {
|
||||
if (this.upgrades[index] >= 0) {
|
||||
this.upgrades[index] = -1;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean emitsEnergyTo(TileEntity receiver, ForgeDirection direction) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getOfferedEnergy() {
|
||||
return Math.min(this.storedEnergy, 32);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawEnergy(double amount) {
|
||||
this.worldObj.markBlockForUpdate(this.xCoord, this.yCoord, this.zCoord);
|
||||
this.emitPower = true;
|
||||
this.storedEnergy -= amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getSourceTier() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||
NBTTagCompound nbt = pkt.func_148857_g();
|
||||
|
||||
this.storedEnergy = nbt.getInteger("storedEnergy");
|
||||
this.energyMax = nbt.getInteger("energyMax");
|
||||
this.upgrades = nbt.getByteArray("upgrades");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Packet getDescriptionPacket() {
|
||||
NBTTagCompound nbt = new NBTTagCompound();
|
||||
|
||||
nbt.setInteger("storedEnergy", this.storedEnergy);
|
||||
nbt.setInteger("energyMax", this.energyMax);
|
||||
nbt.setByteArray("upgrades", this.upgrades);
|
||||
|
||||
return new S35PacketUpdateTileEntity(
|
||||
this.xCoord, this.yCoord, this.zCoord, this.getBlockMetadata(), nbt
|
||||
);
|
||||
}
|
||||
}
|
|
@ -3,7 +3,7 @@ package net.anvilcraft.thaummach.utils;
|
|||
import dev.tilera.auracore.client.FXSparkle;
|
||||
import net.anvilcraft.thaummach.TMItems;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.world.World;
|
||||
import thaumcraft.client.fx.particles.FXWisp;
|
||||
|
@ -279,7 +279,7 @@ public class UtilsFX {
|
|||
* Draws an upgrade into the GuiContainer.
|
||||
*/
|
||||
public static void
|
||||
renderUpgradeIntoGUI(GuiContainer gui, int upgrade, int x, int y) {
|
||||
renderUpgradeIntoGUI(Gui gui, int upgrade, int x, int y) {
|
||||
if (upgrade < 0)
|
||||
return;
|
||||
|
||||
|
|
|
@ -53,6 +53,15 @@
|
|||
}
|
||||
]
|
||||
},
|
||||
"alecloop": {
|
||||
"category": "block",
|
||||
"sounds": [
|
||||
{
|
||||
"name": "alecloop",
|
||||
"stream": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"upgrade": {
|
||||
"category": "master",
|
||||
"sounds": [
|
||||
|
|
Binary file not shown.
Binary file not shown.
After Width: | Height: | Size: 593 B |
Binary file not shown.
After Width: | Height: | Size: 7.1 KiB |
Binary file not shown.
After Width: | Height: | Size: 1.7 KiB |
Loading…
Reference in New Issue