Merge remote-tracking branch 'HbmMods/master'

This commit is contained in:
Vaern 2023-08-05 18:59:18 -07:00
commit 5423359205
64 changed files with 5683 additions and 193 deletions

View File

@ -1,13 +1,25 @@
## Added
* New command `/ntmsatellites`
* `/ntmsatellites orbit` will send the held saatellite into orbit
* `/ntmsatellites descend <frequency>` will delete the given satellite
* Electrolysis machine
* A large machine that can do the chemical plant's electrolysis recipes, as well as crystal processing
* Crystals are turned into molten metals as well as byproducts, the metal can be cast using foundry blocks
* Processing crystals requires nitric acid and yields more than what the centrifuge would give
* Environment suit
* An airtight suit for diving with high radiation resistance
* Relatively cheap, but protection is comparatively low
* Has sprint assist and accelerated diving
## Changed
* Updated russian localization
* It's no longer possible to insert items into the satellite cargo pad, it's only for unloading
* The satellite linker will no longer assign new frequencies in the randomizer slot if that frequency is already taken
* Custom machines will now show a hologram showing how they are built
* Bedrock ores now spawn in the nether
* Nether bedrock ores include red phosphorus and glowstone, both yielding powders instead of ores
* All current nether bedrock ores are tier 1 and do not require any bore fluid
* Custom machines now show their recipes in NEI
* All it took was battling NEI's source code for 3 hours and my sanity
* The chlorocalcite centrifugation process now requires 8,000mB of sulfuric acid instead of 100mB of water
* Mixed chlorocalcite solution now requires flux as a reducing agent
* All chlorine producing electrolysis recipes have been moved to the electrolysis machine and can no longer be done in the chemical plant
* If only there was a much simpler recipe that may have existed at some point, life could be a dream
## Fixed
* Fixed crash caused by mobs spawning in highly polluted area
* Fixed custom machines not sending fluid
* Fixed custom machine item IO not working beyond the first slot
* Fixed the player's arms clipping through the armor model when punching

View File

@ -15,4 +15,4 @@ credits=HbMinecraft, rodolphito (explosion algorithms), grangerave (explosion al
\ Voxelstice (OpenComputers integration, turbine spinup), BallOfEnergy1 (OpenComputers integration), martemen\
\ (project settings), Pvndols (thorium fuel recipe, gas turbine), JamesH2 (blood mechanics, nitric acid,\
\ particle emitter), sdddddf80 (recipe configs, chinese localization, custom machine holograms),\
\ SuperCraftAlex (tooltips) LePeep (coilgun model), Maksymisio (polish localization)
\ SuperCraftAlex (tooltips) LePeep (coilgun model, BDCL QC), Maksymisio (polish localization)

View File

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.Random;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
import com.hbm.items.ModItems;
import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry;
@ -92,10 +93,19 @@ public class BlockCustomMachine extends BlockContainer {
TileEntityCustomMachine tile = (TileEntityCustomMachine) world.getTileEntity(x, y, z);
if(tile != null && stack.hasTagCompound()) {
tile.machineType = stack.stackTagCompound.getString("machineType");
tile.init();
tile.markChanged();
if(tile != null) {
int id = stack.getItemDamage() - 100;
if(id >= 0 && id < CustomMachineConfigJSON.customMachines.size()) {
MachineConfiguration config = CustomMachineConfigJSON.niceList.get(id);
if(config != null) {
tile.machineType = config.unlocalizedName;
tile.init();
tile.markChanged();
}
}
}
}
@ -126,8 +136,6 @@ public class BlockCustomMachine extends BlockContainer {
if(tile != null) {
ItemStack stack = new ItemStack(item, 1, CustomMachineConfigJSON.niceList.indexOf(tile.config) + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", tile.machineType);
ret.add(stack);
}
}
@ -142,8 +150,6 @@ public class BlockCustomMachine extends BlockContainer {
if(tile != null && tile.machineType != null && !tile.machineType.isEmpty()) {
ItemStack stack = new ItemStack(this, 1, CustomMachineConfigJSON.niceList.indexOf(tile.config) + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", tile.machineType);
return stack;
}

View File

@ -20,7 +20,7 @@ public class MachineElectrolyser extends BlockDummyable {
@Override
public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityElectrolyser();
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
return null;
}
@ -42,39 +42,54 @@ public class MachineElectrolyser extends BlockDummyable {
@Override
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
super.fillSpace(world, x, y, z, dir, o);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {2, -1, 5, 5, 1, 1}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -3, 5, 5, 0, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, 4, -4, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, 2, -2, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, 0, 0, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, -2, 2, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, -4, 4, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, 4, -4, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, 2, -2, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, -2, 2, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, -4, 4, -1, 2}, this, dir);
x += dir.offsetX * o;
z += dir.offsetZ * o;
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {2, -1, 5, 5, 1, 1}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -3, 5, 5, 0, 0}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, 4, -4, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, 2, -2, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, 0, 0, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, -2, 2, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y, z, new int[] {3, -1, -4, 4, -3, 3}, this, dir);
MultiblockHandlerXR.fillSpace(world,x + dir.offsetX * 4, y + 3, z + dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world,x + dir.offsetX * 2, y + 3, z + dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x, y + 3, z, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x - dir.offsetX * 2, y + 3, z - dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
MultiblockHandlerXR.fillSpace(world, x - dir.offsetX * 4, y + 3, z - dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, this, dir);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
this.makeExtra(world, x - dir.offsetX * 5, y, z - dir.offsetZ * 5);
this.makeExtra(world, x - dir.offsetX * 5 + rot.offsetX, y, z - dir.offsetZ * 5 + rot.offsetZ);
this.makeExtra(world, x - dir.offsetX * 5 - rot.offsetX, y, z - dir.offsetZ * 5 - rot.offsetZ);
this.makeExtra(world, x + dir.offsetX * 5, y, z + dir.offsetZ * 5);
this.makeExtra(world, x + dir.offsetX * 5 + rot.offsetX, y, z + dir.offsetZ * 5 + rot.offsetZ);
this.makeExtra(world, x + dir.offsetX * 5 - rot.offsetX, y, z + dir.offsetZ * 5 - rot.offsetZ);
}
@Override
protected boolean checkRequirement(World world, int x, int y, int z, ForgeDirection dir, int o) {
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y , z + dir.offsetZ * o, getDimensions(), x, y, z, dir)) return false;
x += dir.offsetX * o;
z += dir.offsetZ * o;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {2, -1, 5, 5, 1, 1}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -3, 5, 5, 0, 0}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, 4, -4, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, 2, -2, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, 0, 0, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, -2, 2, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y, z + dir.offsetZ * o, new int[] {3, -1, -4, 4, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, 4, -4, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, 2, -2, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, -2, 2, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * o , y + 3, z + dir.offsetZ * o, new int[] {0, 0, -4, 4, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y , z, getDimensions(), x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {2, -1, 5, 5, 1, 1}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -3, 5, 5, 0, 0}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, 4, -4, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, 2, -2, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, 0, 0, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, -2, 2, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y, z, new int[] {3, -1, -4, 4, -3, 3}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * 4, y + 3, z + dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x + dir.offsetX * 2, y + 3, z + dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x, y + 3, z, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x - dir.offsetX * 2, y + 3, z - dir.offsetZ * 2, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
if(!MultiblockHandlerXR.checkSpace(world, x - dir.offsetX * 4, y + 3, z - dir.offsetZ * 4, new int[] {0, 0, 0, 0, -1, 2}, x, y, z, dir)) return false;
return true;
}

View File

@ -48,6 +48,8 @@ public class WorldConfig {
public static int bedrockNiterSpawn = 50;
public static int bedrockFluoriteSpawn = 50;
public static int bedrockRedstoneSpawn = 50;
public static int bedrockGlowstoneSpawn = 100;
public static int bedrockPhosphorusSpawn = 50;
public static int ironClusterSpawn = 4;
public static int titaniumClusterSpawn = 2;
@ -153,7 +155,10 @@ public class WorldConfig {
bedrockNiterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.B11_bedrockNiterWeight", "Spawn weight for niter bedrock ore", 50);
bedrockFluoriteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.B12_bedrockFluoriteWeight", "Spawn weight for fluorite bedrock ore", 50);
bedrockRedstoneSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.B13_bedrockRedstoneWeight", "Spawn weight for redstone bedrock ore", 50);
bedrockChlorocalciteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.B14_bedrockbChlorocalciteWeight", "Spawn weight for chlorocalcite bedrock ore", 35);
bedrockChlorocalciteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.B14_bedrockChlorocalciteWeight", "Spawn weight for chlorocalcite bedrock ore", 35);
bedrockGlowstoneSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.BN00_bedrockGlowstoneWeight", "Spawn weight for glowstone bedrock ore", 100);
bedrockPhosphorusSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.BN01_bedrockPhosphorusWeight", "Spawn weight for phosphorus bedrock ore", 50);
ironClusterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.C00_ironClusterSpawn", "Amount of iron cluster veins per chunk", 4);
titaniumClusterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.C01_titaniumClusterSpawn", "Amount of titanium cluster veins per chunk", 2);

View File

@ -105,6 +105,10 @@ public class ArmorRecipes {
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dieselsuit_plate, 1), new Object[] { "W W", "CDC", "SWS", 'W', new ItemStack(Blocks.wool, 1, 14), 'S', STEEL.ingot(), 'C', ModItems.circuit_targeting_tier3, 'D', ModBlocks.machine_diesel });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dieselsuit_legs, 1), new Object[] { "M M", "S S", "W W", 'W', new ItemStack(Blocks.wool, 1, 14), 'S', STEEL.ingot(), 'M', ModItems.motor });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dieselsuit_boots, 1), new Object[] { "W W", "S S", 'W', new ItemStack(Blocks.wool, 1, 14), 'S', STEEL.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.envsuit_helmet, 1), new Object[] { "TCT", "TGT", "RRR", 'T', TI.plate(), 'C', ModItems.circuit_red_copper, 'G', KEY_ANYPANE, 'R', RUBBER.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.envsuit_plate, 1), new Object[] { "T T", "TCT", "RRR", 'T', TI.plate(), 'C', TI.plateCast(), 'R', RUBBER.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.envsuit_legs, 1), new Object[] { "TCT", "R R", "T T", 'T', TI.plate(), 'C', TI.plateCast(), 'R', RUBBER.ingot() });
CraftingManager.addRecipeAuto(new ItemStack(ModItems.envsuit_boots, 1), new Object[] { "R R", "T T", 'T', TI.plate(), 'R', RUBBER.ingot() });
//Bismuth fursui- I mean armor
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bismuth_helmet, 1), new Object[] { "GPP", "P ", "FPP", 'G', Items.gold_ingot, 'P', ModItems.plate_bismuth, 'F', ModItems.rag });

View File

