mirror of
https://github.com/GTNewHorizons/EnderIO.git
synced 2026-11-15 09:34:50 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5083fb2a60 | ||
|
|
05ee12955d | ||
|
|
a7acc7e224 | ||
|
|
a59bb21e59 | ||
|
|
5b6c13ff0a | ||
|
|
6f8b6e2a9c | ||
|
|
479c8328b4 | ||
|
|
0c23f4937d | ||
|
|
cde2e4fa60 | ||
|
|
abbb6dc151 | ||
|
|
b3def82cde | ||
|
|
8b4e7f7ec3 | ||
|
|
d69d77ecae | ||
|
|
a233f6ba30 | ||
|
|
581150178f | ||
|
|
313a243bf5 | ||
|
|
d5f1008b08 | ||
|
|
e1e1f06dc6 | ||
|
|
aad9c092b1 | ||
|
|
f8c56939cd | ||
|
|
e2e22d6103 | ||
|
|
a798d2146d |
No files matched your search
+17
-16
@@ -1,24 +1,24 @@
|
||||
// Add your dependencies here
|
||||
|
||||
dependencies {
|
||||
api('com.github.GTNewHorizons:EnderCore:0.4.8:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.8:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.7.45-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.6.22:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.42:dev')
|
||||
api('com.github.GTNewHorizons:EnderCore:0.5.0:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:ForestryMC:4.10.17:dev')
|
||||
compileOnly('com.github.GTNewHorizons:NotEnoughItems:2.8.19-GTNH:dev')
|
||||
api("com.github.GTNewHorizons:GTNHLib:0.7.0:dev")
|
||||
compileOnly('com.github.GTNewHorizons:BuildCraft:7.1.45:dev')
|
||||
api('curse.maven:cofh-lib-220333:2388748') // https://www.curseforge.com/minecraft/mc-mods/cofh-lib/files/2388748
|
||||
shadowImplementation('cglib:cglib-nodep:3.3.0')
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.13.28-GTNH:dev")
|
||||
api("com.github.GTNewHorizons:TinkersConstruct:1.14.6-GTNH:dev")
|
||||
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.8.4:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-613-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles:1.0.4:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.51.291:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.2.15-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.16.28:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.1.0-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.16.4-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.11.15-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:waila:1.9.2:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Applied-Energistics-2-Unofficial:rv3-beta-717-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Baubles-Expanded:2.2.1-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:GT5-Unofficial:5.09.52.60:dev') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:ModularUI2:2.3.4-1.7.10:dev") {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Railcraft:9.17.0:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:StorageDrawers:2.2.0-GTNH:api') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:Chisel:2.17.0-GTNH:dev') {transitive = false}
|
||||
compileOnly('com.github.GTNewHorizons:OpenComputers:1.12.2-GTNH:api') {transitive = false}
|
||||
compileOnly('curse.maven:minefactory-reloaded-66672:2366150') // https://www.curseforge.com/minecraft/mc-mods/minefactory-reloaded/files/2366150
|
||||
compileOnly('thaumcraft:Thaumcraft:1.7.10-4.2.3.5:dev')
|
||||
compileOnly('curse.maven:ee3-65509:2305023') // https://www.curseforge.com/minecraft/mc-mods/ee3/files/2305023
|
||||
@@ -26,5 +26,6 @@ dependencies {
|
||||
compileOnly(rfg.deobf('curse.maven:mekanism-268560:2475797')) // https://www.curseforge.com/minecraft/mc-mods/mekanism/files/2475797
|
||||
compileOnly(rfg.deobf('maven.modrinth:immibis-microblocks:59.1.2')) // https://modrinth.com/mod/immibis-microblocks/version/59.1.2
|
||||
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta42:api') {transitive = false}
|
||||
compileOnlyApi('com.github.GTNewHorizons:Angelica:1.0.0-beta62:api') {transitive = false}
|
||||
compileOnly("com.github.GTNewHorizons:Hodgepodge:2.7.3:dev")
|
||||
}
|
||||
+2
-2
@@ -80,7 +80,7 @@ apiPackage = api
|
||||
# Specify the configuration file for Forge's access transformers here. It must be placed into /src/main/resources/META-INF/
|
||||
# There can be multiple files in a space-separated list.
|
||||
# Example value: mymodid_at.cfg nei_at.cfg
|
||||
accessTransformersFile =
|
||||
accessTransformersFile = enderio_at.cfg
|
||||
|
||||
# Provides setup for Mixins if enabled. If you don't know what mixins are: Keep it disabled!
|
||||
usesMixins = false
|
||||
@@ -151,7 +151,7 @@ modrinthProjectId =
|
||||
# type can be one of [project, version],
|
||||
# and the name is the Modrinth project or version slug/id of the other mod.
|
||||
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
|
||||
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
|
||||
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
|
||||
modrinthRelations =
|
||||
|
||||
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
|
||||
|
||||
+1
-1
@@ -17,7 +17,7 @@ pluginManagement {
|
||||
}
|
||||
|
||||
plugins {
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
|
||||
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.44'
|
||||
}
|
||||
|
||||
|
||||
@@ -103,9 +103,6 @@ import crazypants.enderio.machine.painter.BlockPaintedFenceGateRenderer;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedGlowstone;
|
||||
import crazypants.enderio.machine.painter.PaintedBlockRenderer;
|
||||
import crazypants.enderio.machine.painter.PaintedItemRenderer;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.power.CapBankRenderer2;
|
||||
import crazypants.enderio.machine.power.CapacitorBankRenderer;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.ranged.RangeRenderer;
|
||||
import crazypants.enderio.machine.reservoir.ReservoirRenderer;
|
||||
@@ -321,13 +318,6 @@ public class ClientProxy extends CommonProxy {
|
||||
ClientRegistry.bindTileEntitySpecialRenderer(TileCapBank.class, newCbr);
|
||||
}
|
||||
|
||||
CapacitorBankRenderer capr = new CapacitorBankRenderer();
|
||||
MinecraftForgeClient.registerItemRenderer(Item.getItemFromBlock(EnderIO.blockCapacitorBank), capr);
|
||||
|
||||
BlockCapacitorBank.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
CapBankRenderer2 cbr2 = new CapBankRenderer2();
|
||||
RenderingRegistry.registerBlockHandler(cbr2);
|
||||
|
||||
BlockVacuumChest.renderId = RenderingRegistry.getNextAvailableRenderId();
|
||||
VacuumChestRenderer vcr = new VacuumChestRenderer();
|
||||
RenderingRegistry.registerBlockHandler(vcr);
|
||||
|
||||
@@ -9,12 +9,18 @@ import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ClientTickEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.render.ConduitRenderer;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
import crazypants.enderio.machine.transceiver.ServerChannelRegister;
|
||||
|
||||
public class CommonProxy {
|
||||
|
||||
@@ -23,6 +29,7 @@ public class CommonProxy {
|
||||
protected long serverTickCount = 0;
|
||||
protected long clientTickCount = 0;
|
||||
protected final TickTimer tickTimer = new TickTimer();
|
||||
public ConduitNetworkTickHandler conduitNetworkTickHandler = null;
|
||||
|
||||
public CommonProxy() {}
|
||||
|
||||
@@ -44,7 +51,7 @@ public class CommonProxy {
|
||||
}
|
||||
|
||||
public void loadIcons() {
|
||||
;
|
||||
|
||||
}
|
||||
|
||||
public void load() {
|
||||
@@ -76,6 +83,22 @@ public class CommonProxy {
|
||||
return new ResourceLocation(EnderIO.DOMAIN + TEXTURE_PATH + name + TEXTURE_EXT);
|
||||
}
|
||||
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
conduitNetworkTickHandler = new ConduitNetworkTickHandler();
|
||||
FMLCommonHandler.instance().bus().register(conduitNetworkTickHandler);
|
||||
}
|
||||
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
HyperCubeRegister.load();
|
||||
ServerChannelRegister.load();
|
||||
}
|
||||
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
HyperCubeRegister.unload();
|
||||
FMLCommonHandler.instance().bus().unregister(conduitNetworkTickHandler);
|
||||
conduitNetworkTickHandler = null;
|
||||
}
|
||||
|
||||
public final class TickTimer {
|
||||
|
||||
@SubscribeEvent
|
||||
|
||||
@@ -38,6 +38,7 @@ import cpw.mods.fml.common.event.FMLLoadCompleteEvent;
|
||||
import cpw.mods.fml.common.event.FMLMissingMappingsEvent;
|
||||
import cpw.mods.fml.common.event.FMLPostInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLPreInitializationEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerAboutToStartEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStartedEvent;
|
||||
import cpw.mods.fml.common.event.FMLServerStoppedEvent;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -111,7 +112,6 @@ import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockEnd
|
||||
import crazypants.enderio.machine.generator.zombie.BlockZombieGenerator.BlockFrankenZombieGenerator;
|
||||
import crazypants.enderio.machine.generator.zombie.PacketNutrientTank;
|
||||
import crazypants.enderio.machine.hypercube.BlockHyperCube;
|
||||
import crazypants.enderio.machine.hypercube.HyperCubeRegister;
|
||||
import crazypants.enderio.machine.invpanel.BlockInventoryPanel;
|
||||
import crazypants.enderio.machine.killera.BlockKillerJoe;
|
||||
import crazypants.enderio.machine.light.BlockElectricLight;
|
||||
@@ -132,7 +132,6 @@ import crazypants.enderio.machine.painter.BlockPaintedStair;
|
||||
import crazypants.enderio.machine.painter.BlockPaintedWall;
|
||||
import crazypants.enderio.machine.painter.BlockPainter;
|
||||
import crazypants.enderio.machine.painter.PaintSourceValidator;
|
||||
import crazypants.enderio.machine.power.BlockCapacitorBank;
|
||||
import crazypants.enderio.machine.ranged.RangeEntity;
|
||||
import crazypants.enderio.machine.reservoir.BlockReservoir;
|
||||
import crazypants.enderio.machine.slicensplice.BlockSliceAndSplice;
|
||||
@@ -191,7 +190,6 @@ import crazypants.util.EE3Util;
|
||||
after:Waila@[1.5.8,);\
|
||||
after:Thaumcraft;\
|
||||
after:appliedenergistics2@[rv2-beta-8,);\
|
||||
after:chisel;\
|
||||
after:Railcraft@[9.16.7,)\
|
||||
""", guiFactory = "crazypants.enderio.config.ConfigFactoryEIO")
|
||||
public class EnderIO {
|
||||
@@ -215,6 +213,7 @@ public class EnderIO {
|
||||
|
||||
public static final boolean hasLwjgl3 = Loader.isModLoaded("lwjgl3ify");
|
||||
public static final boolean hasGT5 = Loader.isModLoaded("gregtech") && !Loader.isModLoaded("gregapi");
|
||||
public static final boolean hasHP = Loader.isModLoaded("hodgepodge");
|
||||
|
||||
// Materials
|
||||
public static ItemCapacitor itemBasicCapacitor;
|
||||
@@ -286,7 +285,6 @@ public class EnderIO {
|
||||
public static BlockSolarPanel blockSolarPanel;
|
||||
public static BlockReservoir blockReservoir;
|
||||
public static BlockAlloySmelter blockAlloySmelter;
|
||||
public static BlockCapacitorBank blockCapacitorBank;
|
||||
public static BlockCapBank blockCapBank;
|
||||
public static BlockWirelessCharger blockWirelessCharger;
|
||||
public static BlockCrusher blockCrusher;
|
||||
@@ -396,7 +394,6 @@ public class EnderIO {
|
||||
|
||||
blockCrusher = BlockCrusher.create();
|
||||
blockAlloySmelter = BlockAlloySmelter.create();
|
||||
blockCapacitorBank = BlockCapacitorBank.create();
|
||||
blockCapBank = BlockCapBank.create();
|
||||
|
||||
blockPainter = BlockPainter.create();
|
||||
@@ -490,7 +487,9 @@ public class EnderIO {
|
||||
itemGrindingBall = ItemGrindingBall.create();
|
||||
itemAlloyEndergy = ItemAlloyEndergy.create();
|
||||
itemGrindingBallEndergy = ItemGrindingBallEndergy.create();
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
if (!hasGT5) {
|
||||
itemPowderIngot = ItemPowderIngot.create();
|
||||
}
|
||||
|
||||
registerFluids();
|
||||
|
||||
@@ -730,7 +729,9 @@ public class EnderIO {
|
||||
SkeletonHandler.registerSkeleton(this);
|
||||
}
|
||||
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
if (!hasGT5) {
|
||||
MaterialRecipes.registerDependantOresInDictionary();
|
||||
}
|
||||
|
||||
EnderfaceRecipes.addRecipes();
|
||||
MaterialRecipes.addRecipes();
|
||||
@@ -893,22 +894,18 @@ public class EnderIO {
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStarted(FMLServerStartedEvent event) {
|
||||
HyperCubeRegister.load();
|
||||
ServerChannelRegister.load();
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldSaved(WorldEvent.Save event) {
|
||||
// Only save together with the overworld, because this gets called for every dimension separately
|
||||
if (event.world.provider != null && event.world.provider.dimensionId == 0) {
|
||||
ServerChannelRegister.store();
|
||||
}
|
||||
public void onServerAboutToStart(FMLServerAboutToStartEvent event) {
|
||||
proxy.onServerAboutToStart(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void serverStopped(FMLServerStoppedEvent event) {
|
||||
HyperCubeRegister.unload();
|
||||
public void onServerStarted(FMLServerStartedEvent event) {
|
||||
proxy.onServerStarted(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
public void onServerStopped(FMLServerStoppedEvent event) {
|
||||
proxy.onServerStopped(event);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@@ -920,4 +917,12 @@ public class EnderIO {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void worldSaved(WorldEvent.Save event) {
|
||||
// Only save together with the overworld, because this gets called for every dimension separately
|
||||
if (event.world.provider != null && event.world.provider.dimensionId == 0) {
|
||||
ServerChannelRegister.store();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,6 @@ public enum ModObject {
|
||||
blockReservoir,
|
||||
blockAlloySmelter,
|
||||
blockSolarPanel,
|
||||
blockCapacitorBank,
|
||||
blockCapBank,
|
||||
blockSagMill,
|
||||
blockHyperCube,
|
||||
|
||||
@@ -7,6 +7,8 @@ import java.util.List;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
|
||||
// I=base type, I is the base class of the implementations accepted by the network
|
||||
public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
|
||||
@@ -64,7 +66,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
public void addConduit(I con) {
|
||||
if (!conduits.contains(con)) {
|
||||
if (conduits.isEmpty()) {
|
||||
ConduitNetworkTickHandler.instance.registerNetwork(this);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.registerNetwork(this);
|
||||
}
|
||||
conduits.add(con);
|
||||
}
|
||||
@@ -75,7 +77,7 @@ public abstract class AbstractConduitNetwork<T extends IConduit, I extends T> {
|
||||
con.setNetwork(null);
|
||||
}
|
||||
conduits.clear();
|
||||
ConduitNetworkTickHandler.instance.unregisterNetwork(this);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.unregisterNetwork(this);
|
||||
}
|
||||
|
||||
public List<I> getConduits() {
|
||||
|
||||
@@ -32,7 +32,6 @@ import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.Util;
|
||||
|
||||
import cpw.mods.fml.common.FMLCommonHandler;
|
||||
import cpw.mods.fml.common.Optional;
|
||||
import cpw.mods.fml.common.Optional.Interface;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@@ -93,9 +92,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
public static BlockConduitBundle create() {
|
||||
|
||||
MinecraftForge.EVENT_BUS.register(ConduitNetworkTickHandler.instance);
|
||||
FMLCommonHandler.instance().bus().register(ConduitNetworkTickHandler.instance);
|
||||
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketFluidLevel.class, PacketFluidLevel.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketHandler.INSTANCE
|
||||
@@ -160,7 +156,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
|
||||
BlockConduitBundle result = new BlockConduitBundle();
|
||||
result.init();
|
||||
MinecraftForge.EVENT_BUS.register(result);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -292,41 +287,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
effectRenderer.addEffect(digFX);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySound(PlaySoundSourceEvent event) {
|
||||
String path = event.sound.getPositionedSoundLocation().getResourcePath();
|
||||
if ("silence.step".equals(path)) {
|
||||
ISound snd = event.sound;
|
||||
World world = EnderIO.proxy.getClientWorld();
|
||||
BlockCoord bc = new BlockCoord(snd.getXPosF(), snd.getYPosF(), snd.getZPosF());
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playHitSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playHitSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySoundAtEntity(PlaySoundAtEntityEvent event) {
|
||||
String path = event.name;
|
||||
World world = event.entity.worldObj;
|
||||
if ("EnderIO:silence.step".equals(path) && world.isRemote) {
|
||||
BlockCoord bc = new BlockCoord(event.entity.posX, event.entity.posY - 2, event.entity.posZ);
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playStepSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playStepSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
@@ -334,6 +294,7 @@ public class BlockConduitBundle extends BlockEio
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_EXTERNAL_CONNECTION_BASE + dir.ordinal(), this);
|
||||
}
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_EXTERNAL_CONNECTION_SELECTOR, this);
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -473,24 +434,6 @@ public class BlockConduitBundle extends BlockEio
|
||||
: resist;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeed(BreakSpeed event) {
|
||||
if (event.block == this) {
|
||||
ItemStack held = event.entityPlayer.getCurrentEquippedItem();
|
||||
if (held == null || held.getItem().getHarvestLevel(held, "pickaxe") == -1) {
|
||||
event.newSpeed += 2;
|
||||
}
|
||||
IConduitBundle te = (IConduitBundle) event.entity.worldObj.getTileEntity(event.x, event.y, event.z);
|
||||
if (te != null && te.getFacadeType() == FacadeType.HARDENED) {
|
||||
if (!ConduitUtil.isSolidFacadeRendered(te, event.entityPlayer)) {
|
||||
event.newSpeed *= 6;
|
||||
} else {
|
||||
event.newSpeed *= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int getRenderBlockPass() {
|
||||
@@ -1274,4 +1217,61 @@ public class BlockConduitBundle extends BlockEio
|
||||
private boolean hasMicroblocks(IConduitBundle bundle) {
|
||||
return !bundle.getCoverSystem().getAllParts().isEmpty();
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySound(PlaySoundSourceEvent event) {
|
||||
String path = event.sound.getPositionedSoundLocation().getResourcePath();
|
||||
if ("silence.step".equals(path)) {
|
||||
ISound snd = event.sound;
|
||||
World world = EnderIO.proxy.getClientWorld();
|
||||
if (world == null) return;
|
||||
BlockCoord bc = new BlockCoord(snd.getXPosF(), snd.getYPosF(), snd.getZPosF());
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playHitSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playHitSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@SubscribeEvent
|
||||
public void onPlaySoundAtEntity(PlaySoundAtEntityEvent event) {
|
||||
String path = event.name;
|
||||
World world = event.entity.worldObj;
|
||||
if ("EnderIO:silence.step".equals(path) && world.isRemote) {
|
||||
BlockCoord bc = new BlockCoord(event.entity.posX, event.entity.posY - 2, event.entity.posZ);
|
||||
TileEntity te = bc.getTileEntity(world);
|
||||
if (te instanceof TileConduitBundle && ((TileConduitBundle) te).hasFacade()) {
|
||||
Block facade = getFacade(world, bc.x, bc.y, bc.z, -1);
|
||||
ConduitUtil.playStepSound(facade.stepSound, world, bc.x, bc.y, bc.z);
|
||||
} else {
|
||||
ConduitUtil.playStepSound(Block.soundTypeMetal, world, bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeed(BreakSpeed event) {
|
||||
if (event.block == BlockConduitBundle.this) {
|
||||
ItemStack held = event.entityPlayer.getCurrentEquippedItem();
|
||||
if (held == null || held.getItem().getHarvestLevel(held, "pickaxe") == -1) {
|
||||
event.newSpeed += 2;
|
||||
}
|
||||
IConduitBundle te = (IConduitBundle) event.entity.worldObj.getTileEntity(event.x, event.y, event.z);
|
||||
if (te != null && te.getFacadeType() == FacadeType.HARDENED) {
|
||||
if (!ConduitUtil.isSolidFacadeRendered(te, event.entityPlayer)) {
|
||||
event.newSpeed *= 6;
|
||||
} else {
|
||||
event.newSpeed *= 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -10,18 +10,15 @@ import cpw.mods.fml.common.gameevent.TickEvent.Phase;
|
||||
|
||||
public class ConduitNetworkTickHandler {
|
||||
|
||||
public static final ConduitNetworkTickHandler instance = new ConduitNetworkTickHandler();
|
||||
public interface TickListener {
|
||||
|
||||
public static interface TickListener {
|
||||
void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickStart(TickEvent.ServerTickEvent evt);
|
||||
|
||||
public void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
void tickEnd(TickEvent.ServerTickEvent evt);
|
||||
}
|
||||
|
||||
private final List<TickListener> listeners = new ArrayList<TickListener>();
|
||||
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean>();
|
||||
private final List<TickListener> listeners = new ArrayList<>();
|
||||
private final IdentityHashMap<AbstractConduitNetwork<?, ?>, Boolean> networks = new IdentityHashMap<>();
|
||||
|
||||
public void addListener(TickListener listener) {
|
||||
listeners.add(listener);
|
||||
|
||||
@@ -12,8 +12,8 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.conduit.AbstractItemConduit;
|
||||
import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduit extends AbstractItemConduit {
|
||||
|
||||
|
||||
@@ -13,8 +13,8 @@ import crazypants.enderio.conduit.IConduit;
|
||||
import crazypants.enderio.conduit.ItemConduitSubtype;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.ItemPowerConduit;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.ICapacitor;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemPowerConduitEndergy extends ItemPowerConduit {
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@ public class GuiEnderface extends GuiScreen {
|
||||
|
||||
if (hit != null) {
|
||||
Block block = world.getBlock(hit.blockX, hit.blockY, hit.blockZ);
|
||||
if (block == EnderIO.blockHyperCube || block == EnderIO.blockCapacitorBank) {
|
||||
if (block == EnderIO.blockHyperCube) {
|
||||
block.onBlockActivated(world, hit.blockX, hit.blockY, hit.blockZ, player, 0, 0, 0, 0);
|
||||
} else {
|
||||
openInterface(hit.blockX, hit.blockY, hit.blockZ, hit.sideHit, hit.hitVec);
|
||||
|
||||
@@ -14,7 +14,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.generator.stirling.StirlingGeneratorContainer;
|
||||
import crazypants.enderio.machine.generator.stirling.TileEntityStirlingGenerator;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerBurnTime implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.FluidFuelRegister;
|
||||
import crazypants.enderio.fluid.IFluidCoolant;
|
||||
import crazypants.enderio.fluid.IFluidFuel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class TooltipHandlerFluid implements ITooltipCallback {
|
||||
|
||||
|
||||
@@ -28,7 +28,7 @@ import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.DarkSteelItems;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.BaublesUtil;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles|API")
|
||||
|
||||
@@ -11,12 +11,14 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.input.Mouse;
|
||||
|
||||
import com.enderio.core.common.util.ChatUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.KeyInputEvent;
|
||||
import cpw.mods.fml.common.gameevent.InputEvent.MouseInputEvent;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.tool.IConduitControl;
|
||||
@@ -134,6 +136,18 @@ public class KeyTracker {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onKeyInput(KeyInputEvent event) {
|
||||
handleInput();
|
||||
}
|
||||
|
||||
// mouse button presses arrive on a separate event
|
||||
@SubscribeEvent
|
||||
public void onMouseInput(MouseInputEvent event) {
|
||||
if (Mouse.getEventButton() >= 0) {
|
||||
handleInput();
|
||||
}
|
||||
}
|
||||
|
||||
private void handleInput() {
|
||||
handleGlide();
|
||||
handleSoundDetector();
|
||||
handleNightVision();
|
||||
|
||||
@@ -24,10 +24,10 @@ import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
import crazypants.enderio.conduit.power.NetworkPowerManager;
|
||||
import crazypants.enderio.conduit.power.PowerConduitNetwork;
|
||||
import crazypants.enderio.conduit.power.PowerTracker;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.EnergyHandlerPI;
|
||||
import crazypants.enderio.power.IInternalPowerReceiver;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketConduitProbe implements IMessage, IMessageHandler<PacketConduitProbe, IMessage> {
|
||||
|
||||
@@ -67,7 +67,6 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
public static ItemDarkSteelAxe create() {
|
||||
ItemDarkSteelAxe res = new ItemDarkSteelAxe();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -188,18 +187,6 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
return usedPower;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.entityPlayer.isSneaking()
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelAxePowerUsePerDamagePointMultiHarvest)
|
||||
&& isLog(evt.block, evt.metadata)) {
|
||||
evt.newSpeed = evt.originalSpeed / Config.darkSteelAxeSpeedPenaltyMultiHarvest;
|
||||
}
|
||||
if (isEquipped(evt.entityPlayer) && evt.block.getMaterial() == Material.leaves) {
|
||||
evt.newSpeed = 6;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack item, EntityPlayer player, World world, int x, int y, int z, int side,
|
||||
float par8, float par9, float par10) {
|
||||
@@ -258,6 +245,7 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -336,4 +324,19 @@ public class ItemDarkSteelAxe extends ItemAxe
|
||||
return (x < y) ? -1 : ((x == y) ? 0 : 1);
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.entityPlayer.isSneaking()
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelAxePowerUsePerDamagePointMultiHarvest)
|
||||
&& isLog(evt.block, evt.metadata)) {
|
||||
evt.newSpeed = evt.originalSpeed / Config.darkSteelAxeSpeedPenaltyMultiHarvest;
|
||||
}
|
||||
if (isEquipped(evt.entityPlayer) && evt.block.getMaterial() == Material.leaves) {
|
||||
evt.newSpeed = 6;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,6 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.ForgeHooks;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
@@ -34,7 +33,7 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.upgrade.EnergyUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.SpoonUpgrade;
|
||||
import crazypants.enderio.item.darksteel.upgrade.TravelUpgrade;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.teleport.TravelController;
|
||||
|
||||
public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
@@ -61,7 +60,6 @@ public class ItemDarkSteelPickaxe extends ItemPickaxe
|
||||
public static ItemDarkSteelPickaxe create() {
|
||||
ItemDarkSteelPickaxe res = new ItemDarkSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -62,13 +62,12 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
public static ItemDarkSteelShears create() {
|
||||
ItemDarkSteelShears res = new ItemDarkSteelShears();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
protected final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
protected final EntityComparator entityComparator = new EntityComparator();
|
||||
private final MultiHarvestComparator harvestComparator = new MultiHarvestComparator();
|
||||
private final EntityComparator entityComparator = new EntityComparator();
|
||||
protected String name;
|
||||
|
||||
protected ItemDarkSteelShears(String name) {
|
||||
@@ -202,14 +201,6 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
return false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.originalSpeed > 2.0
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelShearsPowerUsePerDamagePoint)) {
|
||||
evt.newSpeed = evt.originalSpeed * Config.darkSteelShearsEffeciencyBoostWhenPowered;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setDamage(ItemStack stack, int newDamage) {
|
||||
int oldDamage = getDamage(stack);
|
||||
@@ -231,6 +222,7 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -330,4 +322,15 @@ public class ItemDarkSteelShears extends ItemShears
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
public static class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakSpeedEvent(PlayerEvent.BreakSpeed evt) {
|
||||
if (evt.originalSpeed > 2.0
|
||||
&& isEquippedAndPowered(evt.entityPlayer, Config.darkSteelShearsPowerUsePerDamagePoint)) {
|
||||
evt.newSpeed = evt.originalSpeed * Config.darkSteelShearsEffeciencyBoostWhenPowered;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -72,7 +72,6 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
public static ItemDarkSteelSword create() {
|
||||
ItemDarkSteelSword res = new ItemDarkSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
@@ -117,71 +116,6 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
return false;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEnderTeleport(EnderTeleportEvent evt) {
|
||||
if (evt.entityLiving.getEntityData().getBoolean("hitByDarkSteelSword")) {
|
||||
evt.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Set priorty to lowest in the hope any other mod adding head drops will have already added them
|
||||
// by the time this is called to prevent multiple head drops
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onEntityDrop(LivingDropsEvent evt) {
|
||||
|
||||
if (!(evt.source.getEntity() instanceof EntityPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer) evt.source.getEntity();
|
||||
// Handle TiC weapons with beheading differently
|
||||
if (handleBeheadingWeapons(player, evt)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double skullDropChance = getSkullDropChance(player, evt);
|
||||
if (player instanceof FakePlayer) {
|
||||
skullDropChance *= Config.fakePlayerSkullChance;
|
||||
}
|
||||
if (Math.random() <= skullDropChance) {
|
||||
dropSkull(evt, player);
|
||||
}
|
||||
|
||||
// Special handling for ender pear drops
|
||||
if (isEquipped(player)) {
|
||||
String name = EntityList.getEntityString(evt.entityLiving);
|
||||
if (evt.entityLiving instanceof EntityEnderman || ENDERZOO_ENDERMINY.equals(name)) {
|
||||
int numPearls = 0;
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChance) {
|
||||
numPearls++;
|
||||
}
|
||||
for (int i = 0; i < evt.lootingLevel; i++) {
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChancePerLooting) {
|
||||
numPearls++;
|
||||
}
|
||||
}
|
||||
|
||||
int existing = 0;
|
||||
for (EntityItem stack : evt.drops) {
|
||||
if (stack.getEntityItem() != null && stack.getEntityItem().getItem() == Items.ender_pearl) {
|
||||
existing += stack.getEntityItem().stackSize;
|
||||
}
|
||||
}
|
||||
int toDrop = numPearls - existing;
|
||||
if (toDrop > 0) {
|
||||
evt.drops.add(
|
||||
Util.createDrop(
|
||||
player.worldObj,
|
||||
new ItemStack(Items.ender_pearl, toDrop, 0),
|
||||
evt.entityLiving.posX,
|
||||
evt.entityLiving.posY,
|
||||
evt.entityLiving.posZ,
|
||||
false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected void dropSkull(LivingDropsEvent evt, EntityPlayer player) {
|
||||
ItemStack skull = getSkullForEntity(evt.entityLiving);
|
||||
if (skull != null && !containsDrop(evt, skull)) {
|
||||
@@ -292,6 +226,7 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
protected void init() {
|
||||
GameRegistry.registerItem(this, getUnlocalizedName());
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -437,4 +372,73 @@ public class ItemDarkSteelSword extends ItemSword
|
||||
|
||||
return super.onItemRightClick(stack, world, player);
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onEnderTeleport(EnderTeleportEvent evt) {
|
||||
if (evt.entityLiving.getEntityData().getBoolean("hitByDarkSteelSword")) {
|
||||
evt.setCanceled(true);
|
||||
}
|
||||
}
|
||||
|
||||
// Set priorty to lowest in the hope any other mod adding head drops will have already added them
|
||||
// by the time this is called to prevent multiple head drops
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST)
|
||||
public void onEntityDrop(LivingDropsEvent evt) {
|
||||
|
||||
if (!(evt.source.getEntity() instanceof EntityPlayer)) {
|
||||
return;
|
||||
}
|
||||
|
||||
EntityPlayer player = (EntityPlayer) evt.source.getEntity();
|
||||
// Handle TiC weapons with beheading differently
|
||||
if (handleBeheadingWeapons(player, evt)) {
|
||||
return;
|
||||
}
|
||||
|
||||
double skullDropChance = getSkullDropChance(player, evt);
|
||||
if (player instanceof FakePlayer) {
|
||||
skullDropChance *= Config.fakePlayerSkullChance;
|
||||
}
|
||||
if (Math.random() <= skullDropChance) {
|
||||
dropSkull(evt, player);
|
||||
}
|
||||
|
||||
// Special handling for ender pear drops
|
||||
if (isEquipped(player)) {
|
||||
String name = EntityList.getEntityString(evt.entityLiving);
|
||||
if (evt.entityLiving instanceof EntityEnderman || ENDERZOO_ENDERMINY.equals(name)) {
|
||||
int numPearls = 0;
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChance) {
|
||||
numPearls++;
|
||||
}
|
||||
for (int i = 0; i < evt.lootingLevel; i++) {
|
||||
if (Math.random() <= Config.darkSteelSwordEnderPearlDropChancePerLooting) {
|
||||
numPearls++;
|
||||
}
|
||||
}
|
||||
|
||||
int existing = 0;
|
||||
for (EntityItem stack : evt.drops) {
|
||||
if (stack.getEntityItem() != null && stack.getEntityItem().getItem() == Items.ender_pearl) {
|
||||
existing += stack.getEntityItem().stackSize;
|
||||
}
|
||||
}
|
||||
int toDrop = numPearls - existing;
|
||||
if (toDrop > 0) {
|
||||
evt.drops.add(
|
||||
Util.createDrop(
|
||||
player.worldObj,
|
||||
new ItemStack(Items.ender_pearl, toDrop, 0),
|
||||
evt.entityLiving.posX,
|
||||
evt.entityLiving.posY,
|
||||
evt.entityLiving.posZ,
|
||||
false));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -30,7 +29,6 @@ public class ItemEndSteelAxe extends ItemDarkSteelAxe implements IEndSteelItem {
|
||||
public static ItemEndSteelAxe create() {
|
||||
ItemEndSteelAxe res = new ItemEndSteelAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -30,7 +29,6 @@ public class ItemEndSteelPickaxe extends ItemDarkSteelPickaxe implements IEndSte
|
||||
public static ItemEndSteelPickaxe create() {
|
||||
ItemEndSteelPickaxe res = new ItemEndSteelPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -35,7 +34,6 @@ public class ItemEndSteelSword extends ItemDarkSteelSword implements IEndSteelIt
|
||||
public static ItemEndSteelSword create() {
|
||||
ItemEndSteelSword res = new ItemEndSteelSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -30,7 +29,6 @@ public class ItemStellarAxe extends ItemDarkSteelAxe implements IStellarItem {
|
||||
public static ItemStellarAxe create() {
|
||||
ItemStellarAxe res = new ItemStellarAxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@@ -30,7 +29,6 @@ public class ItemStellarPickaxe extends ItemDarkSteelPickaxe implements IStellar
|
||||
public static ItemStellarPickaxe create() {
|
||||
ItemStellarPickaxe res = new ItemStellarPickaxe();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.common.MinecraftForge;
|
||||
import net.minecraftforge.common.util.EnumHelper;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@@ -35,7 +34,6 @@ public class ItemStellarSword extends ItemDarkSteelSword implements IStellarItem
|
||||
public static ItemStellarSword create() {
|
||||
ItemStellarSword res = new ItemStellarSword();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem;
|
||||
import crazypants.enderio.item.darksteel.IDarkSteelItem.IEndSteelItem;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class EnergyUpgrade extends AbstractUpgrade {
|
||||
|
||||
|
||||
@@ -28,7 +28,6 @@ import crazypants.enderio.item.skull.BlockEndermanSkull;
|
||||
import crazypants.enderio.machine.buffer.BlockItemBuffer.Type;
|
||||
import crazypants.enderio.machine.capbank.BlockItemCapBank;
|
||||
import crazypants.enderio.machine.capbank.CapBankType;
|
||||
import crazypants.enderio.machine.capbank.ConvertOldRecipe;
|
||||
import crazypants.enderio.machine.light.BlockItemElectricLight;
|
||||
import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.MachinePart;
|
||||
@@ -343,9 +342,6 @@ public class MachineRecipes {
|
||||
.createItemStackWithPower(CapBankType.getMetaFromType(CapBankType.VIBRANT), 0);
|
||||
RecipeUtil.addShaped(capBank3, "bcb", "cmc", "bcb", 'b', electricalSteel, 'c', capacitor3, 'm', vibCry);
|
||||
|
||||
ConvertOldRecipe convertRecipe = new ConvertOldRecipe();
|
||||
GameRegistry.addRecipe(convertRecipe);
|
||||
|
||||
GameRegistry.addRecipe(
|
||||
new UpgradeCapBankRecipe(
|
||||
capBank2,
|
||||
|
||||
@@ -38,7 +38,7 @@ public class GuiAlloySmelter extends GuiPoweredMachineBase<TileAlloySmelter> {
|
||||
vanillaFurnaceButton.setSize(BUTTON_SIZE, BUTTON_SIZE);
|
||||
|
||||
vanillaFurnaceTooltip = new GuiToolTip(
|
||||
new Rectangle(xSize - 5 - BUTTON_SIZE, 62, BUTTON_SIZE, BUTTON_SIZE),
|
||||
new Rectangle(xSize - 5 - BUTTON_SIZE, 43, BUTTON_SIZE, BUTTON_SIZE),
|
||||
(String[]) null);
|
||||
|
||||
addProgressTooltip(55, 35, 14, 14);
|
||||
|
||||
@@ -11,8 +11,8 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiBuffer extends GuiPoweredMachineBase<TileBuffer> {
|
||||
|
||||
@@ -93,11 +93,6 @@ public class GuiBuffer extends GuiPoweredMachineBase<TileBuffer> {
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketBufferIO(getTileEntity(), lastInput, lastOutput));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean renderPowerBar() {
|
||||
return getTileEntity().hasPower();
|
||||
|
||||
@@ -49,8 +49,8 @@ import crazypants.enderio.machine.capbank.packet.PacketNetworkIdRequest;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkIdResponse;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateRequest;
|
||||
import crazypants.enderio.machine.capbank.packet.PacketNetworkStateResponse;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
|
||||
@@ -89,7 +89,9 @@ public class ContainerCapBank extends ContainerEnderTileEntity<TileCapBank> {
|
||||
}
|
||||
|
||||
if (hasBaublesSlots()) {
|
||||
for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
// for (int i = 0; i < baubles.getSizeInventory(); i++) {
|
||||
// Capped since the sprite only has 4 slots
|
||||
for (int i = 0; i < Math.min(baubles.getSizeInventory(), 4); i++) {
|
||||
addSlotToContainer(new Slot(baubles, i, -15 + armorOffset, 84 + i * 18) {
|
||||
|
||||
@Override
|
||||
@@ -122,7 +124,9 @@ public class ContainerCapBank extends ContainerEnderTileEntity<TileCapBank> {
|
||||
int startHotBarSlot = endPlayerSlot + 1;
|
||||
int endHotBarSlot = startHotBarSlot + 9;
|
||||
int startBaublesSlot = endHotBarSlot + 1;
|
||||
int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + baubles.getSizeInventory();
|
||||
// int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + baubles.getSizeInventory();
|
||||
// Capped since the sprite only has 4 slots
|
||||
int endBaublesSlot = baubles == null ? 0 : startBaublesSlot + Math.min(baubles.getSizeInventory(), 4);
|
||||
|
||||
ItemStack copystack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
|
||||
@@ -1,66 +0,0 @@
|
||||
package crazypants.enderio.machine.capbank;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.inventory.InventoryCrafting;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.item.crafting.IRecipe;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.RecipeSorter;
|
||||
import net.minecraftforge.oredict.RecipeSorter.Category;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class ConvertOldRecipe implements IRecipe {
|
||||
|
||||
static {
|
||||
RecipeSorter.register(
|
||||
"EnderIO:convertOldCapBankRecipe",
|
||||
ConvertOldRecipe.class,
|
||||
Category.SHAPELESS,
|
||||
"after:minecraft:shapeless");
|
||||
}
|
||||
|
||||
private ItemStack output;
|
||||
|
||||
@Override
|
||||
public boolean matches(InventoryCrafting inv, World world) {
|
||||
ItemStack input = null;
|
||||
for (int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
ItemStack checkStack = inv.getStackInSlot(i);
|
||||
if (checkStack != null) {
|
||||
if (input != null) {
|
||||
return false;
|
||||
}
|
||||
if (Block.getBlockFromItem(checkStack.getItem()) == EnderIO.blockCapacitorBank) {
|
||||
input = checkStack;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (input == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
output = new ItemStack(EnderIO.blockCapBank, 1, CapBankType.getMetaFromType(CapBankType.ACTIVATED));
|
||||
PowerHandlerUtil.setStoredEnergyForItem(output, PowerHandlerUtil.getStoredEnergyForItem(input));
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getCraftingResult(InventoryCrafting inv) {
|
||||
return output.copy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRecipeSize() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getRecipeOutput() {
|
||||
return output;
|
||||
}
|
||||
}
|
||||
@@ -30,8 +30,8 @@ import crazypants.enderio.machine.capbank.packet.PacketNetworkStateRequest;
|
||||
import crazypants.enderio.machine.gui.GuiButtonIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiOverlayIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCapBank extends GuiContainerBaseEIO {
|
||||
|
||||
|
||||
@@ -747,7 +747,7 @@ public class TileCapBank extends TileEntityEio
|
||||
|
||||
@Override
|
||||
public String getInventoryName() {
|
||||
return EnderIO.blockCapacitorBank.getUnlocalizedName() + ".name";
|
||||
return EnderIO.blockCapBank.getUnlocalizedName() + ".name";
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -16,7 +16,7 @@ import com.enderio.core.common.util.RoundRobinIterator;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent.ServerTickEvent;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.ConduitNetworkTickHandler.TickListener;
|
||||
import crazypants.enderio.conduit.ConnectionMode;
|
||||
import crazypants.enderio.conduit.power.IPowerConduit;
|
||||
@@ -212,7 +212,7 @@ public class CapBankNetwork implements ICapBankNetwork {
|
||||
long curTime = world.getTotalWorldTime();
|
||||
if (curTime != timeAtLastApply) {
|
||||
timeAtLastApply = curTime;
|
||||
ConduitNetworkTickHandler.instance.addListener(tickListener);
|
||||
EnderIO.proxy.conduitNetworkTickHandler.addListener(tickListener);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ import com.enderio.core.client.render.RenderUtil;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.capbank.TileCapBank;
|
||||
import crazypants.enderio.machine.capbank.network.CapBankClientNetwork;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class IoDisplay implements IInfoRenderer {
|
||||
|
||||
|
||||
@@ -17,8 +17,8 @@ import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.PacketItemBuffer;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
|
||||
@@ -67,11 +67,6 @@ public class GuiCrafter extends GuiPoweredMachineBase<TileCrafter> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final int getXSize() {
|
||||
return 219;
|
||||
|
||||
@@ -7,34 +7,23 @@ import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
|
||||
public class GuiEnchanter extends GuiContainerBaseEIO {
|
||||
|
||||
private TileEnchanter te;
|
||||
private ContainerEnchanter container;
|
||||
private IconButton recipeButton;
|
||||
|
||||
public GuiEnchanter(EntityPlayer player, InventoryPlayer inventory, TileEnchanter te) {
|
||||
super(new ContainerEnchanter(player, inventory, te), "enchanter");
|
||||
container = (ContainerEnchanter) inventorySlots;
|
||||
this.te = te;
|
||||
|
||||
recipeButton = new IconButton(this, 100, 154, 8, IconEIO.RECIPE);
|
||||
recipeButton.visible = false;
|
||||
recipeButton.setIconMargin(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
recipeButton.onGuiInit();
|
||||
recipeButton.visible = EnderIO.proxy.isNeiInstalled();
|
||||
((ContainerEnchanter) inventorySlots).createGhostSlots(getGhostSlots());
|
||||
container.createGhostSlots(getGhostSlots());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,10 +34,6 @@ public class GuiEnchanter extends GuiContainerBaseEIO {
|
||||
int sy = (height - ySize) / 2;
|
||||
drawTexturedModalRect(sx, sy, 0, 0, this.xSize, this.ySize);
|
||||
|
||||
if (EnderIO.proxy.isNeiInstalled()) {
|
||||
IconEIO.map.render(IconEIO.RECIPE, sx + 155, sy + 8, 16, 16, 0, true);
|
||||
}
|
||||
|
||||
int curCost = te.getCurrentEnchantmentCost();
|
||||
if (curCost > 0) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
@@ -138,11 +138,6 @@ public class GuiFarmStation extends GuiPoweredMachineBase<TileFarmStation> {
|
||||
super.actionPerformed(b);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getPowerOutputLabel() {
|
||||
return EnderIO.lang.localize("farm.gui.baseUse");
|
||||
|
||||
@@ -17,7 +17,9 @@ import net.minecraftforge.common.IPlantable;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.mitchej123.hodgepodge.mixins.interfaces.INetherSeed;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.farm.TileFarmStation;
|
||||
|
||||
public class PlantableFarmer implements IFarmerJoe {
|
||||
@@ -109,7 +111,13 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
|
||||
protected boolean plant(TileFarmStation farm, World worldObj, BlockCoord bc, IPlantable plantable) {
|
||||
worldObj.setBlock(bc.x, bc.y, bc.z, Blocks.air, 0, 1 | 2);
|
||||
Block target = plantable.getPlant(null, 0, 0, 0);
|
||||
Block target;
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
target = netherSeed.hodgepodge$getPlant(null, 0, 0, 0);
|
||||
} else {
|
||||
target = plantable.getPlant(null, 0, 0, 0);
|
||||
}
|
||||
int meta = plantable.getPlantMetadata(null, 0, 0, 0);
|
||||
worldObj.setBlock(bc.x, bc.y, bc.z, target, meta, 1 | 2);
|
||||
farm.actionPerformed(false);
|
||||
@@ -117,7 +125,13 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
protected boolean canPlant(World worldObj, BlockCoord bc, IPlantable plantable) {
|
||||
Block target = plantable.getPlant(null, 0, 0, 0);
|
||||
Block target;
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
target = netherSeed.hodgepodge$getPlant(null, 0, 0, 0);
|
||||
} else {
|
||||
target = plantable.getPlant(null, 0, 0, 0);
|
||||
}
|
||||
Block ground = worldObj.getBlock(bc.x, bc.y - 1, bc.z);
|
||||
if (target != null && target.canPlaceBlockAt(worldObj, bc.x, bc.y, bc.z)
|
||||
&& target.canBlockStay(worldObj, bc.x, bc.y, bc.z)
|
||||
@@ -182,10 +196,14 @@ public class PlantableFarmer implements IFarmerJoe {
|
||||
}
|
||||
|
||||
private boolean isPlantableForBlock(ItemStack stack, Block block) {
|
||||
if (!(stack.getItem() instanceof IPlantable)) {
|
||||
return false;
|
||||
if (stack.getItem() instanceof IPlantable plantable) {
|
||||
// needed for Pam's nether seeds
|
||||
if (EnderIO.hasHP && plantable instanceof INetherSeed netherSeed) {
|
||||
return netherSeed.hodgepodge$getPlant(null, 0, 0, 0) == block;
|
||||
} else {
|
||||
return plantable.getPlant(null, 0, 0, 0) == block;
|
||||
}
|
||||
}
|
||||
IPlantable plantable = (IPlantable) stack.getItem();
|
||||
return plantable.getPlant(null, 0, 0, 0) == block;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+1
-6
@@ -16,7 +16,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiCombustionGenerator extends GuiPoweredMachineBase<TileCombustionGenerator> {
|
||||
|
||||
@@ -52,11 +52,6 @@ public class GuiCombustionGenerator extends GuiPoweredMachineBase<TileCombustion
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
+1
-6
@@ -19,8 +19,8 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class GuiStirlingGenerator extends GuiPoweredMachineBase<TileEntityStirlingGenerator> {
|
||||
@@ -58,11 +58,6 @@ public class GuiStirlingGenerator extends GuiPoweredMachineBase<TileEntityStirli
|
||||
return fmt.format(args, new StringBuffer(), null).toString();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String formatProgressTooltip(int scaledProgress, float remaining) {
|
||||
int totalBurnTime = getTileEntity().totalBurnTime;
|
||||
|
||||
@@ -17,7 +17,7 @@ import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.generator.zombie.TileZombieGenerator.TileEnderGenerator;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerator> {
|
||||
|
||||
@@ -41,11 +41,6 @@ public class GuiZombieGenerator extends GuiPoweredMachineBase<TileZombieGenerato
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
@@ -12,7 +12,6 @@ import net.minecraft.inventory.Slot;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.api.common.util.IProgressTile;
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.button.ToggleButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
@@ -22,7 +21,6 @@ import com.enderio.core.common.vecmath.Vector4f;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.IoConfigRenderer.SelectedFace;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
@@ -46,8 +44,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
|
||||
protected final GuiButtonIoConfig configB;
|
||||
|
||||
protected IconButton recipeButton;
|
||||
|
||||
protected List<GuiToolTip> progressTooltips;
|
||||
protected int lastProgressTooltipValue = -1;
|
||||
|
||||
@@ -66,11 +62,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
|
||||
y += 19;
|
||||
configB = new GuiButtonIoConfig(this, CONFIG_ID, x, y, machine, configOverlay);
|
||||
|
||||
y += 19;
|
||||
recipeButton = new IconButton(this, RECIPE_ID, x, y, IconEIO.RECIPE);
|
||||
recipeButton.visible = false;
|
||||
recipeButton.setIconMargin(1, 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -78,11 +69,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
super.initGui();
|
||||
redstoneButton.onGuiInit();
|
||||
configB.onGuiInit();
|
||||
recipeButton.onGuiInit();
|
||||
}
|
||||
|
||||
protected boolean showRecipeButton() {
|
||||
return EnderIO.proxy.isNeiInstalled();
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -96,10 +82,6 @@ public abstract class GuiMachineBase<T extends AbstractMachineEntity> extends Gu
|
||||
guibutton.drawButton(mc, 0, 0);
|
||||
}
|
||||
|
||||
if (showRecipeButton()) {
|
||||
recipeButton.visible = true;
|
||||
}
|
||||
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
|
||||
renderSlotHighlights();
|
||||
|
||||
@@ -11,7 +11,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
|
||||
import crazypants.enderio.machine.AbstractPoweredMachineEntity;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public abstract class GuiPoweredMachineBase<T extends AbstractPoweredMachineEntity> extends GuiMachineBase<T> {
|
||||
|
||||
|
||||
@@ -27,8 +27,8 @@ import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.hypercube.TileHyperCube.IoMode;
|
||||
import crazypants.enderio.machine.hypercube.TileHyperCube.SubChannel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiHyperCube extends GuiContainerBaseEIO {
|
||||
|
||||
|
||||
@@ -536,11 +536,6 @@ public class GuiInventoryPanel extends GuiMachineBase<TileInventoryPanel> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXSize() {
|
||||
return 280;
|
||||
|
||||
@@ -28,9 +28,7 @@ public class BlockKillerJoe extends AbstractMachineBlock<TileKillerJoe> {
|
||||
.registerMessage(PacketSwing.class, PacketSwing.class, PacketHandler.nextID(), Side.CLIENT);
|
||||
PacketGivePlayerXP.register();
|
||||
PacketExperianceContainer.register();
|
||||
|
||||
BlockKillerJoe res = new BlockKillerJoe();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -40,19 +38,18 @@ public class BlockKillerJoe extends AbstractMachineBlock<TileKillerJoe> {
|
||||
setStepSound(Block.soundTypeGlass);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public float getExplosionResistance(Entity par1Entity, World world, int x, int y, int z, double explosionX,
|
||||
double explosionY, double explosionZ) {
|
||||
return 2000;
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void getKillDisplayName(PlayerEvent.NameFormat nameEvt) {
|
||||
if (nameEvt.username != null && nameEvt.username.startsWith(USERNAME)) {
|
||||
nameEvt.displayname = getLocalizedName();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerKillerJoe(player.inventory, (TileKillerJoe) world.getTileEntity(x, y, z));
|
||||
@@ -101,4 +98,14 @@ public class BlockKillerJoe extends AbstractMachineBlock<TileKillerJoe> {
|
||||
return 5;
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void getKillDisplayName(PlayerEvent.NameFormat nameEvt) {
|
||||
if (nameEvt.username != null && nameEvt.username.startsWith(USERNAME)) {
|
||||
nameEvt.displayname = getLocalizedName();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -102,11 +102,6 @@ public class GuiKillerJoe extends GuiMachineBase<TileKillerJoe> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderSlotHighlights(IoMode mode) {
|
||||
super.renderSlotHighlights(mode);
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
package crazypants.enderio.machine.monitor;
|
||||
|
||||
import static crazypants.enderio.machine.power.PowerDisplayUtil.formatPower;
|
||||
import static crazypants.enderio.machine.power.PowerDisplayUtil.formatPowerFloat;
|
||||
import static crazypants.enderio.power.PowerDisplayUtil.formatPower;
|
||||
import static crazypants.enderio.power.PowerDisplayUtil.formatPowerFloat;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
@@ -25,8 +25,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.ContainerNoInv;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiPowerMonitor extends GuiContainerBaseEIO {
|
||||
|
||||
|
||||
@@ -76,8 +76,4 @@ public class GuiAttractor extends GuiPoweredMachineBase<TileAttractor> {
|
||||
ColorUtil.getRGB(Color.white));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -75,8 +75,4 @@ public class GuiAversionObelisk extends GuiPoweredMachineBase<TileAversionObelis
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
+18
-10
@@ -25,7 +25,6 @@ public class BlockInhibitorObelisk extends BlockObeliskAbstract<TileInhibitorObe
|
||||
public static BlockInhibitorObelisk create() {
|
||||
BlockInhibitorObelisk res = new BlockInhibitorObelisk();
|
||||
res.init();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
return instance = res;
|
||||
}
|
||||
|
||||
@@ -33,6 +32,12 @@ public class BlockInhibitorObelisk extends BlockObeliskAbstract<TileInhibitorObe
|
||||
super(ModObject.blockInhibitorObelisk, TileInhibitorObelisk.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
MinecraftForge.EVENT_BUS.register(new EventHandler());
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return ID == getGuiId()
|
||||
@@ -58,15 +63,18 @@ public class BlockInhibitorObelisk extends BlockObeliskAbstract<TileInhibitorObe
|
||||
|
||||
public Map<BlockCoord, Float> activeInhibitors = Maps.newHashMap();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTeleport(TeleportEntityEvent event) {
|
||||
for (Entry<BlockCoord, Float> e : activeInhibitors.entrySet()) {
|
||||
BlockCoord bc = e.getKey();
|
||||
int dist = bc.getDist(new BlockCoord(event.targetX, event.targetY, event.targetZ));
|
||||
if (dist < e.getValue()) {
|
||||
TileEntity te = bc.getTileEntity(event.entity.worldObj);
|
||||
if (te instanceof TileInhibitorObelisk && ((TileInhibitorObelisk) te).isActive()) {
|
||||
event.setCanceled(true);
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onTeleport(TeleportEntityEvent event) {
|
||||
for (Entry<BlockCoord, Float> e : activeInhibitors.entrySet()) {
|
||||
BlockCoord bc = e.getKey();
|
||||
int dist = bc.getDist(new BlockCoord(event.targetX, event.targetY, event.targetZ));
|
||||
if (dist < e.getValue()) {
|
||||
TileEntity te = bc.getTileEntity(event.entity.worldObj);
|
||||
if (te instanceof TileInhibitorObelisk && ((TileInhibitorObelisk) te).isActive()) {
|
||||
event.setCanceled(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,11 +113,6 @@ public class GuiWeatherObelisk extends GuiPoweredMachineBase<TileWeatherObelisk>
|
||||
return WeatherTask.fromFluid(fs.getFluid());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
bindGuiTexture();
|
||||
|
||||
@@ -157,8 +157,4 @@ public class GuiExperienceObelisk extends GuiMachineBase<TileExperienceObelisk>
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -199,7 +199,7 @@ public class BlockPaintedGlowstone extends BlockEio
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:conduitConnector");
|
||||
blockIcon = IIconRegister.registerIcon("glowstone");
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -231,10 +231,12 @@ public class BlockPaintedGlowstone extends BlockEio
|
||||
|
||||
@Override
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEnder te, ItemStack drop) {
|
||||
TileEntityPaintedBlock tef = (TileEntityPaintedBlock) te;
|
||||
if (tef != null) {
|
||||
if (te instanceof TileEntityPaintedBlock tef) {
|
||||
ItemStack itemStack = createItemStackForSourceBlock(tef.getSourceBlock(), tef.getSourceBlockMetadata());
|
||||
drop.stackTagCompound = (NBTTagCompound) itemStack.stackTagCompound.copy();
|
||||
NBTTagCompound tag = itemStack.stackTagCompound;
|
||||
if (tag != null) {
|
||||
drop.stackTagCompound = (NBTTagCompound) tag.copy();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -39,11 +39,6 @@ public class GuiPainter extends GuiPoweredMachineBase<TileEntityPainter> {
|
||||
super.drawGuiContainerBackgroundLayer(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void renderSlotHighlight(int slot, Vector4f col) {
|
||||
if (getTileEntity().getSlotDefinition().isOutputSlot(slot)) {
|
||||
|
||||
@@ -63,7 +63,8 @@ public final class PainterUtil {
|
||||
sourceName = is.getDisplayName();
|
||||
}
|
||||
}
|
||||
return EnderIO.lang.localize("blockPainter.paintedWith") + " " + sourceName;
|
||||
return EnderIO.lang.localize("blockPainter.paintedWith") + " "
|
||||
+ (sourceName.isEmpty() ? EnderIO.lang.localize("blockPainter.paintedWith.none") : sourceName);
|
||||
}
|
||||
|
||||
public static void setSourceBlock(ItemStack item, Block source, int meta) {
|
||||
|
||||
@@ -1,369 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.client.gui.IAdvancedTooltipProvider;
|
||||
import com.enderio.core.client.handlers.SpecialTooltipHandler;
|
||||
import com.enderio.core.common.TileEntityEnder;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ChatUtil;
|
||||
import com.enderio.core.common.util.Util;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
|
||||
import cpw.mods.fml.common.network.IGuiHandler;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.BlockEio;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
import crazypants.enderio.tool.ToolUtil;
|
||||
import crazypants.enderio.waila.IWailaInfoProvider;
|
||||
|
||||
public class BlockCapacitorBank extends BlockEio implements IGuiHandler, IAdvancedTooltipProvider, IWailaInfoProvider {
|
||||
|
||||
public static int renderId = -1;
|
||||
|
||||
public static BlockCapacitorBank create() {
|
||||
PacketHandler.INSTANCE
|
||||
.registerMessage(PacketClientState.class, PacketClientState.class, PacketHandler.nextID(), Side.SERVER);
|
||||
PacketHandler.INSTANCE.registerMessage(
|
||||
PacketPowerStorage.class,
|
||||
PacketPowerStorage.class,
|
||||
PacketHandler.nextID(),
|
||||
Side.CLIENT);
|
||||
|
||||
BlockCapacitorBank res = new BlockCapacitorBank();
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
|
||||
IIcon overlayIcon;
|
||||
IIcon fillBarIcon;
|
||||
|
||||
private IIcon blockIconInput;
|
||||
private IIcon blockIconOutput;
|
||||
private IIcon blockIconLocked;
|
||||
|
||||
protected BlockCapacitorBank() {
|
||||
super(ModObject.blockCapacitorBank.unlocalisedName, TileCapacitorBank.class);
|
||||
setHardness(2.0F);
|
||||
setCreativeTab(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
|
||||
GameRegistry.registerBlock(this, BlockItemCapacitorBank.class, name);
|
||||
if (teClass != null) {
|
||||
GameRegistry.registerTileEntity(teClass, name + "TileEntity");
|
||||
}
|
||||
|
||||
EnderIO.guiHandler.registerGuiHandler(GuiHandler.GUI_ID_CAPACITOR_BANK, this);
|
||||
setLightOpacity(255);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item p_149666_1_, CreativeTabs p_149666_2_, List<ItemStack> list) {}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addCommonEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addBasicEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
list.add(
|
||||
PowerDisplayUtil.formatStoredPower(
|
||||
PowerHandlerUtil.getStoredEnergyForItem(itemstack),
|
||||
TileCapacitorBank.BASE_CAP.getMaxEnergyStored()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void addDetailedEntries(ItemStack itemstack, EntityPlayer entityplayer, List<String> list, boolean flag) {
|
||||
SpecialTooltipHandler.addDetailedTooltipFromResources(list, itemstack);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer entityPlayer, int side, float par7,
|
||||
float par8, float par9) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (ToolUtil.isToolEquipped(entityPlayer)) {
|
||||
|
||||
ForgeDirection faceHit = ForgeDirection.getOrientation(side);
|
||||
TileCapacitorBank tcb = (TileCapacitorBank) te;
|
||||
tcb.toggleIoModeForFace(faceHit);
|
||||
if (world.isRemote) {
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
} else {
|
||||
world.notifyBlocksOfNeighborChange(x, y, z, EnderIO.blockCapacitorBank);
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
return super.onBlockActivated(world, x, y, z, entityPlayer, side, par7, par8, par9);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean openGui(World world, int x, int y, int z, EntityPlayer entityPlayer, int side) {
|
||||
if (!world.isRemote) {
|
||||
entityPlayer.openGui(EnderIO.instance, GuiHandler.GUI_ID_CAPACITOR_BANK, world, x, y, z);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
return new ContainerCapacitorBank(player, player.inventory, ((TileCapacitorBank) te).getController());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
return new GuiCapacitorBank(player, player.inventory, ((TileCapacitorBank) te).getController());
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
@Override
|
||||
public void registerBlockIcons(IIconRegister IIconRegister) {
|
||||
blockIcon = IIconRegister.registerIcon("enderio:capacitorBank");
|
||||
blockIconInput = IIconRegister.registerIcon("enderio:capacitorBankInput");
|
||||
blockIconOutput = IIconRegister.registerIcon("enderio:capacitorBankOutput");
|
||||
blockIconLocked = IIconRegister.registerIcon("enderio:capacitorBankLocked");
|
||||
overlayIcon = IIconRegister.registerIcon("enderio:capacitorBankOverlays");
|
||||
fillBarIcon = IIconRegister.registerIcon("enderio:capacitorBankFillBar");
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderId;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSideSolid(IBlockAccess world, int x, int y, int z, ForgeDirection side) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess par1IBlockAccess, int par2, int par3, int par4, int par5) {
|
||||
Block i1 = par1IBlockAccess.getBlock(par2, par3, par4);
|
||||
return i1 == this ? false : super.shouldSideBeRendered(par1IBlockAccess, par2, par3, par4, par5);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess ba, int x, int y, int z, int side) {
|
||||
TileEntity te = ba.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return blockIcon;
|
||||
}
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
IoMode mode = cb.getIoMode(ForgeDirection.values()[side]);
|
||||
if (mode == null || mode == IoMode.NONE) {
|
||||
return blockIcon;
|
||||
}
|
||||
if (mode == IoMode.PULL) {
|
||||
return blockIconInput;
|
||||
}
|
||||
if (mode == IoMode.PUSH) {
|
||||
return blockIconOutput;
|
||||
}
|
||||
return blockIconLocked;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockAdded(World world, int x, int y, int z) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank tr = (TileCapacitorBank) te;
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 1) {
|
||||
tr.setCreativeMode();
|
||||
}
|
||||
tr.onBlockAdded();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block blockId) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
TileEntity tile = world.getTileEntity(x, y, z);
|
||||
if (tile instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank te = (TileCapacitorBank) tile;
|
||||
te.onNeighborBlockChange(blockId);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean doNormalDrops(World world, int x, int y, int z) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void processDrop(World world, int x, int y, int z, TileEntityEnder te, ItemStack drop) {
|
||||
PowerHandlerUtil.setStoredEnergyForItem(drop, ((TileCapacitorBank) te).doGetEnergyStored());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||
if (world.isRemote) {
|
||||
return;
|
||||
}
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
cb.addEnergy(PowerHandlerUtil.getStoredEnergyForItem(stack));
|
||||
if (player instanceof EntityPlayerMP) {
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
BlockCoord bc = new BlockCoord(x, y, z);
|
||||
bc = bc.getLocation(dir);
|
||||
te = world.getTileEntity(bc.x, bc.y, bc.z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
if (((TileCapacitorBank) te).isMaxSize()) {
|
||||
ChatUtil.sendNoSpam((EntityPlayerMP) player, "Capacitor bank is at maximum size");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDropped(Random r) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block par5, int par6) {
|
||||
if (!world.isRemote && world.getGameRules().getGameRuleBooleanValue("doTileDrops")) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
super.breakBlock(world, x, y, z, par5, par6);
|
||||
return;
|
||||
}
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
Util.dropItems(world, cb, x, y, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public AxisAlignedBB getSelectedBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
TileCapacitorBank tr = (TileCapacitorBank) te;
|
||||
if (!tr.isMultiblock()) {
|
||||
return super.getSelectedBoundingBoxFromPool(world, x, y, z);
|
||||
}
|
||||
|
||||
Vector3d min = new Vector3d(Double.MAX_VALUE, Double.MAX_VALUE, Double.MAX_VALUE);
|
||||
Vector3d max = new Vector3d(-Double.MAX_VALUE, -Double.MAX_VALUE, -Double.MAX_VALUE);
|
||||
for (BlockCoord bc : tr.multiblock) {
|
||||
min.x = Math.min(min.x, bc.x);
|
||||
max.x = Math.max(max.x, bc.x + 1);
|
||||
min.y = Math.min(min.y, bc.y);
|
||||
max.y = Math.max(max.y, bc.y + 1);
|
||||
min.z = Math.min(min.z, bc.z);
|
||||
max.z = Math.max(max.z, bc.z + 1);
|
||||
}
|
||||
return AxisAlignedBB.getBoundingBox(min.x, min.y, min.z, max.x, max.y, max.z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void getWailaInfo(List<String> tooltip, EntityPlayer player, World world, int x, int y, int z) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cap = (TileCapacitorBank) te;
|
||||
String format = Util.TAB + Util.ALIGNRIGHT + EnumChatFormatting.WHITE;
|
||||
|
||||
tooltip.add(
|
||||
String.format(
|
||||
"%s : %s%s%sRF/t ",
|
||||
EnderIO.lang.localize("capbank.maxIO"),
|
||||
format,
|
||||
PowerDisplayUtil.formatPower(cap.getMaxIO()),
|
||||
Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(
|
||||
String.format(
|
||||
"%s : %s%s%sRF/t ",
|
||||
EnderIO.lang.localize("capbank.maxIn"),
|
||||
format,
|
||||
PowerDisplayUtil.formatPower(cap.getMaxInput()),
|
||||
Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add(
|
||||
String.format(
|
||||
"%s : %s%s%sRF/t ",
|
||||
EnderIO.lang.localize("capbank.maxOut"),
|
||||
format,
|
||||
PowerDisplayUtil.formatPower(cap.getMaxOutput()),
|
||||
Util.TAB + Util.ALIGNRIGHT));
|
||||
tooltip.add("Deprecated. Convert by placing in crafting grid");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getDefaultDisplayMask(World world, int x, int y, int z) {
|
||||
return IWailaInfoProvider.BIT_DETAILED;
|
||||
}
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
import cofh.api.energy.IEnergyContainerItem;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
public class BlockItemCapacitorBank extends ItemBlock implements IEnergyContainerItem {
|
||||
|
||||
public static ItemStack createItemStackWithPower(int storedEnergy) {
|
||||
ItemStack res = new ItemStack(EnderIO.blockCapacitorBank);
|
||||
PowerHandlerUtil.setStoredEnergyForItem(res, storedEnergy);
|
||||
return res;
|
||||
}
|
||||
|
||||
public BlockItemCapacitorBank() {
|
||||
super(EnderIO.blockCapacitorBank);
|
||||
setHasSubtypes(true);
|
||||
}
|
||||
|
||||
public BlockItemCapacitorBank(Block block) {
|
||||
super(block);
|
||||
setHasSubtypes(true);
|
||||
setCreativeTab(EnderIOTab.tabEnderIO);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int par1) {
|
||||
return par1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack par1ItemStack) {
|
||||
int meta = par1ItemStack.getItemDamage();
|
||||
String result = super.getUnlocalizedName(par1ItemStack);
|
||||
if (meta == 1) {
|
||||
result += ".creative";
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item par1, CreativeTabs par2CreativeTabs, List<ItemStack> par3List) {}
|
||||
|
||||
@Override
|
||||
public boolean showDurabilityBar(ItemStack itemStack) {
|
||||
return itemStack.getItemDamage() != 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getDurabilityForDisplay(ItemStack itemStack) {
|
||||
double stored = getMaxEnergyStored(itemStack) - getEnergyStored(itemStack) + 1;
|
||||
double max = getMaxEnergyStored(itemStack) + 1;
|
||||
return stored / max;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) {
|
||||
if (container.stackSize > 1) {
|
||||
return 0;
|
||||
}
|
||||
int energy = getEnergyStored(container);
|
||||
int maxInput = TileCapacitorBank.BASE_CAP.getMaxEnergyReceived();
|
||||
int energyReceived = Math.min(getMaxEnergyStored(container) - energy, Math.min(maxReceive, maxInput));
|
||||
|
||||
if (!simulate && container.getItemDamage() != 1) {
|
||||
energy += energyReceived;
|
||||
PowerHandlerUtil.setStoredEnergyForItem(container, energy);
|
||||
}
|
||||
return energyReceived;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) {
|
||||
if (container.stackSize > 1) {
|
||||
return 0;
|
||||
}
|
||||
int energy = getEnergyStored(container);
|
||||
int maxOutput = TileCapacitorBank.BASE_CAP.getMaxEnergyExtracted();
|
||||
int energyExtracted = Math.min(energy, Math.min(maxExtract, maxOutput));
|
||||
|
||||
if (!simulate && container.getItemDamage() != 1) {
|
||||
energy -= energyExtracted;
|
||||
PowerHandlerUtil.setStoredEnergyForItem(container, energy);
|
||||
}
|
||||
return energyExtracted;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getEnergyStored(ItemStack container) {
|
||||
return PowerHandlerUtil.getStoredEnergyForItem(container);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxEnergyStored(ItemStack container) {
|
||||
return TileCapacitorBank.BASE_CAP.getMaxEnergyStored();
|
||||
}
|
||||
}
|
||||
@@ -1,280 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.api.client.render.IRenderFace;
|
||||
import com.enderio.core.client.render.ConnectedTextureRenderer;
|
||||
import com.enderio.core.client.render.CustomCubeRenderer;
|
||||
import com.enderio.core.client.render.CustomRenderBlocks;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.util.ForgeDirectionOffsets;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
import com.enderio.core.common.vecmath.Vector3d;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.enderio.core.common.vecmath.Vector4f;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
import com.gtnewhorizons.angelica.api.ThreadSafeISBRH;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.machine.power.GaugeBounds.VPos;
|
||||
|
||||
@ThreadSafeISBRH(perThread = true)
|
||||
public class CapBankRenderer2 implements ISimpleBlockRenderingHandler {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
private static final double PIXEL_SIZE = 1 / 16d;
|
||||
|
||||
private final List<IRenderFace> renderers = new ArrayList<>(2);
|
||||
|
||||
private ConnectedTextureRenderer connectedTexRenderer;
|
||||
|
||||
public CapBankRenderer2() {
|
||||
connectedTexRenderer = new ConnectedTextureRenderer();
|
||||
connectedTexRenderer.setMatchMeta(true);
|
||||
|
||||
GaugueRenderer gaugeRenderer = new GaugueRenderer();
|
||||
renderers.add(connectedTexRenderer);
|
||||
renderers.add(gaugeRenderer);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId,
|
||||
RenderBlocks renderer) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cb = ((TileCapacitorBank) te);
|
||||
cb.energyAtLastRender = cb.getEnergyStored();
|
||||
}
|
||||
int meta = world.getBlockMetadata(x, y, z);
|
||||
if (meta == 1) {
|
||||
connectedTexRenderer.setEdgeTexture(IconUtil.whiteTexture);
|
||||
connectedTexRenderer.setForceAllEdges(true);
|
||||
} else {
|
||||
connectedTexRenderer.setEdgeTexture(EnderIO.blockAlloySmelter.getBlockTextureFromSide(3));
|
||||
connectedTexRenderer.setForceAllEdges(false);
|
||||
}
|
||||
CustomCubeRenderer.get().renderBlock(world, block, x, y, z, renderers);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockCapacitorBank.renderId;
|
||||
}
|
||||
|
||||
private class GaugueRenderer implements IRenderFace {
|
||||
|
||||
@Override
|
||||
public void renderFace(CustomRenderBlocks rb, ForgeDirection face, Block par1Block, double x, double y,
|
||||
double z, IIcon texture, List<Vertex> refVertices, boolean translateToXyz) {
|
||||
// Gauge
|
||||
TileEntity te = rb.blockAccess.getTileEntity((int) x, (int) y, (int) z);
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return;
|
||||
}
|
||||
TileCapacitorBank capBank = ((TileCapacitorBank) te);
|
||||
List<GaugeBounds> gaugeBounds = null;
|
||||
gaugeBounds = capBank.getGaugeBounds();
|
||||
|
||||
if (gaugeBounds == null || gaugeBounds.isEmpty()) {
|
||||
return;
|
||||
}
|
||||
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
if (gb.face == face) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.addTranslation((float) x, (float) y, (float) z);
|
||||
int b = 0;
|
||||
Vector4f col = new Vector4f();
|
||||
int colCount = 0;
|
||||
for (Vertex v : refVertices) {
|
||||
b += v.brightness;
|
||||
if (v.color != null) {
|
||||
colCount++;
|
||||
col.add(v.color);
|
||||
}
|
||||
}
|
||||
if (b > 0) {
|
||||
b /= 4;
|
||||
tes.setBrightness(b);
|
||||
} else {
|
||||
tes.setBrightness(15 << 20 | 0 << 4);
|
||||
}
|
||||
if (colCount > 0) {
|
||||
col.scale(0.25);
|
||||
tes.setColorRGBA_F(col.x, col.y, col.z, col.w);
|
||||
}
|
||||
renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon, refVertices, x, y, z);
|
||||
renderFillBarOnFace(
|
||||
gb,
|
||||
EnderIO.blockCapacitorBank.fillBarIcon,
|
||||
capBank.getEnergyStoredRatio(),
|
||||
refVertices,
|
||||
x,
|
||||
y,
|
||||
z);
|
||||
capBank.lastRenderStoredRatio = capBank.getEnergyStoredRatio();
|
||||
tes.addTranslation((float) -x, (float) -y, (float) -z);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mb) {
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if (isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void renderGaugeOnFace(GaugeBounds gb, IIcon icon, List<Vertex> vertices, double x, double y,
|
||||
double z) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
|
||||
for (Vertex coord : corners) {
|
||||
coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.001f));
|
||||
Vector3d xyz = new Vector3d(coord.xyz);
|
||||
xyz.x += x;
|
||||
xyz.y += y;
|
||||
xyz.z += z;
|
||||
Vertex v = getClosestVertex(vertices, xyz);
|
||||
if (v != null) {
|
||||
if (v.color != null) {
|
||||
tes.setColorRGBA_F(v.color.x, v.color.y, v.color.z, v.color.w);
|
||||
} else {
|
||||
tes.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
}
|
||||
if (v.brightness > 0) {
|
||||
tes.setBrightness(v.brightness);
|
||||
}
|
||||
}
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderFillBarOnFace(GaugeBounds gb, IIcon icon, double filledRatio, List<Vertex> vertices,
|
||||
double x, double y, double z) {
|
||||
|
||||
int totalPixels;
|
||||
if (gb.vInfo.verticalHeight == 1) {
|
||||
totalPixels = VPos.SINGLE_BLOCK.numFillPixels;
|
||||
} else {
|
||||
totalPixels = VPos.BOTTOM.numFillPixels + VPos.TOP.numFillPixels
|
||||
+ (VPos.MIDDLE.numFillPixels * (gb.vInfo.verticalHeight - 2));
|
||||
}
|
||||
|
||||
int targetPixelCount = (int) Math.max(0, Math.round(totalPixels * filledRatio));
|
||||
int pixelsBellowFace;
|
||||
if (gb.vInfo.index < 2) {
|
||||
// either none or a bottom section
|
||||
pixelsBellowFace = gb.vInfo.index * VPos.BOTTOM.numFillPixels;
|
||||
} else { // has middle section
|
||||
pixelsBellowFace = VPos.BOTTOM.numFillPixels + (VPos.MIDDLE.numFillPixels * (gb.vInfo.index - 1));
|
||||
}
|
||||
|
||||
if (pixelsBellowFace >= targetPixelCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
VPos yPos = gb.vInfo.pos;
|
||||
int numPixelsLeft = targetPixelCount - pixelsBellowFace;
|
||||
int fillPixels = Math.min(numPixelsLeft, yPos.numFillPixels);
|
||||
|
||||
double maxY = (yPos.fillOffset * PIXEL_SIZE) + (fillPixels * PIXEL_SIZE);
|
||||
float vWidth = icon.getMaxV() - icon.getMinV();
|
||||
float maxV = icon.getMinV() + ((float) maxY * vWidth);
|
||||
|
||||
Tessellator tes = Tessellator.instance;
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<com.enderio.core.common.vecmath.Vertex> corners = gb.bb
|
||||
.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
|
||||
for (Vertex coord : corners) {
|
||||
coord.xyz.add(ForgeDirectionOffsets.offsetScaled(gb.face, 0.002f));
|
||||
|
||||
Vector3d xyz = new Vector3d(coord.xyz);
|
||||
xyz.x += x;
|
||||
xyz.y += y;
|
||||
xyz.z += z;
|
||||
Vertex v = getClosestVertex(vertices, xyz);
|
||||
if (v != null) {
|
||||
if (v.color != null) {
|
||||
tes.setColorRGBA_F(v.color.x, v.color.y, v.color.z, v.color.w);
|
||||
} else {
|
||||
tes.setColorOpaque_F(0.7f, 0.7f, 0.7f);
|
||||
}
|
||||
if (v.brightness > 0) {
|
||||
tes.setBrightness(v.brightness);
|
||||
}
|
||||
}
|
||||
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if (val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
private Vertex getClosestVertex(List<Vertex> vertices, Vector3d corner) {
|
||||
Vertex result = null;
|
||||
double d2 = Double.MAX_VALUE;
|
||||
for (Vertex v : vertices) {
|
||||
double tmp = corner.distanceSquared(v.xyz);
|
||||
if (tmp <= d2) {
|
||||
result = v;
|
||||
d2 = tmp;
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
||||
// ------------ Inner Classes
|
||||
|
||||
}
|
||||
@@ -1,339 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.CubeRenderer;
|
||||
import com.enderio.core.client.render.IconUtil;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
import com.enderio.core.common.vecmath.Vertex;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.power.PowerHandlerUtil;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public class CapacitorBankRenderer extends TileEntitySpecialRenderer implements IItemRenderer {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
private static final double PIXEL_SIZE = 1 / 16d;
|
||||
|
||||
// ------------------------- Item renderer
|
||||
|
||||
@Override
|
||||
public boolean handleRenderType(ItemStack item, ItemRenderType type) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldUseRenderHelper(ItemRenderType type, ItemStack item, ItemRendererHelper helper) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {
|
||||
renderBlock(
|
||||
null,
|
||||
PowerHandlerUtil.getStoredEnergyForItem(item) / TileCapacitorBank.BASE_CAP.getMaxEnergyStored(),
|
||||
item.getItemDamage());
|
||||
}
|
||||
|
||||
// ------------------------- Entity renderer
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float f) {
|
||||
if (!(te instanceof TileCapacitorBank)) {
|
||||
return;
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().entityRenderer.disableLightmap(0);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x, y, z);
|
||||
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
renderBlock(cb, cb.getEnergyStoredRatio(), 0);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().entityRenderer.enableLightmap(0);
|
||||
}
|
||||
|
||||
private void renderBlock(TileCapacitorBank te, double filledRatio, int meta) {
|
||||
RenderUtil.bindBlockTexture();
|
||||
Tessellator tes = Tessellator.instance;
|
||||
|
||||
BlockCoord myBC;
|
||||
BlockCoord[] mb;
|
||||
if (te != null && te.isMultiblock()) {
|
||||
myBC = new BlockCoord(te);
|
||||
mb = te.multiblock;
|
||||
} else {
|
||||
myBC = DEFAULT_BC;
|
||||
mb = DEFAULT_MB;
|
||||
}
|
||||
|
||||
List<GaugeBounds> gaugeBounds = calculateGaugeBounds(myBC, mb);
|
||||
|
||||
float[] brightness;
|
||||
float maxBrightness = 0;
|
||||
if (te != null) {
|
||||
brightness = new float[6];
|
||||
for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
brightness[dir.ordinal()] = RenderUtil.claculateTotalBrightnessForLocation(
|
||||
te.getWorldObj(),
|
||||
te.xCoord + dir.offsetX,
|
||||
te.yCoord + dir.offsetY,
|
||||
te.zCoord + dir.offsetZ);
|
||||
maxBrightness = Math.max(brightness[dir.ordinal()], maxBrightness);
|
||||
}
|
||||
} else {
|
||||
brightness = new float[] { 1, 1, 1, 1, 1, 1 };
|
||||
maxBrightness = 1;
|
||||
}
|
||||
|
||||
tes.startDrawingQuads();
|
||||
CubeRenderer.get()
|
||||
.render(BoundingBox.UNIT_CUBE, EnderIO.blockCapacitorBank.getIcon(0, 0), null, brightness, true);
|
||||
tes.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_POLYGON_OFFSET_FILL);
|
||||
GL11.glPolygonOffset(-1.0f, -1.0f);
|
||||
|
||||
tes.startDrawingQuads();
|
||||
tes.setColorRGBA_F(maxBrightness, maxBrightness, maxBrightness, 1);
|
||||
if (te != null) {
|
||||
renderBorder(te.getWorldObj(), te.xCoord, te.yCoord, te.zCoord, meta);
|
||||
} else {
|
||||
renderBorder(null, 0, 0, 0, meta);
|
||||
}
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon);
|
||||
}
|
||||
tes.draw();
|
||||
|
||||
GL11.glPolygonOffset(-3.0F, -3.0F);
|
||||
tes.startDrawingQuads();
|
||||
tes.setColorRGBA_F(maxBrightness, maxBrightness, maxBrightness, 1);
|
||||
|
||||
for (GaugeBounds gb : gaugeBounds) {
|
||||
renderFillBarOnFace(gb, EnderIO.blockCapacitorBank.fillBarIcon, filledRatio);
|
||||
}
|
||||
tes.draw();
|
||||
|
||||
GL11.glDisable(GL11.GL_POLYGON_OFFSET_FILL);
|
||||
}
|
||||
|
||||
private void renderBorder(IBlockAccess blockAccess, int x, int y, int z, int meta) {
|
||||
IIcon texture;
|
||||
if (meta == 0) {
|
||||
texture = EnderIO.blockAlloySmelter.getBlockTextureFromSide(3);
|
||||
} else {
|
||||
texture = IconUtil.whiteTexture;
|
||||
}
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
RenderUtil.renderConnectedTextureFace(
|
||||
blockAccess,
|
||||
EnderIO.blockCapacitorBank,
|
||||
x,
|
||||
y,
|
||||
z,
|
||||
face,
|
||||
texture,
|
||||
blockAccess == null,
|
||||
false,
|
||||
false);
|
||||
}
|
||||
}
|
||||
|
||||
private List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mb) {
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if (isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
private void renderGaugeOnFace(GaugeBounds gb, IIcon icon) {
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.setNormal(gb.face.offsetX, gb.face.offsetY, gb.face.offsetZ);
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<Vertex> corners = gb.bb.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), icon.getMaxV());
|
||||
for (Vertex coord : corners) {
|
||||
tes.setNormal(coord.nx(), coord.ny(), coord.nz());
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), coord.y(), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void renderFillBarOnFace(GaugeBounds gb, IIcon icon, double filledRatio) {
|
||||
|
||||
int totalPixels;
|
||||
if (gb.vInfo.verticalHeight == 1) {
|
||||
totalPixels = VPos.SINGLE_BLOCK.numFillPixels;
|
||||
} else {
|
||||
totalPixels = VPos.BOTTOM.numFillPixels + VPos.TOP.numFillPixels
|
||||
+ (VPos.MIDDLE.numFillPixels * (gb.vInfo.verticalHeight - 2));
|
||||
}
|
||||
|
||||
int targetPixelCount = (int) Math.max(0, Math.round(totalPixels * filledRatio));
|
||||
int pixelsBellowFace;
|
||||
if (gb.vInfo.index < 2) {
|
||||
// either none or a bottom section
|
||||
pixelsBellowFace = gb.vInfo.index * VPos.BOTTOM.numFillPixels;
|
||||
} else { // has middle section
|
||||
pixelsBellowFace = VPos.BOTTOM.numFillPixels + (VPos.MIDDLE.numFillPixels * (gb.vInfo.index - 1));
|
||||
}
|
||||
|
||||
if (pixelsBellowFace >= targetPixelCount) {
|
||||
return;
|
||||
}
|
||||
|
||||
VPos yPos = gb.vInfo.pos;
|
||||
int numPixelsLeft = targetPixelCount - pixelsBellowFace;
|
||||
int fillPixels = Math.min(numPixelsLeft, yPos.numFillPixels);
|
||||
|
||||
double maxY = (yPos.fillOffset * PIXEL_SIZE) + (fillPixels * PIXEL_SIZE);
|
||||
float vWidth = icon.getMaxV() - icon.getMinV();
|
||||
float maxV = icon.getMinV() + ((float) maxY * vWidth);
|
||||
|
||||
Tessellator tes = Tessellator.instance;
|
||||
tes.setNormal(gb.face.offsetX, gb.face.offsetY, gb.face.offsetZ);
|
||||
Vector2f u = gb.getMinMaxU(icon);
|
||||
List<com.enderio.core.common.vecmath.Vertex> corners = gb.bb
|
||||
.getCornersWithUvForFace(gb.face, u.x, u.y, icon.getMinV(), maxV);
|
||||
for (Vertex coord : corners) {
|
||||
if (coord.uv != null) {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), coord.u(), coord.v());
|
||||
} else {
|
||||
tes.addVertexWithUV(coord.x(), Math.min(coord.y(), maxY), coord.z(), 0, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if (val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
// ------------ Inner Classes
|
||||
|
||||
enum VPos {
|
||||
|
||||
SINGLE_BLOCK(0, 10, 3),
|
||||
BOTTOM(0.5f, 13, 3),
|
||||
MIDDLE(0.75f, 16, 0),
|
||||
TOP(0.25f, 13, 0);
|
||||
|
||||
final float uOffset;
|
||||
final int numFillPixels;
|
||||
final int fillOffset;
|
||||
|
||||
private VPos(float uOffset, int numFillPixels, int fillOffset) {
|
||||
this.uOffset = uOffset;
|
||||
this.numFillPixels = numFillPixels;
|
||||
this.fillOffset = fillOffset;
|
||||
}
|
||||
}
|
||||
|
||||
static class VInfo {
|
||||
|
||||
VPos pos;
|
||||
int verticalHeight;
|
||||
int index;
|
||||
|
||||
VInfo(VPos pos, int verticalHeight, int index) {
|
||||
this.pos = pos;
|
||||
this.verticalHeight = verticalHeight;
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
|
||||
static class GaugeBounds {
|
||||
|
||||
final BoundingBox bb;
|
||||
final VInfo vInfo;
|
||||
final ForgeDirection face;
|
||||
|
||||
GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
this.face = face;
|
||||
vInfo = getVPosForFace(me, mb, face);
|
||||
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
|
||||
float scaleX = uPlane.x != 0 ? 0.25f : 1;
|
||||
float scaleY = uPlane.y != 0 ? 0.25f : 1;
|
||||
float scaleZ = uPlane.z != 0 ? 0.25f : 1;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
|
||||
}
|
||||
|
||||
Vector2f getMinMaxU(IIcon icon) {
|
||||
VPos yPos = vInfo.pos;
|
||||
float uWidth = icon.getMaxU() - icon.getMinU();
|
||||
float uOffset = yPos.uOffset * uWidth;
|
||||
float minU = icon.getMinU() + uOffset;
|
||||
float maxU = minU + (uWidth * 0.25f);
|
||||
return new Vector2f(minU, maxU);
|
||||
}
|
||||
|
||||
private VInfo getVPosForFace(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
int maxY = me.y;
|
||||
int minY = me.y;
|
||||
for (BlockCoord bc : mb) {
|
||||
if (bc.x == me.x && bc.z == me.z && !containsLocaction(mb, bc.getLocation(face))) {
|
||||
maxY = Math.max(maxY, bc.y);
|
||||
minY = Math.min(minY, bc.y);
|
||||
}
|
||||
}
|
||||
if (maxY == me.y && minY == me.y) {
|
||||
return new VInfo(VPos.SINGLE_BLOCK, 1, 0);
|
||||
}
|
||||
int height = maxY - minY + 1;
|
||||
if (maxY > me.y) {
|
||||
return me.y > minY ? new VInfo(VPos.MIDDLE, height, me.y - minY) : new VInfo(VPos.BOTTOM, height, 0);
|
||||
}
|
||||
return new VInfo(VPos.TOP, height, height - 1);
|
||||
}
|
||||
|
||||
private boolean containsLocaction(BlockCoord[] mb, BlockCoord location) {
|
||||
for (BlockCoord bc : mb) {
|
||||
if (location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,172 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
public class ContainerCapacitorBank extends Container {
|
||||
|
||||
private final TileCapacitorBank tileEntity;
|
||||
|
||||
public ContainerCapacitorBank(final Entity player, InventoryPlayer playerInv, TileCapacitorBank te) {
|
||||
|
||||
tileEntity = te;
|
||||
int armorOffset = 21;
|
||||
addSlotToContainer(new Slot(tileEntity, 0, 59 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(0, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(tileEntity, 1, 79 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(1, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(tileEntity, 2, 99 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(2, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
addSlotToContainer(new Slot(tileEntity, 3, 119 + armorOffset, 59) {
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack itemStack) {
|
||||
return tileEntity.isItemValidForSlot(3, itemStack);
|
||||
}
|
||||
});
|
||||
|
||||
// add players inventory
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
for (int j = 0; j < 9; ++j) {
|
||||
addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, +armorOffset + 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < 9; ++i) {
|
||||
addSlotToContainer(new Slot(playerInv, i, +armorOffset + 8 + i * 18, 142));
|
||||
}
|
||||
|
||||
// armor slots
|
||||
for (int i = 0; i < 4; ++i) {
|
||||
final int k = i;
|
||||
addSlotToContainer(
|
||||
new Slot(playerInv, playerInv.getSizeInventory() - 1 - i, -15 + armorOffset, 30 + i * 18) {
|
||||
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValid(ItemStack par1ItemStack) {
|
||||
if (par1ItemStack == null) {
|
||||
return false;
|
||||
}
|
||||
return par1ItemStack.getItem().isValidArmor(par1ItemStack, k, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getBackgroundIconIndex() {
|
||||
return ItemArmor.func_94602_b(k);
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer entityplayer) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer entityPlayer, int slotIndex) {
|
||||
|
||||
int startPlayerSlot = 4;
|
||||
int endPlayerSlot = startPlayerSlot + 26;
|
||||
int startHotBarSlot = endPlayerSlot + 1;
|
||||
int endHotBarSlot = startHotBarSlot + 9;
|
||||
|
||||
ItemStack copystack = null;
|
||||
Slot slot = (Slot) inventorySlots.get(slotIndex);
|
||||
if (slot != null && slot.getHasStack()) {
|
||||
|
||||
ItemStack origStack = slot.getStack();
|
||||
copystack = origStack.copy();
|
||||
|
||||
if (slotIndex < 4) {
|
||||
// merge from machine input slots to inventory
|
||||
if (!mergeItemStackIntoArmor(entityPlayer, origStack, slotIndex)) {
|
||||
if (!mergeItemStack(origStack, startPlayerSlot, endHotBarSlot, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
} else {
|
||||
// Check from inv-> charge then inv->hotbar or hotbar->inv
|
||||
if (slotIndex >= startPlayerSlot) {
|
||||
if (!tileEntity.isItemValidForSlot(0, origStack) || !mergeItemStack(origStack, 0, 4, false)) {
|
||||
|
||||
if (slotIndex <= endPlayerSlot) {
|
||||
if (!mergeItemStack(origStack, startHotBarSlot, endHotBarSlot, false)) {
|
||||
return null;
|
||||
}
|
||||
} else if (slotIndex >= startHotBarSlot && slotIndex <= endHotBarSlot) {
|
||||
if (!mergeItemStack(origStack, startPlayerSlot, endPlayerSlot, false)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (origStack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
|
||||
slot.onSlotChanged();
|
||||
|
||||
if (origStack.stackSize == copystack.stackSize) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(entityPlayer, origStack);
|
||||
}
|
||||
|
||||
return copystack;
|
||||
}
|
||||
|
||||
private boolean mergeItemStackIntoArmor(EntityPlayer entityPlayer, ItemStack origStack, int slotIndex) {
|
||||
if (origStack == null || !(origStack.getItem() instanceof ItemArmor)) {
|
||||
return false;
|
||||
}
|
||||
ItemArmor armor = (ItemArmor) origStack.getItem();
|
||||
int index = 3 - armor.armorType;
|
||||
ItemStack[] ai = entityPlayer.inventory.armorInventory;
|
||||
if (ai[index] == null) {
|
||||
ai[index] = origStack.copy();
|
||||
origStack.stackSize = 0;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1,157 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import com.enderio.core.client.render.BoundingBox;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
import com.enderio.core.common.vecmath.Vector2f;
|
||||
import com.enderio.core.common.vecmath.Vector4d;
|
||||
|
||||
class GaugeBounds {
|
||||
|
||||
private static final BlockCoord DEFAULT_BC = new BlockCoord(0, 0, 0);
|
||||
private static final BlockCoord[] DEFAULT_MB = new BlockCoord[] { DEFAULT_BC };
|
||||
|
||||
static List<GaugeBounds> calculateGaugeBounds(BlockCoord me, BlockCoord[] mbIn) {
|
||||
|
||||
BlockCoord[] mb;
|
||||
if (mbIn != null) {
|
||||
mb = mbIn;
|
||||
} else {
|
||||
DEFAULT_MB[0] = me;
|
||||
mb = DEFAULT_MB;
|
||||
}
|
||||
|
||||
List<GaugeBounds> res = new ArrayList<GaugeBounds>();
|
||||
for (ForgeDirection face : ForgeDirection.VALID_DIRECTIONS) {
|
||||
if (face != ForgeDirection.UP && face != ForgeDirection.DOWN) {
|
||||
boolean isRight = isRightFace(me, mb, face);
|
||||
if (isRight) {
|
||||
res.add(new GaugeBounds(me, mb, face));
|
||||
}
|
||||
}
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
static boolean isRightFace(BlockCoord me, BlockCoord[] mb, ForgeDirection dir) {
|
||||
|
||||
if (me == null || contains(mb, me.getLocation(dir))) {
|
||||
return false;
|
||||
}
|
||||
if (mb == null) {
|
||||
return true;
|
||||
}
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(dir);
|
||||
|
||||
int myRightVal = (int) uPlane.x * me.x + (int) uPlane.y * me.y + (int) uPlane.z * me.z;
|
||||
int max = myRightVal;
|
||||
for (BlockCoord bc : mb) {
|
||||
int val = (int) uPlane.x * bc.x + (int) uPlane.y * bc.y + (int) uPlane.z * bc.z;
|
||||
if (val > max) {
|
||||
max = val;
|
||||
}
|
||||
}
|
||||
return myRightVal == max;
|
||||
}
|
||||
|
||||
private static boolean contains(BlockCoord[] mb, BlockCoord location) {
|
||||
if (mb == null) {
|
||||
return false;
|
||||
}
|
||||
for (BlockCoord bc : mb) {
|
||||
if (location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
final BoundingBox bb;
|
||||
final VInfo vInfo;
|
||||
final ForgeDirection face;
|
||||
|
||||
GaugeBounds(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
this.face = face;
|
||||
vInfo = getVPosForFace(me, mb, face);
|
||||
|
||||
Vector4d uPlane = RenderUtil.getUPlaneForFace(face);
|
||||
float scaleX = uPlane.x != 0 ? 0.25f : 1;
|
||||
float scaleY = uPlane.y != 0 ? 0.25f : 1;
|
||||
float scaleZ = uPlane.z != 0 ? 0.25f : 1;
|
||||
bb = BoundingBox.UNIT_CUBE.scale(scaleX, scaleY, scaleZ);
|
||||
}
|
||||
|
||||
Vector2f getMinMaxU(IIcon icon) {
|
||||
VPos yPos = vInfo.pos;
|
||||
float uWidth = icon.getMaxU() - icon.getMinU();
|
||||
float uOffset = yPos.uOffset * uWidth;
|
||||
float minU = icon.getMinU() + uOffset;
|
||||
float maxU = minU + (uWidth * 0.25f);
|
||||
return new Vector2f(minU, maxU);
|
||||
}
|
||||
|
||||
private VInfo getVPosForFace(BlockCoord me, BlockCoord[] mb, ForgeDirection face) {
|
||||
int maxY = me.y;
|
||||
int minY = me.y;
|
||||
for (BlockCoord bc : mb) {
|
||||
if (bc.x == me.x && bc.z == me.z && !containsLocaction(mb, bc.getLocation(face))) {
|
||||
maxY = Math.max(maxY, bc.y);
|
||||
minY = Math.min(minY, bc.y);
|
||||
}
|
||||
}
|
||||
if (maxY == me.y && minY == me.y) {
|
||||
return new VInfo(VPos.SINGLE_BLOCK, 1, 0);
|
||||
}
|
||||
int height = maxY - minY + 1;
|
||||
if (maxY > me.y) {
|
||||
return me.y > minY ? new VInfo(VPos.MIDDLE, height, me.y - minY) : new VInfo(VPos.BOTTOM, height, 0);
|
||||
}
|
||||
return new VInfo(VPos.TOP, height, height - 1);
|
||||
}
|
||||
|
||||
private boolean containsLocaction(BlockCoord[] mb, BlockCoord location) {
|
||||
for (BlockCoord bc : mb) {
|
||||
if (location.equals(bc)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
enum VPos {
|
||||
|
||||
SINGLE_BLOCK(0, 10, 3),
|
||||
BOTTOM(0.5f, 13, 3),
|
||||
MIDDLE(0.75f, 16, 0),
|
||||
TOP(0.25f, 13, 0);
|
||||
|
||||
final float uOffset;
|
||||
final int numFillPixels;
|
||||
final int fillOffset;
|
||||
|
||||
private VPos(float uOffset, int numFillPixels, int fillOffset) {
|
||||
this.uOffset = uOffset;
|
||||
this.numFillPixels = numFillPixels;
|
||||
this.fillOffset = fillOffset;
|
||||
}
|
||||
}
|
||||
|
||||
static class VInfo {
|
||||
|
||||
VPos pos;
|
||||
int verticalHeight;
|
||||
int index;
|
||||
|
||||
VInfo(VPos pos, int verticalHeight, int index) {
|
||||
this.pos = pos;
|
||||
this.verticalHeight = verticalHeight;
|
||||
this.index = index;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,335 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.GuiButton;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.gui.button.IconButton;
|
||||
import com.enderio.core.client.gui.widget.GuiToolTip;
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.gui.RedstoneModeButton;
|
||||
import crazypants.enderio.machine.IRedstoneModeControlable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.machine.gui.GuiOverlayIoConfig;
|
||||
import crazypants.enderio.machine.gui.GuiPoweredMachineBase;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
|
||||
public class GuiCapacitorBank extends GuiContainerBaseEIO {
|
||||
|
||||
protected static final int INPUT_BUTTON_ID = 18;
|
||||
protected static final int OUTPUT_BUTTON_ID = 37;
|
||||
|
||||
protected static final int CONFIG_ID = 377996104;
|
||||
|
||||
private static final int POWER_X = 11 + 18;
|
||||
private static final int POWER_Y = 9;
|
||||
private static final int POWER_WIDTH = 10;
|
||||
private static final int POWER_HEIGHT = 68;
|
||||
protected static final int BOTTOM_POWER_Y = POWER_Y + POWER_HEIGHT;
|
||||
|
||||
private int inputX = 78 + 24;
|
||||
private int inputY = 18;
|
||||
|
||||
private int outputX = 78 + 24;
|
||||
private int outputY = 36;
|
||||
|
||||
private int rightMargin = 8 + 24;
|
||||
|
||||
private final TileCapacitorBank capBank;
|
||||
|
||||
private RedstoneModeButton inputRsButton;
|
||||
private RedstoneModeButton outputRsButton;
|
||||
|
||||
private GuiTextField maxInputTF;
|
||||
private GuiTextField maxOutputTF;
|
||||
|
||||
private GuiOverlayIoConfig configOverlay;
|
||||
private IconButton configB;
|
||||
|
||||
public GuiCapacitorBank(Entity player, InventoryPlayer playerInv, TileCapacitorBank te) {
|
||||
super(new ContainerCapacitorBank(player, playerInv, te), "capacitorBank");
|
||||
this.capBank = te;
|
||||
|
||||
xSize = 176 + 42;
|
||||
|
||||
addToolTip(new GuiToolTip(new Rectangle(5, POWER_Y, POWER_WIDTH, POWER_HEIGHT), "") {
|
||||
|
||||
@Override
|
||||
protected void updateText() {
|
||||
text.clear();
|
||||
text.add(PowerDisplayUtil.formatPower(capBank.getEnergyStored()) + " " + PowerDisplayUtil.ofStr());
|
||||
text.add(
|
||||
PowerDisplayUtil.formatPower(capBank.getMaxEnergyStored()) + " "
|
||||
+ PowerDisplayUtil.abrevation());
|
||||
}
|
||||
});
|
||||
|
||||
int x = xSize - rightMargin - GuiPoweredMachineBase.BUTTON_SIZE - 21;
|
||||
int y = inputY;
|
||||
inputRsButton = new RedstoneModeButton(this, -1, x, y, new IRedstoneModeControlable() {
|
||||
|
||||
@Override
|
||||
public void setRedstoneControlMode(RedstoneControlMode mode) {
|
||||
capBank.setInputControlMode(mode);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getRedstoneControlMode() {
|
||||
return capBank.getInputControlMode();
|
||||
}
|
||||
});
|
||||
inputRsButton.setTooltipKey("enderio.gui.capBank.inputRs");
|
||||
|
||||
y += 18;
|
||||
outputRsButton = new RedstoneModeButton(this, -1, x, y, new IRedstoneModeControlable() {
|
||||
|
||||
@Override
|
||||
public void setRedstoneControlMode(RedstoneControlMode mode) {
|
||||
capBank.setOutputControlMode(mode);
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
|
||||
@Override
|
||||
public RedstoneControlMode getRedstoneControlMode() {
|
||||
return capBank.getOutputControlMode();
|
||||
}
|
||||
});
|
||||
outputRsButton.setTooltipKey("enderio.gui.capBank.outputRs");
|
||||
|
||||
y += 20;
|
||||
configB = new IconButton(this, CONFIG_ID, x, y, IconEIO.IO_CONFIG_UP);
|
||||
configB.setToolTip(EnderIO.lang.localize("gui.machine.ioMode.overlay.tooltip"));
|
||||
|
||||
List<BlockCoord> coords = new ArrayList<BlockCoord>();
|
||||
if (te.isMultiblock()) {
|
||||
BlockCoord[] mb = te.getController().multiblock;
|
||||
if (mb != null) {
|
||||
coords.addAll(Arrays.asList(mb));
|
||||
}
|
||||
}
|
||||
|
||||
if (coords.isEmpty()) {
|
||||
coords.add(te.getLocation());
|
||||
}
|
||||
|
||||
configOverlay = new GuiOverlayIoConfig(coords) {
|
||||
|
||||
@Override
|
||||
public void setVisible(boolean visible) {
|
||||
super.setVisible(visible);
|
||||
configB.setIcon(visible ? IconEIO.IO_CONFIG_DOWN : IconEIO.IO_CONFIG_UP);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String getLabelForMode(IoMode mode) {
|
||||
if (mode == IoMode.PUSH) {
|
||||
return EnderIO.lang.localize("gui.capBank.outputMode");
|
||||
} else if (mode == IoMode.PULL) {
|
||||
return EnderIO.lang.localize("gui.capBank.inputMode");
|
||||
}
|
||||
return super.getLabelForMode(mode);
|
||||
}
|
||||
};
|
||||
addOverlay(configOverlay);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void actionPerformed(GuiButton b) {
|
||||
super.actionPerformed(b);
|
||||
if (b.id == CONFIG_ID) {
|
||||
boolean vis = !configOverlay.isVisible();
|
||||
configOverlay.setVisible(vis);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
configB.onGuiInit();
|
||||
|
||||
int x = guiLeft + xSize - rightMargin - GuiPoweredMachineBase.BUTTON_SIZE;
|
||||
int y = guiTop + inputY;
|
||||
|
||||
FontRenderer fontRenderer = getFontRenderer();
|
||||
|
||||
inputRsButton.onGuiInit();
|
||||
outputRsButton.onGuiInit();
|
||||
|
||||
x = guiLeft + inputX;
|
||||
y = guiTop + inputY;
|
||||
maxInputTF = new GuiTextField(fontRenderer, x, y, 68, 16);
|
||||
maxInputTF.setCanLoseFocus(true);
|
||||
maxInputTF.setMaxStringLength(10);
|
||||
maxInputTF.setFocused(false);
|
||||
maxInputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxInput()));
|
||||
|
||||
x = guiLeft + outputX;
|
||||
y = guiTop + outputY;
|
||||
maxOutputTF = new GuiTextField(fontRenderer, x, y, 68, 16);
|
||||
maxOutputTF.setCanLoseFocus(true);
|
||||
maxOutputTF.setMaxStringLength(10);
|
||||
maxOutputTF.setFocused(true);
|
||||
maxOutputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxOutput()));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char par1, int par2) {
|
||||
super.keyTyped(par1, par2);
|
||||
if (par1 == 'e') {
|
||||
super.keyTyped(par1, 1);
|
||||
}
|
||||
maxInputTF.textboxKeyTyped(par1, par2);
|
||||
maxOutputTF.textboxKeyTyped(par1, par2);
|
||||
updateInputOutput();
|
||||
}
|
||||
|
||||
private void updateInputOutput() {
|
||||
int input = parsePower(maxInputTF);
|
||||
if (input >= 0 && capBank.getMaxInput() != input) {
|
||||
setMaxInput(input);
|
||||
}
|
||||
int output = parsePower(maxOutputTF);
|
||||
if (output >= 0 && capBank.getMaxOutput() != output) {
|
||||
setMaxOutput(output);
|
||||
}
|
||||
}
|
||||
|
||||
private void setMaxOutput(int output) {
|
||||
if (output != capBank.getMaxOutput()) {
|
||||
capBank.setMaxOutput(output);
|
||||
maxOutputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxOutput()));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
}
|
||||
|
||||
private void setMaxInput(int input) {
|
||||
if (input != capBank.getMaxInput()) {
|
||||
capBank.setMaxInput(input);
|
||||
maxInputTF.setText(PowerDisplayUtil.formatPower(capBank.getMaxInput()));
|
||||
PacketHandler.INSTANCE.sendToServer(new PacketClientState(capBank));
|
||||
}
|
||||
}
|
||||
|
||||
private int parsePower(GuiTextField tf) {
|
||||
String txt = tf.getText();
|
||||
try {
|
||||
Integer power = PowerDisplayUtil.parsePower(txt);
|
||||
if (power == null) {
|
||||
return -1;
|
||||
}
|
||||
return power.intValue();
|
||||
} catch (Exception e) {
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int par1, int par2, int par3) {
|
||||
super.mouseClicked(par1, par2, par3);
|
||||
maxInputTF.mouseClicked(par1, par2, par3);
|
||||
maxOutputTF.mouseClicked(par1, par2, par3);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void updateScreen() {
|
||||
maxInputTF.updateCursorCounter();
|
||||
maxOutputTF.updateCursorCounter();
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
bindGuiTexture();
|
||||
int sx = (width - xSize) / 2;
|
||||
int sy = (height - ySize) / 2;
|
||||
|
||||
drawTexturedModalRect(sx, sy, 0, 0, this.xSize - 21, this.ySize);
|
||||
|
||||
int i1 = capBank.getEnergyStoredScaled(POWER_HEIGHT);
|
||||
drawTexturedModalRect(sx + POWER_X, sy + BOTTOM_POWER_Y - i1, 176 + 21, 0, POWER_WIDTH, i1);
|
||||
|
||||
for (int i = 0; i < buttonList.size(); ++i) {
|
||||
GuiButton guibutton = (GuiButton) this.buttonList.get(i);
|
||||
guibutton.drawButton(this.mc, 0, 0);
|
||||
}
|
||||
|
||||
maxInputTF.drawTextBox();
|
||||
maxOutputTF.drawTextBox();
|
||||
|
||||
int midX = sx + xSize / 2;
|
||||
|
||||
String str = EnderIO.lang.localize("gui.capBank.maxIo") + " "
|
||||
+ PowerDisplayUtil.formatPower(capBank.getMaxIO())
|
||||
+ " "
|
||||
+ PowerDisplayUtil.abrevation()
|
||||
+ PowerDisplayUtil.perTickStr();
|
||||
FontRenderer fontRenderer = getFontRenderer();
|
||||
int swid = fontRenderer.getStringWidth(str);
|
||||
int x = midX - swid / 2;
|
||||
int y = guiTop + 5;
|
||||
|
||||
drawString(fontRenderer, str, x, y, -1);
|
||||
|
||||
str = EnderIO.lang.localize("gui.capBank.maxInput") + ":";
|
||||
swid = fontRenderer.getStringWidth(str);
|
||||
x = guiLeft + inputX - swid - 3;
|
||||
y = guiTop + inputY + 2;
|
||||
drawString(fontRenderer, str, x, y, -1);
|
||||
|
||||
str = EnderIO.lang.localize("gui.capBank.maxOutput") + ":";
|
||||
swid = fontRenderer.getStringWidth(str);
|
||||
x = guiLeft + outputX - swid - 3;
|
||||
y = guiTop + outputY + 2;
|
||||
drawString(fontRenderer, str, x, y, -1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawHoveringText(List par1List, int par2, int par3, FontRenderer font) {
|
||||
GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_LIGHTING_BIT);
|
||||
super.drawHoveringText(par1List, par2 + 24, par3, font);
|
||||
GL11.glPopAttrib();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGuiLeft() {
|
||||
return guiLeft + 24;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getGuiTop() {
|
||||
return guiTop;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXSize() {
|
||||
return xSize - 42;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getOverlayOffsetX() {
|
||||
return 21;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FontRenderer getFontRenderer() {
|
||||
return Minecraft.getMinecraft().fontRenderer;
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.machine.RedstoneControlMode;
|
||||
import crazypants.enderio.network.PacketUtil;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketClientState implements IMessage, IMessageHandler<PacketClientState, IMessage> {
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private RedstoneControlMode inputMode;
|
||||
private RedstoneControlMode outputMode;
|
||||
private int maxInput;
|
||||
private int maxOutput;
|
||||
|
||||
public PacketClientState() {}
|
||||
|
||||
public PacketClientState(TileCapacitorBank capBank) {
|
||||
x = capBank.xCoord;
|
||||
y = capBank.yCoord;
|
||||
z = capBank.zCoord;
|
||||
|
||||
inputMode = capBank.getInputControlMode();
|
||||
outputMode = capBank.getOutputControlMode();
|
||||
|
||||
maxInput = capBank.getMaxInput();
|
||||
maxOutput = capBank.getMaxOutput();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf dos) {
|
||||
dos.writeInt(x);
|
||||
dos.writeInt(y);
|
||||
dos.writeInt(z);
|
||||
dos.writeShort((short) inputMode.ordinal());
|
||||
dos.writeShort((short) outputMode.ordinal());
|
||||
dos.writeInt(maxInput);
|
||||
dos.writeInt(maxOutput);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf data) {
|
||||
x = data.readInt();
|
||||
y = data.readInt();
|
||||
z = data.readInt();
|
||||
short inputOrdinal = data.readShort();
|
||||
short outputOrdinal = data.readShort();
|
||||
outputMode = RedstoneControlMode.values()[outputOrdinal];
|
||||
inputMode = RedstoneControlMode.values()[inputOrdinal];
|
||||
|
||||
maxInput = data.readInt();
|
||||
maxOutput = data.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketClientState message, MessageContext ctx) {
|
||||
EntityPlayer player = ctx.getServerHandler().playerEntity;
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (PacketUtil.isInvalidPacketForGui(ctx, te, getClass())) return null;
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank cb = (TileCapacitorBank) te;
|
||||
cb.setInputControlMode(message.inputMode);
|
||||
cb.setOutputControlMode(message.outputMode);
|
||||
cb.setMaxInput(message.maxInput);
|
||||
cb.setMaxOutput(message.maxOutput);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import com.enderio.core.common.util.BlockCoord;
|
||||
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessage;
|
||||
import cpw.mods.fml.common.network.simpleimpl.IMessageHandler;
|
||||
import cpw.mods.fml.common.network.simpleimpl.MessageContext;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
|
||||
public class PacketPowerStorage implements IMessage, IMessageHandler<PacketPowerStorage, IMessage> {
|
||||
|
||||
private int x;
|
||||
private int y;
|
||||
private int z;
|
||||
private int storedEnergy;
|
||||
|
||||
public PacketPowerStorage() {}
|
||||
|
||||
public PacketPowerStorage(TileCapacitorBank ent) {
|
||||
x = ent.xCoord;
|
||||
y = ent.yCoord;
|
||||
z = ent.zCoord;
|
||||
storedEnergy = ent.storedEnergyRF;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void toBytes(ByteBuf buf) {
|
||||
buf.writeInt(x);
|
||||
buf.writeInt(y);
|
||||
buf.writeInt(z);
|
||||
buf.writeInt(storedEnergy);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fromBytes(ByteBuf buf) {
|
||||
x = buf.readInt();
|
||||
y = buf.readInt();
|
||||
z = buf.readInt();
|
||||
storedEnergy = buf.readInt();
|
||||
}
|
||||
|
||||
@Override
|
||||
public IMessage onMessage(PacketPowerStorage message, MessageContext ctx) {
|
||||
EntityPlayer player = EnderIO.proxy.getClientPlayer();
|
||||
TileEntity te = player.worldObj.getTileEntity(message.x, message.y, message.z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank me = (TileCapacitorBank) te;
|
||||
me.storedEnergyRF = message.storedEnergy;
|
||||
|
||||
double dif = Math.abs(me.lastRenderStoredRatio - me.getEnergyStoredRatio());
|
||||
if (dif > 0.025) { // update rendering at a 2.5% diff
|
||||
if (!me.isMultiblock()) {
|
||||
player.worldObj.markBlockForUpdate(message.x, message.y, message.z);
|
||||
} else {
|
||||
BlockCoord[] mb = me.multiblock;
|
||||
for (BlockCoord bc : mb) {
|
||||
updateGaugeRender(player.worldObj, bc);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
private void updateGaugeRender(World worldObj, BlockCoord bc) {
|
||||
TileEntity te = worldObj.getTileEntity(bc.x, bc.y, bc.z);
|
||||
if (te instanceof TileCapacitorBank) {
|
||||
TileCapacitorBank me = (TileCapacitorBank) te;
|
||||
List<GaugeBounds> gb = me.getGaugeBounds();
|
||||
if (gb != null && !gb.isEmpty()) {
|
||||
worldObj.markBlockForUpdate(bc.x, bc.y, bc.z);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -18,7 +18,7 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.EnderIOTab;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class BlockItemSolarPanel extends ItemBlockWithMetadata
|
||||
implements IAdvancedTooltipProvider, IResourceTooltipProvider {
|
||||
|
||||
@@ -89,8 +89,6 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
PoweredSpawnerConfig.getInstance();
|
||||
|
||||
BlockPoweredSpawner res = new BlockPoweredSpawner();
|
||||
MinecraftForge.EVENT_BUS.register(res);
|
||||
FMLCommonHandler.instance().bus().register(res);
|
||||
res.init();
|
||||
return res;
|
||||
}
|
||||
@@ -115,144 +113,16 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void init() {
|
||||
super.init();
|
||||
EventHandler handler = new EventHandler();
|
||||
MinecraftForge.EVENT_BUS.register(handler);
|
||||
FMLCommonHandler.instance().bus().register(handler);
|
||||
}
|
||||
|
||||
private final Map<BlockCoord, ItemStack> dropCache = new HashMap<BlockCoord, ItemStack>();
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakEvent(BlockEvent.BreakEvent evt) {
|
||||
if (evt.block instanceof BlockMobSpawner) {
|
||||
if (evt.getPlayer() != null && !evt.getPlayer().capabilities.isCreativeMode
|
||||
&& !evt.getPlayer().worldObj.isRemote
|
||||
&& !evt.isCanceled()) {
|
||||
TileEntity tile = evt.getPlayer().worldObj.getTileEntity(evt.x, evt.y, evt.z);
|
||||
if (tile instanceof TileEntityMobSpawner) {
|
||||
|
||||
if (Math.random() > Config.brokenSpawnerDropChance) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack equipped = evt.getPlayer().getCurrentEquippedItem();
|
||||
if (equipped != null) {
|
||||
for (UniqueIdentifier uid : toolBlackList) {
|
||||
Item blackListItem = GameRegistry.findItem(uid.modId, uid.name);
|
||||
if (blackListItem == equipped.getItem()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tile;
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
ItemStack drop = ItemBrokenSpawner.createStackForMobType(name);
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), drop);
|
||||
|
||||
for (int i = (int) (Math.random() * 7); i > 0; i--) {
|
||||
logic.spawnDelay = 0;
|
||||
logic.updateSpawner();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onHarvestDropsEvent(BlockEvent.HarvestDropsEvent evt) {
|
||||
if (!evt.isCanceled() && evt.block instanceof BlockMobSpawner) {
|
||||
BlockCoord bc = new BlockCoord(evt.x, evt.y, evt.z);
|
||||
if (dropCache.containsKey(bc)) {
|
||||
ItemStack stack = dropCache.get(bc);
|
||||
if (stack != null) {
|
||||
evt.drops.add(stack);
|
||||
}
|
||||
} else {
|
||||
// A spawner was broken---but not by a player. The TE has been
|
||||
// invalidated already, but we might be able to recover it.
|
||||
try {
|
||||
for (Object object : evt.world.loadedTileEntityList) {
|
||||
if (object instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) object;
|
||||
if (spawner.getWorldObj() == evt.world && spawner.xCoord == evt.x
|
||||
&& spawner.yCoord == evt.y
|
||||
&& spawner.zCoord == evt.z) {
|
||||
// Bingo!
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
evt.drops.add(ItemBrokenSpawner.createStackForMobType(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Risky recovery failed. Happens.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerTick(TickEvent.ServerTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
dropCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void handleAnvilEvent(AnvilUpdateEvent evt) {
|
||||
if (evt.left == null || evt.left.stackSize != 1
|
||||
|| evt.left.getItem() != Item.getItemFromBlock(EnderIO.blockPoweredSpawner)
|
||||
|| evt.right == null
|
||||
|| ItemBrokenSpawner.getMobTypeFromStack(evt.right) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String spawnerType = ItemBrokenSpawner.getMobTypeFromStack(evt.right);
|
||||
if (isBlackListed(spawnerType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
evt.cost = Config.powerSpawnerAddSpawnerCost;
|
||||
evt.output = evt.left.copy();
|
||||
if (evt.output.stackTagCompound == null) {
|
||||
evt.output.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
evt.output.stackTagCompound.setBoolean("eio.abstractMachine", true);
|
||||
writeMobTypeToNBT(evt.output.stackTagCompound, spawnerType);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingUpdate(LivingUpdateEvent livingUpdate) {
|
||||
|
||||
Entity ent = livingUpdate.entityLiving;
|
||||
if (!ent.getEntityData().hasKey(KEY_SPAWNED_BY_POWERED_SPAWNER)) {
|
||||
return;
|
||||
}
|
||||
if (fieldpersistenceRequired == null) {
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
return;
|
||||
}
|
||||
|
||||
long spawnTime = ent.getEntityData().getLong(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
long livedFor = livingUpdate.entity.worldObj.getTotalWorldTime() - spawnTime;
|
||||
if (livedFor > Config.poweredSpawnerDespawnTimeSeconds * 20) {
|
||||
try {
|
||||
fieldpersistenceRequired.setBoolean(livingUpdate.entityLiving, false);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
} catch (Exception e) {
|
||||
Log.warn("BlockPoweredSpawner.onLivingUpdate: Error occured allowing entity to despawn: " + e);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isBlackListed(String entityId) {
|
||||
return PoweredSpawnerConfig.getInstance().isBlackListed(entityId);
|
||||
}
|
||||
@@ -362,4 +232,144 @@ public class BlockPoweredSpawner extends AbstractMachineBlock<TilePoweredSpawner
|
||||
Util.dropItems(evt.getPlayer().worldObj, drop, evt.x, evt.y, evt.z, true);
|
||||
}
|
||||
}
|
||||
|
||||
public class EventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onBreakEvent(BlockEvent.BreakEvent evt) {
|
||||
if (evt.block instanceof BlockMobSpawner) {
|
||||
if (evt.getPlayer() != null && !evt.getPlayer().capabilities.isCreativeMode
|
||||
&& !evt.getPlayer().worldObj.isRemote
|
||||
&& !evt.isCanceled()) {
|
||||
TileEntity tile = evt.getPlayer().worldObj.getTileEntity(evt.x, evt.y, evt.z);
|
||||
if (tile instanceof TileEntityMobSpawner) {
|
||||
|
||||
if (Math.random() > Config.brokenSpawnerDropChance) {
|
||||
return;
|
||||
}
|
||||
|
||||
ItemStack equipped = evt.getPlayer().getCurrentEquippedItem();
|
||||
if (equipped != null) {
|
||||
for (UniqueIdentifier uid : toolBlackList) {
|
||||
Item blackListItem = GameRegistry.findItem(uid.modId, uid.name);
|
||||
if (blackListItem == equipped.getItem()) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) tile;
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
ItemStack drop = ItemBrokenSpawner.createStackForMobType(name);
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), drop);
|
||||
|
||||
for (int i = (int) (Math.random() * 7); i > 0; i--) {
|
||||
logic.spawnDelay = 0;
|
||||
logic.updateSpawner();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
dropCache.put(new BlockCoord(evt.x, evt.y, evt.z), null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onHarvestDropsEvent(BlockEvent.HarvestDropsEvent evt) {
|
||||
if (!evt.isCanceled() && evt.block instanceof BlockMobSpawner) {
|
||||
BlockCoord bc = new BlockCoord(evt.x, evt.y, evt.z);
|
||||
if (dropCache.containsKey(bc)) {
|
||||
ItemStack stack = dropCache.get(bc);
|
||||
if (stack != null) {
|
||||
evt.drops.add(stack);
|
||||
}
|
||||
} else {
|
||||
// A spawner was broken---but not by a player. The TE has been
|
||||
// invalidated already, but we might be able to recover it.
|
||||
try {
|
||||
for (Object object : evt.world.loadedTileEntityList) {
|
||||
if (object instanceof TileEntityMobSpawner) {
|
||||
TileEntityMobSpawner spawner = (TileEntityMobSpawner) object;
|
||||
if (spawner.getWorldObj() == evt.world && spawner.xCoord == evt.x
|
||||
&& spawner.yCoord == evt.y
|
||||
&& spawner.zCoord == evt.z) {
|
||||
// Bingo!
|
||||
MobSpawnerBaseLogic logic = spawner.func_145881_a();
|
||||
if (logic != null) {
|
||||
String name = logic.getEntityNameToSpawn();
|
||||
if (name != null && !isBlackListed(name)) {
|
||||
evt.drops.add(ItemBrokenSpawner.createStackForMobType(name));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// Risky recovery failed. Happens.
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onServerTick(TickEvent.ServerTickEvent event) {
|
||||
if (event.phase == TickEvent.Phase.END) {
|
||||
dropCache.clear();
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void handleAnvilEvent(AnvilUpdateEvent evt) {
|
||||
if (evt.left == null || evt.left.stackSize != 1
|
||||
|| evt.left.getItem() != Item.getItemFromBlock(EnderIO.blockPoweredSpawner)
|
||||
|| evt.right == null
|
||||
|| ItemBrokenSpawner.getMobTypeFromStack(evt.right) == null) {
|
||||
return;
|
||||
}
|
||||
|
||||
String spawnerType = ItemBrokenSpawner.getMobTypeFromStack(evt.right);
|
||||
if (isBlackListed(spawnerType)) {
|
||||
return;
|
||||
}
|
||||
|
||||
evt.cost = Config.powerSpawnerAddSpawnerCost;
|
||||
evt.output = evt.left.copy();
|
||||
if (evt.output.stackTagCompound == null) {
|
||||
evt.output.stackTagCompound = new NBTTagCompound();
|
||||
}
|
||||
evt.output.stackTagCompound.setBoolean("eio.abstractMachine", true);
|
||||
writeMobTypeToNBT(evt.output.stackTagCompound, spawnerType);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onLivingUpdate(LivingUpdateEvent livingUpdate) {
|
||||
|
||||
Entity ent = livingUpdate.entityLiving;
|
||||
if (!ent.getEntityData().hasKey(KEY_SPAWNED_BY_POWERED_SPAWNER)) {
|
||||
return;
|
||||
}
|
||||
if (fieldpersistenceRequired == null) {
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
return;
|
||||
}
|
||||
|
||||
long spawnTime = ent.getEntityData().getLong(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
long livedFor = livingUpdate.entity.worldObj.getTotalWorldTime() - spawnTime;
|
||||
if (livedFor > Config.poweredSpawnerDespawnTimeSeconds * 20) {
|
||||
try {
|
||||
fieldpersistenceRequired.setBoolean(livingUpdate.entityLiving, false);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
} catch (Exception e) {
|
||||
Log.warn("BlockPoweredSpawner.onLivingUpdate: Error occured allowing entity to despawn: " + e);
|
||||
ent.getEntityData().removeTag(KEY_SPAWNED_BY_POWERED_SPAWNER);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -132,8 +132,4 @@ public class GuiPoweredSpawner extends GuiPoweredMachineBase<TilePoweredSpawner>
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -29,8 +29,8 @@ import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.machine.AbstractMachineBlock;
|
||||
import crazypants.enderio.machine.AbstractMachineEntity;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class BlockTank extends AbstractMachineBlock<TileTank> implements IAdvancedTooltipProvider {
|
||||
|
||||
|
||||
@@ -112,11 +112,6 @@ public class GuiTank extends GuiMachineBase<TileTank> {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float par1, int par2, int par3) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
@@ -19,8 +19,8 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.PacketItemBuffer;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GeneralTab implements ITabPanel {
|
||||
|
||||
|
||||
@@ -51,11 +51,6 @@ public class GuiTransceiver extends GuiPoweredMachineBase<TileTransceiver> {
|
||||
generalTab.updatePowerBarTooltip(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean showRecipeButton() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getXSize() {
|
||||
return ContainerTransceiver.GUI_WIDTH;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.enderio.material;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasGT5;
|
||||
import static crazypants.enderio.material.Alloy.DARK_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.END_STEEL;
|
||||
import static crazypants.enderio.material.Alloy.ENERGETIC_ALLOY;
|
||||
@@ -58,10 +59,13 @@ public class MaterialRecipes {
|
||||
|
||||
public static void registerOresInDictionary() {
|
||||
// Ore Dictionary Registration
|
||||
for (PowderIngot powder : PowderIngot.values()) {
|
||||
if (!powder.hasDependancy()) {
|
||||
OreDictionary
|
||||
.registerOre(powder.oreDictName, new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
if (!hasGT5) {
|
||||
for (PowderIngot powder : PowderIngot.values()) {
|
||||
if (!powder.hasDependancy()) {
|
||||
OreDictionary.registerOre(
|
||||
powder.oreDictName,
|
||||
new ItemStack(EnderIO.itemPowderIngot, 1, powder.ordinal()));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -431,17 +435,19 @@ public class MaterialRecipes {
|
||||
RecipeUtil.addShaped(vibCry, "nnn", "ngn", "nnn", 'n', vibrantNugget, 'g', "gemEmerald");
|
||||
|
||||
// Smelting
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack ingotIron = new ItemStack(Items.iron_ingot);
|
||||
ItemStack ingotGold = new ItemStack(Items.gold_ingot);
|
||||
if (!hasGT5) {
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack ingotIron = new ItemStack(Items.iron_ingot);
|
||||
ItemStack ingotGold = new ItemStack(Items.gold_ingot);
|
||||
|
||||
GameRegistry.addSmelting(dustIron, ingotIron, 0);
|
||||
GameRegistry.addSmelting(dustGold, ingotGold, 0);
|
||||
GameRegistry.addSmelting(dustIron, ingotIron, 0);
|
||||
GameRegistry.addSmelting(dustGold, ingotGold, 0);
|
||||
|
||||
// Ender Dusts
|
||||
ItemStack enderDust = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
RecipeUtil.addShaped(new ItemStack(Items.ender_pearl), "eee", "eee", "eee", 'e', enderDust);
|
||||
// Ender Dusts
|
||||
ItemStack enderDust = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
RecipeUtil.addShaped(new ItemStack(Items.ender_pearl), "eee", "eee", "eee", 'e', enderDust);
|
||||
}
|
||||
|
||||
// Dark Iron Bars
|
||||
ItemStack diBars = new ItemStack(EnderIO.blockDarkIronBars, 16, 0);
|
||||
@@ -564,24 +570,29 @@ public class MaterialRecipes {
|
||||
ItemStack darkRod = new ItemStack(EnderIO.itemMaterial, 1, Material.DARK_STEEL_ROD.ordinal());
|
||||
RecipeUtil.addShaped(darkRod, " ns", "nsn", "sn ", 's', darkSteel, 'n', endSteelNugget);
|
||||
|
||||
// Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
if (!hasGT5) {
|
||||
// Food
|
||||
ItemStack flour = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack bread = new ItemStack(Items.bread, 1, 0);
|
||||
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
GameRegistry.addSmelting(flour, bread, 0.35f);
|
||||
}
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
RecipeUtil.addShapeless(enderios, Items.bowl, Items.milk_bucket, "cropWheat", "dustEnderPearl");
|
||||
|
||||
if (OreDictionaryHelper.hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (OreDictionaryHelper.hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
if (!hasGT5) {
|
||||
if (OreDictionaryHelper.hasCopper()) {
|
||||
ItemStack dustCopper = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COPPER.ordinal());
|
||||
ItemStack ingotCoppper = OreDictionaryPreferences.instance
|
||||
.getPreferred(OreDictionaryHelper.INGOT_COPPER);
|
||||
GameRegistry.addSmelting(dustCopper, ingotCoppper, 0);
|
||||
}
|
||||
if (OreDictionaryHelper.hasTin()) {
|
||||
ItemStack dustTin = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_TIN.ordinal());
|
||||
ItemStack ingotTin = OreDictionaryPreferences.instance.getPreferred(OreDictionaryHelper.INGOT_TIN);
|
||||
GameRegistry.addSmelting(dustTin, ingotTin, 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,19 +11,17 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.common.util.ItemUtil;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemList;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.alloy.AlloyRecipeManager;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -51,7 +49,7 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(72, 19, 22, 19),
|
||||
"EnderIOAlloySmelter",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -117,10 +115,6 @@ public class AlloySmelterRecipeHandler extends TemplateRecipeHandler {
|
||||
AlloySmelterRecipe recipe = (AlloySmelterRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 100, 52, 0x808080, false);
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -15,13 +15,10 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.enchanter.EnchanterRecipe;
|
||||
import crazypants.enderio.machine.enchanter.EnchanterRecipeManager;
|
||||
import crazypants.enderio.machine.enchanter.GuiEnchanter;
|
||||
@@ -54,7 +51,7 @@ public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, -3, 16, 16),
|
||||
new Rectangle(97, 24, 22, 17),
|
||||
"EIOEnchanter",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -131,9 +128,6 @@ public class EnchanterRecipeHandler extends TemplateRecipeHandler {
|
||||
GuiDraw.drawStringC(s, 83, 46, 0x80FF20);
|
||||
}
|
||||
|
||||
int x = 149, y = -3;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -1,16 +1,19 @@
|
||||
package crazypants.enderio.nei;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
import codechicken.nei.api.API;
|
||||
import codechicken.nei.api.IConfigureNEI;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.conduit.gas.GasUtil;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.alloy.GuiAlloySmelter;
|
||||
import crazypants.enderio.machine.crusher.GuiCrusher;
|
||||
import crazypants.enderio.machine.invpanel.GuiInventoryPanel;
|
||||
import crazypants.enderio.machine.invpanel.client.InventoryPanelNEIOverlayHandler;
|
||||
import crazypants.enderio.machine.painter.PainterUtil;
|
||||
import crazypants.enderio.machine.slicensplice.GuiSliceAndSplice;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
|
||||
public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
|
||||
@@ -18,9 +21,11 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
public void loadConfig() {
|
||||
API.registerRecipeHandler(new AlloySmelterRecipeHandler());
|
||||
API.registerUsageHandler(new AlloySmelterRecipeHandler());
|
||||
API.setGuiOffset(GuiAlloySmelter.class, 4, 6);
|
||||
|
||||
API.registerRecipeHandler(new SagMillRecipeHandler());
|
||||
API.registerUsageHandler(new SagMillRecipeHandler());
|
||||
API.setGuiOffset(GuiCrusher.class, 6, 11);
|
||||
|
||||
API.registerRecipeHandler(new VatRecipeHandler());
|
||||
API.registerUsageHandler(new VatRecipeHandler());
|
||||
@@ -30,9 +35,11 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
|
||||
API.registerRecipeHandler(new SliceAndSpliceRecipeHandler());
|
||||
API.registerUsageHandler(new SliceAndSpliceRecipeHandler());
|
||||
API.setGuiOffset(GuiSliceAndSplice.class, 13, 11);
|
||||
|
||||
API.registerRecipeHandler(new SoulBinderRecipeHandler());
|
||||
API.registerUsageHandler(new SoulBinderRecipeHandler());
|
||||
API.setGuiOffset(GuiSoulBinder.class, 11, 11);
|
||||
|
||||
API.registerGuiOverlayHandler(GuiInventoryPanel.class, new InventoryPanelNEIOverlayHandler(), "crafting");
|
||||
|
||||
@@ -71,7 +78,6 @@ public class NEIEnderIOConfig implements IConfigureNEI {
|
||||
API.hideItem(new ItemStack(EnderIO.itemGasConduit));
|
||||
}
|
||||
API.hideItem(new ItemStack(EnderIO.blockHyperCube));
|
||||
API.hideItem(new ItemStack(EnderIO.blockCapacitorBank, 1, OreDictionary.WILDCARD_VALUE));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -14,20 +14,17 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.crusher.CrusherRecipeManager;
|
||||
import crazypants.enderio.machine.crusher.GrindingBall;
|
||||
import crazypants.enderio.machine.crusher.GuiCrusher;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.Recipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.recipe.RecipeOutput;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -61,7 +58,7 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(74, 21, 17, 22),
|
||||
"EnderIOSagMill",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -127,10 +124,6 @@ public class SagMillRecipeHandler extends TemplateRecipeHandler {
|
||||
MillRecipe recipe = (MillRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 96, 33, 0x808080, false);
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -12,19 +12,16 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.slicensplice.ContainerSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.GuiSliceAndSplice;
|
||||
import crazypants.enderio.machine.slicensplice.SliceAndSpliceRecipeManager;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -52,7 +49,7 @@ public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(91, 37, 22, 17),
|
||||
"EnderIOSliceAndSplice",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -113,10 +110,6 @@ public class SliceAndSpliceRecipeHandler extends TemplateRecipeHandler {
|
||||
SliceAndSpliceRecipe recipe = (SliceAndSpliceRecipe) arecipes.get(recipeIndex);
|
||||
String energyString = PowerDisplayUtil.formatPower(recipe.getEnergy()) + " " + PowerDisplayUtil.abrevation();
|
||||
GuiDraw.drawString(energyString, 100, 57, 0x808080, false);
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
public List<ItemStack> getInputs(RecipeInput input) {
|
||||
|
||||
@@ -13,20 +13,17 @@ import net.minecraft.util.StatCollector;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.IMachineRecipe;
|
||||
import crazypants.enderio.machine.MachineRecipeRegistry;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.soul.GuiSoulBinder;
|
||||
import crazypants.enderio.machine.soul.ISoulBinderRecipe;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -54,7 +51,7 @@ public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(70, 23, 22, 17),
|
||||
"EnderIOSoulBinder",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -142,10 +139,6 @@ public class SoulBinderRecipeHandler extends TemplateRecipeHandler {
|
||||
String s = I18n.format("container.repair.cost", new Object[] { Integer.valueOf(cost) });
|
||||
GuiDraw.drawStringC(s, 83, 55, 0x80FF20);
|
||||
}
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
private static final ArrayList<PositionedStack> EMPTY_VIAL_OUTPUT = new ArrayList<PositionedStack>();
|
||||
|
||||
@@ -3,33 +3,37 @@ package crazypants.enderio.nei;
|
||||
import java.awt.Point;
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidContainerRegistry;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.enderio.core.client.render.EnderWidget;
|
||||
import com.enderio.core.client.render.RenderUtil;
|
||||
import com.enderio.core.common.util.FluidUtil;
|
||||
|
||||
import codechicken.lib.gui.GuiDraw;
|
||||
import codechicken.nei.ItemStackMap;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.GuiCraftingRecipe;
|
||||
import codechicken.nei.recipe.GuiRecipe;
|
||||
import codechicken.nei.recipe.GuiUsageRecipe;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import crazypants.enderio.fluid.Fluids;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.machine.recipe.IRecipe;
|
||||
import crazypants.enderio.machine.recipe.RecipeInput;
|
||||
import crazypants.enderio.machine.vat.GuiVat;
|
||||
import crazypants.enderio.machine.vat.VatRecipeManager;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@@ -66,7 +70,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
public void loadTransferRects() {
|
||||
transferRects.add(
|
||||
new TemplateRecipeHandler.RecipeTransferRect(
|
||||
new Rectangle(149, 32, 16, 16),
|
||||
new Rectangle(70, 8, 28, 43),
|
||||
"EnderIOVat",
|
||||
new Object[0]));
|
||||
}
|
||||
@@ -157,8 +161,8 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
if (rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
RenderUtil.renderGuiTank(
|
||||
rec.inFluid,
|
||||
rec.inFluid.amount,
|
||||
rec.inFluid.amount,
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 8,
|
||||
rec.getInputFluidAmount(),
|
||||
inTankBounds.x,
|
||||
inTankBounds.y,
|
||||
0,
|
||||
@@ -169,8 +173,8 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
if (rec.result != null && rec.result.getFluid() != null) {
|
||||
RenderUtil.renderGuiTank(
|
||||
rec.result,
|
||||
rec.result.amount,
|
||||
rec.result.amount,
|
||||
FluidContainerRegistry.BUCKET_VOLUME * 8,
|
||||
rec.getResultFluidAmount(),
|
||||
outTankBounds.x,
|
||||
outTankBounds.y,
|
||||
0,
|
||||
@@ -190,9 +194,6 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
GuiDraw.drawStringC(str, ps.relx + 8, ps.rely + 19, 0x808080, false);
|
||||
}
|
||||
|
||||
int x = 149, y = 32;
|
||||
EnderWidget.map.render(EnderWidget.BUTTON, x, y, 16, 16, 0, true);
|
||||
IconEIO.map.render(IconEIO.RECIPE, x + 1, y + 1, 14, 14, 0, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -202,24 +203,19 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public List<String> handleTooltip(GuiRecipe<?> gui, List<String> currenttip, int recipeIndex) {
|
||||
InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point offset = gui.getRecipePosition(recipeIndex);
|
||||
Point relMouse = new Point(
|
||||
pos.x - ((gui.width - 176) / 2) - offset.x,
|
||||
pos.y - ((gui.height - 166) / 2) - offset.y);
|
||||
final InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
final Point pos = GuiDraw.getMousePosition();
|
||||
final Point offset = gui.getRecipePosition(recipeIndex);
|
||||
final Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
|
||||
if (inTankBounds.contains(relMouse) || outTankBounds.contains(relMouse)) {
|
||||
if (inTankBounds.contains(relMouse)) {
|
||||
if (rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
currenttip.add(rec.inFluid.getFluid().getLocalizedName(rec.inFluid));
|
||||
}
|
||||
} else {
|
||||
if (rec.result != null && rec.result.getFluid() != null) {
|
||||
currenttip.add(rec.result.getFluid().getLocalizedName(rec.result));
|
||||
}
|
||||
}
|
||||
if (inTankBounds.contains(relMouse) && rec.inFluid != null && rec.inFluid.getFluid() != null) {
|
||||
currenttip.add(rec.inFluid.getFluid().getLocalizedName(rec.inFluid));
|
||||
currenttip.add(EnumChatFormatting.GRAY.toString() + rec.getInputFluidAmount() + " " + Fluids.MB());
|
||||
} else if (outTankBounds.contains(relMouse) && rec.result != null && rec.result.getFluid() != null) {
|
||||
currenttip.add(rec.result.getFluid().getLocalizedName(rec.result));
|
||||
currenttip.add(EnumChatFormatting.GRAY.toString() + rec.getResultFluidAmount() + " " + Fluids.MB());
|
||||
}
|
||||
|
||||
return super.handleTooltip(gui, currenttip, recipeIndex);
|
||||
}
|
||||
|
||||
@@ -241,9 +237,7 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
InnerVatRecipe rec = (InnerVatRecipe) arecipes.get(recipeIndex);
|
||||
Point pos = GuiDraw.getMousePosition();
|
||||
Point offset = gui.getRecipePosition(recipeIndex);
|
||||
Point relMouse = new Point(
|
||||
pos.x - ((gui.width - 176) / 2) - offset.x,
|
||||
pos.y - ((gui.height - 166) / 2) - offset.y);
|
||||
Point relMouse = new Point(pos.x - gui.guiLeft - offset.x, pos.y - gui.guiTop - offset.y);
|
||||
|
||||
if (inTankBounds.contains(relMouse)) {
|
||||
transferFluidTank(rec.inFluid, usage);
|
||||
@@ -283,7 +277,10 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public class InnerVatRecipe extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
private ArrayList<PositionedStack> inputs;
|
||||
private List<PositionedStack> inputs = new ArrayList<>();
|
||||
private ItemStackMap<Float> firstItemMultiplier = new ItemStackMap();
|
||||
private ItemStackMap<Float> secondItemMultiplier = new ItemStackMap();
|
||||
private Map<FluidStack, Float> fluidMultiplier = new HashMap<>();
|
||||
private int energy;
|
||||
private FluidStack result;
|
||||
private FluidStack inFluid;
|
||||
@@ -294,7 +291,31 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return getCycledIngredients(cycleticks / 30, inputs);
|
||||
return getCycledIngredients(cycleticks / 30, this.inputs);
|
||||
}
|
||||
|
||||
public int getInputFluidAmount() {
|
||||
return (int) Math
|
||||
.round(FluidContainerRegistry.BUCKET_VOLUME * getFirstItemMultiplier() * getSecondItemMultiplier());
|
||||
}
|
||||
|
||||
public int getResultFluidAmount() {
|
||||
return (int) Math.round(
|
||||
FluidContainerRegistry.BUCKET_VOLUME * getFirstItemMultiplier()
|
||||
* getSecondItemMultiplier()
|
||||
* getFluidMultiplier());
|
||||
}
|
||||
|
||||
public float getFirstItemMultiplier() {
|
||||
return this.inputs.isEmpty() ? 1f : this.firstItemMultiplier.getOrDefault(this.inputs.get(0).item, 1f);
|
||||
}
|
||||
|
||||
public float getSecondItemMultiplier() {
|
||||
return this.inputs.size() < 2 ? 1f : this.secondItemMultiplier.getOrDefault(this.inputs.get(1).item, 1f);
|
||||
}
|
||||
|
||||
public float getFluidMultiplier() {
|
||||
return this.fluidMultiplier.getOrDefault(this.inFluid, 1f);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -303,28 +324,41 @@ public class VatRecipeHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
|
||||
public InnerVatRecipe(int energy, RecipeInput[] ingredients, FluidStack result) {
|
||||
ArrayList<ItemStack> inputsOne = new ArrayList<ItemStack>();
|
||||
ArrayList<ItemStack> inputsTwo = new ArrayList<ItemStack>();
|
||||
final List<ItemStack> inputsOne = new ArrayList<>();
|
||||
final List<ItemStack> inputsTwo = new ArrayList<>();
|
||||
|
||||
for (RecipeInput input : ingredients) {
|
||||
float multi = input.getMulitplier();
|
||||
|
||||
if (input.getInput() != null) {
|
||||
List<ItemStack> equivs = getInputs(input);
|
||||
final List<ItemStack> equivs = getInputs(input);
|
||||
|
||||
if (input.getSlotNumber() == 0) {
|
||||
inputsOne.addAll(equivs);
|
||||
|
||||
for (ItemStack stack : equivs) {
|
||||
this.firstItemMultiplier.put(stack, multi);
|
||||
}
|
||||
} else if (input.getSlotNumber() == 1) {
|
||||
inputsTwo.addAll(equivs);
|
||||
}
|
||||
} else if (input.getFluidInput() != null) {
|
||||
inFluid = input.getFluidInput();
|
||||
}
|
||||
}
|
||||
|
||||
inputs = new ArrayList<PositionedStack>();
|
||||
for (ItemStack stack : equivs) {
|
||||
this.secondItemMultiplier.put(stack, multi);
|
||||
}
|
||||
}
|
||||
|
||||
} else if (input.getFluidInput() != null) {
|
||||
this.inFluid = input.getFluidInput();
|
||||
this.fluidMultiplier.put(this.inFluid, multi);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if (!inputsOne.isEmpty()) {
|
||||
inputs.add(new PositionedStack(inputsOne, 51, 1));
|
||||
this.inputs.add(new PositionedStack(inputsOne, 51, 1));
|
||||
}
|
||||
if (!inputsTwo.isEmpty()) {
|
||||
inputs.add(new PositionedStack(inputsTwo, 100, 1));
|
||||
this.inputs.add(new PositionedStack(inputsTwo, 100, 1));
|
||||
}
|
||||
|
||||
this.energy = energy;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
package crazypants.enderio.machine.power;
|
||||
package crazypants.enderio.power;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
import java.text.DecimalFormatSymbols;
|
||||
@@ -16,7 +16,7 @@ import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.teleport.TravelSource;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class ItemTeleportStaff extends ItemTravelStaff {
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ import crazypants.enderio.ModObject;
|
||||
import crazypants.enderio.api.teleport.IItemOfTravel;
|
||||
import crazypants.enderio.api.teleport.TravelSource;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
@Optional.Interface(iface = "baubles.api.IBauble", modid = "Baubles|API")
|
||||
public class ItemTravelStaff extends ItemEnergyContainer implements IItemOfTravel, IResourceTooltipProvider, IBauble {
|
||||
|
||||
@@ -24,8 +24,8 @@ import crazypants.enderio.GuiHandler;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.gui.GuiContainerBaseEIO;
|
||||
import crazypants.enderio.gui.IconEIO;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.network.PacketHandler;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
|
||||
public class GuiTelePad extends GuiContainerBaseEIO implements IToggleableGui {
|
||||
|
||||
|
||||
@@ -20,7 +20,6 @@ import crazypants.enderio.material.FrankenSkull;
|
||||
import crazypants.enderio.material.Material;
|
||||
import crazypants.enderio.power.Capacitors;
|
||||
import thaumcraft.api.ThaumcraftApi;
|
||||
import thaumcraft.api.ThaumcraftApiHelper;
|
||||
import thaumcraft.api.aspects.Aspect;
|
||||
import thaumcraft.api.aspects.AspectList;
|
||||
|
||||
@@ -153,19 +152,6 @@ public class ThaumcraftCompat {
|
||||
ThaumcraftApi.registerObjectTag(
|
||||
new ItemStack(EnderIO.blockFusedQuartz, 1, BlockFusedQuartz.Type.ENLIGHTENED_GLASS.ordinal()),
|
||||
new AspectList().add(Aspect.CRYSTAL, 2).add(Aspect.LIGHT, 8).add(Aspect.SENSES, 2));
|
||||
|
||||
// This is a horrible hack due to the fact that I am assembling my aspects after TC does recipe parsing
|
||||
// Therefore I redo all EIO items
|
||||
for (Object o : Item.itemRegistry.getKeys()) {
|
||||
if (o instanceof String) {
|
||||
String ownermod = ((String) o).substring(0, ((String) o).indexOf(':'));
|
||||
if (EnderIO.MODID.equals(ownermod)) {
|
||||
for (int idx = 0; idx < 16; idx++) {
|
||||
addAspectsFromRecipes((Item) Item.itemRegistry.getObject((String) o), idx);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static AspectList getAspects(Block block) {
|
||||
@@ -185,10 +171,6 @@ public class ThaumcraftCompat {
|
||||
return new AspectList(item);
|
||||
}
|
||||
|
||||
private static void addAspectsFromRecipes(Item item, int meta) {
|
||||
ThaumcraftApi.registerObjectTag(new ItemStack(item, 1, meta), ThaumcraftApiHelper.generateTags(item, meta));
|
||||
}
|
||||
|
||||
public static void loadUpgrades(List<IDarkSteelUpgrade> upgrades) {
|
||||
upgrades.add(GogglesOfRevealingUpgrade.INSTANCE);
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ import crazypants.enderio.machine.IIoConfigurable;
|
||||
import crazypants.enderio.machine.IoMode;
|
||||
import crazypants.enderio.machine.capbank.TileCapBank;
|
||||
import crazypants.enderio.machine.invpanel.TileInventoryPanel;
|
||||
import crazypants.enderio.machine.power.PowerDisplayUtil;
|
||||
import crazypants.enderio.power.IInternalPoweredTile;
|
||||
import crazypants.enderio.power.PowerDisplayUtil;
|
||||
import crazypants.util.IFacade;
|
||||
import mcp.mobius.waila.api.ITaggedList;
|
||||
import mcp.mobius.waila.api.IWailaConfigHandler;
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
package crazypants.util;
|
||||
|
||||
import static crazypants.enderio.EnderIO.hasGT5;
|
||||
import static crazypants.enderio.material.Material.BINDER_COMPOSITE;
|
||||
import static crazypants.enderio.material.Material.CONDUIT_BINDER;
|
||||
import static crazypants.enderio.material.Material.PHASED_IRON_NUGGET;
|
||||
@@ -9,6 +10,7 @@ import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
@@ -20,6 +22,7 @@ import com.pahimar.ee3.api.exchange.EnergyValueRegistryProxy;
|
||||
import com.pahimar.ee3.api.exchange.RecipeRegistryProxy;
|
||||
|
||||
import cpw.mods.fml.common.Loader;
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import crazypants.enderio.EnderIO;
|
||||
import crazypants.enderio.config.Config;
|
||||
import crazypants.enderio.item.ItemEnderFood.EnderFood;
|
||||
@@ -93,47 +96,59 @@ public class EE3Util {
|
||||
*/
|
||||
public static void registerMiscRecipes() {
|
||||
if (IS_EE3_LOADED) {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack stick4 = new ItemStack(Items.stick, 4);
|
||||
ItemStack cobble4 = new ItemStack(Blocks.cobblestone, 4);
|
||||
registerRecipe(basicGear, stick4, cobble4);
|
||||
|
||||
ItemStack flour10 = new ItemStack(EnderIO.itemPowderIngot, 10, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack wheat5 = new ItemStack(Items.wheat, 5);
|
||||
ItemStack seeds1 = new ItemStack(Items.wheat_seeds, 1);
|
||||
registerRecipe(flour10, wheat5, seeds1);
|
||||
if (!hasGT5) {
|
||||
ItemStack basicGear = new ItemStack(EnderIO.itemMachinePart, 1, MachinePart.BASIC_GEAR.ordinal());
|
||||
ItemStack stick4 = new ItemStack(Items.stick, 4);
|
||||
ItemStack cobble4 = new ItemStack(Blocks.cobblestone, 4);
|
||||
registerRecipe(basicGear, stick4, cobble4);
|
||||
ItemStack flour10 = new ItemStack(EnderIO.itemPowderIngot, 10, PowderIngot.FLOUR.ordinal());
|
||||
ItemStack wheat5 = new ItemStack(Items.wheat, 5);
|
||||
ItemStack seeds1 = new ItemStack(Items.wheat_seeds, 1);
|
||||
registerRecipe(flour10, wheat5, seeds1);
|
||||
}
|
||||
|
||||
ItemStack enderios = EnderFood.ENDERIOS.getStack();
|
||||
ItemStack bowl = new ItemStack(Items.bowl, 1);
|
||||
ItemStack wheat = new ItemStack(Items.wheat, 1);
|
||||
ItemStack milkb = new ItemStack(Items.milk_bucket, 1);
|
||||
FluidStack milk = FluidContainerRegistry.getFluidForFilledItem(milkb);
|
||||
ItemStack dustEnderPearl = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack dustEnderPearl;
|
||||
if (hasGT5) {
|
||||
dustEnderPearl = GameRegistry.findItemStack("gregtech", "gt.metaitem.01", 1);
|
||||
Items.feather.setDamage(Objects.requireNonNull(dustEnderPearl), 2532);
|
||||
} else {
|
||||
dustEnderPearl = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_ENDER.ordinal());
|
||||
}
|
||||
if (milk != null) {
|
||||
registerRecipe(enderios, bowl, milk, wheat, dustEnderPearl);
|
||||
} else {
|
||||
registerRecipe(enderios, bowl, milkb, wheat, dustEnderPearl);
|
||||
}
|
||||
|
||||
ItemStack dustCoal = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COAL.ordinal());
|
||||
ItemStack coal = new ItemStack(Items.coal, 1);
|
||||
registerRecipe(dustCoal, coal);
|
||||
if (!hasGT5) {
|
||||
ItemStack dustCoal = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_COAL.ordinal());
|
||||
ItemStack coal = new ItemStack(Items.coal, 1);
|
||||
registerRecipe(dustCoal, coal);
|
||||
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack iron = new ItemStack(Items.iron_ingot, 1);
|
||||
registerRecipe(dustIron, iron);
|
||||
ItemStack dustIron = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_IRON.ordinal());
|
||||
ItemStack iron = new ItemStack(Items.iron_ingot, 1);
|
||||
registerRecipe(dustIron, iron);
|
||||
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot, 1);
|
||||
registerRecipe(dustGold, gold);
|
||||
ItemStack dustGold = new ItemStack(EnderIO.itemPowderIngot, 1, PowderIngot.POWDER_GOLD.ordinal());
|
||||
ItemStack gold = new ItemStack(Items.gold_ingot, 1);
|
||||
registerRecipe(dustGold, gold);
|
||||
|
||||
ItemStack dustObsidian4 = new ItemStack(EnderIO.itemPowderIngot, 4, PowderIngot.POWDER_OBSIDIAN.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
|
||||
registerRecipe(dustObsidian4, obsidian);
|
||||
ItemStack dustObsidian4 = new ItemStack(
|
||||
EnderIO.itemPowderIngot,
|
||||
4,
|
||||
PowderIngot.POWDER_OBSIDIAN.ordinal());
|
||||
ItemStack obsidian = new ItemStack(Blocks.obsidian, 1);
|
||||
registerRecipe(dustObsidian4, obsidian);
|
||||
|
||||
ItemStack enderDust9 = new ItemStack(EnderIO.itemPowderIngot, 9, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack enderPearl = new ItemStack(Items.ender_pearl);
|
||||
registerRecipe(enderDust9, enderPearl);
|
||||
ItemStack enderDust9 = new ItemStack(EnderIO.itemPowderIngot, 9, PowderIngot.POWDER_ENDER.ordinal());
|
||||
ItemStack enderPearl = new ItemStack(Items.ender_pearl);
|
||||
registerRecipe(enderDust9, enderPearl);
|
||||
}
|
||||
|
||||
ItemStack cbc8 = BINDER_COMPOSITE.getStack(8);
|
||||
ItemStack sand2 = new ItemStack(Blocks.sand, 2);
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
# Access Transformer configuration file
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_146999_f #xSize
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147000_g #ySize
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147003_i #guiLeft
|
||||
public net.minecraft.client.gui.inventory.GuiContainer field_147009_r #guiTop
|
||||
@@ -238,12 +238,6 @@ item.itemLightInverted.name=Světlo (Obrácené)
|
||||
item.itemLightInverted.tooltip.detailed.line1=Vysílá světlo, vypne se s
|
||||
item.itemLightInverted.tooltip.detailed.line2=ruditovým signálem
|
||||
|
||||
tile.blockCapacitorBank.name=Banka kondenzátorů Bank
|
||||
tile.blockCapacitorBank.creative.name=Kreativní banka kondenzátorů
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Multi-blokové energetické úložiště.
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=Umí nabít předměty, které využívají RF.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Obsahuje
|
||||
|
||||
enderio.capbank.maxIO=Maximální I/O
|
||||
enderio.capbank.maxIn=Maximální vstup
|
||||
enderio.capbank.maxOut=Maximální výstup
|
||||
|
||||
@@ -364,12 +364,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=Energie versorgt
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Schalte mit einem Redstonesignal ab.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Kann Energie von Drahtlos-Ladegeräten empfangen.
|
||||
|
||||
tile.blockCapacitorBank.name=Kondensatorbank (Veraltet)
|
||||
tile.blockCapacitorBank.creative.name=Kreative Kondensatorbank (Veraltet)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=In einen neuen Block umwandeln
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=durch Platzieren in Fertigungsgitter.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Enthält
|
||||
|
||||
tile.blockCapBank.creative.name=Kreative Kondensatorbank
|
||||
tile.blockCapBank.simple.name=Basis-Kondensatorbank
|
||||
tile.blockCapBank.activated.name=Kondensatorbank
|
||||
|
||||
@@ -441,11 +441,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line2=power.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Turn off with a redstone signal.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line4=Can receive power from wireless chargers.
|
||||
|
||||
tile.blockCapacitorBank.name=Capacitor Bank (Deprecated)
|
||||
tile.blockCapacitorBank.creative.name=Creative Capacitor Bank (Deprecated)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Convert to new block by placing
|
||||
tile.blockCapacitorBank.tooltip.detailed.line2=in a crafting grid
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contains
|
||||
|
||||
tile.blockCapBank.name=Capacitor Bank
|
||||
tile.blockCapBank.creative.name=Creative Capacitor Bank
|
||||
@@ -782,6 +777,7 @@ enderio.itemCoordSelector.chat.setDimension=Set Dimension: %s%s
|
||||
#Painter
|
||||
tile.blockPainter.name=Painting Machine
|
||||
enderio.blockPainter.paintedWith=Painted with:
|
||||
enderio.blockPainter.paintedWith.none=§onothing§r
|
||||
tile.blockPaintedFence.name=Painted Fence
|
||||
tile.blockPaintedFenceGate.name=Painted Gate
|
||||
tile.blockPaintedWall.name=Painted Wall
|
||||
|
||||
@@ -270,11 +270,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -272,11 +272,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
@@ -270,11 +270,6 @@ item.itemWirelessLightInverted.tooltip.detailed.line1=Ilumina una gran área cua
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line2=Desactívala con una señal de redstone.
|
||||
item.itemWirelessLightInverted.tooltip.detailed.line3=Puede recibir energía de los cargadores inalámbricos.
|
||||
|
||||
tile.blockCapacitorBank.name=Condensador de Almacenaje (Obsoleto)
|
||||
tile.blockCapacitorBank.creative.name=Condensador de Almacenaje Creativo (Obsoleto)
|
||||
tile.blockCapacitorBank.tooltip.detailed.line1=Conviértelo en nuevo poniéndolo en una cuadrícula de fabricación.
|
||||
tile.blockCapacitorBank.tooltipPrefix=Contiene
|
||||
|
||||
tile.blockCapBank.creative.name=Condensador de Almacenaje Creativo
|
||||
tile.blockCapBank.simple.name=Condensador de Almacenaje Básico
|
||||
tile.blockCapBank.activated.name=Condensador de Almacenaje
|
||||
|
||||
Loaded 100 of 123 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user