mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
upgrade crap, funny new stamps
This commit is contained in:
parent
5c33fa1707
commit
1d92906dd7
@ -12,6 +12,10 @@
|
||||
* Stylish as hell
|
||||
* Decoy missile
|
||||
* A cheap tier 1 missile that shows up on radar screens as tier 4 (eg. nuclear) missiles
|
||||
* Printing press stamps
|
||||
* 8 different stamps for printing certain pages
|
||||
* If a meteor dungeon safe is generated without a black book inside, it will generate tow random stamps instead
|
||||
* With all 8 stamps, allows you to print your own black book
|
||||
|
||||
## Changed
|
||||
* Reduced the blast resistance of the large doors from absurdly high to still very but not quite as high
|
||||
@ -36,6 +40,8 @@
|
||||
* The flux display is now functional. It will display the flux curve of the last 30 seconds, as well as labels for the total flux level.
|
||||
* With the color assigning buttons and the flux display finished, the console is now finally complete
|
||||
* Compressing blood at 4 PU now turns it into crude oil at a ratio of 2:1
|
||||
* Increased the cap for the overdrive upgrade in acidizers, tier 2 should now yield the proper amount and tier 3 should now be better than tier 2
|
||||
* The tooltip of valid upgrades now changes when a compatible machine GUI is open
|
||||
|
||||
## Fixed
|
||||
* Fixed ancient bug where custom missiles launched using the launch table would not use the accuracy calculation and always be pin-point accurate
|
||||
|
||||
@ -60,6 +60,7 @@ public class GunDetonatorFactory {
|
||||
config.config.add(BulletConfigSyncingUtil.G12_DU);
|
||||
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
|
||||
config.config.add(BulletConfigSyncingUtil.G12_AM);
|
||||
config.config.add(BulletConfigSyncingUtil.G12_PERCUSSION);
|
||||
config.config.add(BulletConfigSyncingUtil.NUKE_NORMAL);
|
||||
config.config.add(BulletConfigSyncingUtil.NUKE_LOW);
|
||||
config.config.add(BulletConfigSyncingUtil.NUKE_SAFE);
|
||||
|
||||
@ -0,0 +1,27 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIMachineExposureChamber;
|
||||
import com.hbm.inventory.recipes.ExposureChamberRecipes;
|
||||
|
||||
public class ExposureChamberHandler extends NEIUniversalHandler {
|
||||
|
||||
public ExposureChamberHandler() {
|
||||
super("Exposure Chamber", ModBlocks.machine_exposure_chamber, ExposureChamberRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmExposure";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
super.loadTransferRects();
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(31, 28, 41, 10), "ntmExposure"));
|
||||
guiGui.add(GUIMachineExposureChamber.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
}
|
||||
@ -110,7 +110,7 @@ public class PressRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
if(in.matchesRecipe(ingredient, true))
|
||||
this.arecipes.add(new SmeltingSet(ItemStamp.stamps.get(recipe.getKey().getValue()), new ComparableStack(ingredient), recipe.getValue()));
|
||||
else if(ingredient.getItem() instanceof ItemStamp && ((ItemStamp)ingredient.getItem()).type == stamp)
|
||||
else if(ingredient.getItem() instanceof ItemStamp && ((ItemStamp)ingredient.getItem()).getStampType(ingredient.getItem(), ingredient.getItemDamage()) == stamp)
|
||||
this.arecipes.add(new SmeltingSet(ingredient, recipe.getKey().getKey(), recipe.getValue()));
|
||||
}
|
||||
}
|
||||
|
||||
@ -998,6 +998,17 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.coil_copper, 16),
|
||||
new ComparableStack(ModItems.circuit_gold, 2)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_exposure_chamber, 1), new AStack[] {
|
||||
!exp ? new OreDictStack(AL.plateCast(), 12) : new OreDictStack(AL.heavyComp(), 1),
|
||||
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 12),
|
||||
new OreDictStack(ALLOY.wireDense(), 32),
|
||||
new ComparableStack(ModItems.motor_desh, 2),
|
||||
new ComparableStack(ModItems.circuit_gold, 3),
|
||||
new ComparableStack(ModBlocks.capacitor_tantalium, 1),
|
||||
new ComparableStack(ModBlocks.glass_quartz, 16)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.euphemium_capacitor, 1), new AStack[]
|
||||
{
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
@ -33,6 +34,25 @@ public class ExposureChamberRecipes extends SerializableRecipe {
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
|
||||
for(ExposureChamberRecipe recipe : ExposureChamberRecipes.recipes) {
|
||||
|
||||
Object[] array = new Object[2];
|
||||
|
||||
array[1] = recipe.particle;
|
||||
AStack stack = recipe.ingredient.copy();
|
||||
stack.stacksize = 8;
|
||||
array[0] = stack;
|
||||
|
||||
recipes.put(array, recipe.output);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmExposureChamber.json";
|
||||
|
||||
@ -15,6 +15,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumBriquetteType;
|
||||
import com.hbm.items.ItemEnums.EnumPages;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
||||
import com.hbm.items.ItemAmmoEnums.Ammo556mm;
|
||||
import com.hbm.items.ItemAmmoEnums.AmmoLunaticSniper;
|
||||
@ -40,7 +41,7 @@ public class PressRecipes extends SerializableRecipe {
|
||||
if(!(stamp.getItem() instanceof ItemStamp))
|
||||
return null;
|
||||
|
||||
StampType type = ((ItemStamp) stamp.getItem()).type;
|
||||
StampType type = ((ItemStamp) stamp.getItem()).getStampType(stamp.getItem(), stamp.getItemDamage());
|
||||
|
||||
for(Entry<Pair<AStack, StampType>, ItemStack> recipe : recipes.entrySet()) {
|
||||
|
||||
@ -116,6 +117,15 @@ public class PressRecipes extends SerializableRecipe {
|
||||
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_actionexpress), new ItemStack(ModItems.ammo_50ae, 12));
|
||||
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_luna), ModItems.ammo_luna_sniper.stackFromEnum(4, AmmoLunaticSniper.SABOT));
|
||||
makeRecipe(StampType.C50, new ComparableStack(ModItems.assembly_762), new ItemStack(ModItems.ammo_762, 32));
|
||||
|
||||
makeRecipe(StampType.PRINTING1, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE1));
|
||||
makeRecipe(StampType.PRINTING2, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE2));
|
||||
makeRecipe(StampType.PRINTING3, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE3));
|
||||
makeRecipe(StampType.PRINTING4, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE4));
|
||||
makeRecipe(StampType.PRINTING5, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE5));
|
||||
makeRecipe(StampType.PRINTING6, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE6));
|
||||
makeRecipe(StampType.PRINTING7, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE7));
|
||||
makeRecipe(StampType.PRINTING8, new ComparableStack(Items.paper), DictFrame.fromOne(ModItems.page_of_, EnumPages.PAGE8));
|
||||
}
|
||||
|
||||
public static void makeRecipe(StampType type, AStack in, Item out) {
|
||||
|
||||
@ -61,4 +61,8 @@ public class ItemEnums {
|
||||
DIGAMMAUPONTOP,
|
||||
DIGAMMAFOROURRIGHT
|
||||
}
|
||||
|
||||
public static enum EnumPages {
|
||||
PAGE1, PAGE2, PAGE3, PAGE4, PAGE5, PAGE6, PAGE7, PAGE8
|
||||
}
|
||||
}
|
||||
|
||||
@ -762,6 +762,7 @@ public class ModItems {
|
||||
public static Item stamp_desh_plate;
|
||||
public static Item stamp_desh_wire;
|
||||
public static Item stamp_desh_circuit;
|
||||
public static Item stamp_book;
|
||||
|
||||
public static Item stamp_357;
|
||||
public static Item stamp_44;
|
||||
@ -2364,6 +2365,7 @@ public class ModItems {
|
||||
public static Item letter;
|
||||
public static Item book_secret;
|
||||
public static Item book_of_;
|
||||
public static Item page_of_;
|
||||
public static Item burnt_bark;
|
||||
|
||||
public static Item smoke1;
|
||||
@ -3258,6 +3260,7 @@ public class ModItems {
|
||||
stamp_44 = new ItemStamp(1000, StampType.C44).setUnlocalizedName("stamp_44").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":stamp_44");
|
||||
stamp_9 = new ItemStamp(1000, StampType.C9).setUnlocalizedName("stamp_9").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":stamp_9");
|
||||
stamp_50 = new ItemStamp(1000, StampType.C50).setUnlocalizedName("stamp_50").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":stamp_50");
|
||||
stamp_book = new ItemStampBook().setUnlocalizedName("stamp_book").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":stamp_book");
|
||||
|
||||
stamp_desh_357 = new ItemStamp(0, StampType.C357).setUnlocalizedName("stamp_desh_357").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":stamp_357_desh");
|
||||
stamp_desh_44 = new ItemStamp(0, StampType.C44).setUnlocalizedName("stamp_desh_44").setMaxStackSize(1).setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":stamp_44_desh");
|
||||
@ -5412,6 +5415,7 @@ public class ModItems {
|
||||
letter = new ItemStarterKit().setUnlocalizedName("letter").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":letter");
|
||||
book_secret = new ItemCustomLore().setUnlocalizedName("book_secret").setCreativeTab(MainRegistry.polaroidID == 11 ? MainRegistry.consumableTab : null).setTextureName(RefStrings.MODID + ":book_secret");
|
||||
book_of_ = new ItemBook().setUnlocalizedName("book_of_").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":book_of_");
|
||||
page_of_ = new ItemEnumMulti(ItemEnums.EnumPages.class, true, false).setUnlocalizedName("page_of_").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":page_of_");
|
||||
burnt_bark = new ItemCustomLore().setUnlocalizedName("burnt_bark").setCreativeTab(null).setTextureName(RefStrings.MODID + ":burnt_bark");
|
||||
|
||||
smoke1 = new Item().setUnlocalizedName("smoke1").setTextureName(RefStrings.MODID + ":smoke1");
|
||||
@ -6453,6 +6457,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(stamp_desh_44, stamp_desh_44.getUnlocalizedName());
|
||||
GameRegistry.registerItem(stamp_desh_9, stamp_desh_9.getUnlocalizedName());
|
||||
GameRegistry.registerItem(stamp_desh_50, stamp_desh_50.getUnlocalizedName());
|
||||
GameRegistry.registerItem(stamp_book, stamp_book.getUnlocalizedName());
|
||||
|
||||
//Molds
|
||||
GameRegistry.registerItem(mold_base, mold_base.getUnlocalizedName());
|
||||
@ -7988,6 +7993,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(glitch, glitch.getUnlocalizedName());
|
||||
GameRegistry.registerItem(book_secret, book_secret.getUnlocalizedName());
|
||||
GameRegistry.registerItem(book_of_, book_of_.getUnlocalizedName());
|
||||
GameRegistry.registerItem(page_of_, page_of_.getUnlocalizedName());
|
||||
GameRegistry.registerItem(burnt_bark, burnt_bark.getUnlocalizedName());
|
||||
|
||||
//Kits
|
||||
|
||||
@ -10,19 +10,27 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemStamp extends Item {
|
||||
|
||||
public StampType type;
|
||||
protected StampType type;
|
||||
public static final HashMap<StampType, List<ItemStack>> stamps = new HashMap();
|
||||
|
||||
public ItemStamp(int dura, StampType type) {
|
||||
this.setMaxDamage(dura);
|
||||
this.type = type;
|
||||
|
||||
if(type != null) {
|
||||
this.addStampToList(this, 0, type);
|
||||
}
|
||||
}
|
||||
|
||||
protected void addStampToList(Item item, int meta, StampType type) {
|
||||
List<ItemStack> list = stamps.get(type);
|
||||
|
||||
if(list == null)
|
||||
list = new ArrayList();
|
||||
|
||||
list.add(new ItemStack(this));
|
||||
ItemStack stack = new ItemStack(item, 1, meta);
|
||||
|
||||
list.add(stack);
|
||||
stamps.put(type, list);
|
||||
}
|
||||
|
||||
@ -32,16 +40,27 @@ public class ItemStamp extends Item {
|
||||
list.add("[CREATED USING TEMPLATE FOLDER]");
|
||||
}
|
||||
|
||||
//TODO: give UFFR one (1) good boy token
|
||||
/** Params can't take an ItemStack, for some reason it crashes during init */
|
||||
public StampType getStampType(Item item, int meta) {
|
||||
return type;
|
||||
}
|
||||
|
||||
public static enum StampType {
|
||||
FLAT,
|
||||
PLATE,
|
||||
WIRE,
|
||||
CIRCUIT,
|
||||
//DISC,
|
||||
C357,
|
||||
C44,
|
||||
C50,
|
||||
C9;
|
||||
C9,
|
||||
PRINTING1,
|
||||
PRINTING2,
|
||||
PRINTING3,
|
||||
PRINTING4,
|
||||
PRINTING5,
|
||||
PRINTING6,
|
||||
PRINTING7,
|
||||
PRINTING8;
|
||||
}
|
||||
}
|
||||
|
||||
42
src/main/java/com/hbm/items/machine/ItemStampBook.java
Normal file
42
src/main/java/com/hbm/items/machine/ItemStampBook.java
Normal file
@ -0,0 +1,42 @@
|
||||
package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemStampBook extends ItemStamp {
|
||||
|
||||
public ItemStampBook() {
|
||||
super(0, null);
|
||||
|
||||
for(int i = 0; i < 8; i++) {
|
||||
StampType type = getStampType(this, i);
|
||||
this.addStampToList(this, i, type);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public StampType getStampType(Item item, int meta) {
|
||||
meta %= 8;
|
||||
return StampType.values()[StampType.PRINTING1.ordinal() + meta];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < 8; i++) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
StampType type = this.getStampType(stack.getItem(), stack.getItemDamage());
|
||||
return super.getUnlocalizedName() + "." + type.name().toLowerCase(Locale.US);
|
||||
}
|
||||
}
|
||||
@ -606,7 +606,7 @@ public class CraftingManager {
|
||||
|
||||
addRecipeAuto(new ItemStack(ModItems.key, 1), new Object[] { " B", " B ", "P ", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten });
|
||||
addRecipeAuto(new ItemStack(ModItems.key_kit, 1), new Object[] { "PKP", "DTD", "PKP", 'P', GOLD.plate(), 'K', ModItems.key, 'D', DESH.dust(), 'T', KEY_TOOL_SCREWDRIVER });
|
||||
addRecipeAuto(new ItemStack(ModItems.key_red, 1), new Object[] { "DSC", "SMS", "KSD", 'C', ModItems.circuit_targeting_tier4, 'M', Items.nether_star, 'K', ModItems.key, 'D', DESH.dust(), 'S', BIGMT.plate() });
|
||||
addRecipeAuto(new ItemStack(ModItems.key_red, 1), new Object[] { "RCA", "CIC", "KCR", 'R', KEY_RED, 'C', STAR.wireDense(), 'A', ModItems.gem_alexandrite, 'I', ModItems.ingot_chainsteel, 'K', ModItems.key });
|
||||
addRecipeAuto(new ItemStack(ModItems.pin, 1), new Object[] { "W ", " W", " W", 'W', ModItems.wire_copper });
|
||||
addRecipeAuto(new ItemStack(ModItems.padlock_rusty, 1), new Object[] { "I", "B", "I", 'I', IRON.ingot(), 'B', ModItems.bolt_tungsten });
|
||||
addRecipeAuto(new ItemStack(ModItems.padlock, 1), new Object[] { " P ", "PBP", "PPP", 'P', STEEL.plate(), 'B', ModItems.bolt_tungsten });
|
||||
|
||||
@ -4,11 +4,13 @@ import java.lang.reflect.Field;
|
||||
import java.security.MessageDigest;
|
||||
import java.security.NoSuchAlgorithmException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.apache.logging.log4j.Level;
|
||||
@ -1200,7 +1202,12 @@ public class ModEventHandler {
|
||||
}
|
||||
}
|
||||
|
||||
private static final String hash = "41eb77f138ce350932e33b6b26b233df9aad0c0c80c6a49cb9a54ddd8fae3f83";
|
||||
private static final Set<String> hashes = new HashSet();
|
||||
|
||||
static {
|
||||
hashes.add("41de5c372b0589bbdb80571e87efa95ea9e34b0d74c6005b8eab495b7afd9994");
|
||||
hashes.add("31da6223a100ed348ceb3254ceab67c9cc102cb2a04ac24de0df3ef3479b1036");
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onClickSign(PlayerInteractEvent event) {
|
||||
@ -1210,14 +1217,14 @@ public class ModEventHandler {
|
||||
int z = event.z;
|
||||
World world = event.world;
|
||||
|
||||
if(!world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK && world.getBlock(x, y, z) == Blocks.standing_sign) {
|
||||
if(!world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK && world.getTileEntity(x, y, z) instanceof TileEntitySign) {
|
||||
|
||||
TileEntitySign sign = (TileEntitySign)world.getTileEntity(x, y, z);
|
||||
|
||||
String result = smoosh(sign.signText[0], sign.signText[1], sign.signText[2], sign.signText[3]);
|
||||
//System.out.println(result);
|
||||
System.out.println(result);
|
||||
|
||||
if(result.equals(hash)) {
|
||||
if(hashes.contains(result)) {
|
||||
world.func_147480_a(x, y, z, false);
|
||||
EntityItem entityitem = new EntityItem(world, x, y, z, new ItemStack(ModItems.bobmazon_hidden));
|
||||
entityitem.delayBeforeCanPickup = 10;
|
||||
|
||||
@ -77,6 +77,7 @@ public class NEIConfig implements IConfigureNEI {
|
||||
registerHandler(new ElectrolyserMetalHandler());
|
||||
registerHandler(new AshpitHandler());
|
||||
registerHandler(new ArcWelderHandler());
|
||||
registerHandler(new ExposureChamberHandler());
|
||||
|
||||
for(MachineConfiguration conf : CustomMachineConfigJSON.niceList) registerHandlerBypass(new CustomMachineHandler(conf));
|
||||
|
||||
|
||||
@ -1,15 +1,26 @@
|
||||
package com.hbm.render.tileentity;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.item.ItemRenderBase;
|
||||
import com.hbm.render.util.BeamPronter;
|
||||
import com.hbm.render.util.BeamPronter.EnumBeamType;
|
||||
import com.hbm.render.util.BeamPronter.EnumWaveType;
|
||||
import com.hbm.tileentity.machine.TileEntityMachineExposureChamber;
|
||||
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.client.IItemRenderer;
|
||||
|
||||
public class RenderExposureChamber extends TileEntitySpecialRenderer {
|
||||
public class RenderExposureChamber extends TileEntitySpecialRenderer implements IItemRendererProvider {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float interp) {
|
||||
@ -34,6 +45,15 @@ public class RenderExposureChamber extends TileEntitySpecialRenderer {
|
||||
|
||||
double rotation = chamber.prevRotation + (chamber.rotation - chamber.prevRotation) * interp;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(rotation, 0, 1, 0);
|
||||
ResourceManager.exposure_chamber.renderPart("Magnets");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
|
||||
|
||||
if(chamber.isOn) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(rotation / 2D, 0, 1, 0);
|
||||
@ -42,14 +62,76 @@ public class RenderExposureChamber extends TileEntitySpecialRenderer {
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotated(rotation, 0, 1, 0);
|
||||
ResourceManager.exposure_chamber.renderPart("Magnets");
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
|
||||
if(chamber.isOn) {
|
||||
|
||||
int duration = 8;
|
||||
Random rand = new Random(chamber.getWorldObj().getTotalWorldTime() / duration);
|
||||
int chance = 2;
|
||||
int color = chamber.getWorldObj().getTotalWorldTime() % duration >= duration / 2 ? 0x80d0ff : 0xffffff;
|
||||
rand.nextInt(chance); //RNG behaves weirldy in the first iteration
|
||||
if(rand.nextInt(chance) == 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 3.675, -7.5);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, 5), EnumWaveType.RANDOM, EnumBeamType.LINE, color, 0xffffff, (int)(System.currentTimeMillis() % 1000) / 50, 15, 0.125F, 1, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
if(rand.nextInt(chance) == 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(1.1875, 2.5, -7.5);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, 5), EnumWaveType.RANDOM, EnumBeamType.LINE, color, 0xffffff, (int)(System.currentTimeMillis() % 1000) / 50, 15, 0.125F, 1, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
if(rand.nextInt(chance) == 0) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(-1.1875, 2.5, -7.5);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, 5), EnumWaveType.RANDOM, EnumBeamType.LINE, color, 0xffffff, (int)(System.currentTimeMillis() % 1000) / 50, 15, 0.125F, 1, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 1.75, 0);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 1.5, 0), EnumWaveType.RANDOM, EnumBeamType.LINE, 0x80d0ff, 0xffffff, (int)(System.currentTimeMillis() % 1000) / 50, 10, 0.125F, 1, 0);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 1.5, 0), EnumWaveType.RANDOM, EnumBeamType.LINE, 0x8080ff, 0xffffff, (int)(System.currentTimeMillis() + 5 % 1000) / 50, 10, 0.125F, 1, 0);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(0, 2.5, 0);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -1), EnumWaveType.SPIRAL, EnumBeamType.LINE, 0xffff80, 0xffffff, (int)(System.currentTimeMillis() % 360), 15, 0.125F, 1, 0);
|
||||
BeamPronter.prontBeam(Vec3.createVectorHelper(0, 0, -1), EnumWaveType.SPIRAL, EnumBeamType.LINE, 0xff8080, 0xffffff, (int)(System.currentTimeMillis() % 360) + 180, 15, 0.125F, 1, 0);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glPopAttrib();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemForRenderer() {
|
||||
return Item.getItemFromBlock(ModBlocks.machine_exposure_chamber);
|
||||
}
|
||||
|
||||
@Override
|
||||
public IItemRenderer getRenderer() {
|
||||
return new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -1.5, 0);
|
||||
GL11.glScaled(3, 3, 3);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glTranslated(1.5, 0, 0);
|
||||
GL11.glRotated(90, 0, 1, 0);
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.exposure_chamber_tex);
|
||||
ResourceManager.exposure_chamber.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glEnable(GL11.GL_CULL_FACE);
|
||||
}};
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,11 @@ public interface IUpgradeInfoProvider {
|
||||
return EnumChatFormatting.GREEN.YELLOW + ">>> " + I18nUtil.resolveKey(block.getUnlocalizedName() + ".name") + " <<<";
|
||||
}
|
||||
|
||||
public static final String KEY_ACID = "upgrade.acid";
|
||||
public static final String KEY_BURN = "upgrade.burn";
|
||||
public static final String KEY_CONSUMPTION = "upgrade.consumption";
|
||||
public static final String KEY_SPEED = "upgrade.speed";
|
||||
public static final String KEY_DELAY = "upgrade.delay";
|
||||
public static final String KEY_EFFICIENCY = "upgrade.efficiency";
|
||||
public static final String KEY_FORTUNE = "upgrade.fortune";
|
||||
public static final String KEY_RANGE = "upgrade.range";
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerElectrolyserFluid;
|
||||
@ -25,8 +26,10 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.CrucibleUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -41,11 +44,12 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityElectrolyser extends TileEntityMachineBase implements IEnergyUser, IFluidStandardTransceiver, IControlReceiver, IGUIProvider {
|
||||
public class TileEntityElectrolyser extends TileEntityMachineBase implements IEnergyUser, IFluidStandardTransceiver, IControlReceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 20000000;
|
||||
@ -489,4 +493,27 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
|
||||
public boolean hasPermission(EntityPlayer player) {
|
||||
return this.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_electrolyser));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 25) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -250,7 +250,7 @@ public class TileEntityFurnaceIron extends TileEntityMachineBase implements IGUI
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.furnace_iron));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 50 / 3) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 50 / 3) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -356,12 +356,12 @@ public class TileEntityMachineArcWelder extends TileEntityMachineBase implements
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_electric_furnace_off));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 100 / 6) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 100 / 6) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 100 / 6) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_SPEED, "+" + (level * 100 / 3) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 100 / 3) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -280,12 +280,12 @@ public class TileEntityMachineAssembler extends TileEntityMachineAssemblerBase i
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 300) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_SPEED, "+" + (level * 5) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 5) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
@ -296,7 +296,7 @@ public class TileEntityMachineAssembler extends TileEntityMachineAssemblerBase i
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 9;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,10 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerAssemfac;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -10,6 +12,9 @@ import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIAssemfac;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardTransceiver;
|
||||
@ -21,10 +26,11 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineAssemfac extends TileEntityMachineAssemblerBase implements IFluidStandardTransceiver {
|
||||
public class TileEntityMachineAssemfac extends TileEntityMachineAssemblerBase implements IFluidStandardTransceiver, IUpgradeInfoProvider {
|
||||
|
||||
public AssemblerArm[] arms;
|
||||
|
||||
@ -421,4 +427,33 @@ public class TileEntityMachineAssemfac extends TileEntityMachineAssemblerBase im
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIAssemfac(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assemfac));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 15) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 300) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 5) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 6;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 12;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerCentrifuge;
|
||||
import com.hbm.inventory.gui.GUIMachineCentrifuge;
|
||||
@ -9,7 +12,10 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -20,10 +26,11 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineCentrifuge extends TileEntityMachineBase implements IEnergyUser, IGUIProvider {
|
||||
public class TileEntityMachineCentrifuge extends TileEntityMachineBase implements IEnergyUser, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public int progress;
|
||||
public long power;
|
||||
@ -307,4 +314,32 @@ public class TileEntityMachineCentrifuge extends TileEntityMachineBase implement
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineCentrifuge(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_centrifuge));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 100) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerChemfac;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
@ -13,6 +14,9 @@ import com.hbm.inventory.gui.GUIChemfac;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -23,10 +27,11 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineChemfac extends TileEntityMachineChemplantBase {
|
||||
public class TileEntityMachineChemfac extends TileEntityMachineChemplantBase implements IUpgradeInfoProvider {
|
||||
|
||||
float rotSpeed;
|
||||
public float rot;
|
||||
@ -346,4 +351,33 @@ public class TileEntityMachineChemfac extends TileEntityMachineChemplantBase {
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIChemfac(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_chemfac));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 15) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 300) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 5) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 6;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 12;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
@ -21,7 +22,10 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
@ -38,10 +42,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineChemplant extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidAcceptor, IFluidStandardTransceiver, IGUIProvider {
|
||||
public class TileEntityMachineChemplant extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidAcceptor, IFluidStandardTransceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -654,4 +659,33 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineChemplant(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_chemplant));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 300) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 5) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 9;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,9 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerCompressor;
|
||||
@ -13,7 +16,10 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
@ -26,11 +32,12 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCompressor extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, IEnergyUser, IFluidStandardTransceiver {
|
||||
public class TileEntityMachineCompressor extends TileEntityMachineBase implements IGUIProvider, IControlReceiver, IEnergyUser, IFluidStandardTransceiver, IUpgradeInfoProvider {
|
||||
|
||||
public FluidTank[] tanks;
|
||||
public long power;
|
||||
@ -85,7 +92,7 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement
|
||||
|
||||
//there is a reason to do this but i'm not telling you
|
||||
// ^ a few months later i have to wonder what the fuck this guy was on about, and if i ever see him i will punch him in the nuts
|
||||
if(timeBase == this.processTimeBase) this.processTime = speedLevel == 3 ? 10 : speedLevel == 2 ? 20 : speedLevel == 1 ? 60 : timeBase;
|
||||
if(rec == null) this.processTime = speedLevel == 3 ? 10 : speedLevel == 2 ? 20 : speedLevel == 1 ? 60 : timeBase;
|
||||
else this.processTime = timeBase / (speedLevel + 1);
|
||||
this.powerRequirement = this.powerRequirementBase / (powerLevel + 1);
|
||||
this.processTime = this.processTime / (overLevel + 1);
|
||||
@ -329,4 +336,32 @@ public class TileEntityMachineCompressor extends TileEntityMachineBase implement
|
||||
public double getMaxRenderDistanceSquared() {
|
||||
return 65536.0D;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_compressor));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + "Recipe: "+ I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level == 3 ? 90 : level == 2 ? 80 : level == 1 ? 40 : 0) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + "Generic compression: "+ I18nUtil.resolveKey(this.KEY_DELAY, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 9;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,17 +1,24 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerCrystallizer;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUICrystallizer;
|
||||
import com.hbm.inventory.recipes.CrystallizerRecipes;
|
||||
import com.hbm.inventory.recipes.CrystallizerRecipes.CrystallizerRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
@ -26,10 +33,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCrystallizer extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IGUIProvider {
|
||||
public class TileEntityMachineCrystallizer extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1000000;
|
||||
@ -63,6 +71,8 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
tank.setType(7, slots);
|
||||
tank.loadTank(3, 4, slots);
|
||||
|
||||
UpgradeManager.eval(slots, 5, 6);
|
||||
|
||||
for(int i = 0; i < getCycleCount(); i++) {
|
||||
|
||||
if(canProcess()) {
|
||||
@ -156,7 +166,7 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
else if(slots[2].stackSize + stack.stackSize <= slots[2].getMaxStackSize())
|
||||
slots[2].stackSize += stack.stackSize;
|
||||
|
||||
tank.setFill(tank.getFill() - result.acidAmount);
|
||||
tank.setFill(tank.getFill() - getRequiredAcid(result.acidAmount));
|
||||
|
||||
float freeChance = this.getFreeChance();
|
||||
|
||||
@ -183,7 +193,7 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
if(slots[0].stackSize < result.itemAmount)
|
||||
return false;
|
||||
|
||||
if(tank.getFill() < result.acidAmount) return false;
|
||||
if(tank.getFill() < getRequiredAcid(result.acidAmount)) return false;
|
||||
|
||||
ItemStack stack = result.output.copy();
|
||||
|
||||
@ -199,89 +209,39 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
public int getRequiredAcid(int base) {
|
||||
|
||||
for(int i = 5; i <= 6; i++) {
|
||||
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_effect_1)
|
||||
base *= 3;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_effect_2)
|
||||
base *= 4;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_effect_3)
|
||||
base *= 5;
|
||||
int efficiency = Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT), 3);
|
||||
if(efficiency > 0) {
|
||||
return base * (efficiency + 2);
|
||||
}
|
||||
|
||||
return base;
|
||||
}
|
||||
|
||||
public float getFreeChance() {
|
||||
|
||||
float chance = 0.0F;
|
||||
|
||||
for(int i = 5; i <= 6; i++) {
|
||||
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_effect_1)
|
||||
chance += 0.05F;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_effect_2)
|
||||
chance += 0.1F;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_effect_3)
|
||||
chance += 0.15F;
|
||||
int efficiency = Math.min(UpgradeManager.getLevel(UpgradeType.EFFECT), 3);
|
||||
if(efficiency > 0) {
|
||||
return Math.min(efficiency * 0.05F, 0.15F);
|
||||
}
|
||||
|
||||
return Math.min(chance, 0.15F);
|
||||
return 0;
|
||||
}
|
||||
|
||||
public short getDuration() {
|
||||
|
||||
float durationMod = 1;
|
||||
CrystallizerRecipe result = CrystallizerRecipes.getOutput(slots[0], tank.getTankType());
|
||||
|
||||
int base = result != null ? result.duration : 600;
|
||||
|
||||
for(int i = 5; i <= 6; i++) {
|
||||
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_1)
|
||||
durationMod -= 0.25F;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_2)
|
||||
durationMod -= 0.50F;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_3)
|
||||
durationMod -= 0.75F;
|
||||
int speed = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
if(speed > 0) {
|
||||
return (short) Math.ceil((base * Math.max(1F - 0.25F * speed, 0.25F)));
|
||||
}
|
||||
|
||||
return (short) Math.ceil((base * Math.max(durationMod, 0.25F)));
|
||||
return (short) base;
|
||||
}
|
||||
|
||||
public int getPowerRequired() {
|
||||
|
||||
int consumption = 0;
|
||||
|
||||
for(int i = 5; i <= 6; i++) {
|
||||
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_1)
|
||||
consumption += 1000;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_2)
|
||||
consumption += 2000;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_speed_3)
|
||||
consumption += 3000;
|
||||
}
|
||||
|
||||
return (int) (demand + Math.min(consumption, 3000));
|
||||
int speed = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
|
||||
return (int) (demand + Math.min(speed * 1000, 3000));
|
||||
}
|
||||
|
||||
public float getCycleCount() {
|
||||
|
||||
int cycles = 1;
|
||||
|
||||
for(int i = 5; i <= 6; i++) {
|
||||
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_1)
|
||||
cycles += 2;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_2)
|
||||
cycles += 4;
|
||||
if(slots[i] != null && slots[i].getItem() == ModItems.upgrade_overdrive_3)
|
||||
cycles += 6;
|
||||
}
|
||||
|
||||
return Math.min(cycles, 4);
|
||||
int speed = UpgradeManager.getLevel(UpgradeType.OVERDRIVE);
|
||||
return Math.min(1 + speed * 2, 7);
|
||||
}
|
||||
|
||||
public long getPowerScaled(int i) {
|
||||
@ -388,4 +348,33 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICrystallizer(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.EFFECT || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.turret_maxwell));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.EFFECT) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_EFFICIENCY, "+" + (level * 5) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_ACID, "+" + (level * 100 + 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.EFFECT) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 2;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMachineEPress;
|
||||
import com.hbm.inventory.gui.GUIMachineEPress;
|
||||
@ -8,7 +11,9 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.items.machine.ItemStamp;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -19,10 +24,11 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineEPress extends TileEntityMachineBase implements IEnergyUser, IGUIProvider {
|
||||
public class TileEntityMachineEPress extends TileEntityMachineBase implements IEnergyUser, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power = 0;
|
||||
public final static long maxPower = 50000;
|
||||
@ -254,4 +260,23 @@ public class TileEntityMachineEPress extends TileEntityMachineBase implements IE
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineEPress(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_epress));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (50 * level / 3) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -279,12 +279,12 @@ public class TileEntityMachineElectricFurnace extends TileEntityMachineBase impl
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_electric_furnace_off));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_SPEED, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 30) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_SPEED, "+" + (level * 10) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 10) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -24,9 +24,11 @@ import com.hbm.items.machine.ItemDrillbit.EnumDrillType;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.Compat;
|
||||
import com.hbm.util.EnumUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
@ -50,11 +52,12 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineExcavator extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IControlReceiver, IGUIProvider {
|
||||
public class TileEntityMachineExcavator extends TileEntityMachineBase implements IEnergyUser, IFluidStandardReceiver, IControlReceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public static final long maxPower = 1_000_000;
|
||||
public long power;
|
||||
@ -839,4 +842,28 @@ public class TileEntityMachineExcavator extends TileEntityMachineBase implements
|
||||
public FluidTank[] getReceivingTanks() {
|
||||
return new FluidTank[] {tank};
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (100 - 100 / (level / 2 + 1)) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMachineExposureChamber;
|
||||
import com.hbm.inventory.gui.GUIMachineExposureChamber;
|
||||
@ -8,7 +11,10 @@ import com.hbm.inventory.recipes.ExposureChamberRecipes.ExposureChamberRecipe;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -17,14 +23,14 @@ import cpw.mods.fml.relauncher.SideOnly;
|
||||
import io.netty.buffer.ByteBuf;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineExposureChamber extends TileEntityMachineBase implements IGUIProvider, IEnergyUser {
|
||||
public class TileEntityMachineExposureChamber extends TileEntityMachineBase implements IGUIProvider, IEnergyUser, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1_000_000;
|
||||
@ -176,6 +182,52 @@ public class TileEntityMachineExposureChamber extends TileEntityMachineBase impl
|
||||
return ExposureChamberRecipes.getRecipe(particle, ingredient);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
|
||||
//will only load new capsules if there's no cached particles, this should prevent clogging
|
||||
|
||||
//accept items when the slots are already partially filled, i.e. applicable
|
||||
if(i == 0 && slots[0] != null) return true;
|
||||
if(i == 3 && slots[3] != null) return true;
|
||||
|
||||
//if there's no particle stored, use the un-consumed capsule for reference
|
||||
ItemStack particle = slots[1] != null ? slots[1] : slots[0];
|
||||
|
||||
//if no particle is loaded and an ingot is present
|
||||
if(i == 0 && particle == null && slots[3] != null) {
|
||||
ExposureChamberRecipe recipe = getRecipe(stack, slots[3]);
|
||||
return recipe != null;
|
||||
}
|
||||
|
||||
//if a particle is loaded but no ingot present
|
||||
if(i == 3 && particle != null && slots[3] == null) {
|
||||
ExposureChamberRecipe recipe = getRecipe(slots[0], stack);
|
||||
return recipe != null;
|
||||
}
|
||||
|
||||
//if there's nothing at all, find a reference recipe and see if the item matches anything
|
||||
if(particle == null && slots[3] == null) {
|
||||
|
||||
for(ExposureChamberRecipe recipe : ExposureChamberRecipes.recipes) {
|
||||
if(i == 0 && recipe.particle.matchesRecipe(stack, true)) return true;
|
||||
if(i == 3 && recipe.ingredient.matchesRecipe(stack, true)) return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
|
||||
return i == 2 || i == 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int[] getAccessibleSlotsFromSide(int side) {
|
||||
return new int[] {0, 2, 3, 4};
|
||||
}
|
||||
|
||||
@Override
|
||||
public void serialize(ByteBuf buf) {
|
||||
buf.writeBoolean(this.isOn);
|
||||
@ -246,4 +298,33 @@ public class TileEntityMachineExposureChamber extends TileEntityMachineBase impl
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineExposureChamber(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_exposure_chamber));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 50) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 50) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -23,7 +23,10 @@ import com.hbm.items.machine.ItemMachineUpgrade;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import api.hbm.block.IDrillInteraction;
|
||||
@ -47,10 +50,11 @@ import net.minecraft.item.crafting.FurnaceRecipes;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IMiningDrill, IFluidStandardSender, IGUIProvider {
|
||||
public class TileEntityMachineMiningLaser extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IMiningDrill, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public int age = 0;
|
||||
@ -714,4 +718,40 @@ public class TileEntityMachineMiningLaser extends TileEntityMachineBase implemen
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMiningLaser(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE || type == UpgradeType.EFFECT || type == UpgradeType.FORTUNE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (100 * level / 16) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 * level / 16) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.EFFECT) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_RANGE, "+" + (2 * level) + "m"));
|
||||
}
|
||||
if(type == UpgradeType.FORTUNE) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_FORTUNE, "+" + level));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 12;
|
||||
if(type == UpgradeType.POWER) return 12;
|
||||
if(type == UpgradeType.EFFECT) return 12;
|
||||
if(type == UpgradeType.FORTUNE) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 9;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerMixer;
|
||||
@ -12,7 +15,10 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -25,9 +31,10 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineMixer extends TileEntityMachineBase implements INBTPacketReceiver, IControlReceiver, IGUIProvider, IEnergyUser, IFluidStandardTransceiver {
|
||||
public class TileEntityMachineMixer extends TileEntityMachineBase implements INBTPacketReceiver, IControlReceiver, IGUIProvider, IEnergyUser, IFluidStandardTransceiver, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 10_000;
|
||||
@ -310,7 +317,34 @@ public class TileEntityMachineMixer extends TileEntityMachineBase implements INB
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
|
||||
if(data.hasKey("toggle")) this.recipeIndex++;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 300) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 25) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 6;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,7 +26,9 @@ import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.sound.AudioWrapper;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachinePolluting;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -43,10 +45,11 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineTurbofan extends TileEntityMachinePolluting implements IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardTransceiver, IGUIProvider {
|
||||
public class TileEntityMachineTurbofan extends TileEntityMachinePolluting implements IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardTransceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 1_000_000;
|
||||
@ -488,4 +491,24 @@ public class TileEntityMachineTurbofan extends TileEntityMachinePolluting implem
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineTurbofan(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.AFTERBURN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.AFTERBURN) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_EFFICIENCY, "+" + (int)(level * 100 * (1 + Math.min(level / 3D, 4D))) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.AFTERBURN) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
@ -11,8 +12,12 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.inventory.gui.GUIMachineOilWell;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
import com.hbm.world.feature.OilSpot;
|
||||
|
||||
@ -22,6 +27,7 @@ import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.GuiScreen;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineFrackingTower extends TileEntityOilDrillBase implements IFluidAcceptor {
|
||||
@ -221,4 +227,23 @@ public class TileEntityMachineFrackingTower extends TileEntityOilDrillBase imple
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineOilWell(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_fracking_tower));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 25) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 10) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.AFTERBURN) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_BURN, level * 10, level * 50));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.pollution.PollutionHandler;
|
||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
||||
import com.hbm.interfaces.IControlReceiver;
|
||||
@ -21,7 +22,9 @@ import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
@ -37,9 +40,10 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineGasFlare extends TileEntityMachineBase implements IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver, IControlReceiver, IGUIProvider {
|
||||
public class TileEntityMachineGasFlare extends TileEntityMachineBase implements IEnergyGenerator, IFluidContainer, IFluidAcceptor, IFluidStandardReceiver, IControlReceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -307,4 +311,27 @@ public class TileEntityMachineGasFlare extends TileEntityMachineBase implements
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineGasFlare(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.EFFECT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_flare));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.EFFECT) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_EFFICIENCY, "+" + (100 * level / 3) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.EFFECT) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.machine.oil;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidSource;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
@ -16,7 +17,10 @@ import com.hbm.inventory.recipes.LiquefactionRecipes;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -29,9 +33,10 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardSender, IGUIProvider {
|
||||
public class TileEntityMachineLiquefactor extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardSender, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -296,4 +301,28 @@ public class TileEntityMachineLiquefactor extends TileEntityMachineBase implemen
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUILiquefactor(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
@ -9,8 +10,12 @@ import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.inventory.container.ContainerMachineOilWell;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.gui.GUIMachineOilWell;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -21,6 +26,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
@ -174,4 +180,23 @@ public class TileEntityMachineOilWell extends TileEntityOilDrillBase {
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineOilWell(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_well));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 25) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 10) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.AFTERBURN) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_BURN, level * 10, level * 50));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
@ -9,7 +10,11 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.container.ContainerMachineOilWell;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.gui.GUIMachineOilWell;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -21,6 +26,7 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
@ -224,4 +230,23 @@ public class TileEntityMachinePumpjack extends TileEntityOilDrillBase {
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUIMachineOilWell(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_pumpjack));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 25) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_DELAY, "+" + (level * 10) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.AFTERBURN) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_BURN, level * 10, level * 50));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,5 +1,8 @@
|
||||
package com.hbm.tileentity.machine.oil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.inventory.UpgradeManager;
|
||||
import com.hbm.inventory.container.ContainerSolidifier;
|
||||
@ -11,7 +14,9 @@ import com.hbm.inventory.recipes.SolidificationRecipes;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
@ -25,9 +30,10 @@ import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider {
|
||||
public class TileEntityMachineSolidifier extends TileEntityMachineBase implements IEnergyUser, IFluidAcceptor, IFluidStandardReceiver, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000;
|
||||
@ -270,4 +276,28 @@ public class TileEntityMachineSolidifier extends TileEntityMachineBase implement
|
||||
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUISolidifier(player.inventory, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembler));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_DELAY, "-" + (level * 25) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (100 - 100 / (level + 1)) + "%"));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,6 +17,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.IConfigurableMachine;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.IPersistentNBT;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.tileentity.TileEntityMachineBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple;
|
||||
@ -34,7 +35,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public abstract class TileEntityOilDrillBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardTransceiver, IConfigurableMachine, IPersistentNBT, IGUIProvider {
|
||||
public abstract class TileEntityOilDrillBase extends TileEntityMachineBase implements IEnergyUser, IFluidSource, IFluidStandardTransceiver, IConfigurableMachine, IPersistentNBT, IGUIProvider, IUpgradeInfoProvider {
|
||||
|
||||
public int indicator = 0;
|
||||
|
||||
@ -382,4 +383,18 @@ public abstract class TileEntityOilDrillBase extends TileEntityMachineBase imple
|
||||
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.POWER || type == UpgradeType.OVERDRIVE || type == UpgradeType.AFTERBURN;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 3;
|
||||
if(type == UpgradeType.POWER) return 3;
|
||||
if(type == UpgradeType.AFTERBURN) return 3;
|
||||
if(type == UpgradeType.OVERDRIVE) return 3;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,13 +3,18 @@ package com.hbm.tileentity.turret;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUITurretMaxwell;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.EntityDamageUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -21,10 +26,11 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT {
|
||||
public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT implements IUpgradeInfoProvider {
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
@ -64,6 +70,41 @@ public class TileEntityTurretMaxwell extends TileEntityTurretBaseNT {
|
||||
|
||||
return ammoStacks;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvideInfo(UpgradeType type, int level, boolean extendedInfo) {
|
||||
return type == UpgradeType.SPEED || type == UpgradeType.EFFECT || type == UpgradeType.POWER || type == UpgradeType.AFTERBURN || type == UpgradeType.OVERDRIVE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.turret_maxwell));
|
||||
if(type == UpgradeType.SPEED) {
|
||||
info.add(EnumChatFormatting.GREEN + "Damage +0." + (level * 25) + "/t");
|
||||
}
|
||||
if(type == UpgradeType.POWER) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "-" + (level * 3) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.EFFECT) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_RANGE, "+" + (level * 3) + "m"));
|
||||
}
|
||||
if(type == UpgradeType.AFTERBURN) {
|
||||
info.add(EnumChatFormatting.GREEN + "Afterburn +3s");
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxLevel(UpgradeType type) {
|
||||
if(type == UpgradeType.SPEED) return 27;
|
||||
if(type == UpgradeType.POWER) return 27;
|
||||
if(type == UpgradeType.EFFECT) return 27;
|
||||
if(type == UpgradeType.AFTERBURN) return 27;
|
||||
if(type == UpgradeType.OVERDRIVE) return 27;
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public double getAcceptableInaccuracy() {
|
||||
|
||||
@ -50,12 +50,19 @@ public class TestDungeonRoom8 extends CellularDungeonRoom {
|
||||
|
||||
int r = world.rand.nextInt(10);
|
||||
|
||||
if(r == 0)
|
||||
if(r == 0) {
|
||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(ModItems.book_of_));
|
||||
else if(r < 4)
|
||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, generateBook(world));
|
||||
else
|
||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(Items.book));
|
||||
} else if(r < 4) {
|
||||
TileEntitySafe safe = (TileEntitySafe) world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2);
|
||||
safe.setInventorySlotContents(5, generateBook(world));
|
||||
safe.setInventorySlotContents(7, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
safe.setInventorySlotContents(9, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
} else {
|
||||
TileEntitySafe safe = (TileEntitySafe) world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2);
|
||||
safe.setInventorySlotContents(5, new ItemStack(Items.book));
|
||||
safe.setInventorySlotContents(7, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
safe.setInventorySlotContents(9, new ItemStack(ModItems.stamp_book, 1, world.rand.nextInt(8)));
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
@ -315,6 +315,7 @@ container.droneProvider=Anbieter
|
||||
container.droneRequester=Abnehmer
|
||||
container.electricFurnace=Elektrischer Ofen
|
||||
container.epress=Hydraulische Presse
|
||||
container.exposureChamber=Bestrahlungskammer
|
||||
container.factoryAdvanced=Fortgeschrittene Fabrik
|
||||
container.factoryTitanium=Einfache Fabrik
|
||||
container.fluidtank=Tank
|
||||
@ -2608,6 +2609,14 @@ item.padlock_unbreakable.name=Unzerstörbares Vorhängeschloss
|
||||
item.pads_rubber.name=Gummischuhsohlen
|
||||
item.pads_slime.name=Schleimschuhsohlen
|
||||
item.pads_static.name=Statische Schuhsolen
|
||||
item.page_of_.page1.name=Seite 1
|
||||
item.page_of_.page2.name=Seite 2
|
||||
item.page_of_.page3.name=Seite 3
|
||||
item.page_of_.page4.name=Seite 4
|
||||
item.page_of_.page5.name=Seite 5
|
||||
item.page_of_.page6.name=Seite 6
|
||||
item.page_of_.page7.name=Seite 7
|
||||
item.page_of_.page8.name=Seite 8
|
||||
item.pancake.name=Pfannkuchen aus Altmetall, Nägeln und Edelsteinpulver
|
||||
item.part_beryllium.name=Berylliumstaubkiste
|
||||
item.part_carbon.name=Kohlenstoffstaubkiste
|
||||
@ -3158,6 +3167,14 @@ item.stamp_357.name=.357 Magnum-Stempel
|
||||
item.stamp_44.name=.44 Magnum-Stempel
|
||||
item.stamp_50.name=Großkaliberstempel
|
||||
item.stamp_9.name=Kleinkaliberstempel
|
||||
item.stamp_book.printing1.name=Druckpressstempel (Teil 1)
|
||||
item.stamp_book.printing2.name=Druckpressstempel (Teil 2)
|
||||
item.stamp_book.printing3.name=Druckpressstempel (Teil 3)
|
||||
item.stamp_book.printing4.name=Druckpressstempel (Teil 4)
|
||||
item.stamp_book.printing5.name=Druckpressstempel (Teil 5)
|
||||
item.stamp_book.printing6.name=Druckpressstempel (Teil 6)
|
||||
item.stamp_book.printing7.name=Druckpressstempel (Teil 7)
|
||||
item.stamp_book.printing8.name=Druckpressstempel (Teil 8)
|
||||
item.stamp_desh_circuit.name=Schaltkreisstempel (Desh)
|
||||
item.stamp_desh_flat.name=Flacher Stempe (Desh)
|
||||
item.stamp_desh_plate.name=Plattenstempel (Desh)
|
||||
@ -4096,6 +4113,7 @@ tile.machine_electric_furnace_off.name=Elektrischer Ofen
|
||||
tile.machine_electric_furnace_on.name=Elektrischer Ofen
|
||||
tile.machine_electrolyser.name=Electrolysegerät
|
||||
tile.machine_epress.name=Hydraulische Presse
|
||||
tile.machine_exposure_chamber.name=Bestrahlungskammer
|
||||
tile.machine_excavator.name=Großer Minenbohrer
|
||||
tile.machine_fel.name=FEL
|
||||
tile.machine_fensu.name=FEnSU
|
||||
|
||||
@ -672,6 +672,7 @@ container.droneProvider=Provider
|
||||
container.droneRequester=Requester
|
||||
container.electricFurnace=Electric Furnace
|
||||
container.epress=Electric Press
|
||||
container.exposureChamber=Exposure Chamber
|
||||
container.factoryAdvanced=Advanced Factory
|
||||
container.factoryTitanium=Basic Factory
|
||||
container.fluidtank=Tank
|
||||
@ -3363,6 +3364,14 @@ item.padlock_unbreakable.name=Unbreakable Padlock
|
||||
item.pads_rubber.name=Rubber Pads
|
||||
item.pads_slime.name=Slime Pads
|
||||
item.pads_static.name=Static Pads
|
||||
item.page_of_.page1.name=Page 1
|
||||
item.page_of_.page2.name=Page 2
|
||||
item.page_of_.page3.name=Page 3
|
||||
item.page_of_.page4.name=Page 4
|
||||
item.page_of_.page5.name=Page 5
|
||||
item.page_of_.page6.name=Page 6
|
||||
item.page_of_.page7.name=Page 7
|
||||
item.page_of_.page8.name=Page 8
|
||||
item.pancake.name=Pancake made from Scrap Metal, Nails and Gem Dust
|
||||
item.part_beryllium.name=Box of Beryllium Dust
|
||||
item.part_carbon.name=Box of Carbon Dust
|
||||
@ -4070,6 +4079,14 @@ item.stamp_357.name=.357 Magnum Stamp
|
||||
item.stamp_44.name=.44 Magnum Stamp
|
||||
item.stamp_50.name=Large Caliber Stamp
|
||||
item.stamp_9.name=Small Caliber Stamp
|
||||
item.stamp_book.printing1.name=Printing Press Stamp (Part 1)
|
||||
item.stamp_book.printing2.name=Printing Press Stamp (Part 2)
|
||||
item.stamp_book.printing3.name=Printing Press Stamp (Part 3)
|
||||
item.stamp_book.printing4.name=Printing Press Stamp (Part 4)
|
||||
item.stamp_book.printing5.name=Printing Press Stamp (Part 5)
|
||||
item.stamp_book.printing6.name=Printing Press Stamp (Part 6)
|
||||
item.stamp_book.printing7.name=Printing Press Stamp (Part 7)
|
||||
item.stamp_book.printing8.name=Printing Press Stamp (Part 8)
|
||||
item.stamp_desh_circuit.name=Circuit Stamp (Desh)
|
||||
item.stamp_desh_flat.name=Flat Stamp (Desh)
|
||||
item.stamp_desh_plate.name=Plate Stamp (Desh)
|
||||
@ -5082,6 +5099,7 @@ tile.machine_electric_furnace_on.name=Electric Furnace
|
||||
tile.machine_electrolyser.name=Electrolysis Machine
|
||||
tile.machine_epress.name=Electric Press
|
||||
tile.machine_excavator.name=Large Mining Drill
|
||||
tile.machine_exposure_chamber.name=Exposure Chamber
|
||||
tile.machine_fel.name=FEL
|
||||
tile.machine_fensu.name=FEnSU
|
||||
tile.machine_flare.name=Flare Stack
|
||||
@ -5619,8 +5637,13 @@ turret.off=OFF
|
||||
turret.on=ON
|
||||
turret.players=Target Players: %s
|
||||
|
||||
upgrade.acid=Acid required %s
|
||||
upgrade.burn=Burn %smb/t for %sHE
|
||||
upgrade.consumption=Consumption %s
|
||||
upgrade.speed=Process time %s
|
||||
upgrade.delay=Process time %s
|
||||
upgrade.efficiency=Efficiency %s
|
||||
upgrade.fortune=Fortune %s
|
||||
upgrade.range=Range %s
|
||||
|
||||
upgrade.gui.title=§lAcceptable Upgrades:§r
|
||||
upgrade.gui.afterburner= * §dAfterburner§r: Stacks to level %s
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 306 B After Width: | Height: | Size: 325 B |
BIN
src/main/resources/assets/hbm/textures/items/page_of_.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/page_of_.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 241 B |
BIN
src/main/resources/assets/hbm/textures/items/stamp_book.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/stamp_book.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 685 B |
Binary file not shown.
|
Before Width: | Height: | Size: 6.7 KiB After Width: | Height: | Size: 6.7 KiB |
Loading…
x
Reference in New Issue
Block a user