@ -53,6 +53,7 @@ public class HazmatRegistry {
double t45 = 1D; // 90%
double ajr = 1.3D; // 95%
double bj = 1D; // 90%
double env = 2D; // 99%
double hev = 2.3D; // 99.5%
double rpa = 2D; // 99%
double fau = 4D; // 99.99%
@ -108,6 +109,11 @@ public class HazmatRegistry {
HazmatRegistry.registerHazmat(ModItems.steamsuit_legs, 1.3 * legs);
HazmatRegistry.registerHazmat(ModItems.steamsuit_boots, 1.3 * boots);
HazmatRegistry.registerHazmat(ModItems.envsuit_helmet, env * helmet);
HazmatRegistry.registerHazmat(ModItems.envsuit_plate, env * chest);
HazmatRegistry.registerHazmat(ModItems.envsuit_legs, env * legs);
HazmatRegistry.registerHazmat(ModItems.envsuit_boots, env * boots);
HazmatRegistry.registerHazmat(ModItems.hev_helmet, hev * helmet);
HazmatRegistry.registerHazmat(ModItems.hev_plate, hev * chest);
HazmatRegistry.registerHazmat(ModItems.hev_legs, hev * legs);

View File

@ -0,0 +1,208 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.recipes.CustomMachineRecipes;
import com.hbm.inventory.recipes.CustomMachineRecipes.CustomMachineRecipe;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.lib.RefStrings;
import com.hbm.util.ItemStackUtil;
import com.hbm.util.Tuple.Pair;
import codechicken.nei.NEIServerUtils;
import codechicken.nei.PositionedStack;
import codechicken.nei.recipe.TemplateRecipeHandler;
import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting;
public class CustomMachineHandler extends TemplateRecipeHandler {
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
public MachineConfiguration conf;
@Override
public TemplateRecipeHandler newInstance() { // brick by brick, suck my dick
try {
return new CustomMachineHandler(conf);
} catch(Exception e) {
throw new RuntimeException(e);
}
}
public CustomMachineHandler(MachineConfiguration conf) {
super();
this.conf = conf;
loadTransferRects();
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
}
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
List<PositionedStack> inputs = new ArrayList();
PositionedStack machine;
List<PositionedStack> outputs = new ArrayList();
public RecipeSet(CustomMachineRecipe recipe) {
for(int i = 0; i < 3; i++) if(recipe.inputFluids.length > i) inputs.add(new PositionedStack(ItemFluidIcon.make(recipe.inputFluids[i]), 12 + i * 18, 6));
for(int i = 0; i < 3; i++) if(recipe.inputItems.length > i) inputs.add(new PositionedStack(recipe.inputItems[i].extractForNEI(), 12 + i * 18, 24));
for(int i = 3; i < 6; i++) if(recipe.inputItems.length > i) inputs.add(new PositionedStack(recipe.inputItems[i].extractForNEI(), 12 + i * 18, 42));
for(int i = 0; i < 3; i++) if(recipe.outputFluids.length > i) outputs.add(new PositionedStack(ItemFluidIcon.make(recipe.outputFluids[i]), 102 + i * 18, 6));
for(int i = 0; i < 3; i++) if(recipe.outputItems.length > i) {
Pair<ItemStack, Float> pair = recipe.outputItems[i];
ItemStack out = pair.getKey();
if(pair.getValue() != 1) {
ItemStackUtil.addTooltipToStack(out, EnumChatFormatting.RED + "" + (((int)(pair.getValue() * 1000)) / 10D) + "%");
}
outputs.add(new PositionedStack(out, 102 + i * 18, 24));
}
for(int i = 3; i < 6; i++) if(recipe.outputItems.length > i) {
Pair<ItemStack, Float> pair = recipe.outputItems[i];
ItemStack out = pair.getKey();
if(pair.getValue() != 1) {
ItemStackUtil.addTooltipToStack(out, EnumChatFormatting.RED + "" + (((int)(pair.getValue() * 1000)) / 10D) + "%");
}
outputs.add(new PositionedStack(out, 102 + i * 18, 42));
}
this.machine = new PositionedStack(new ItemStack(ModBlocks.custom_machine, 1, 100 + CustomMachineConfigJSON.niceList.indexOf(conf)), 75, 42);
}
@Override
public List<PositionedStack> getIngredients() {
return getCycledIngredients(cycleticks / 20, inputs);
}
@Override
public PositionedStack getResult() {
return outputs.get(0);
}
@Override
public List<PositionedStack> getOtherStacks() {
List<PositionedStack> other = new ArrayList();
other.addAll(inputs);
other.add(machine);
other.addAll(outputs);
return getCycledIngredients(cycleticks / 20, other);
}
}
@Override
public String getRecipeName() {
return conf.localizedName;
}
@Override
public String getGuiTexture() {
return RefStrings.MODID + ":textures/gui/nei/gui_nei_custom.png";
}
@Override
public void loadCraftingRecipes(String outputId, Object... results) {
if(outputId.equals("ntm_" + conf.unlocalizedName)) {
List<CustomMachineRecipe> recipes = CustomMachineRecipes.recipes.get(conf.recipeKey);
if(recipes != null) for(CustomMachineRecipe recipe : recipes) {
this.arecipes.add(new RecipeSet(recipe));
}
} else {
super.loadCraftingRecipes(outputId, results);
}
}
@Override
public void loadCraftingRecipes(ItemStack result) {
List<CustomMachineRecipe> recipes = CustomMachineRecipes.recipes.get(conf.recipeKey);
System.out.println(conf.recipeKey);
if(recipes != null) outer:for(CustomMachineRecipe recipe : recipes) {
for(Pair<ItemStack, Float> stack : recipe.outputItems) {
if(NEIServerUtils.areStacksSameTypeCrafting(stack.getKey(), result)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
for(FluidStack fluid : recipe.outputFluids) {
ItemStack drop = ItemFluidIcon.make(fluid);
if(compareFluidStacks(result, drop)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
}
}
@Override
public void loadUsageRecipes(String inputId, Object... ingredients) {
if(inputId.equals("ntm_" + conf.unlocalizedName)) {
loadCraftingRecipes("ntm_" + conf.unlocalizedName, new Object[0]);
} else {
super.loadUsageRecipes(inputId, ingredients);
}
}
@Override
public void loadUsageRecipes(ItemStack ingredient) {
List<CustomMachineRecipe> recipes = CustomMachineRecipes.recipes.get(conf.recipeKey);
if(recipes != null) outer:for(CustomMachineRecipe recipe : recipes) {
for(AStack stack : recipe.inputItems) {
List<ItemStack> stacks = stack.extractForNEI();
for(ItemStack sta : stacks) {
if(NEIServerUtils.areStacksSameTypeCrafting(ingredient, sta)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
}
for(FluidStack fluid : recipe.inputFluids) {
ItemStack drop = ItemFluidIcon.make(fluid);
if(compareFluidStacks(ingredient, drop)) {
this.arecipes.add(new RecipeSet(recipe));
continue outer;
}
}
}
}
public static boolean compareFluidStacks(ItemStack sta1, ItemStack sta2) {
return sta1.getItem() == sta2.getItem() && sta1.getItemDamage() == sta2.getItemDamage();
}
@Override
public void loadTransferRects() {
if(this.conf == null) return;
transferRects.add(new RecipeTransferRect(new Rectangle(65, 23, 36, 18), "ntm_" + conf.unlocalizedName));
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
}
}

View File

@ -0,0 +1,27 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.gui.GUIElectrolyserFluid;
import com.hbm.inventory.recipes.ElectrolyserFluidRecipes;
public class ElectrolyserFluidHandler extends NEIUniversalHandler {
public ElectrolyserFluidHandler() {
super("Electrolysis", ModBlocks.machine_electrolyser, ElectrolyserFluidRecipes.getRecipes());
}
@Override
public String getKey() {
return "ntmElectrolysisFluid";
}
@Override
public void loadTransferRects() {
super.loadTransferRects();
transferRectsGui.add(new RecipeTransferRect(new Rectangle(57, 15, 12, 40), "ntmElectrolysisFluid"));
guiGui.add(GUIElectrolyserFluid.class);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
}

View File

@ -0,0 +1,27 @@
package com.hbm.handler.nei;
import java.awt.Rectangle;
import com.hbm.blocks.ModBlocks;
import com.hbm.inventory.gui.GUIElectrolyserMetal;
import com.hbm.inventory.recipes.ElectrolyserMetalRecipes;
public class ElectrolyserMetalHandler extends NEIUniversalHandler {
public ElectrolyserMetalHandler() {
super("Electrolysis", ModBlocks.machine_electrolyser, ElectrolyserMetalRecipes.getRecipes());
}
@Override
public String getKey() {
return "ntmElectrolysisMetal";
}
@Override
public void loadTransferRects() {
super.loadTransferRects();
transferRectsGui.add(new RecipeTransferRect(new Rectangle(2, 35, 22, 25), "ntmElectrolysisMetal"));
guiGui.add(GUIElectrolyserMetal.class);
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
}
}

View File

@ -1,12 +1,17 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotTakeOnly;
import com.hbm.items.ModItems;
import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.items.machine.ItemMachineUpgrade;
import com.hbm.tileentity.machine.TileEntityElectrolyser;
import api.hbm.energy.IBatteryItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerElectrolyserFluid extends Container {
@ -47,6 +52,48 @@ public class ContainerElectrolyserFluid extends Container {
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(par2 <= 13) {
if(!this.mergeItemStack(var5, 14, this.inventorySlots.size(), true)) {
return null;
}
} else {
if(var3.getItem() instanceof IBatteryItem || var3.getItem() == ModItems.battery_creative) {
if(!this.mergeItemStack(var5, 0, 1, false)) {
return null;
}
} else if(var3.getItem() instanceof ItemMachineUpgrade) {
if(!this.mergeItemStack(var5, 1, 3, false)) {
return null;
}
} else if(var3.getItem() instanceof IItemFluidIdentifier) {
if(!this.mergeItemStack(var5, 3, 4, false)) {
return null;
}
} else {
return null;
}
}
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
} else {
var4.onSlotChanged();
}
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return electrolyser.isUseableByPlayer(player);

View File

@ -0,0 +1,92 @@
package com.hbm.inventory.container;
import com.hbm.inventory.SlotCraftingOutput;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemMachineUpgrade;
import com.hbm.tileentity.machine.TileEntityElectrolyser;
import api.hbm.energy.IBatteryItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.Slot;
import net.minecraft.item.ItemStack;
public class ContainerElectrolyserMetal extends Container {
private TileEntityElectrolyser electrolyser;
public ContainerElectrolyserMetal(InventoryPlayer invPlayer, TileEntityElectrolyser tedf) {
electrolyser = tedf;
//Battery
this.addSlotToContainer(new Slot(tedf, 0, 186, 109));
//Upgrades
this.addSlotToContainer(new Slot(tedf, 1, 186, 140));
this.addSlotToContainer(new Slot(tedf, 2, 186, 158));
//Input
this.addSlotToContainer(new Slot(tedf, 14, 10, 22));
//Outputs
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 15, 136, 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 16, 154, 18));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 17, 136, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 18, 154, 36));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 19, 136, 54));
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, tedf, 20, 154, 54));
for(int i = 0; i < 3; i++) {
for(int j = 0; j < 9; j++) {
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
}
}
for(int i = 0; i < 9; i++) {
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 180));
}
}
@Override
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
ItemStack var3 = null;
Slot var4 = (Slot) this.inventorySlots.get(par2);
if(var4 != null && var4.getHasStack()) {
ItemStack var5 = var4.getStack();
var3 = var5.copy();
if(par2 <= 10) {
if(!this.mergeItemStack(var5, 11, this.inventorySlots.size(), true)) {
return null;
}
} else {
if(var3.getItem() instanceof IBatteryItem || var3.getItem() == ModItems.battery_creative) {
if(!this.mergeItemStack(var5, 0, 1, false)) {
return null;
}
} else if(var3.getItem() instanceof ItemMachineUpgrade) {
if(!this.mergeItemStack(var5, 1, 3, false)) {
return null;
}
} else {
if(!this.mergeItemStack(var5, 3, 4, false)) {
return null;
}
}
}
if(var5.stackSize == 0) {
var4.putStack((ItemStack) null);
} else {
var4.onSlotChanged();
}
}
return var3;
}
@Override
public boolean canInteractWith(EntityPlayer player) {
return electrolyser.isUseableByPlayer(player);
}
}

View File

@ -4,11 +4,15 @@ import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerElectrolyserFluid;
import com.hbm.lib.RefStrings;
import com.hbm.packet.NBTControlPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.machine.TileEntityElectrolyser;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.ResourceLocation;
public class GUIElectrolyserFluid extends GuiInfoContainer {
@ -37,6 +41,13 @@ public class GUIElectrolyserFluid extends GuiInfoContainer {
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 8 <= x && guiLeft + 8 + 54 > x && guiTop + 82 < y && guiTop + 82 + 12 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("sgm", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, electrolyser.xCoord, electrolyser.yCoord, electrolyser.zCoord));
}
}
@Override
@ -52,6 +63,15 @@ public class GUIElectrolyserFluid extends GuiInfoContainer {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
int p = (int) (electrolyser.power * 89 / electrolyser.maxPower);
drawTexturedModalRect(guiLeft + 186, guiTop + 107 - p, 210, 89 - p, 16, p);
if(electrolyser.power >= electrolyser.usage)
drawTexturedModalRect(guiLeft + 190, guiTop + 4, 226, 40, 9, 12);
int e = electrolyser.progressFluid * 41 / electrolyser.processFluidTime;
drawTexturedModalRect(guiLeft + 62, guiTop + 26, 226, 0, 12, e);
electrolyser.tanks[0].renderTank(guiLeft + 42, guiTop + 70, this.zLevel, 16, 52);
electrolyser.tanks[1].renderTank(guiLeft + 96, guiTop + 70, this.zLevel, 16, 52);

View File

@ -0,0 +1,110 @@
package com.hbm.inventory.gui;
import java.awt.Color;
import org.lwjgl.input.Keyboard;
import org.lwjgl.opengl.GL11;
import com.hbm.inventory.container.ContainerElectrolyserMetal;
import com.hbm.inventory.material.Mats;
import com.hbm.lib.RefStrings;
import com.hbm.packet.NBTControlPacket;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.machine.TileEntityElectrolyser;
import com.hbm.util.I18nUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.audio.PositionedSoundRecord;
import net.minecraft.client.resources.I18n;
import net.minecraft.entity.player.InventoryPlayer;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.ResourceLocation;
public class GUIElectrolyserMetal extends GuiInfoContainer {
public static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_electrolyser_metal.png");
private TileEntityElectrolyser electrolyser;
public GUIElectrolyserMetal(InventoryPlayer invPlayer, TileEntityElectrolyser electrolyser) {
super(new ContainerElectrolyserMetal(invPlayer, electrolyser));
this.electrolyser = electrolyser;
this.xSize = 210;
this.ySize = 204;
}
@Override
public void drawScreen(int mouseX, int mouseY, float f) {
super.drawScreen(mouseX, mouseY, f);
electrolyser.tanks[3].renderTankInfo(this, mouseX, mouseY, guiLeft + 36, guiTop + 18, 16, 52);
if(electrolyser.leftStack != null) {
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 58, guiTop + 18, 34, 42, mouseX, mouseY, EnumChatFormatting.YELLOW + I18nUtil.resolveKey(electrolyser.leftStack.material.getUnlocalizedName()) + ": " + Mats.formatAmount(electrolyser.leftStack.amount, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
} else {
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 58, guiTop + 18, 34, 42, mouseX, mouseY, EnumChatFormatting.RED + "Empty");
}
if(electrolyser.rightStack != null) {
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 96, guiTop + 18, 34, 42, mouseX, mouseY, EnumChatFormatting.YELLOW + I18nUtil.resolveKey(electrolyser.rightStack.material.getUnlocalizedName()) + ": " + Mats.formatAmount(electrolyser.rightStack.amount, Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)));
} else {
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 96, guiTop + 18, 34, 42, mouseX, mouseY, EnumChatFormatting.RED + "Empty");
}
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 186, guiTop + 18, 16, 89, electrolyser.power, electrolyser.maxPower);
}
protected void mouseClicked(int x, int y, int i) {
super.mouseClicked(x, y, i);
if(guiLeft + 8 <= x && guiLeft + 8 + 54 > x && guiTop + 82 < y && guiTop + 82 + 12 >= y) {
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
NBTTagCompound data = new NBTTagCompound();
data.setBoolean("sgf", true);
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, electrolyser.xCoord, electrolyser.yCoord, electrolyser.zCoord));
}
}
@Override
protected void drawGuiContainerForegroundLayer(int i, int j) {
String name = this.electrolyser.hasCustomInventoryName() ? this.electrolyser.getInventoryName() : I18n.format(this.electrolyser.getInventoryName());
this.fontRendererObj.drawString(name, (this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2) - 16, 7, 0xffffff);
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 94, 4210752);
}
@Override
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
if(electrolyser.leftStack != null) {
int p = electrolyser.leftStack.amount * 42 / electrolyser.maxMaterial;
Color color = new Color(electrolyser.leftStack.material.moltenColor);
GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
drawTexturedModalRect(guiLeft + 58, guiTop + 60 - p, 210, 131 - p, 34, p);
}
if(electrolyser.rightStack != null) {
int p = electrolyser.rightStack.amount * 42 / electrolyser.maxMaterial;
Color color = new Color(electrolyser.rightStack.material.moltenColor);
GL11.glColor3f(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F);
drawTexturedModalRect(guiLeft + 96, guiTop + 60 - p, 210, 131 - p, 34, p);
}
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
int p = (int) (electrolyser.power * 89 / electrolyser.maxPower);
drawTexturedModalRect(guiLeft + 186, guiTop + 107 - p, 210, 89 - p, 16, p);
if(electrolyser.power >= electrolyser.usage)
drawTexturedModalRect(guiLeft + 190, guiTop + 4, 226, 25, 9, 12);
int o = electrolyser.progressOre * 26 / electrolyser.processOreTime;
drawTexturedModalRect(guiLeft + 7, guiTop + 71 - o, 226, 25 - o, 22, o);
electrolyser.tanks[3].renderTank(guiLeft + 36, guiTop + 70, this.zLevel, 16, 52);
}
}

View File

@ -320,9 +320,11 @@ public class GUIRBMKConsole extends GuiScreen {
case FUEL_SIM:
if(col.data.hasKey("c_heat")) {
int fh = (int)Math.ceil((col.data.getDouble("c_heat") - 20) * 8 / col.data.getDouble("c_maxHeat"));
if(fh > 8) fh = 8;
drawTexturedModalRect(guiLeft + x + 1, guiTop + y + size - fh - 1, 11, 191 - fh, 2, fh);
int fe = (int)Math.ceil((col.data.getDouble("enrichment")) * 8);
if(fe > 8) fe = 8;
drawTexturedModalRect(guiLeft + x + 4, guiTop + y + size - fe - 1, 14, 191 - fe, 2, fe);
}
break;

View File

@ -399,15 +399,8 @@ public class ChemplantRecipes extends SerializableRecipe {
.inputFluids(new FluidStack(Fluids.MUSTARDGAS, 4000))
.outputItems(new ItemStack(ModItems.ammo_arty, 1, 11)));
recipes.add(new ChemRecipe(101, "CC_CENTRIFUGE", 200)
.inputFluids(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 500), new FluidStack(Fluids.WATER, 1_000))
.inputFluids(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 500), new FluidStack(Fluids.SULFURIC_ACID, 8_000))
.outputFluids(new FluidStack(Fluids.POTASSIUM_CHLORIDE, 250), new FluidStack(Fluids.CALCIUM_CHLORIDE, 250)));
recipes.add(new ChemRecipe(102, "PC_ELECTROLYSIS", 200)
.inputFluids(new FluidStack(Fluids.POTASSIUM_CHLORIDE, 250))
.outputItems(new ItemStack(ModItems.dust))
.outputFluids(new FluidStack(Fluids.CHLORINE, 125)));
recipes.add(new ChemRecipe(103, "CC_ELECTROLYSIS", 200)
.inputFluids(new FluidStack(Fluids.CALCIUM_CHLORIDE, 250))
.outputFluids(new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125)));
}
public static void registerFuelProcessing() {

View File

@ -0,0 +1,111 @@
package com.hbm.inventory.recipes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import net.minecraft.item.ItemStack;
public class ElectrolyserFluidRecipes extends SerializableRecipe {
public static HashMap<FluidType, ElectrolysisRecipe> recipes = new HashMap();
@Override
public void registerDefaults() {
recipes.put(Fluids.WATER, new ElectrolysisRecipe(1_000, new FluidStack(Fluids.HYDROGEN, 100), new FluidStack(Fluids.OXYGEN, 100)));
recipes.put(Fluids.HEAVYWATER, new ElectrolysisRecipe(1_000, new FluidStack(Fluids.DEUTERIUM, 50), new FluidStack(Fluids.OXYGEN, 50)));
recipes.put(Fluids.POTASSIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.NONE, 0), new ItemStack(ModItems.dust)));
recipes.put(Fluids.CALCIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125)));
}
public static HashMap getRecipes() {
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
for(Entry<FluidType, ElectrolysisRecipe> entry : ElectrolyserFluidRecipes.recipes.entrySet()) {
ElectrolysisRecipe recipe = entry.getValue();
FluidStack input = new FluidStack(entry.getKey(), recipe.amount);
List outputs = new ArrayList();
if(recipe.output1.type != Fluids.NONE) outputs.add(ItemFluidIcon.make(recipe.output1));
if(recipe.output2.type != Fluids.NONE) outputs.add(ItemFluidIcon.make(recipe.output2));
for(ItemStack byproduct : recipe.byproduct) outputs.add(byproduct);
recipes.put(new ComparableStack(ItemFluidIcon.make(input)), outputs.toArray());
}
return recipes;
}
@Override
public String getFileName() {
return "hbmElectrolyzerFluid.json";
}
@Override
public Object getRecipeObject() {
return recipes;
}
@Override
public void deleteRecipes() {
recipes.clear();
}
@Override
public void readRecipe(JsonElement recipe) {
JsonObject obj = (JsonObject) recipe;
FluidStack input = this.readFluidStack(obj.get("input").getAsJsonArray());
FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
ItemStack[] byproducts = new ItemStack[0];
if(obj.has("byproducts")) byproducts = this.readItemStackArray(obj.get("byproducts").getAsJsonArray());
recipes.put(input.type, new ElectrolysisRecipe(input.fill, output1, output2, byproducts));
}
@Override
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
Entry<FluidType, ElectrolysisRecipe> rec = (Entry) recipe;
writer.name("input"); this.writeFluidStack(new FluidStack(rec.getKey(), rec.getValue().amount), writer);
writer.name("output1"); this.writeFluidStack(rec.getValue().output1, writer);
writer.name("output2"); this.writeFluidStack(rec.getValue().output2, writer);
if(rec.getValue().byproduct != null && rec.getValue().byproduct.length > 0) {
writer.name("byproducts").beginArray();
for(ItemStack stack : rec.getValue().byproduct) this.writeItemStack(stack, writer);
writer.endArray();
}
}
public static class ElectrolysisRecipe {
public FluidStack output1;
public FluidStack output2;
public int amount;
public ItemStack[] byproduct;
public ElectrolysisRecipe(int amount, FluidStack output1, FluidStack output2, ItemStack... byproduct) {
this.output1 = output1;
this.output2 = output2;
this.amount = amount;
this.byproduct = byproduct;
}
}
}

View File

@ -0,0 +1,157 @@
package com.hbm.inventory.recipes;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map.Entry;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter;
import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.material.MaterialShapes;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.items.machine.ItemScraps;
import com.hbm.util.ItemStackUtil;
import net.minecraft.item.ItemStack;
public class ElectrolyserMetalRecipes extends SerializableRecipe {
public static HashMap<AStack, ElectrolysisMetalRecipe> recipes = new HashMap();
@Override
public void registerDefaults() {
recipes.put(new ComparableStack(ModItems.crystal_iron), new ElectrolysisMetalRecipe(
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(6)),
new MaterialStack(Mats.MAT_TITANIUM, MaterialShapes.INGOT.q(2)),
new ItemStack(ModItems.powder_lithium_tiny, 1)));
recipes.put(new ComparableStack(ModItems.crystal_gold), new ElectrolysisMetalRecipe(
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(6)),
new MaterialStack(Mats.MAT_LEAD, MaterialShapes.INGOT.q(2)),
new ItemStack(ModItems.powder_lithium_tiny, 1),
new ItemStack(ModItems.ingot_mercury, 1)));
}
public static ElectrolysisMetalRecipe getRecipe(ItemStack stack) {
ComparableStack comp = new ComparableStack(stack).makeSingular();
if(recipes.containsKey(comp)) return recipes.get(comp);
List<String> names = ItemStackUtil.getOreDictNames(stack);
for(String name : names) {
OreDictStack ore = new OreDictStack(name);
if(recipes.containsKey(ore)) return recipes.get(ore);
}
return null;
}
public static HashMap getRecipes() {
HashMap<Object[], Object[]> recipes = new HashMap<Object[], Object[]>();
for(Entry<AStack, ElectrolysisMetalRecipe> entry : ElectrolyserMetalRecipes.recipes.entrySet()) {
ElectrolysisMetalRecipe recipe = entry.getValue();
Object[] input = new Object[] { entry.getKey().copy(), new ComparableStack(ItemFluidIcon.make(Fluids.NITRIC_ACID, 100)) };
List outputs = new ArrayList();
if(recipe.output1 != null) outputs.add(ItemScraps.create(recipe.output1, true));
if(recipe.output2 != null) outputs.add(ItemScraps.create(recipe.output2, true));
for(ItemStack byproduct : recipe.byproduct) outputs.add(byproduct);
recipes.put(input, outputs.toArray());
}
return recipes;
}
@Override
public String getFileName() {
return "hbmElectrolyzerMetal.json";
}
@Override
public Object getRecipeObject() {
return recipes;
}
@Override
public void deleteRecipes() {
recipes.clear();
}
@Override
public void readRecipe(JsonElement recipe) {
JsonObject obj = (JsonObject) recipe;
AStack input = this.readAStack(obj.get("input").getAsJsonArray());
JsonArray out1 = obj.get("output1").getAsJsonArray();
String name1 = out1.get(0).getAsString();
int amount1 = out1.get(1).getAsInt();
MaterialStack output1 = new MaterialStack(Mats.matByName.get(name1), amount1);
JsonArray out2 = obj.get("output2").getAsJsonArray();
String name2 = out2.get(0).getAsString();
int amount2 = out2.get(1).getAsInt();
MaterialStack output2 = new MaterialStack(Mats.matByName.get(name2), amount2);
ItemStack[] byproducts = new ItemStack[0];
if(obj.has("byproducts")) byproducts = this.readItemStackArray(obj.get("byproducts").getAsJsonArray());
recipes.put(input, new ElectrolysisMetalRecipe(output1, output2, byproducts));
}
@Override
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
Entry<AStack, ElectrolysisMetalRecipe> rec = (Entry) recipe;
writer.name("input"); this.writeAStack(rec.getKey(), writer);
writer.name("output1");
writer.beginArray();
writer.setIndent("");
writer.value(rec.getValue().output1.material.names[0]).value(rec.getValue().output1.amount);
writer.endArray();
writer.setIndent(" ");
writer.name("output2");
writer.beginArray();
writer.setIndent("");
writer.value(rec.getValue().output2.material.names[0]).value(rec.getValue().output2.amount);
writer.endArray();
writer.setIndent(" ");
if(rec.getValue().byproduct != null && rec.getValue().byproduct.length > 0) {
writer.name("byproducts").beginArray();
for(ItemStack stack : rec.getValue().byproduct) this.writeItemStack(stack, writer);
writer.endArray();
}
}
public static class ElectrolysisMetalRecipe {
public MaterialStack output1;
public MaterialStack output2;
public ItemStack[] byproduct;
public ElectrolysisMetalRecipe(MaterialStack output1, MaterialStack output2, ItemStack... byproduct) {
this.output1 = output1;
this.output2 = output2;
this.byproduct = byproduct;
}
}
}

View File

@ -79,7 +79,7 @@ public class MixerRecipes extends SerializableRecipe {
register(Fluids.CHLOROCALCITE_SOLUTION, new MixerRecipe(500, 50).setStack1(new FluidStack(Fluids.WATER, 250)).setStack2(new FluidStack(Fluids.NITRIC_ACID, 250)).setSolid(new OreDictStack(CHLOROCALCITE.dust())));
register(Fluids.CHLOROCALCITE_MIX, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.CHLOROCALCITE_SOLUTION, 500)).setStack2(new FluidStack(Fluids.SULFURIC_ACID, 500)));
register(Fluids.CHLOROCALCITE_MIX, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.CHLOROCALCITE_SOLUTION, 500)).setStack2(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new ComparableStack(ModItems.powder_flux)));
}
public static void register(FluidType type, MixerRecipe... rec) {

View File

@ -62,6 +62,9 @@ public abstract class SerializableRecipe {
recipeHandlers.add(new MixerRecipes());
recipeHandlers.add(new OutgasserRecipes());
recipeHandlers.add(new CompressorRecipes());
recipeHandlers.add(new ElectrolyserFluidRecipes());
recipeHandlers.add(new ElectrolyserMetalRecipes());
recipeHandlers.add(new MatDistribution());
recipeHandlers.add(new CustomMachineRecipes());
}

View File

@ -1968,6 +1968,10 @@ public class ModItems {
public static Item bj_plate_jetpack;
public static Item bj_legs;
public static Item bj_boots;
public static Item envsuit_helmet;
public static Item envsuit_plate;
public static Item envsuit_legs;
public static Item envsuit_boots;
public static Item hev_helmet;
public static Item hev_plate;
public static Item hev_legs;
@ -4860,6 +4864,20 @@ public class ModItems {
bj_legs = new ArmorBJ(aMatBJ, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs");
bj_boots = new ArmorBJ(aMatBJ, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_boots").setTextureName(RefStrings.MODID + ":bj_boots");
ArmorMaterial aMatEnv = EnumHelper.addArmorMaterial("HBM_ENV", 150, new int[] { 3, 8, 6, 3 }, 100);
aMatEnv.customCraftingMaterial = ModItems.plate_armor_hev;
envsuit_helmet = new ArmorEnvsuit(aMatEnv, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 100_000, 1_000, 250, 0).setMod(0.5F).setThreshold(2.0F)
.addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 1))
.addEffect(new PotionEffect(Potion.jump.id, 20, 0))
.addResistance("fall", 0.25F)
.addResistance("monoxide", 0F)
.addResistance("onFire", 0F)
.hides(EnumPlayerPart.HAT)
.setUnlocalizedName("envsuit_helmet").setTextureName(RefStrings.MODID + ":envsuit_helmet");
envsuit_plate = new ArmorEnvsuit(aMatEnv, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 100_000, 1_000, 250, 0).cloneStats((ArmorFSB) envsuit_helmet).setUnlocalizedName("envsuit_plate").setTextureName(RefStrings.MODID + ":envsuit_plate");
envsuit_legs = new ArmorEnvsuit(aMatEnv, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 100_000, 1_000, 250, 0).cloneStats((ArmorFSB) envsuit_helmet).setUnlocalizedName("envsuit_legs").setTextureName(RefStrings.MODID + ":envsuit_legs");
envsuit_boots = new ArmorEnvsuit(aMatEnv, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 100_000, 1_000, 250, 0).cloneStats((ArmorFSB) envsuit_helmet).setUnlocalizedName("envsuit_boots").setTextureName(RefStrings.MODID + ":envsuit_boots");
ArmorMaterial aMatHEV = EnumHelper.addArmorMaterial("HBM_HEV", 150, new int[] { 3, 8, 6, 3 }, 100);
aMatHEV.customCraftingMaterial = ModItems.plate_armor_hev;
hev_helmet = new ArmorHEV(aMatHEV, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).setMod(0.20F).setCap(4.0F).setThreshold(2.0F)
@ -7792,6 +7810,10 @@ public class ModItems {
GameRegistry.registerItem(bj_plate_jetpack, bj_plate_jetpack.getUnlocalizedName());
GameRegistry.registerItem(bj_legs, bj_legs.getUnlocalizedName());
GameRegistry.registerItem(bj_boots, bj_boots.getUnlocalizedName());
GameRegistry.registerItem(envsuit_helmet, envsuit_helmet.getUnlocalizedName());
GameRegistry.registerItem(envsuit_plate, envsuit_plate.getUnlocalizedName());
GameRegistry.registerItem(envsuit_legs, envsuit_legs.getUnlocalizedName());
GameRegistry.registerItem(envsuit_boots, envsuit_boots.getUnlocalizedName());
GameRegistry.registerItem(hev_helmet, hev_helmet.getUnlocalizedName());
GameRegistry.registerItem(hev_plate, hev_plate.getUnlocalizedName());
GameRegistry.registerItem(hev_legs, hev_legs.getUnlocalizedName());

View File

@ -0,0 +1,87 @@
package com.hbm.items.armor;
import java.util.UUID;
import com.google.common.collect.Multimap;
import com.hbm.items.ModItems;
import com.hbm.render.model.ModelArmorEnvsuit;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBiped;
import net.minecraft.entity.EntityLivingBase;
import net.minecraft.entity.SharedMonsterAttributes;
import net.minecraft.entity.ai.attributes.AttributeModifier;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import net.minecraft.potion.Potion;
import net.minecraft.potion.PotionEffect;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
public class ArmorEnvsuit extends ArmorFSBPowered {
public ArmorEnvsuit(ArmorMaterial material, int slot, String texture, long maxPower, long chargeRate, long consumption, long drain) {
super(material, slot, texture, maxPower, chargeRate, consumption, drain);
}
@SideOnly(Side.CLIENT)
ModelArmorEnvsuit[] models;
@Override
@SideOnly(Side.CLIENT)
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
if(models == null) {
models = new ModelArmorEnvsuit[4];
for(int i = 0; i < 4; i++)
models[i] = new ModelArmorEnvsuit(i);
}
return models[armorSlot];
}
private static final UUID speed = UUID.fromString("6ab858ba-d712-485c-bae9-e5e765fc555a");
@Override
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
super.onArmorTick(world, player, stack);
if(this != ModItems.envsuit_plate)
return;
/// SPEED ///
Multimap multimap = super.getAttributeModifiers(stack);
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "SQUIRREL SPEED", 0.1, 0));
player.getAttributeMap().removeAttributeModifiers(multimap);
if(this.hasFSBArmor(player)) {
if(player.isSprinting()) player.getAttributeMap().applyAttributeModifiers(multimap);
if(player.isInWater()) {
if(!world.isRemote) {
player.setAir(300);
player.addPotionEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0));
}
double mo = 0.1 * player.moveForward;
Vec3 vec = player.getLookVec();
vec.xCoord *= mo;
vec.yCoord *= mo;
vec.zCoord *= mo;
player.motionX += vec.xCoord;
player.motionY += vec.yCoord;
player.motionZ += vec.zCoord;
} else {
if(!world.isRemote) {
player.removePotionEffect(Potion.nightVision.id);
}
}
}
}
}

View File

@ -12,7 +12,6 @@ import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.Item;
import net.minecraft.item.ItemBlock;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
public class ItemCustomMachine extends ItemBlock {
@ -24,10 +23,7 @@ public class ItemCustomMachine extends ItemBlock {
public void getSubItems(Item item, CreativeTabs tab, List list) {
for(int i = 0; i < CustomMachineConfigJSON.niceList.size(); i++) {
MachineConfiguration conf = CustomMachineConfigJSON.niceList.get(i);
ItemStack stack = new ItemStack(item, 1, i + 100);
stack.stackTagCompound = new NBTTagCompound();
stack.stackTagCompound.setString("machineType", conf.unlocalizedName);
list.add(stack);
}
}
@ -35,15 +31,14 @@ public class ItemCustomMachine extends ItemBlock {
@Override
public String getItemStackDisplayName(ItemStack stack) {
if(stack.hasTagCompound()) {
String name = stack.getTagCompound().getString("machineType");
MachineConfiguration conf = CustomMachineConfigJSON.customMachines.get(name);
int id = stack.getItemDamage() - 100;
if(id >= 0 && id < CustomMachineConfigJSON.customMachines.size()) {
MachineConfiguration conf = CustomMachineConfigJSON.niceList.get(id);
if(conf != null) {
return conf.localizedName;
}
return "INVALID MACHINE CONTROLLER (" + name + ")";
}
return "INVALID MACHINE CONTROLLER";

View File

@ -12,6 +12,7 @@ import com.hbm.items.ModItems;
import com.hbm.lib.ModDamageSource;
import com.hbm.main.MainRegistry;
import api.hbm.energy.IBatteryItem;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
import net.minecraft.item.Item;
@ -21,7 +22,7 @@ import net.minecraft.potion.PotionEffect;
import net.minecraft.util.ChatComponentText;
import net.minecraft.world.World;
public class ItemGlitch extends Item {
public class ItemGlitch extends Item implements IBatteryItem {
public ItemGlitch()
{
@ -235,4 +236,12 @@ public class ItemGlitch extends Item {
}
}
@Override public void chargeBattery(ItemStack stack, long i) { }
@Override public void setCharge(ItemStack stack, long i) { }
@Override public void dischargeBattery(ItemStack stack, long i) { }
@Override public long getCharge(ItemStack stack) { return 200; }
@Override public long getMaxCharge() { return 200; }
@Override public long getChargeRate() { return 0; }
@Override public long getDischargeRate() { return 200; }
}

View File

@ -41,58 +41,60 @@ public class ItemPowerNetTool extends Item {
TileEntity te = world.getTileEntity(x, y, z);
if(!(te instanceof IEnergyConductor))
return false;
if(world.isRemote)
return true;
IEnergyConductor con = (IEnergyConductor) te;
IPowerNet net = con.getPowerNet();
if(net == null) {
player.addChatComponentMessage(ChatBuilder.start("Error: No network found! This should be impossible!").color(EnumChatFormatting.RED).flush());
if((te instanceof IEnergyConductor)) {
IEnergyConductor con = (IEnergyConductor) te;
IPowerNet net = con.getPowerNet();
if(net == null) {
player.addChatComponentMessage(ChatBuilder.start("Error: No network found! This should be impossible!").color(EnumChatFormatting.RED).flush());
return true;
}
if(!(net instanceof PowerNet)) {
player.addChatComponentMessage(ChatBuilder.start("Error: Cannot print diagnostic for non-standard power net implementation!").color(EnumChatFormatting.RED).flush());
}
PowerNet network = (PowerNet) net;
String id = Integer.toHexString(net.hashCode());
player.addChatComponentMessage(ChatBuilder.start("Start of diagnostic for network " + id).color(EnumChatFormatting.GOLD).flush());
player.addChatComponentMessage(ChatBuilder.start("Links: " + network.getLinks().size()).color(EnumChatFormatting.YELLOW).flush());
player.addChatComponentMessage(ChatBuilder.start("Proxies: " + network.getProxies().size()).color(EnumChatFormatting.YELLOW).flush());
player.addChatComponentMessage(ChatBuilder.start("Subscribers: " + network.getSubscribers().size()).color(EnumChatFormatting.YELLOW).flush());
player.addChatComponentMessage(ChatBuilder.start("End of diagnostic for network " + id).color(EnumChatFormatting.GOLD).flush());
for(IEnergyConductor link : network.getLinks()) {
Vec3 pos = link.getDebugParticlePos();
boolean errored = link.getPowerNet() != net;
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "debug");
data.setInteger("color", errored ? 0xff0000 : 0xffff00);
data.setFloat("scale", 0.5F);
data.setString("text", id);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, radius));
}
for(IEnergyConnector subscriber : network.getSubscribers()) {
Vec3 pos = subscriber.getDebugParticlePos();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "debug");
data.setInteger("color", 0x0000ff);
data.setFloat("scale", 1.5F);
data.setString("text", id);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, radius));
}
return true;
}
if(!(net instanceof PowerNet)) {
player.addChatComponentMessage(ChatBuilder.start("Error: Cannot print diagnostic for non-standard power net implementation!").color(EnumChatFormatting.RED).flush());
}
PowerNet network = (PowerNet) net;
String id = Integer.toHexString(net.hashCode());
player.addChatComponentMessage(ChatBuilder.start("Start of diagnostic for network " + id).color(EnumChatFormatting.GOLD).flush());
player.addChatComponentMessage(ChatBuilder.start("Links: " + network.getLinks().size()).color(EnumChatFormatting.YELLOW).flush());
player.addChatComponentMessage(ChatBuilder.start("Proxies: " + network.getProxies().size()).color(EnumChatFormatting.YELLOW).flush());
player.addChatComponentMessage(ChatBuilder.start("Subscribers: " + network.getSubscribers().size()).color(EnumChatFormatting.YELLOW).flush());
player.addChatComponentMessage(ChatBuilder.start("End of diagnostic for network " + id).color(EnumChatFormatting.GOLD).flush());
for(IEnergyConductor link : network.getLinks()) {
Vec3 pos = link.getDebugParticlePos();
boolean errored = link.getPowerNet() != net;
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "debug");
data.setInteger("color", errored ? 0xff0000 : 0xffff00);
data.setFloat("scale", 0.5F);
data.setString("text", id);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, radius));
}
for(IEnergyConnector subscriber : network.getSubscribers()) {
Vec3 pos = subscriber.getDebugParticlePos();
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "debug");
data.setInteger("color", 0x0000ff);
data.setFloat("scale", 1.5F);
data.setString("text", id);
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, radius));
}
return true;
return false;
}
private static final int radius = 20;

View File

@ -116,14 +116,15 @@ public class HbmWorldGen implements IWorldGenerator {
if(WorldConfig.alexandriteSpawn > 0 && rand.nextInt(WorldConfig.alexandriteSpawn) == 0)
DungeonToolbox.generateOre(world, rand, i, j, 1, 3, 10, 5, ModBlocks.ore_alexandrite);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_tungsten, rand, 32);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_cinnebar, rand, 16);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_zirconium, rand, 16);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_borax, rand, 16);
if(WorldConfig.overworldOre) {
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_iron, rand, 24);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_titanium, rand, 32);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.6D, ModBlocks.cluster_depth_tungsten, rand, 32);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_cinnebar, rand, 16);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_zirconium, rand, 16);
DepthDeposit.generateConditionOverworld(world, i, 0, 3, j, 5, 0.8D, ModBlocks.ore_depth_borax, rand, 16);
DungeonToolbox.generateOre(world, rand, i, j, 25, 6, 30, 10, ModBlocks.ore_gneiss_iron, ModBlocks.stone_gneiss);
DungeonToolbox.generateOre(world, rand, i, j, 10, 6, 30, 10, ModBlocks.ore_gneiss_gold, ModBlocks.stone_gneiss);
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.uraniumSpawn * 3, 6, 30, 10, ModBlocks.ore_gneiss_uranium, ModBlocks.stone_gneiss);
@ -721,10 +722,18 @@ public class HbmWorldGen implements IWorldGenerator {
if(GeneralConfig.enablePlutoniumOre)
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.netherPlutoniumSpawn, 4, 0, 127, ModBlocks.ore_nether_plutonium, Blocks.netherrack);
}
if(rand.nextInt(10) == 0) {
WeightedRandomGeneric<BedrockOreDefinition> item = (WeightedRandomGeneric<BedrockOreDefinition>) WeightedRandom.getRandomItem(rand, BedrockOre.weightedOresNether);
BedrockOreDefinition def = item.get();
int randPosX = i + rand.nextInt(2) + 8;
int randPosZ = j + rand.nextInt(2) + 8;
BedrockOre.generate(world, randPosX, randPosZ, def.stack, def.acid, def.color, def.tier, ModBlocks.stone_depth_nether);
}
DepthDeposit.generateConditionNether(world, i, 0, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
DepthDeposit.generateConditionNether(world, i, 125, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
DepthDeposit.generateConditionNether(world, i, 0, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
DepthDeposit.generateConditionNether(world, i, 125, 3, j, 7, 0.6D, ModBlocks.ore_depth_nether_neodymium, rand, 16);
}
for(int k = 0; k < 30; k++){
int x = i + rand.nextInt(16);

View File

@ -4,6 +4,8 @@ import java.util.List;
import com.hbm.blocks.ModBlocks;
import com.hbm.blocks.generic.BlockMotherOfAllOres.TileEntityRandomOre;
import com.hbm.config.CustomMachineConfigJSON;
import com.hbm.config.CustomMachineConfigJSON.MachineConfiguration;
import com.hbm.config.VersatileConfig;
import com.hbm.handler.nei.*;
import com.hbm.items.ModItems;
@ -14,6 +16,8 @@ import codechicken.nei.api.API;
import codechicken.nei.api.IConfigureNEI;
import codechicken.nei.api.IHighlightHandler;
import codechicken.nei.api.ItemInfo.Layout;
import codechicken.nei.recipe.GuiCraftingRecipe;
import codechicken.nei.recipe.GuiUsageRecipe;
import codechicken.nei.recipe.ICraftingHandler;
import codechicken.nei.recipe.IUsageHandler;
import net.minecraft.entity.player.EntityPlayer;
@ -69,6 +73,10 @@ public class NEIConfig implements IConfigureNEI {
registerHandler(new SawmillHandler());
registerHandler(new MixerHandler());
registerHandler(new OutgasserHandler());
registerHandler(new ElectrolyserFluidHandler());
registerHandler(new ElectrolyserMetalHandler());
for(MachineConfiguration conf : CustomMachineConfigJSON.niceList) registerHandlerBypass(new CustomMachineHandler(conf));
//fluids
registerHandler(new FluidRecipeHandler());
@ -153,6 +161,12 @@ public class NEIConfig implements IConfigureNEI {
API.registerRecipeHandler((ICraftingHandler) o);
API.registerUsageHandler((IUsageHandler) o);
}
/** Bypasses the utterly useless restriction of one registered handler per class */
public static void registerHandlerBypass(Object o) {
GuiCraftingRecipe.craftinghandlers.add((ICraftingHandler) o);
GuiUsageRecipe.usagehandlers.add((IUsageHandler) o);
}
@Override
public String getName() {

View File

@ -775,6 +775,7 @@ public class ResourceManager {
public static final IModelCustom armor_wings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/murk.obj"));
public static final IModelCustom armor_solstice = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/solstice.obj"));
public static final IModelCustom player_manly_af = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/armor/player_fem.obj"));
public static final IModelCustom armor_envsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/envsuit.obj"));
////Texture Items
@ -873,6 +874,12 @@ public class ResourceManager {
public static final ResourceLocation bj_jetpack = new ResourceLocation(RefStrings.MODID, "textures/armor/bj_jetpack.png");
public static final ResourceLocation bj_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/bj_arm.png");
public static final ResourceLocation envsuit_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/envsuit_helmet.png");
public static final ResourceLocation envsuit_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/envsuit_leg.png");
public static final ResourceLocation envsuit_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/envsuit_chest.png");
public static final ResourceLocation envsuit_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/envsuit_arm.png");
public static final ResourceLocation envsuit_tail = new ResourceLocation(RefStrings.MODID, "textures/armor/envsuit_tail.png");
public static final ResourceLocation hev_helmet = new ResourceLocation(RefStrings.MODID, "textures/armor/hev_helmet.png");
public static final ResourceLocation hev_leg = new ResourceLocation(RefStrings.MODID, "textures/armor/hev_leg.png");
public static final ResourceLocation hev_chest = new ResourceLocation(RefStrings.MODID, "textures/armor/hev_chest.png");

View File

@ -1191,17 +1191,6 @@ public class ItemRenderLibrary {
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.machine_electrolyser), new ItemRenderBase( ) {
public void renderInventory() {
GL11.glScaled(3, 3, 3);
}
public void renderCommon() {
GL11.glScaled(0.5, 0.5, 0.5);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.electrolyser_tex); ResourceManager.electrolyser.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}});
renderers.put(Item.getItemFromBlock(ModBlocks.red_pylon_large), new ItemRenderBase( ) {
public void renderInventory() {
GL11.glTranslated(0, -5, 0);

View File

@ -12,6 +12,9 @@ public class ModelRendererObj {
public float rotationPointX;
public float rotationPointY;
public float rotationPointZ;
public float originPointX;
public float originPointY;
public float originPointZ;
public float rotateAngleX;
public float rotateAngleY;
public float rotateAngleZ;
@ -35,9 +38,9 @@ public class ModelRendererObj {
}
public ModelRendererObj setRotationPoint(float x, float y, float z) {
this.rotationPointX = x;
this.rotationPointY = y;
this.rotationPointZ = z;
this.originPointX = this.rotationPointX = x;
this.originPointY = this.rotationPointY = y;
this.originPointZ = this.rotationPointZ = z;
return this;
}
@ -90,7 +93,7 @@ public class ModelRendererObj {
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
}
GL11.glTranslatef(-this.rotationPointX * scale, -this.rotationPointY * scale, -this.rotationPointZ * scale);
GL11.glTranslatef(-this.rotationPointX * scale, -this.rotationPointY * scale, -this.originPointZ * scale); //yes, that is correct
GL11.glScalef(scale, scale, scale);

View File

@ -0,0 +1,172 @@
package com.hbm.render.loader;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.model.ModelBase;
import net.minecraft.client.model.ModelBox;
import net.minecraft.client.model.ModelRenderer;
import net.minecraft.client.renderer.GLAllocation;
import net.minecraft.client.renderer.Tessellator;
public class ModelRendererTest extends ModelRenderer {
//TODO: blow up mojank HQ with a JDAM
private boolean compiled;
private int displayList;
public ModelRendererTest(ModelBase p_i1173_1_) {
super(p_i1173_1_);
}
public ModelRendererTest(ModelBase p_i1174_1_, int p_i1174_2_, int p_i1174_3_) {
this(p_i1174_1_);
this.setTextureOffset(p_i1174_2_, p_i1174_3_);
}
@SideOnly(Side.CLIENT)
public void render(float p_78785_1_) {
if(!this.isHidden) {
if(this.showModel) {
if(!this.compiled) {
this.compileDisplayList(p_78785_1_);
}
GL11.glTranslatef(this.offsetX, this.offsetY, this.offsetZ);
int i;
if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if(this.rotationPointX == 0.0F && this.rotationPointY == 0.0F && this.rotationPointZ == 0.0F) {
GL11.glCallList(this.displayList);
if(this.childModels != null) {
for(i = 0; i < this.childModels.size(); ++i) {
((ModelRenderer) this.childModels.get(i)).render(p_78785_1_);
}
}
} else {
GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_);
GL11.glCallList(this.displayList);
if(this.childModels != null) {
for(i = 0; i < this.childModels.size(); ++i) {
((ModelRenderer) this.childModels.get(i)).render(p_78785_1_);
}
}
GL11.glTranslatef(-this.rotationPointX * p_78785_1_, -this.rotationPointY * p_78785_1_, -this.rotationPointZ * p_78785_1_);
}
} else {
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * p_78785_1_, this.rotationPointY * p_78785_1_, this.rotationPointZ * p_78785_1_);
if(this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
}
if(this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
}
if(this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
}
GL11.glPushMatrix();
GL11.glScaled(0.1, 0.1, 0.1);
ResourceManager.chemplant_body.renderAll();
GL11.glPopMatrix();
//GL11.glCallList(this.displayList);
if(this.childModels != null) {
for(i = 0; i < this.childModels.size(); ++i) {
((ModelRenderer) this.childModels.get(i)).render(p_78785_1_);
}
}
GL11.glPopMatrix();
}
GL11.glTranslatef(-this.offsetX, -this.offsetY, -this.offsetZ);
}
}
}
@SideOnly(Side.CLIENT)
public void renderWithRotation(float p_78791_1_) {
if(!this.isHidden) {
if(this.showModel) {
if(!this.compiled) {
this.compileDisplayList(p_78791_1_);
}
GL11.glPushMatrix();
GL11.glTranslatef(this.rotationPointX * p_78791_1_, this.rotationPointY * p_78791_1_, this.rotationPointZ * p_78791_1_);
if(this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
}
if(this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
}
if(this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
}
GL11.glCallList(this.displayList);
GL11.glPopMatrix();
}
}
}
@SideOnly(Side.CLIENT)
public void postRender(float p_78794_1_) {
if(!this.isHidden) {
if(this.showModel) {
if(!this.compiled) {
this.compileDisplayList(p_78794_1_);
}
if(this.rotateAngleX == 0.0F && this.rotateAngleY == 0.0F && this.rotateAngleZ == 0.0F) {
if(this.rotationPointX != 0.0F || this.rotationPointY != 0.0F || this.rotationPointZ != 0.0F) {
GL11.glTranslatef(this.rotationPointX * p_78794_1_, this.rotationPointY * p_78794_1_, this.rotationPointZ * p_78794_1_);
}
} else {
GL11.glTranslatef(this.rotationPointX * p_78794_1_, this.rotationPointY * p_78794_1_, this.rotationPointZ * p_78794_1_);
if(this.rotateAngleZ != 0.0F) {
GL11.glRotatef(this.rotateAngleZ * (180F / (float) Math.PI), 0.0F, 0.0F, 1.0F);
}
if(this.rotateAngleY != 0.0F) {
GL11.glRotatef(this.rotateAngleY * (180F / (float) Math.PI), 0.0F, 1.0F, 0.0F);
}
if(this.rotateAngleX != 0.0F) {
GL11.glRotatef(this.rotateAngleX * (180F / (float) Math.PI), 1.0F, 0.0F, 0.0F);
}
}
}
}
}
@SideOnly(Side.CLIENT)
private void compileDisplayList(float p_78788_1_) {
this.displayList = GLAllocation.generateDisplayLists(1);
GL11.glNewList(this.displayList, GL11.GL_COMPILE);
Tessellator tessellator = Tessellator.instance;
for(int i = 0; i < this.cubeList.size(); ++i) {
((ModelBox) this.cubeList.get(i)).render(tessellator, p_78788_1_);
}
GL11.glEndList();
this.compiled = true;
}
}

View File

@ -39,16 +39,17 @@ public class ModelArmorBase extends ModelBiped {
rightFoot = new ModelRendererObj(null).setRotationPoint(-1.9F, 12.0F, 0.0F);
}
public void setRotationAngles(float p_78087_1_, float p_78087_2_, float p_78087_3_, float p_78087_4_, float p_78087_5_, float p_78087_6_, Entity entity) {
public void setRotationAngles(float walkCycle, float walkAmplitude, float idleCycle, float headYaw, float headPitch, float scale, Entity entity) {
//super.setRotationAngles(walkCycle, walkAmplitude, idleCycle, headYaw, headPitch, scale, entity);
head.rotateAngleY = p_78087_4_ / (180F / (float) Math.PI);
head.rotateAngleX = p_78087_5_ / (180F / (float) Math.PI);
rightArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 2.0F * p_78087_2_ * 0.5F;
leftArm.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 2.0F * p_78087_2_ * 0.5F;
head.rotateAngleY = headYaw / (180F / (float) Math.PI);
head.rotateAngleX = headPitch / (180F / (float) Math.PI);
rightArm.rotateAngleX = MathHelper.cos(walkCycle * 0.6662F + (float) Math.PI) * 2.0F * walkAmplitude * 0.5F;
leftArm.rotateAngleX = MathHelper.cos(walkCycle * 0.6662F) * 2.0F * walkAmplitude * 0.5F;
rightArm.rotateAngleZ = 0.0F;
leftArm.rotateAngleZ = 0.0F;
rightFoot.rotateAngleX = rightLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F) * 1.4F * p_78087_2_;
leftFoot.rotateAngleX = leftLeg.rotateAngleX = MathHelper.cos(p_78087_1_ * 0.6662F + (float) Math.PI) * 1.4F * p_78087_2_;
rightFoot.rotateAngleX = rightLeg.rotateAngleX = MathHelper.cos(walkCycle * 0.6662F) * 1.4F * walkAmplitude;
leftFoot.rotateAngleX = leftLeg.rotateAngleX = MathHelper.cos(walkCycle * 0.6662F + (float) Math.PI) * 1.4F * walkAmplitude;
rightFoot.rotateAngleY = rightLeg.rotateAngleY = 0.0F;
leftFoot.rotateAngleY = leftLeg.rotateAngleY = 0.0F;
@ -143,10 +144,10 @@ public class ModelArmorBase extends ModelBiped {
head.offsetY = 0.0F;
}
rightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
leftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
rightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
leftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
rightArm.rotateAngleZ += MathHelper.cos(idleCycle * 0.09F) * 0.05F + 0.05F;
leftArm.rotateAngleZ -= MathHelper.cos(idleCycle * 0.09F) * 0.05F + 0.05F;
rightArm.rotateAngleX += MathHelper.sin(idleCycle * 0.067F) * 0.05F;
leftArm.rotateAngleX -= MathHelper.sin(idleCycle * 0.067F) * 0.05F;
if(this.aimedBow) {
f6 = 0.0F;
@ -159,10 +160,10 @@ public class ModelArmorBase extends ModelBiped {
leftArm.rotateAngleX = -((float) Math.PI / 2F) + head.rotateAngleX;
rightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
leftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
rightArm.rotateAngleZ += MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
leftArm.rotateAngleZ -= MathHelper.cos(p_78087_3_ * 0.09F) * 0.05F + 0.05F;
rightArm.rotateAngleX += MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
leftArm.rotateAngleX -= MathHelper.sin(p_78087_3_ * 0.067F) * 0.05F;
rightArm.rotateAngleZ += MathHelper.cos(idleCycle * 0.09F) * 0.05F + 0.05F;
leftArm.rotateAngleZ -= MathHelper.cos(idleCycle * 0.09F) * 0.05F + 0.05F;
rightArm.rotateAngleX += MathHelper.sin(idleCycle * 0.067F) * 0.05F;
leftArm.rotateAngleX -= MathHelper.sin(idleCycle * 0.067F) * 0.05F;
}
}

View File

@ -0,0 +1,80 @@
package com.hbm.render.model;
import org.lwjgl.opengl.GL11;
import com.hbm.main.ResourceManager;
import com.hbm.render.loader.ModelRendererObj;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.OpenGlHelper;
import net.minecraft.entity.Entity;
public class ModelArmorEnvsuit extends ModelArmorBase {
ModelRendererObj lamps;
public ModelArmorEnvsuit(int type) {
super(type);
head = new ModelRendererObj(ResourceManager.armor_envsuit, "Helmet");
lamps = new ModelRendererObj(ResourceManager.armor_envsuit, "Lamps");
body = new ModelRendererObj(ResourceManager.armor_envsuit, "Chest");
leftArm = new ModelRendererObj(ResourceManager.armor_envsuit, "LeftArm").setRotationPoint(-5.0F, 2.0F, 0.0F);
rightArm = new ModelRendererObj(ResourceManager.armor_envsuit, "RightArm").setRotationPoint(5.0F, 2.0F, 0.0F);
leftLeg = new ModelRendererObj(ResourceManager.armor_envsuit, "LeftLeg").setRotationPoint(1.9F, 12.0F, 0.0F);
rightLeg = new ModelRendererObj(ResourceManager.armor_envsuit, "RightLeg").setRotationPoint(-1.9F, 12.0F, 0.0F);
leftFoot = new ModelRendererObj(ResourceManager.armor_envsuit, "LeftFoot").setRotationPoint(1.9F, 12.0F, 0.0F);
rightFoot = new ModelRendererObj(ResourceManager.armor_envsuit, "RightFoot").setRotationPoint(-1.9F, 12.0F, 0.0F);
}
@Override
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
head.copyTo(lamps);
GL11.glPushMatrix();
if(type == 0) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.envsuit_helmet);
GL11.glEnable(GL11.GL_BLEND);
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
head.render(par7);
GL11.glDisable(GL11.GL_BLEND);
/// START GLOW ///
float lastX = OpenGlHelper.lastBrightnessX;
float lastY = OpenGlHelper.lastBrightnessY;
GL11.glPushAttrib(GL11.GL_LIGHTING_BIT);
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, 240F, 240F);
GL11.glDisable(GL11.GL_LIGHTING);
GL11.glDisable(GL11.GL_TEXTURE_2D);
GL11.glColor3f(1F, 1F, 0.8F);
lamps.render(par7);
GL11.glColor3f(1F, 1F, 1F);
GL11.glEnable(GL11.GL_TEXTURE_2D);
GL11.glEnable(GL11.GL_LIGHTING);
GL11.glPopAttrib();
OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, lastX, lastY);
/// END GLOW ///
}
if(type == 1) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.envsuit_chest);
body.render(par7);
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.envsuit_arm);
leftArm.render(par7);
rightArm.render(par7);
}
if(type == 2) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.envsuit_leg);
leftLeg.render(par7);
rightLeg.render(par7);
}
if(type == 3) {
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.envsuit_leg);
leftFoot.render(par7);
rightFoot.render(par7);
}
GL11.glPopMatrix();
}
}

View File

@ -404,9 +404,9 @@ public class RenderBobble extends TileEntitySpecialRenderer {
renderItem(new ItemStack(ModItems.coin_maskman, 1, 5));
break;
case ADAM29:
GL11.glTranslated(0.45, 1.15, 0.4);
GL11.glTranslated(0.4, 1.15, 0.4);
GL11.glScaled(0.5, 0.5, 0.5);
renderItem(new ItemStack(ModItems.coffee));
renderItem(new ItemStack(ModItems.can_redbomb));
break;
case PHEO:
GL11.glTranslated(0.5, 1.15, 0.45);

View File

@ -3,19 +3,20 @@ package com.hbm.render.tileentity;
import org.lwjgl.opengl.GL11;
import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ModBlocks;
import com.hbm.main.ResourceManager;
import com.hbm.tileentity.machine.TileEntityElectrolyser;
import com.hbm.render.item.ItemRenderBase;
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
import net.minecraft.item.Item;
import net.minecraft.tileentity.TileEntity;
import net.minecraftforge.client.IItemRenderer;
public class RenderElectrolyser extends TileEntitySpecialRenderer {
public class RenderElectrolyser extends TileEntitySpecialRenderer implements IItemRendererProvider {
@Override
public void renderTileEntityAt(TileEntity te, double x, double y, double z, float interp) {
TileEntityElectrolyser electrolyser = (TileEntityElectrolyser) te;
GL11.glPushMatrix();
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
@ -40,4 +41,25 @@ public class RenderElectrolyser extends TileEntitySpecialRenderer {
}
@Override
public Item getItemForRenderer() {
return Item.getItemFromBlock(ModBlocks.machine_electrolyser);
}
@Override
public IItemRenderer getRenderer() {
return new ItemRenderBase( ) {
public void renderInventory() {
GL11.glTranslated(-1, -1, 0);
GL11.glScaled(2.5, 2.5, 2.5);
}
public void renderCommon() {
GL11.glScaled(0.5, 0.5, 0.5);
GL11.glShadeModel(GL11.GL_SMOOTH);
bindTexture(ResourceManager.electrolyser_tex); ResourceManager.electrolyser.renderAll();
GL11.glShadeModel(GL11.GL_FLAT);
}
};
}
}

View File

@ -114,10 +114,9 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF
}
}
if(config.generatorMode && power > 0) {
for(DirPos pos : this.connectionPos) {
this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
for(DirPos pos : this.connectionPos) {
if(config.generatorMode && power > 0) this.sendPower(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
for(FluidTank tank : this.outputTanks) if(tank.getFill() > 0) this.sendFluid(tank, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
if(this.structureOK) {
@ -337,12 +336,12 @@ public class TileEntityCustomMachine extends TileEntityMachineBase implements IF
@Override
public int[] getAccessibleSlotsFromSide(int side) {
if(this.config == null) return new int[] { };
if(this.config.itemInCount > 0) return new int[] { 4, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 1) return new int[] { 4, 5, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 2) return new int[] { 4, 5, 6, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 3) return new int[] { 4, 5, 6, 7, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 4) return new int[] { 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 5) return new int[] { 4, 5, 6, 7, 8, 9, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 4) return new int[] { 4, 5, 6, 7, 8, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 3) return new int[] { 4, 5, 6, 7, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 2) return new int[] { 4, 5, 6, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 1) return new int[] { 4, 5, 16, 17, 18, 19, 20, 21 };
if(this.config.itemInCount > 0) return new int[] { 4, 16, 17, 18, 19, 20, 21 };
return new int[] { };
}

View File

@ -1,24 +1,51 @@
package com.hbm.tileentity.machine;
import java.util.ArrayList;
import java.util.List;
import com.hbm.blocks.BlockDummyable;
import com.hbm.interfaces.IControlReceiver;
import com.hbm.inventory.UpgradeManager;
import com.hbm.inventory.container.ContainerElectrolyserFluid;
import com.hbm.inventory.container.ContainerElectrolyserMetal;
import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.fluid.tank.FluidTank;
import com.hbm.inventory.gui.GUIElectrolyserFluid;
import com.hbm.inventory.gui.GUIElectrolyserMetal;
import com.hbm.inventory.material.MaterialShapes;
import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.recipes.ElectrolyserFluidRecipes;
import com.hbm.inventory.recipes.ElectrolyserFluidRecipes.ElectrolysisRecipe;
import com.hbm.inventory.recipes.ElectrolyserMetalRecipes;
import com.hbm.inventory.recipes.ElectrolyserMetalRecipes.ElectrolysisMetalRecipe;
import com.hbm.items.machine.ItemMachineUpgrade.UpgradeType;
import com.hbm.lib.Library;
import com.hbm.main.MainRegistry;
import com.hbm.packet.AuxParticlePacketNT;
import com.hbm.packet.PacketDispatcher;
import com.hbm.tileentity.IGUIProvider;
import com.hbm.tileentity.TileEntityMachineBase;
import com.hbm.util.CrucibleUtil;
import com.hbm.util.fauxpointtwelve.DirPos;
import api.hbm.energy.IEnergyUser;
import api.hbm.fluid.IFluidStandardTransceiver;
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.Container;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.AxisAlignedBB;
import net.minecraft.util.Vec3;
import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection;
public class TileEntityElectrolyser extends TileEntityMachineBase implements IEnergyUser, IControlReceiver, IGUIProvider {
public class TileEntityElectrolyser extends TileEntityMachineBase implements IEnergyUser, IFluidStandardTransceiver, IControlReceiver, IGUIProvider {
public long power;
public static final long maxPower = 20000000;
@ -31,6 +58,10 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
public int progressOre;
public static final int processOreTimeBase = 1000;
public int processOreTime;
public MaterialStack leftStack;
public MaterialStack rightStack;
public int maxMaterial = MaterialShapes.BLOCK.q(16);
public FluidTank[] tanks;
@ -42,6 +73,8 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
//5-10: Fluid IO
//11-13: Byproducts
//// METAL
//14: Crystal
//15-20: Outputs
super(21);
tanks = new FluidTank[4];
tanks[0] = new FluidTank(Fluids.WATER, 16000);
@ -49,6 +82,22 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
tanks[2] = new FluidTank(Fluids.OXYGEN, 16000);
tanks[3] = new FluidTank(Fluids.NITRIC_ACID, 16000);
}
@Override
public int[] getAccessibleSlotsFromSide(int meta) {
return new int[] { 11, 12, 13, 14, 15, 16, 17, 18, 19, 20 };
}
@Override
public boolean isItemValidForSlot(int i, ItemStack itemStack) {
if(i == 14) return ElectrolyserMetalRecipes.getRecipe(itemStack) != null;
return false;
}
@Override
public boolean canExtractItem(int i, ItemStack itemStack, int j) {
return i != 14;
}
@Override
public String getName() {
@ -60,6 +109,99 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
if(!worldObj.isRemote) {
this.power = Library.chargeTEFromItems(slots, 0, power, maxPower);
this.tanks[0].setType(3, 4, slots);
this.tanks[0].loadTank(5, 6, slots);
this.tanks[1].unloadTank(7, 8, slots);
this.tanks[2].unloadTank(9, 10, slots);
if(worldObj.getTotalWorldTime() % 20 == 0) {
for(DirPos pos : this.getConPos()) {
this.trySubscribe(worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.trySubscribe(tanks[0].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
this.trySubscribe(tanks[3].getTankType(), worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
if(tanks[1].getFill() > 0) this.sendFluid(tanks[1], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
if(tanks[2].getFill() > 0) this.sendFluid(tanks[2], worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
}
}
UpgradeManager.eval(slots, 1, 2);
int speedLevel = Math.min(UpgradeManager.getLevel(UpgradeType.SPEED), 3);
int powerLevel = Math.min(UpgradeManager.getLevel(UpgradeType.POWER), 3);
processFluidTime = processFluidTimeBase - processFluidTimeBase * speedLevel / 4;
processOreTime = processOreTimeBase - processOreTimeBase * speedLevel / 4;
usage = usageBase - usageBase * powerLevel / 4;
if(this.canProcessFluid()) {
this.progressFluid++;
this.power -= this.usage;
if(this.progressFluid >= this.processFluidTime) {
this.processFluids();
this.progressFluid = 0;
this.markChanged();
}
}
if(this.canProcesMetal()) {
this.progressOre++;
this.power -= this.usage;
if(this.progressOre >= this.processOreTime) {
this.processMetal();
this.progressOre = 0;
this.markChanged();
}
}
if(this.leftStack != null) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset).getOpposite();
List<MaterialStack> toCast = new ArrayList();
toCast.add(this.leftStack);
Vec3 impact = Vec3.createVectorHelper(0, 0, 0);
MaterialStack didPour = CrucibleUtil.pourFullStack(worldObj, xCoord + 0.5D + dir.offsetX * 5.875D, yCoord + 2D, zCoord + 0.5D + dir.offsetZ * 5.875D, 6, true, toCast, MaterialShapes.NUGGET.q(1), impact);
if(didPour != null) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "foundry");
data.setInteger("color", didPour.material.moltenColor);
data.setByte("dir", (byte) dir.ordinal());
data.setFloat("off", 0.625F);
data.setFloat("base", 0.625F);
data.setFloat("len", Math.max(1F, yCoord - (float) (Math.ceil(impact.yCoord) - 0.875) + 2));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, xCoord + 0.5D + dir.offsetX * 5.875D, yCoord + 2, zCoord + 0.5D + dir.offsetZ * 5.875D), new TargetPoint(worldObj.provider.dimensionId, xCoord + 0.5, yCoord + 1, zCoord + 0.5, 50));
if(this.leftStack.amount <= 0) this.leftStack = null;
}
}
if(this.rightStack != null) {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
List<MaterialStack> toCast = new ArrayList();
toCast.add(this.rightStack);
Vec3 impact = Vec3.createVectorHelper(0, 0, 0);
MaterialStack didPour = CrucibleUtil.pourFullStack(worldObj, xCoord + 0.5D + dir.offsetX * 5.875D, yCoord + 2D, zCoord + 0.5D + dir.offsetZ * 5.875D, 6, true, toCast, MaterialShapes.NUGGET.q(1), impact);
if(didPour != null) {
NBTTagCompound data = new NBTTagCompound();
data.setString("type", "foundry");
data.setInteger("color", didPour.material.moltenColor);
data.setByte("dir", (byte) dir.ordinal());
data.setFloat("off", 0.625F);
data.setFloat("base", 0.625F);
data.setFloat("len", Math.max(1F, yCoord - (float) (Math.ceil(impact.yCoord) - 0.875) + 2));
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, xCoord + 0.5D + dir.offsetX * 5.875D, yCoord + 2, zCoord + 0.5D + dir.offsetZ * 5.875D), new TargetPoint(worldObj.provider.dimensionId, xCoord + 0.5, yCoord + 1, zCoord + 0.5, 50));
if(this.rightStack.amount <= 0) this.rightStack = null;
}
}
NBTTagCompound data = new NBTTagCompound();
data.setLong("power", this.power);
data.setInteger("progressFluid", this.progressFluid);
@ -67,10 +209,32 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
data.setInteger("usage", this.usage);
data.setInteger("processFluidTime", this.processFluidTime);
data.setInteger("processOreTime", this.processOreTime);
if(this.leftStack != null) {
data.setInteger("leftType", leftStack.material.id);
data.setInteger("leftAmount", leftStack.amount);
}
if(this.rightStack != null) {
data.setInteger("rightType", rightStack.material.id);
data.setInteger("rightAmount", rightStack.amount);
}
for(int i = 0; i < 4; i++) tanks[i].writeToNBT(data, "t" + i);
this.networkPack(data, 50);
}
}
public DirPos[] getConPos() {
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
return new DirPos[] {
new DirPos(xCoord - dir.offsetX * 6, yCoord, zCoord - dir.offsetZ * 6, dir.getOpposite()),
new DirPos(xCoord - dir.offsetX * 6 + rot.offsetX, yCoord, zCoord - dir.offsetZ * 6 + rot.offsetZ, dir.getOpposite()),
new DirPos(xCoord - dir.offsetX * 6 - rot.offsetX, yCoord, zCoord - dir.offsetZ * 6 - rot.offsetZ, dir.getOpposite()),
new DirPos(xCoord + dir.offsetX * 6, yCoord, zCoord + dir.offsetZ * 6, dir),
new DirPos(xCoord + dir.offsetX * 6 + rot.offsetX, yCoord, zCoord + dir.offsetZ * 6 + rot.offsetZ, dir),
new DirPos(xCoord + dir.offsetX * 6 - rot.offsetX, yCoord, zCoord + dir.offsetZ * 6 - rot.offsetZ, dir)
};
}
@Override
public void networkUnpack(NBTTagCompound nbt) {
@ -80,9 +244,168 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
this.usage = nbt.getInteger("usage");
this.processFluidTime = nbt.getInteger("processFluidTime");
this.processOreTime = nbt.getInteger("processOreTime");
if(nbt.hasKey("leftType")) this.leftStack = new MaterialStack(Mats.matById.get(nbt.getInteger("leftType")), nbt.getInteger("leftAmount"));
else this.leftStack = null;
if(nbt.hasKey("rightType")) this.rightStack = new MaterialStack(Mats.matById.get(nbt.getInteger("rightType")), nbt.getInteger("rightAmount"));
else this.rightStack = null;
for(int i = 0; i < 4; i++) tanks[i].readFromNBT(nbt, "t" + i);
}
public boolean canProcessFluid() {
if(this.power < usage) return false;
ElectrolysisRecipe recipe = ElectrolyserFluidRecipes.recipes.get(tanks[0].getTankType());
if(recipe == null) return false;
if(recipe.amount > tanks[0].getFill()) return false;
if(recipe.output1.type == tanks[1].getTankType() && recipe.output1.fill + tanks[1].getFill() > tanks[1].getMaxFill()) return false;
if(recipe.output2.type == tanks[2].getTankType() && recipe.output2.fill + tanks[2].getFill() > tanks[2].getMaxFill()) return false;
if(recipe.byproduct != null) {
for(int i = 0; i < recipe.byproduct.length; i++) {
ItemStack slot = slots[11 + i];
ItemStack byproduct = recipe.byproduct[i];
if(slot == null) continue;
if(!slot.isItemEqual(byproduct)) return false;
if(slot.stackSize + byproduct.stackSize > slot.getMaxStackSize()) return false;
}
}
return true;
}
public void processFluids() {
ElectrolysisRecipe recipe = ElectrolyserFluidRecipes.recipes.get(tanks[0].getTankType());
tanks[0].setFill(tanks[0].getFill() - recipe.amount);
tanks[1].setTankType(recipe.output1.type);
tanks[2].setTankType(recipe.output2.type);
tanks[1].setFill(tanks[1].getFill() + recipe.output1.fill);
tanks[2].setFill(tanks[2].getFill() + recipe.output2.fill);
if(recipe.byproduct != null) {
for(int i = 0; i < recipe.byproduct.length; i++) {
ItemStack slot = slots[11 + i];
ItemStack byproduct = recipe.byproduct[i];
if(slot == null) {
slots[11 + i] = byproduct.copy();
} else {
slots[11 + i].stackSize += byproduct.stackSize;
}
}
}
}
public boolean canProcesMetal() {
if(slots[14] == null) return false;
if(this.power < usage) return false;
if(this.tanks[3].getFill() < 100) return false;
ElectrolysisMetalRecipe recipe = ElectrolyserMetalRecipes.getRecipe(slots[14]);
if(leftStack != null) {
if(recipe.output1.material != leftStack.material) return false;
if(recipe.output1.amount + leftStack.amount > this.maxMaterial) return false;
}
if(rightStack != null) {
if(recipe.output2.material != rightStack.material) return false;
if(recipe.output2.amount + rightStack.amount > this.maxMaterial) return false;
}
if(recipe.byproduct != null) {
for(int i = 0; i < recipe.byproduct.length; i++) {
ItemStack slot = slots[15 + i];
ItemStack byproduct = recipe.byproduct[i];
if(slot == null) continue;
if(!slot.isItemEqual(byproduct)) return false;
if(slot.stackSize + byproduct.stackSize > slot.getMaxStackSize()) return false;
}
}
return true;
}
public void processMetal() {
ElectrolysisMetalRecipe recipe = ElectrolyserMetalRecipes.getRecipe(slots[14]);
if(leftStack == null) {
leftStack = new MaterialStack(recipe.output1.material, recipe.output1.amount);
} else {
leftStack.amount += recipe.output1.amount;
}
if(rightStack == null) {
rightStack = new MaterialStack(recipe.output2.material, recipe.output2.amount);
} else {
rightStack.amount += recipe.output2.amount;
}
if(recipe.byproduct != null) {
for(int i = 0; i < recipe.byproduct.length; i++) {
ItemStack slot = slots[15 + i];
ItemStack byproduct = recipe.byproduct[i];
if(slot == null) {
slots[15 + i] = byproduct.copy();
} else {
slots[15 + i].stackSize += byproduct.stackSize;
}
}
}
this.tanks[3].setFill(this.tanks[3].getFill() - 100);
this.decrStackSize(14, 1);
}
@Override
public void readFromNBT(NBTTagCompound nbt) {
super.readFromNBT(nbt);
this.power = nbt.getLong("power");
this.progressFluid = nbt.getInteger("progressFluid");
this.progressOre = nbt.getInteger("progressOre");
this.usage = nbt.getInteger("usage");
this.processFluidTime = nbt.getInteger("processFluidTime");
this.processOreTime = nbt.getInteger("processOreTime");
if(nbt.hasKey("leftType")) this.leftStack = new MaterialStack(Mats.matById.get(nbt.getInteger("leftType")), nbt.getInteger("leftAmount"));
else this.leftStack = null;
if(nbt.hasKey("rightType")) this.rightStack = new MaterialStack(Mats.matById.get(nbt.getInteger("rightType")), nbt.getInteger("rightAmount"));
else this.rightStack = null;
for(int i = 0; i < 4; i++) tanks[i].readFromNBT(nbt, "t" + i);
}
@Override
public void writeToNBT(NBTTagCompound nbt) {
super.writeToNBT(nbt);
nbt.setLong("power", this.power);
nbt.setInteger("progressFluid", this.progressFluid);
nbt.setInteger("progressOre", this.progressOre);
nbt.setInteger("usage", this.usage);
nbt.setInteger("processFluidTime", this.processFluidTime);
nbt.setInteger("processOreTime", this.processOreTime);
if(this.leftStack != null) {
nbt.setInteger("leftType", leftStack.material.id);
nbt.setInteger("leftAmount", leftStack.amount);
}
if(this.rightStack != null) {
nbt.setInteger("rightType", rightStack.material.id);
nbt.setInteger("rightAmount", rightStack.amount);
}
for(int i = 0; i < 4; i++) tanks[i].writeToNBT(nbt, "t" + i);
}
AxisAlignedBB bb = null;
@Override
@ -123,25 +446,42 @@ public class TileEntityElectrolyser extends TileEntityMachineBase implements IEn
this.power = power;
}
@Override
public FluidTank[] getAllTanks() {
return tanks;
}
@Override
public FluidTank[] getSendingTanks() {
return new FluidTank[] {tanks[1], tanks[2]};
}
@Override
public FluidTank[] getReceivingTanks() {
return new FluidTank[] {tanks[0], tanks[3]};
}
@Override
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new ContainerElectrolyserFluid(player.inventory, this);
if(ID == 0) return new ContainerElectrolyserFluid(player.inventory, this);
return new ContainerElectrolyserMetal(player.inventory, this);
}
@Override
@SideOnly(Side.CLIENT)
public GuiScreen provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
return new GUIElectrolyserFluid(player.inventory, this);
if(ID == 0) return new GUIElectrolyserFluid(player.inventory, this);
return new GUIElectrolyserMetal(player.inventory, this);
}
@Override
public void receiveControl(NBTTagCompound data) {
}
public void receiveControl(NBTTagCompound data) { }
@Override
public void receiveControl(EntityPlayer player, NBTTagCompound data) {
if(data.hasKey("sgm")) FMLNetworkHandler.openGui(player, MainRegistry.instance, 1, worldObj, xCoord, yCoord, zCoord);
if(data.hasKey("sgf")) FMLNetworkHandler.openGui(player, MainRegistry.instance, 0, worldObj, xCoord, yCoord, zCoord);
}
@Override

View File

@ -11,6 +11,8 @@ import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemRBMKRod;
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
import com.hbm.util.Compat;
import com.hbm.util.ParticleUtil;
import cpw.mods.fml.common.Optional;
import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
@ -83,11 +85,18 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
super.updateEntity();
if(this.heat > this.maxHeat() && !RBMKDials.getMeltdownsDisabled(worldObj)) {
this.meltdown();
if(this.heat > this.maxHeat()) {
if(RBMKDials.getMeltdownsDisabled(worldObj)) {
ParticleUtil.spawnGasFlame(worldObj, xCoord + 0.5, yCoord + RBMKDials.getColumnHeight(worldObj) + 0.5, zCoord + 0.5, 0, 0.2, 0);
} else {
this.meltdown();
}
return;
}
if(this.heat > 10_000) this.heat = 10_000;
//for spreading, we want the buffered flux to be 0 because we want to know exactly how much gets reflected back
this.fluxFast = 0;
this.fluxSlow = 0;

View File

@ -20,33 +20,41 @@ import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
public class BedrockOre {
public static List<WeightedRandomGeneric<BedrockOreDefinition>> weightedOres = new ArrayList();
public static List<WeightedRandomGeneric<BedrockOreDefinition>> weightedOresNether = new ArrayList();
public static void init() {
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.IRON, 1), WorldConfig.bedrockIronSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.COPPER, 1), WorldConfig.bedrockCopperSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.BORAX, 3, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockBoraxSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.CHLOROCALCITE, 3, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockChlorocalciteSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.ASBESTOS, 2), WorldConfig.bedrockAsbestosSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.NIOBIUM, 2, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockNiobiumSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.TITANIUM, 2, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockTitaniumSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.TUNGSTEN, 2, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockTungstenSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.GOLD, 1), WorldConfig.bedrockGoldSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.URANIUM, 4, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockUraniumSpawn);
registerBedrockOre(new BedrockOreDefinition(EnumBedrockOre.THORIUM, 4, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockThoriumSpawn);
registerBedrockOre(new BedrockOreDefinition(new ItemStack(Items.coal, 4), 1, 0x202020), WorldConfig.bedrockCoalSpawn);
registerBedrockOre(new BedrockOreDefinition(new ItemStack(ModItems.niter, 4), 2, 0x808080, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockNiterSpawn);
registerBedrockOre(new BedrockOreDefinition(new ItemStack(ModItems.fluorite, 4), 1, 0xd0d0d0), WorldConfig.bedrockFluoriteSpawn);
registerBedrockOre(new BedrockOreDefinition(new ItemStack(Items.redstone, 4), 1, 0xd01010), WorldConfig.bedrockRedstoneSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.IRON, 1), WorldConfig.bedrockIronSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.COPPER, 1), WorldConfig.bedrockCopperSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.BORAX, 3, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockBoraxSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.CHLOROCALCITE, 3, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockChlorocalciteSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.ASBESTOS, 2), WorldConfig.bedrockAsbestosSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.NIOBIUM, 2, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockNiobiumSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.TITANIUM, 2, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockTitaniumSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.TUNGSTEN, 2, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockTungstenSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.GOLD, 1), WorldConfig.bedrockGoldSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.URANIUM, 4, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockUraniumSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(EnumBedrockOre.THORIUM, 4, new FluidStack(Fluids.SULFURIC_ACID, 500)), WorldConfig.bedrockThoriumSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(Items.coal, 4), 1, 0x202020), WorldConfig.bedrockCoalSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(ModItems.niter, 4), 2, 0x808080, new FluidStack(Fluids.ACID, 500)), WorldConfig.bedrockNiterSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(ModItems.fluorite, 4), 1, 0xd0d0d0), WorldConfig.bedrockFluoriteSpawn);
registerBedrockOre(weightedOres, new BedrockOreDefinition(new ItemStack(Items.redstone, 4), 1, 0xd01010), WorldConfig.bedrockRedstoneSpawn);
registerBedrockOre(weightedOresNether, new BedrockOreDefinition(new ItemStack(Items.glowstone_dust, 4), 1, 0xF9FF4D), WorldConfig.bedrockGlowstoneSpawn);
registerBedrockOre(weightedOresNether, new BedrockOreDefinition(new ItemStack(ModItems.powder_fire, 4), 1, 0xD7341F), WorldConfig.bedrockPhosphorusSpawn);
}
public static void registerBedrockOre(BedrockOreDefinition def, int weight) {
public static void registerBedrockOre(List list, BedrockOreDefinition def, int weight) {
WeightedRandomGeneric<BedrockOreDefinition> weighted = new WeightedRandomGeneric<BedrockOreDefinition>(def, weight);
weightedOres.add(weighted);
list.add(weighted);
}
public static void generate(World world, int x, int z, ItemStack stack, FluidStack acid, int color, int tier) {
generate(world, x, z, stack, acid, color, tier, ModBlocks.stone_depth);
}
public static void generate(World world, int x, int z, ItemStack stack, FluidStack acid, int color, int tier, Block depthRock) {
for(int ix = x - 1; ix <= x + 1; ix++) {
for(int iz = z - 1; iz <= z + 1; iz++) {
@ -77,7 +85,7 @@ public class BedrockOre {
Block b = world.getBlock(ix, iy, iz);
if(b.isReplaceableOreGen(world, ix, iy, iz, Blocks.stone) || b.isReplaceableOreGen(world, ix, iy, iz, Blocks.bedrock)) {
world.setBlock(ix, iy, iz, ModBlocks.stone_depth);
world.setBlock(ix, iy, iz, depthRock);
}
}
}

View File

@ -431,6 +431,21 @@ book_lore.bf_bomb_5.page.6=There's a vital distinction to be made between dissec
book_lore.bf_bomb_5.page.7=The government wants to put this shit into bombs after all, maybe we'll see a couple more wars, couple more million resigned to a fate worse than death. They can't hide this forever. $ $ I don't care. Not anymore. Please, god, let me go back
book_lore.bf_bomb_5.page.8=to actual science. $ $ Goddamnit, Mae, get ahold of yourself...
book_lore.beacon.name=Signal Beacon Instruction Booklet
book_lore.beacon.author=Flim Flam Industries
book_lore.beacon.page.0=Thank you for your purchase of a Mk.2 Illuminated Signal Beacon (rev. 1.3)! This small booklet will provide a short introduction in the operation of the beacon, as well as its inner workings.
book_lore.beacon.page.1=Chapter 1: Architecture $ Each unit is composed of four main parts: The control circuit, a lantern, a fog horn and the casing which houses the other parts. For a detailed explanation of the main circuit, please
book_lore.beacon.page.2=refer to the circuit diagram found on the inside of the maintenance lid of the casing. The lantern is made up of a polycarbonate case containing a dual-color 250 Watt halogen bulb with a standard 200mm socket, replacements
book_lore.beacon.page.3=for the bulb can be ordered from our stores. Third party bulbs are not recommended, as we cannot ensure safe operation. The case is made from a specialized zinc-coated stainless steel and is resistant to weathering.
book_lore.beacon.page.4=Chapter 2: Lantern $ The lantern's primary uses are providing light for ease of maintenance in harsh weather conditions as well as a status indicator. Should the power-on self test (POST) fail, the lantern will
book_lore.beacon.page.5=light up red, otherwise it will light up green. Note that colors can vary depending on the replacement bulb.
book_lore.beacon.page.6=Chapter 3: Fog Horn $ The fog horn is the primary communication device of the beacon. The beacon is designed for peer-to-peer (P2P) communication as well as for message broadcasting.
book_lore.beacon.page.7=Chapter 4: Peer-to-Peer $ For details on communication, refer to the communications handbook. A short rundown of establishing a P2P connection follows: First, the beacon has to give the "START CONNECTION" signal,
book_lore.beacon.page.8=being a single long tone. All available peers should respond with a single long tone as well (order specified by proximity, as well as the communication guidelines outlined in the handbook, section "Responding to a Connection")
book_lore.beacon.page.9=Once the desired peer has responded, give the "ACCEPT CONNECTION" signal, being two long tones, the peer will then also respond with two long tones. All communication afterwards has to happen using pre-negotiated signals,
book_lore.beacon.page.10=most commonly using the FAR-5M standard. Communication will end immediately if no standard has been negotiated, serving as a "ping". Should communication continue, the connection can be ended using another long single tone "END CONNECTION".
book_lore.beacon.page.11=Chapter 5: Warranty $ [ page intentionally left blank ]
cannery.f1=[ Press F1 for help ]
cannery.centrifuge=Gas Centrifuge

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,219 @@
# Blender v2.79 (sub 0) OBJ File: 'test.blend'
# www.blender.org
o Chest
v -4.000000 12.000000 2.000000
v 4.000000 12.000000 2.000000
v -4.000000 12.000000 -2.000000
v 4.000000 12.000000 -2.000000
v 4.000000 0.000000 -2.000000
v -4.000000 0.000000 -2.000000
v 4.000000 0.000000 2.000000
v -4.000000 0.000000 2.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 5/1/1 2/2/1 7/3/1
f 8/4/2 3/5/2 6/6/2
f 6/6/3 4/7/3 5/1/3
f 7/3/4 1/8/4 8/4/4
f 2/2/5 3/5/5 1/8/5
f 6/6/6 7/3/6 8/4/6
f 5/1/1 4/7/1 2/2/1
f 8/4/2 1/8/2 3/5/2
f 6/6/3 3/5/3 4/7/3
f 7/3/4 2/2/4 1/8/4
f 2/2/5 4/7/5 3/5/5
f 6/6/6 5/1/6 7/3/6
o LeftArm
v 4.000000 12.000000 2.000000
v 8.000000 12.000000 2.000000
v 4.000000 12.000000 -2.000000
v 8.000000 12.000000 -2.000000
v 8.000000 0.000000 -2.000000
v 4.000000 0.000000 -2.000000
v 8.000000 0.000000 2.000000
v 4.000000 0.000000 2.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 13/9/7 10/10/7 15/11/7
f 16/12/8 11/13/8 14/14/8
f 14/14/9 12/15/9 13/9/9
f 15/11/10 9/16/10 16/12/10
f 10/10/11 11/13/11 9/16/11
f 14/14/12 15/11/12 16/12/12
f 13/9/7 12/15/7 10/10/7
f 16/12/8 9/16/8 11/13/8
f 14/14/9 11/13/9 12/15/9
f 15/11/10 10/10/10 9/16/10
f 10/10/11 12/15/11 11/13/11
f 14/14/12 13/9/12 15/11/12
o RightArm
v -8.000000 12.000000 2.000000
v -4.000000 12.000000 2.000000
v -8.000000 12.000000 -2.000000
v -4.000000 12.000000 -2.000000
v -4.000000 0.000000 -2.000000
v -8.000000 0.000000 -2.000000
v -4.000000 0.000000 2.000000
v -8.000000 0.000000 2.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 21/17/13 18/18/13 23/19/13
f 24/20/14 19/21/14 22/22/14
f 22/22/15 20/23/15 21/17/15
f 23/19/16 17/24/16 24/20/16
f 18/18/17 19/21/17 17/24/17
f 22/22/18 23/19/18 24/20/18
f 21/17/13 20/23/13 18/18/13
f 24/20/14 17/24/14 19/21/14
f 22/22/15 19/21/15 20/23/15
f 23/19/16 18/18/16 17/24/16
f 18/18/17 20/23/17 19/21/17
f 22/22/18 21/17/18 23/19/18
o RightLeg
v -4.000000 24.000000 2.000000
v 0.000000 24.000000 2.000000
v -4.000000 24.000000 -2.000000
v 0.000000 24.000000 -2.000000
v 0.000000 12.000000 -2.000000
v -4.000000 12.000000 -2.000000
v 0.000000 12.000000 2.000000
v -4.000000 12.000000 2.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 29/25/19 26/26/19 31/27/19
f 32/28/20 27/29/20 30/30/20
f 30/30/21 28/31/21 29/25/21
f 31/27/22 25/32/22 32/28/22
f 26/26/23 27/29/23 25/32/23
f 30/30/24 31/27/24 32/28/24
f 29/25/19 28/31/19 26/26/19
f 32/28/20 25/32/20 27/29/20
f 30/30/21 27/29/21 28/31/21
f 31/27/22 26/26/22 25/32/22
f 26/26/23 28/31/23 27/29/23
f 30/30/24 29/25/24 31/27/24
o LeftLeg
v 0.000000 24.000000 2.000000
v 4.000000 24.000000 2.000000
v 0.000000 24.000000 -2.000000
v 4.000000 24.000000 -2.000000
v 4.000000 12.000000 -2.000000
v 0.000000 12.000000 -2.000000
v 4.000000 12.000000 2.000000
v 0.000000 12.000000 2.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 37/33/25 34/34/25 39/35/25
f 40/36/26 35/37/26 38/38/26
f 38/38/27 36/39/27 37/33/27
f 39/35/28 33/40/28 40/36/28
f 34/34/29 35/37/29 33/40/29
f 38/38/30 39/35/30 40/36/30
f 37/33/25 36/39/25 34/34/25
f 40/36/26 33/40/26 35/37/26
f 38/38/27 35/37/27 36/39/27
f 39/35/28 34/34/28 33/40/28
f 34/34/29 36/39/29 35/37/29
f 38/38/30 37/33/30 39/35/30
o Helmet
v 25.451866 -3.037100 4.881973
v -4.000000 0.000000 4.000000
v 4.000000 0.000000 4.000000
v -4.000000 0.000000 -4.000000
v 4.000000 0.000000 -4.000000
v 4.000000 -8.000000 -4.000000
v -4.000000 -8.000000 -4.000000
v 4.000000 -8.000000 4.000000
v -4.000000 -8.000000 4.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 0.000000
vn 1.0000 0.0000 0.0000
vn -1.0000 0.0000 0.0000
vn 0.0000 0.0000 -1.0000
vn 0.0000 0.0000 1.0000
vn 0.0000 1.0000 0.0000
vn 0.0000 -1.0000 0.0000
s off
f 46/41/31 43/42/31 48/43/31
f 49/44/32 44/45/32 47/46/32
f 47/46/33 45/47/33 46/41/33
f 48/43/34 42/48/34 49/44/34
f 43/42/35 44/45/35 42/48/35
f 47/46/36 48/43/36 49/44/36
f 46/41/31 45/47/31 43/42/31
f 49/44/32 42/48/32 44/45/32
f 47/46/33 44/45/33 45/47/33
f 48/43/34 43/42/34 42/48/34
f 43/42/35 45/47/35 44/45/35
f 47/46/36 46/41/36 48/43/36

Binary file not shown.

After

Width:  |  Height:  |  Size: 384 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 936 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 636 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 764 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.8 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 332 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 366 B

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 334 B

After

Width:  |  Height:  |  Size: 357 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 347 B

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 343 B

After

Width:  |  Height:  |  Size: 361 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 351 B

After

Width:  |  Height:  |  Size: 362 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 154 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 282 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 258 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 1.9 KiB