mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'refs/remotes/upstream/master' into Optimization
# Conflicts: # src/main/java/com/hbm/handler/WeaponAbility.java # src/main/java/com/hbm/items/weapon/sedna/factory/Orchestras.java # src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java # src/main/java/com/hbm/tileentity/machine/TileEntityMachineRotaryFurnace.java
This commit is contained in:
commit
aceb313fec
47
.github/workflows/build.yml
vendored
Normal file
47
.github/workflows/build.yml
vendored
Normal file
@ -0,0 +1,47 @@
|
||||
# This workflow uses actions that are not certified by GitHub.
|
||||
# They are provided by a third-party and are governed by
|
||||
# separate terms of service, privacy policy, and support
|
||||
# documentation.
|
||||
# This workflow will build a Java project with Gradle and cache/restore any dependencies to improve the workflow execution time
|
||||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-java-with-gradle
|
||||
|
||||
# Yes this is a mostly untouched Github actions template
|
||||
|
||||
name: Java CI with Gradle
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [ "master" ]
|
||||
pull_request:
|
||||
branches: [ "master" ]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- name: Set up JDK 8
|
||||
uses: actions/setup-java@v4
|
||||
with:
|
||||
java-version: '8'
|
||||
distribution: 'temurin' # Temurin because it's default :P
|
||||
|
||||
# Configure Gradle for optimal use in GitHub Actions, including caching of downloaded dependencies.
|
||||
# See: https://github.com/gradle/actions/blob/main/setup-gradle/README.md
|
||||
- name: Setup Gradle
|
||||
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0
|
||||
|
||||
- name: Build with Gradle Wrapper
|
||||
run: ./gradlew build
|
||||
|
||||
- name: Upload a Build Artifact
|
||||
uses: actions/upload-artifact@v4.6.0
|
||||
with:
|
||||
# A file, directory or wildcard pattern that describes what to upload
|
||||
path: ./build/libs
|
||||
|
||||
|
||||
21
changelog
21
changelog
@ -1,15 +1,12 @@
|
||||
## Added
|
||||
* Phosphor vines
|
||||
|
||||
## Changed
|
||||
* Raw bedrock ore taken out of the creative tab now has the stats of the position the player is in, instead of being worthless
|
||||
* U233's color coded isotope indicator is now yellow instead of orange, making yellow standard code for "secondary fissile isotope" and orange for "radioisotope"
|
||||
* NITAN powders can now be found in the creative tab
|
||||
* Particle detectors now print an error for when the recipe could not be completed
|
||||
* Removed "no ore dict data" line from tooltips with extended view enabled
|
||||
* Added a client config called `GUN_ANIMATION_SPEED` which allows the speed of gun animations to be changed
|
||||
* Mostly for debugging, since it only applies to the bus animation system, things like smoke trails and muzzle flashes are unaffected
|
||||
|
||||
## Fixed
|
||||
* Fixed raw bedrock ore tooltip not showing the density's color correctly
|
||||
* Fixed T45 helmet not protecting against carbon monoxide
|
||||
* Fixed general issues regarding the rotary furnace
|
||||
* Fixed corrupted broadcaster noise having infinite range
|
||||
* Fixed packet issues for explosive charges and custom machines
|
||||
* Fixed one of the rotary furnace's visual connections now properly showing up
|
||||
* Fixed items being annihilated when shift clicking them into the particle source
|
||||
* Fixed packet optimization not allowing packets to be sent when the day night cycle is halted
|
||||
* Fixed particle detectors not always using power when they should
|
||||
* Fixed rotary furnace voiding low pressure steam when dealing with input numbers not divisible by 100
|
||||
* Fixed state leak causing smoke from the right akimbo weapon to glow when the first one is fired
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5202
|
||||
mod_build_number=5230
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
@ -38,7 +38,8 @@ credits=HbMinecraft,\
|
||||
\ VT-6/24 (models, textures),\
|
||||
\ Nos (models),\
|
||||
\ Minecreep (models),\
|
||||
\ 70k (textures, glyphid AI, strand caster, electrolyzer changes),\
|
||||
\ 70k (textures, glyphid AI, strand caster, electrolyzer changes, cryolite),\
|
||||
\ instantnootles (concept artist),\
|
||||
\ haru315 (spiral point algorithm),\
|
||||
\ Sten89 (models),\
|
||||
\ Pixelguru26 (textures),\
|
||||
|
||||
@ -32,7 +32,7 @@ INDEX includes:
|
||||
optionally returning a value
|
||||
|
||||
On the implementation side we can expect:
|
||||
- ROR readers, torches which have a list of named values which are read, as well as frequencies on which these values are boradcasted
|
||||
- ROR readers, torches which have a list of named values which are read, as well as frequencies on which these values are broadcasted
|
||||
- ROR controllers, torches which have one frequency and can receive commands with parameters which will be executed on the component
|
||||
- ROR programmers, torches which have a list of frequencies and return frequencies which can receive commands with parameters and
|
||||
then send the return value on the return frequency
|
||||
|
||||
@ -1791,9 +1791,9 @@ public class ModBlocks {
|
||||
|
||||
machine_furnace_brick_off = new MachineBrickFurnace(false).setBlockName("machine_furnace_brick_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_furnace_brick_on = new MachineBrickFurnace(true).setBlockName("machine_furnace_brick_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_nuke_furnace_off = new MachineNukeFurnace(false).setBlockName("machine_nuke_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_nuke_furnace_off = new MachineNukeFurnace(false).setBlockName("machine_nuke_furnace_off").setHardness(5.0F).setResistance(10.0F);
|
||||
machine_nuke_furnace_on = new MachineNukeFurnace(true).setBlockName("machine_nuke_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
machine_rtg_furnace_off = new MachineRtgFurnace(false).setBlockName("machine_rtg_furnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||
machine_rtg_furnace_off = new MachineRtgFurnace(false).setBlockName("machine_rtg_furnace_off").setHardness(5.0F).setResistance(10.0F);
|
||||
machine_rtg_furnace_on = new MachineRtgFurnace(true).setBlockName("machine_rtg_furnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||
|
||||
machine_industrial_generator = new MachineIGenerator(Material.iron).setBlockName("machine_industrial_generator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName("gold_block");
|
||||
|
||||
@ -134,12 +134,12 @@ public class BlockPedestal extends BlockContainer {
|
||||
|
||||
if(recipe.extra == recipe.extra.FULL_MOON) {
|
||||
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
|
||||
if(world.getMoonPhase() != 0) continue;
|
||||
if(world.provider.getMoonPhase(world.getWorldInfo().getWorldTime()) != 0) continue;
|
||||
}
|
||||
|
||||
if(recipe.extra == recipe.extra.NEW_MOON) {
|
||||
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue;
|
||||
if(world.getMoonPhase() != 4) continue;
|
||||
if(world.provider.getMoonPhase(world.getWorldInfo().getWorldTime()) != 4) continue;
|
||||
}
|
||||
|
||||
if(recipe.extra == recipe.extra.SUN) {
|
||||
|
||||
@ -1,10 +1,16 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.items.ItemEnums.EnumChunkType;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockResourceStone extends BlockEnumMulti {
|
||||
@ -22,4 +28,16 @@ public class BlockResourceStone extends BlockEnumMulti {
|
||||
|
||||
super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int meta, int fortune) {
|
||||
|
||||
if(meta == BlockEnums.EnumStoneType.MALACHITE.ordinal()) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
ret.add(DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.MALACHITE, 3 + fortune + world.rand.nextInt(fortune + 2)));
|
||||
return ret;
|
||||
}
|
||||
|
||||
return super.getDrops(world, x, y, z, meta, fortune);
|
||||
}
|
||||
}
|
||||
|
||||
@ -176,6 +176,7 @@ public class FoundryChannel extends BlockContainer implements ICrucibleAcceptor
|
||||
}
|
||||
cast.amount = 0;
|
||||
cast.type = null;
|
||||
cast.propagateMaterial(null);
|
||||
cast.markDirty();
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@ -1,15 +1,20 @@
|
||||
package com.hbm.blocks.machine.albion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPABeamline;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockPABeamline extends BlockDummyable {
|
||||
public class BlockPABeamline extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public BlockPABeamline() {
|
||||
super(Material.iron);
|
||||
@ -25,4 +30,9 @@ public class BlockPABeamline extends BlockDummyable {
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {0, 0, 0, 0, 1, 1}; }
|
||||
@Override public int getOffset() { return 0; }
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
package com.hbm.blocks.machine.albion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPADetector;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPADetector extends BlockDummyable {
|
||||
public class BlockPADetector extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public BlockPADetector() {
|
||||
super(Material.iron);
|
||||
@ -20,10 +27,34 @@ public class BlockPADetector extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPADetector();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {2, 2, 2, 2, 4, 4}; }
|
||||
@Override public int getOffset() { return 0; }
|
||||
@Override public int getHeightOffset() { return 2; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x - rot.offsetX * 4, y, z - rot.offsetZ * 4);
|
||||
this.makeExtra(world, x - rot.offsetX * 4, y + 1, z - rot.offsetZ * 4);
|
||||
this.makeExtra(world, x - rot.offsetX * 4, y - 1, z - rot.offsetZ * 4);
|
||||
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX, y, z - rot.offsetZ * 4 + dir.offsetZ);
|
||||
this.makeExtra(world, x - rot.offsetX * 4 - dir.offsetX, y, z - rot.offsetZ * 4 - dir.offsetZ);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
package com.hbm.blocks.machine.albion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPADipole;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPADipole extends BlockDummyable {
|
||||
public class BlockPADipole extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public BlockPADipole() {
|
||||
super(Material.iron);
|
||||
@ -20,10 +27,35 @@ public class BlockPADipole extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPADipole();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {1, 1, 1, 1, 1, 1}; }
|
||||
@Override public int getOffset() { return 0; }
|
||||
@Override public int getHeightOffset() { return 1; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
this.makeExtra(world, x + 1, y - 1, z);
|
||||
this.makeExtra(world, x - 1, y - 1, z);
|
||||
this.makeExtra(world, x, y - 1, z + 1);
|
||||
this.makeExtra(world, x, y - 1, z - 1);
|
||||
this.makeExtra(world, x + 1, y + 1, z);
|
||||
this.makeExtra(world, x - 1, y + 1, z);
|
||||
this.makeExtra(world, x, y + 1, z + 1);
|
||||
this.makeExtra(world, x, y + 1, z - 1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
package com.hbm.blocks.machine.albion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPAQuadrupole;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPAQuadrupole extends BlockDummyable {
|
||||
public class BlockPAQuadrupole extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public BlockPAQuadrupole() {
|
||||
super(Material.iron);
|
||||
@ -20,10 +27,31 @@ public class BlockPAQuadrupole extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPAQuadrupole();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {1, 1, 1, 1, 1, 1}; }
|
||||
@Override public int getOffset() { return 0; }
|
||||
@Override public int getHeightOffset() { return 1; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
this.makeExtra(world, x + dir.offsetX, y, z + dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x, y + 1, z);
|
||||
this.makeExtra(world, x, y - 1, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
package com.hbm.blocks.machine.albion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPARFC;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPARFC extends BlockDummyable {
|
||||
public class BlockPARFC extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public BlockPARFC() {
|
||||
super(Material.iron);
|
||||
@ -20,10 +27,34 @@ public class BlockPARFC extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPARFC();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {1, 1, 1, 1, 4, 4}; }
|
||||
@Override public int getOffset() { return 0; }
|
||||
@Override public int getHeightOffset() { return 1; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
dir = dir.getRotation(ForgeDirection.UP);
|
||||
this.makeExtra(world, x + dir.offsetX * 3, y + 1, z + dir.offsetZ * 3);
|
||||
this.makeExtra(world, x - dir.offsetX * 3, y + 1, z - dir.offsetZ * 3);
|
||||
this.makeExtra(world, x, y + 1, z);
|
||||
this.makeExtra(world, x + dir.offsetX * 3, y - 1, z + dir.offsetZ * 3);
|
||||
this.makeExtra(world, x - dir.offsetX * 3, y - 1, z - dir.offsetZ * 3);
|
||||
this.makeExtra(world, x, y - 1, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,15 +1,22 @@
|
||||
package com.hbm.blocks.machine.albion;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockPASource extends BlockDummyable {
|
||||
public class BlockPASource extends BlockDummyable implements ITooltipProvider {
|
||||
|
||||
public BlockPASource() {
|
||||
super(Material.iron);
|
||||
@ -20,10 +27,36 @@ public class BlockPASource extends BlockDummyable {
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
if(meta >= 12) return new TileEntityPASource();
|
||||
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||
return standardOpenBehavior(world, x, y, z, player, side);
|
||||
}
|
||||
|
||||
@Override public int[] getDimensions() { return new int[] {1, 1, 1, 1, 4, 4}; }
|
||||
@Override public int getOffset() { return 0; }
|
||||
@Override public int getHeightOffset() { return 1; }
|
||||
|
||||
@Override
|
||||
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||
super.fillSpace(world, x, y, z, dir, o);
|
||||
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
this.makeExtra(world, x + rot.offsetX * 4, y, z + rot.offsetZ * 4);
|
||||
this.makeExtra(world, x + dir.offsetX, y, z + dir.offsetZ);
|
||||
this.makeExtra(world, x + dir.offsetX + rot.offsetX * 2, y, z + dir.offsetZ + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x + dir.offsetX - rot.offsetX * 2, y, z + dir.offsetZ - rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - dir.offsetX, y, z - dir.offsetZ);
|
||||
this.makeExtra(world, x - dir.offsetX + rot.offsetX * 2, y, z - dir.offsetZ + rot.offsetZ * 2);
|
||||
this.makeExtra(world, x - dir.offsetX - rot.offsetX * 2, y, z - dir.offsetZ - rot.offsetZ * 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
addStandardInfo(stack, player, list, ext);
|
||||
}
|
||||
}
|
||||
|
||||
@ -32,6 +32,7 @@ public class ClientConfig {
|
||||
public static ConfigWrapper<Boolean> GUN_ANIMS_LEGACY = new ConfigWrapper(false);
|
||||
public static ConfigWrapper<Boolean> GUN_MODEL_FOV = new ConfigWrapper(false);
|
||||
public static ConfigWrapper<Boolean> GUN_VISUAL_RECOIL = new ConfigWrapper(true);
|
||||
public static ConfigWrapper<Double> GUN_ANIMATION_SPEED = new ConfigWrapper(1D);
|
||||
public static ConfigWrapper<Boolean> ITEM_TOOLTIP_SHOW_OREDICT = new ConfigWrapper(true);
|
||||
public static ConfigWrapper<Boolean> ITEM_TOOLTIP_SHOW_CUSTOM_NUKE = new ConfigWrapper(true);
|
||||
public static ConfigWrapper<Boolean> MAIN_MENU_WACKY_SPLASHES = new ConfigWrapper(true);
|
||||
@ -50,6 +51,7 @@ public class ClientConfig {
|
||||
configMap.put("GUN_ANIMS_LEGACY", GUN_ANIMS_LEGACY);
|
||||
configMap.put("GUN_MODEL_FOV", GUN_MODEL_FOV);
|
||||
configMap.put("GUN_VISUAL_RECOIL", GUN_VISUAL_RECOIL);
|
||||
configMap.put("GUN_ANIMATION_SPEED", GUN_ANIMATION_SPEED);
|
||||
configMap.put("ITEM_TOOLTIP_SHOW_OREDICT", ITEM_TOOLTIP_SHOW_OREDICT);
|
||||
configMap.put("ITEM_TOOLTIP_SHOW_CUSTOM_NUKE", ITEM_TOOLTIP_SHOW_CUSTOM_NUKE);
|
||||
configMap.put("MAIN_MENU_WACKY_SPLASHES", MAIN_MENU_WACKY_SPLASHES);
|
||||
|
||||
@ -62,7 +62,6 @@ public class WorldConfig {
|
||||
public static int copperClusterSpawn = 4;
|
||||
public static int alexandriteSpawn = 100;
|
||||
|
||||
public static int malachiteSpawn = 1;
|
||||
public static int limestoneSpawn = 1;
|
||||
|
||||
public static int netherUraniumuSpawn = 8;
|
||||
@ -180,7 +179,6 @@ public class WorldConfig {
|
||||
aluminiumClusterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.C02_aluminiumClusterSpawn", "Amount of aluminium cluster veins per chunk", 3);
|
||||
copperClusterSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.C03_copperClusterSpawn", "Amount of copper cluster veins per chunk", 4);
|
||||
|
||||
malachiteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.L01_malachiteSpawn", "Amount of malachite block veins per chunk", 1);
|
||||
limestoneSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.L02_limestoneSpawn", "Amount of limestone block veins per chunk", 1);
|
||||
|
||||
netherUraniumuSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.N00_uraniumSpawnrate", "Amount of nether uranium per chunk", 8);
|
||||
|
||||
@ -89,7 +89,7 @@ public class ArmorRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.fau_plate, 1), new Object[] { "MCM", "PBP", "PSP", 'M', ModItems.motor_desh, 'C', ModItems.demon_core_closed, 'P', ModItems.plate_armor_fau, 'B', ModItems.starmetal_plate, 'S', ModBlocks.ancient_scrap });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.fau_legs, 1), new Object[] { "MPM", "PBP", "PDP", 'M', ModItems.motor_desh, 'P', ModItems.plate_armor_fau, 'B', ModItems.starmetal_legs, 'D', ModItems.billet_polonium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.fau_boots, 1), new Object[] { "PDP", "PBP", 'P', ModItems.plate_armor_fau, 'D', ModItems.billet_polonium, 'B', ModItems.starmetal_boots });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dns_helmet, 1), new Object[] { "PCP", "PBP", "PSP", 'P', ModItems.plate_armor_dnt, 'S', ModItems.ingot_chainsteel, 'B', ModItems.bj_helmet, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BISMOID) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dns_helmet, 1), new Object[] { "PCP", "PBP", "PSP", 'P', ModItems.plate_armor_dnt, 'S', ModItems.ingot_chainsteel, 'B', ModItems.bj_helmet, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.QUANTUM) });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dns_plate, 1), new Object[] { "PCP", "PBP", "PSP", 'P', ModItems.plate_armor_dnt, 'S', ModItems.ingot_chainsteel, 'B', ModItems.bj_plate_jetpack, 'C', ModItems.singularity_spark });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dns_legs, 1), new Object[] { "PCP", "PBP", "PSP", 'P', ModItems.plate_armor_dnt, 'S', ModItems.ingot_chainsteel, 'B', ModItems.bj_legs, 'C', ModItems.coin_worm });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.dns_boots, 1), new Object[] { "PCP", "PBP", "PSP", 'P', ModItems.plate_armor_dnt, 'S', ModItems.ingot_chainsteel, 'B', ModItems.bj_boots, 'C', ModItems.demon_core_closed });
|
||||
|
||||
@ -21,11 +21,11 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class SmeltingRecipes {
|
||||
|
||||
|
||||
public static void AddSmeltingRec()
|
||||
{
|
||||
GameRegistry.addSmelting(ModItems.glyphid_meat, new ItemStack(ModItems.glyphid_meat_grilled), 1.0F);
|
||||
|
||||
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_thorium), new ItemStack(ModItems.ingot_th232), 3.0F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_uranium), new ItemStack(ModItems.ingot_uranium), 6.0F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_uranium_scorched), new ItemStack(ModItems.ingot_uranium), 6.0F);
|
||||
@ -36,7 +36,7 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_copper), new ItemStack(ModItems.ingot_copper), 2.5F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_tungsten), new ItemStack(ModItems.ingot_tungsten), 6.0F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_nether_tungsten), new ItemStack(ModItems.ingot_tungsten), 12.0F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_aluminium), new ItemStack(ModItems.ingot_aluminium), 2.5F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_aluminium), DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.CRYOLITE, 1), 2.5F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_lead), new ItemStack(ModItems.ingot_lead), 3.0F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_beryllium), new ItemStack(ModItems.ingot_beryllium), 2.0F);
|
||||
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_schrabidium), new ItemStack(ModItems.ingot_schrabidium), 128.0F);
|
||||
@ -46,7 +46,7 @@ public class SmeltingRecipes {
|
||||
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.IRON), new ItemStack(Items.iron_ingot, 16), 10.0F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.COPPER), new ItemStack(ModItems.ingot_copper, 16), 10.0F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.ALUMINIUM), new ItemStack(ModItems.ingot_aluminium, 16), 10.0F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.ALUMINIUM), DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.CRYOLITE, 16), 10.0F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.RAREEARTH), DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.RARE, 16), 10.0F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.COBALT), new ItemStack(ModItems.ingot_cobalt, 4), 10.0F);
|
||||
|
||||
@ -119,7 +119,7 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(ModItems.rag_piss, new ItemStack(ModItems.rag), 0.1F);
|
||||
GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.plant_flower, EnumFlowerType.TOBACCO), DictFrame.fromOne(ModItems.plant_item, EnumPlantType.TOBACCO), 0.1F);
|
||||
GameRegistry.addSmelting(ModItems.ball_fireclay, new ItemStack(ModItems.ingot_firebrick), 0.1F);
|
||||
|
||||
|
||||
//GameRegistry.addSmelting(Items.bone, new ItemStack(Items.slime_ball, 3), 0.0F);
|
||||
//GameRegistry.addSmelting(new ItemStack(Items.dye, 1, 15), new ItemStack(Items.slime_ball, 1), 0.0F);
|
||||
GameRegistry.addSmelting(new ItemStack(Blocks.gravel, 1), new ItemStack(Blocks.cobblestone, 1), 0.0F);
|
||||
@ -133,7 +133,7 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(new ItemStack(ModBlocks.sand_lead), new ItemStack(ModBlocks.glass_lead), 0.25F);
|
||||
GameRegistry.addSmelting(new ItemStack(ModBlocks.ash_digamma), new ItemStack(ModBlocks.glass_ash), 10F);
|
||||
GameRegistry.addSmelting(new ItemStack(ModBlocks.basalt), new ItemStack(ModBlocks.basalt_smooth), 0.1F);
|
||||
|
||||
|
||||
GameRegistry.addSmelting(ModItems.ingot_schraranium, new ItemStack(ModItems.nugget_schrabidium, 1), 2.0F);
|
||||
|
||||
GameRegistry.addSmelting(ModItems.lodestone, new ItemStack(ModItems.crystal_iron, 1), 5.0F);
|
||||
@ -169,14 +169,14 @@ public class SmeltingRecipes {
|
||||
GameRegistry.addSmelting(ModItems.ingot_meteorite_forged, ItemHot.heatUp(new ItemStack(ModItems.ingot_meteorite_forged)), 0.0F);
|
||||
GameRegistry.addSmelting(ModItems.blade_meteorite, ItemHot.heatUp(new ItemStack(ModItems.blade_meteorite)), 0.0F);
|
||||
GameRegistry.addSmelting(ModItems.meteorite_sword, ItemHot.heatUp(new ItemStack(ModItems.meteorite_sword_seared)), 0.0F);
|
||||
|
||||
|
||||
GameRegistry.addSmelting(new ItemStack(ModItems.scrap_plastic, 1, OreDictionary.WILDCARD_VALUE), new ItemStack(ModItems.ingot_polymer), 0.1F);
|
||||
|
||||
|
||||
for(EnumBedrockOre ore : EnumBedrockOre.values()) {
|
||||
int i = ore.ordinal();
|
||||
GameRegistry.addSmelting(new ItemStack(ModItems.ore_bedrock, 1, i), new ItemStack(Blocks.cobblestone, 16), 0.1F);
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < 10; i++)
|
||||
GameRegistry.addSmelting(new ItemStack(ModItems.ingot_steel_dusted, 1, i), ItemHot.heatUp(new ItemStack(ModItems.ingot_steel_dusted, 1, i)), 1.0F);
|
||||
}
|
||||
|
||||
@ -158,8 +158,6 @@ public class WeaponRecipes {
|
||||
|
||||
|
||||
//Ammo assemblies
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pellet_flechette, 1), new Object[] { " L ", " L ", "LLL", 'L', PB.nugget() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.pellet_claws, 1), new Object[] { " X ", "X X", " XX", 'X', STEEL.plate() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', GOLD.wireFine(), 'P', STEEL.plate(), 'S', STEEL.shell(), 'E', ModItems.ball_tatb });
|
||||
|
||||
//240mm Shells
|
||||
|
||||
@ -201,7 +201,7 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
|
||||
if(!worldObj.isRemote && loaderTicket != null) {
|
||||
clearChunkLoader();
|
||||
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(newChunkX, newChunkZ));
|
||||
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(newChunkX + (int) Math.ceil((this.posX + this.motionX) / 16D), newChunkZ + (int) Math.ceil((this.posZ + this.motionZ) / 16D)));
|
||||
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair((int) Math.ceil((this.posX + this.motionX) / 16D), (int) Math.ceil((this.posZ + this.motionZ) / 16D)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.conveyor.IConveyorItem;
|
||||
import api.hbm.conveyor.IEnterableBlock;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -14,6 +15,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class EntityMovingItem extends EntityMovingConveyorObject implements IConveyorItem {
|
||||
|
||||
public EntityItem cacheForRender = null;
|
||||
|
||||
public EntityMovingItem(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
@ -31,10 +34,11 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
|
||||
return stack == null ? new ItemStack(Blocks.stone) : stack;
|
||||
}
|
||||
|
||||
/** Adds the item to the player's inventory */
|
||||
@Override
|
||||
public boolean interactFirst(EntityPlayer player) {
|
||||
|
||||
if(!worldObj.isRemote && player.inventory.addItemStackToInventory(this.getItemStack().copy())) {
|
||||
if(!worldObj.isRemote && !this.isDead && player.inventory.addItemStackToInventory(this.getItemStack().copy())) {
|
||||
player.inventoryContainer.detectAndSendChanges();
|
||||
this.setDead();
|
||||
}
|
||||
@ -42,13 +46,21 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Knocks the item off the belt */
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
public boolean hitByEntity(Entity attacker) {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(!worldObj.isRemote && !this.isDead) {
|
||||
this.setDead();
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, this.getItemStack()));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Ensures the item is knocked off the belt due to non-player attacks (explosions, etc) */
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
this.hitByEntity(source.getEntity());
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -57,6 +69,23 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
|
||||
this.getDataWatcher().addObjectByDataType(10, 5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
super.onUpdate();
|
||||
|
||||
if(worldObj.isRemote) {
|
||||
ItemStack item = this.getItemStack();
|
||||
//initial cache creation
|
||||
if(this.cacheForRender == null) {
|
||||
cacheForRender = new EntityItem(worldObj, 0, 0, 0, item);
|
||||
}
|
||||
//if the cache is no longer relevant, update
|
||||
if(!ItemStack.areItemStacksEqual(cacheForRender.getEntityItem(), item)) {
|
||||
cacheForRender.setEntityItemStack(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -78,6 +107,7 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
|
||||
|
||||
@Override
|
||||
public void enterBlock(IEnterableBlock enterable, BlockPos pos, ForgeDirection dir) {
|
||||
if(this.isDead) return;
|
||||
|
||||
if(enterable.canItemEnter(worldObj, pos.getX(), pos.getY(), pos.getZ(), dir, this)) {
|
||||
enterable.onItemEnter(worldObj, pos.getX(), pos.getY(), pos.getZ(), dir, this);
|
||||
@ -88,6 +118,8 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
|
||||
@Override
|
||||
public boolean onLeaveConveyor() {
|
||||
|
||||
if(this.isDead) return true;
|
||||
|
||||
this.setDead();
|
||||
EntityItem item = new EntityItem(worldObj, posX + motionX * 2, posY + motionY * 2, posZ + motionZ * 2, this.getItemStack());
|
||||
item.motionX = this.motionX * 2;
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
|
||||
import api.hbm.conveyor.IConveyorPackage;
|
||||
import api.hbm.conveyor.IEnterableBlock;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -38,7 +39,7 @@ public class EntityMovingPackage extends EntityMovingConveyorObject implements I
|
||||
@Override
|
||||
public boolean interactFirst(EntityPlayer player) {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(!worldObj.isRemote && !this.isDead) {
|
||||
|
||||
for(ItemStack stack : contents) {
|
||||
if(!player.inventory.addItemStackToInventory(stack.copy())) {
|
||||
@ -53,15 +54,21 @@ public class EntityMovingPackage extends EntityMovingConveyorObject implements I
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
public boolean hitByEntity(Entity attacker) {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
if(!worldObj.isRemote && !this.isDead) {
|
||||
this.setDead();
|
||||
|
||||
for(ItemStack stack : contents) {
|
||||
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY + 0.125, posZ, stack));
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean attackEntityFrom(DamageSource source, float amount) {
|
||||
this.hitByEntity(source.getEntity());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@ -8,7 +8,6 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.MobConfig;
|
||||
import com.hbm.entity.mob.ai.EntityAIBreaking;
|
||||
import com.hbm.entity.pathfinder.PathFinderUtils;
|
||||
import com.hbm.entity.projectile.EntityBullet;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
@ -141,24 +140,6 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
|
||||
|
||||
@Override
|
||||
public void attackEntityWithRangedAttack(EntityLivingBase entity, float f) {
|
||||
|
||||
if(this.getEquipmentInSlot(0) != null) {
|
||||
if(this.getEquipmentInSlot(0).getItem() == ModItems.gun_heavy_revolver) {
|
||||
EntityBullet bullet = new EntityBullet(worldObj, this, entity, 3F, 2);
|
||||
bullet.damage = 10;
|
||||
this.worldObj.spawnEntityInWorld(bullet);
|
||||
this.playSound("hbm:weapon.revolverShootAlt", 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
if(this.getEquipmentInSlot(0).getItem() == ModItems.gun_spas12) {
|
||||
for(int i = 0; i < 7; i++) {
|
||||
EntityBullet bullet = new EntityBullet(worldObj, this, entity, 3F, 5);
|
||||
bullet.damage = 3;
|
||||
this.worldObj.spawnEntityInWorld(bullet);
|
||||
}
|
||||
this.playSound("hbm:weapon.shotgunShoot", 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static final Set<Block> canDestroy = new HashSet();
|
||||
|
||||
@ -78,7 +78,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread + gunSpread);
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, gunSpread);
|
||||
}
|
||||
|
||||
/** For turrets - angles are in radians, and pitch is negative! */
|
||||
@ -94,7 +94,7 @@ public class EntityBulletBaseMK4 extends EntityThrowableInterp {
|
||||
this.motionX = -MathHelper.sin(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionZ = MathHelper.cos(this.rotationYaw / 180.0F * (float) Math.PI) * MathHelper.cos(this.rotationPitch / 180.0F * (float) Math.PI);
|
||||
this.motionY = (-MathHelper.sin(this.rotationPitch / 180.0F * (float) Math.PI));
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, this.config.spread + gunSpread);
|
||||
this.setThrowableHeading(this.motionX, this.motionY, this.motionZ, 1.0F, gunSpread);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -42,7 +42,7 @@ import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@Spaghetti("no")
|
||||
@Spaghetti("my eyes are bleeding")
|
||||
public class ExplosionChaos {
|
||||
|
||||
private final static Random random = new Random();
|
||||
|
||||
@ -28,6 +28,7 @@ import net.minecraft.world.ChunkPosition;
|
||||
import net.minecraft.world.Explosion;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@Deprecated
|
||||
public class ExplosionNT extends Explosion {
|
||||
|
||||
public Set<ExAttrib> atttributes = new HashSet();
|
||||
|
||||
@ -25,8 +25,8 @@ public class HbmKeybinds {
|
||||
public static KeyBinding hudKey = new KeyBinding(category + ".toggleHUD", Keyboard.KEY_V, category);
|
||||
public static KeyBinding dashKey = new KeyBinding(category + ".dash", Keyboard.KEY_LSHIFT, category);
|
||||
public static KeyBinding trainKey = new KeyBinding(category + ".trainInv", Keyboard.KEY_R, category);
|
||||
|
||||
public static KeyBinding copyToolAlt = new KeyBinding(category + ".copyToolAlt", Keyboard.KEY_LMENU, category);
|
||||
|
||||
public static KeyBinding copyToolCtrl = new KeyBinding(category + ".copyToolCtrl", Keyboard.KEY_LCONTROL, category);
|
||||
|
||||
public static KeyBinding reloadKey = new KeyBinding(category + ".reload", Keyboard.KEY_R, category);
|
||||
|
||||
@ -82,7 +82,7 @@ public abstract class WeaponAbility {
|
||||
if(victim instanceof EntityLivingBase) {
|
||||
|
||||
EntityLivingBase living = (EntityLivingBase) victim;
|
||||
|
||||
if(living.getHealth() <= 0) return;
|
||||
living.setHealth(living.getHealth() - amount);
|
||||
if(living.getHealth() <= 0) living.onDeath(DamageSource.magic);
|
||||
player.heal(amount);
|
||||
|
||||
@ -10,10 +10,12 @@ import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingStep;
|
||||
import com.hbm.inventory.fluid.trait.FT_Heatable.HeatingType;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class BoilingHandler extends NEIUniversalHandler {
|
||||
|
||||
public BoilingHandler() {
|
||||
super(ModBlocks.machine_boiler.getLocalizedName(), ModBlocks.machine_boiler, generateRecipes());
|
||||
super(ModBlocks.machine_boiler.getLocalizedName(), new ItemStack[] { new ItemStack(ModBlocks.machine_boiler), new ItemStack(ModBlocks.machine_industrial_boiler) }, generateRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
16
src/main/java/com/hbm/handler/nei/CompressorHandler.java
Normal file
16
src/main/java/com/hbm/handler/nei/CompressorHandler.java
Normal file
@ -0,0 +1,16 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.CompressorRecipes;
|
||||
|
||||
public class CompressorHandler extends NEIUniversalHandler {
|
||||
|
||||
public CompressorHandler() {
|
||||
super(ModBlocks.machine_compressor.getLocalizedName(), ModBlocks.machine_compressor, CompressorRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmCompressor";
|
||||
}
|
||||
}
|
||||
27
src/main/java/com/hbm/handler/nei/DeuteriumHandler.java
Normal file
27
src/main/java/com/hbm/handler/nei/DeuteriumHandler.java
Normal file
@ -0,0 +1,27 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class DeuteriumHandler extends NEIUniversalHandler {
|
||||
|
||||
public DeuteriumHandler() {
|
||||
super(ModBlocks.machine_deuterium_extractor.getLocalizedName(), new ItemStack[] { new ItemStack(ModBlocks.machine_deuterium_extractor), new ItemStack(ModBlocks.machine_deuterium_tower) }, generateRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmDeuterium";
|
||||
}
|
||||
|
||||
public static HashMap<Object, Object> generateRecipes() {
|
||||
HashMap<Object, Object> map = new HashMap();
|
||||
map.put(ItemFluidIcon.make(Fluids.WATER, 1_000), ItemFluidIcon.make(Fluids.HEAVYWATER, 20));
|
||||
return map;
|
||||
}
|
||||
}
|
||||
@ -242,19 +242,19 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
|
||||
case 6: return new int[][] {
|
||||
{102, 6}, {120, 6},
|
||||
{102, 24}, {120, 24},
|
||||
{102, 32}, {120, 32},
|
||||
{102, 42}, {120, 42},
|
||||
};
|
||||
case 7: return new int[][] {
|
||||
{102, 6}, {120, 6},
|
||||
{102, 24}, {120, 24},
|
||||
{102, 32}, {120, 32},
|
||||
{102, 42}, {120, 42},
|
||||
{138, 24},
|
||||
};
|
||||
case 8: return new int[][] {
|
||||
{102, 6}, {120, 6},
|
||||
{102, 24}, {120, 24},
|
||||
{102, 32}, {120, 32},
|
||||
{138, 24}, {138, 32},
|
||||
{102, 42}, {120, 42},
|
||||
{138, 24}, {138, 42},
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
37
src/main/java/com/hbm/handler/nei/OreSlopperHandler.java
Normal file
37
src/main/java/com/hbm/handler/nei/OreSlopperHandler.java
Normal file
@ -0,0 +1,37 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.items.special.ItemBedrockOreNew;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class OreSlopperHandler extends NEIUniversalHandler {
|
||||
|
||||
public OreSlopperHandler() {
|
||||
super(ModBlocks.machine_ore_slopper.getLocalizedName(), ModBlocks.machine_ore_slopper, getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmOreSlopper";
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
List<ItemStack> outputs = new ArrayList();
|
||||
for(BedrockOreType type : BedrockOreType.values()) outputs.add(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type));
|
||||
outputs.add(ItemFluidIcon.make(Fluids.SLOP, 1000));
|
||||
recipes.put(new ItemStack[] {ItemFluidIcon.make(Fluids.WATER, 1000), new ItemStack(ModItems.bedrock_ore_base)}, outputs.toArray(new ItemStack[0]));
|
||||
|
||||
return recipes;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,37 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.ParticleAcceleratorRecipes;
|
||||
import com.hbm.inventory.recipes.ParticleAcceleratorRecipes.ParticleAcceleratorRecipe;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class ParticleAcceleratorHandler extends NEIUniversalHandler {
|
||||
|
||||
public ParticleAcceleratorHandler() {
|
||||
super(ModBlocks.pa_detector.getLocalizedName(), ModBlocks.pa_detector, ParticleAcceleratorRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmParticleAccelerator";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
|
||||
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
|
||||
|
||||
ParticleAcceleratorRecipe paRecipe = ParticleAcceleratorRecipes.getOutput(rec.input[0].item, rec.input[1].item);
|
||||
|
||||
if(paRecipe != null) {
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
String momentum = "Momentum: " + String.format(Locale.US, "%,d", paRecipe.momentum);
|
||||
int side = 8;
|
||||
fontRenderer.drawString(momentum, side, 52, 0x404040);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -10,8 +10,7 @@ public class RTGRecipeHandler extends NEIUniversalHandler {
|
||||
public RTGRecipeHandler() {
|
||||
super("RTG", new ItemStack[] {
|
||||
new ItemStack(ModBlocks.machine_rtg_grey),
|
||||
new ItemStack(ModBlocks.machine_difurnace_rtg_off),
|
||||
new ItemStack(ModBlocks.machine_rtg_furnace_off)
|
||||
new ItemStack(ModBlocks.machine_difurnace_rtg_off)
|
||||
}, ItemRTGPellet.getRecipeMap());
|
||||
}
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ import net.minecraftforge.oredict.OreDictionary.OreRegisterEvent;
|
||||
//the more i optimize this, the more it starts looking like gregtech
|
||||
@NotableComments
|
||||
public class OreDictManager {
|
||||
|
||||
|
||||
/** Alternate, additional names for ore dict registration. Used mostly for DictGroups */
|
||||
private static final HashMap<String, HashSet<String>> reRegistration = new HashMap();
|
||||
|
||||
@ -70,7 +70,7 @@ public class OreDictManager {
|
||||
public static final String KEY_SAPLING = "treeSapling";
|
||||
public static final String KEY_SAND = "sand";
|
||||
public static final String KEY_COBBLESTONE = "cobblestone";
|
||||
|
||||
|
||||
public static final String KEY_BLACK = "dyeBlack";
|
||||
public static final String KEY_RED = "dyeRed";
|
||||
public static final String KEY_GREEN = "dyeGreen";
|
||||
@ -155,45 +155,45 @@ public class OreDictManager {
|
||||
/*
|
||||
* STABLE
|
||||
*/
|
||||
/** TITANIUM */
|
||||
/** TITANIUM */
|
||||
public static final DictFrame TI = new DictFrame("Titanium");
|
||||
/** COPPER */
|
||||
/** COPPER */
|
||||
public static final DictFrame CU = new DictFrame("Copper");
|
||||
public static final DictFrame MINGRADE = new DictFrame("Mingrade");
|
||||
public static final DictFrame ALLOY = new DictFrame("AdvancedAlloy");
|
||||
/** TUNGSTEN */
|
||||
/** TUNGSTEN */
|
||||
public static final DictFrame W = new DictFrame("Tungsten");
|
||||
/** ALUMINUM */
|
||||
/** ALUMINUM */
|
||||
public static final DictFrame AL = new DictFrame("Aluminum");
|
||||
public static final DictFrame STEEL = new DictFrame("Steel");
|
||||
/** TECHNETIUM STEEL */
|
||||
/** TECHNETIUM STEEL */
|
||||
public static final DictFrame TCALLOY = new DictFrame("TcAlloy");
|
||||
/** CADMIUM STEEL */
|
||||
public static final DictFrame CDALLOY = new DictFrame("CdAlloy");
|
||||
/** BISMUTH BRONZE */
|
||||
/** BISMUTH BRONZE */
|
||||
public static final DictFrame BBRONZE = new DictFrame("BismuthBronze");
|
||||
/** ARSENIC BRONZE */
|
||||
public static final DictFrame ABRONZE = new DictFrame("ArsenicBronze");
|
||||
/** BISMUTH STRONTIUM CALCIUM COPPER OXIDE */
|
||||
public static final DictFrame BSCCO = new DictFrame("BSCCO");
|
||||
/** LEAD */
|
||||
/** LEAD */
|
||||
public static final DictFrame PB = new DictFrame("Lead");
|
||||
public static final DictFrame BI = new DictFrame("Bismuth");
|
||||
public static final DictFrame AS = new DictFrame("Arsenic");
|
||||
public static final DictFrame CA = new DictFrame("Calcium");
|
||||
public static final DictFrame CD = new DictFrame("Cadmium");
|
||||
/** TANTALUM */
|
||||
/** TANTALUM */
|
||||
public static final DictFrame TA = new DictFrame("Tantalum");
|
||||
public static final DictFrame COLTAN = new DictFrame("Coltan");
|
||||
/** NIOBIUM */
|
||||
/** NIOBIUM */
|
||||
public static final DictFrame NB = new DictFrame("Niobium");
|
||||
/** BERYLLIUM */
|
||||
/** BERYLLIUM */
|
||||
public static final DictFrame BE = new DictFrame("Beryllium");
|
||||
/** COBALT */
|
||||
/** COBALT */
|
||||
public static final DictFrame CO = new DictFrame("Cobalt");
|
||||
/** BORON */
|
||||
/** BORON */
|
||||
public static final DictFrame B = new DictFrame("Boron");
|
||||
/** SILICON */
|
||||
/** SILICON */
|
||||
public static final DictFrame SI = new DictFrame("Silicon");
|
||||
public static final DictFrame GRAPHITE = new DictFrame("Graphite");
|
||||
public static final DictFrame CARBON = new DictFrame("Carbon");
|
||||
@ -221,11 +221,11 @@ public class OreDictManager {
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
*/
|
||||
/** SULFUR */
|
||||
/** SULFUR */
|
||||
public static final DictFrame S = new DictFrame("Sulfur");
|
||||
/** SALTPETER/NITER */
|
||||
/** SALTPETER/NITER */
|
||||
public static final DictFrame KNO = new DictFrame("Saltpeter");
|
||||
/** FLUORITE */
|
||||
/** FLUORITE */
|
||||
public static final DictFrame F = new DictFrame("Fluorite");
|
||||
public static final DictFrame LIGNITE = new DictFrame("Lignite");
|
||||
public static final DictFrame COALCOKE = new DictFrame("CoalCoke");
|
||||
@ -241,10 +241,12 @@ public class OreDictManager {
|
||||
public static final DictFrame MALACHITE = new DictFrame("Malachite");
|
||||
public static final DictFrame LIMESTONE = new DictFrame("Limestone");
|
||||
public static final DictFrame SLAG = new DictFrame("Slag");
|
||||
public static final DictFrame BAUXITE = new DictFrame("Bauxite");
|
||||
public static final DictFrame CRYOLITE = new DictFrame("Cryolite");
|
||||
/*
|
||||
* HAZARDS, MISC
|
||||
*/
|
||||
/** LITHIUM */
|
||||
/** LITHIUM */
|
||||
public static final DictFrame LI = new DictFrame("Lithium");
|
||||
/** SODIUM */
|
||||
public static final DictFrame NA = new DictFrame("Sodium");
|
||||
@ -266,28 +268,28 @@ public class OreDictManager {
|
||||
* RARE EARTHS
|
||||
*/
|
||||
public static final DictFrame RAREEARTH = new DictFrame("RareEarth");
|
||||
/** LANTHANUM */
|
||||
/** LANTHANUM */
|
||||
public static final DictFrame LA = new DictFrame("Lanthanum");
|
||||
/** ZIRCONIUM */
|
||||
/** ZIRCONIUM */
|
||||
public static final DictFrame ZR = new DictFrame("Zirconium");
|
||||
/** NEODYMIUM */
|
||||
/** NEODYMIUM */
|
||||
public static final DictFrame ND = new DictFrame("Neodymium");
|
||||
/** CERIUM */
|
||||
/** CERIUM */
|
||||
public static final DictFrame CE = new DictFrame("Cerium");
|
||||
/*
|
||||
* NITAN
|
||||
*/
|
||||
/** IODINE */
|
||||
/** IODINE */
|
||||
public static final DictFrame I = new DictFrame("Iodine");
|
||||
/** ASTATINE */
|
||||
/** ASTATINE */
|
||||
public static final DictFrame AT = new DictFrame("Astatine");
|
||||
/** CAESIUM */
|
||||
/** CAESIUM */
|
||||
public static final DictFrame CS = new DictFrame("Caesium");
|
||||
/** STRONTIUM */
|
||||
/** STRONTIUM */
|
||||
public static final DictFrame ST = new DictFrame("Strontium");
|
||||
/** BROMINE */
|
||||
/** BROMINE */
|
||||
public static final DictFrame BR = new DictFrame("Bromine");
|
||||
/** TENNESSINE */
|
||||
/** TENNESSINE */
|
||||
public static final DictFrame TS = new DictFrame("Tennessine") ;
|
||||
/*
|
||||
* FISSION FRAGMENTS
|
||||
@ -298,12 +300,12 @@ public class OreDictManager {
|
||||
public static final DictFrame XE135 = new DictFrame("Xenon135", "Xe135");
|
||||
public static final DictFrame CS137 = new DictFrame("Caesium137", "Cs137");
|
||||
public static final DictFrame AT209 = new DictFrame("Astatine209", "At209");
|
||||
|
||||
|
||||
/*
|
||||
* COLLECTIONS
|
||||
*/
|
||||
/** Any form of elastic polymer */
|
||||
public static final DictGroup ANY_RUBBER = new DictGroup("AnyRubber", LATEX, RUBBER);
|
||||
public static final DictGroup ANY_RUBBER = new DictGroup("AnyRubber", LATEX, RUBBER);
|
||||
/** Any post oil polymer like teflon ("polymer") or bakelite */
|
||||
public static final DictGroup ANY_PLASTIC = new DictGroup("AnyPlastic", POLYMER, BAKELITE); //using the Any prefix means that it's just the secondary prefix, and that shape prefixes are applicable
|
||||
/** Any post vacuum polymer like PET or PVC */
|
||||
@ -327,7 +329,7 @@ public class OreDictManager {
|
||||
public static final DictFrame ANY_BISMOID = new DictFrame("AnyBismoid");
|
||||
public static final DictFrame ANY_ASH = new DictFrame("Ash");
|
||||
|
||||
|
||||
|
||||
public static void registerOres() {
|
||||
|
||||
/*
|
||||
@ -341,7 +343,7 @@ public class OreDictManager {
|
||||
QUARTZ.dust(powder_quartz);
|
||||
DIAMOND.dust(powder_diamond).ore(gravel_diamond, ore_sellafield_diamond);
|
||||
EMERALD.dust(powder_emerald).ore(ore_sellafield_emerald);
|
||||
|
||||
|
||||
/*
|
||||
* RADIOACTIVE
|
||||
*/
|
||||
@ -373,7 +375,7 @@ public class OreDictManager {
|
||||
SRN .rad(HazardRegistry.sr) .blinding(50F) .ingot(ingot_schraranium) .block(block_schraranium);
|
||||
GH336 .rad(HazardRegistry.gh336) .nugget(nugget_gh336) .billet(billet_gh336) .ingot(ingot_gh336);
|
||||
MUD .rad(HazardRegistry.mud) .ingot(ingot_mud);
|
||||
|
||||
|
||||
/*
|
||||
* STABLE
|
||||
*/
|
||||
@ -442,10 +444,12 @@ public class OreDictManager {
|
||||
SODALITE .gem(gem_sodalite);
|
||||
VOLCANIC .gem(gem_volcanic) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM));
|
||||
HEMATITE .ore(fromOne(stone_resource, EnumStoneType.HEMATITE));
|
||||
MALACHITE .ore(fromOne(stone_resource, EnumStoneType.MALACHITE));
|
||||
MALACHITE .ingot(DictFrame.fromOne(chunk_ore, EnumChunkType.MALACHITE)) .ore(fromOne(stone_resource, EnumStoneType.MALACHITE));
|
||||
LIMESTONE .dust(powder_limestone) .ore(fromOne(stone_resource, EnumStoneType.LIMESTONE));
|
||||
BAUXITE .gem(fromOne(stone_resource, EnumStoneType.BAUXITE));
|
||||
CRYOLITE .crystal(fromOne(chunk_ore, EnumChunkType.CRYOLITE));
|
||||
SLAG .block(block_slag);
|
||||
|
||||
|
||||
/*
|
||||
* HAZARDS, MISC
|
||||
*/
|
||||
@ -457,7 +461,7 @@ public class OreDictManager {
|
||||
*/
|
||||
P_WHITE .hot(5) .ingot(ingot_phosphorus) .block(block_white_phosphorus);
|
||||
P_RED .dust(powder_fire) .block(block_red_phosphorus);
|
||||
|
||||
|
||||
/*
|
||||
* RARE METALS
|
||||
*/
|
||||
@ -476,7 +480,7 @@ public class OreDictManager {
|
||||
ZR .nugget(nugget_zirconium) .ingot(ingot_zirconium) .billet(billet_zirconium) .dust(powder_zirconium) .block(block_zirconium) .ore(ore_depth_zirconium);
|
||||
ND .nugget(fragment_neodymium) .dustSmall(powder_neodymium_tiny) .dust(powder_neodymium) .ore(ore_depth_nether_neodymium) .oreNether(ore_depth_nether_neodymium);
|
||||
CE .nugget(fragment_cerium) .dustSmall(powder_cerium_tiny) .dust(powder_cerium);
|
||||
|
||||
|
||||
/*
|
||||
* NITAN
|
||||
*/
|
||||
@ -496,7 +500,7 @@ public class OreDictManager {
|
||||
XE135 .rad(HazardRegistry.xe135) .hot(10F) .dustSmall(powder_xe135_tiny) .dust(powder_xe135);
|
||||
CS137 .rad(HazardRegistry.cs137) .hot(3F) .hydro(3F) .dustSmall(powder_cs137_tiny) .dust(powder_cs137);
|
||||
AT209 .rad(HazardRegistry.at209) .hot(20F) .dust(powder_at209);
|
||||
|
||||
|
||||
/*
|
||||
* COLLECTIONS
|
||||
*/
|
||||
@ -566,7 +570,7 @@ public class OreDictManager {
|
||||
if(mat.autogen.contains(MaterialShapes.STOCK)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.STOCK.name() + name, new ItemStack(ModItems.part_stock, 1, mat.id));
|
||||
if(mat.autogen.contains(MaterialShapes.GRIP)) for(String name : mat.names) OreDictionary.registerOre(MaterialShapes.GRIP.name() + name, new ItemStack(ModItems.part_grip, 1, mat.id));
|
||||
}
|
||||
|
||||
|
||||
for(EnumBedrockOre ore : EnumBedrockOre.values()) {
|
||||
OreDictionary.registerOre("ore" + ore.oreName, new ItemStack(ModItems.ore_enriched, 1, ore.ordinal()));
|
||||
}
|
||||
@ -574,17 +578,17 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("itemRubber", ingot_rubber);
|
||||
|
||||
OreDictionary.registerOre("coalCoke", fromOne(coke, EnumCokeType.COAL));
|
||||
|
||||
|
||||
for(String name : new String[] {"fuelCoke", "coke"}) {
|
||||
OreDictionary.registerOre(name, fromOne(coke, EnumCokeType.COAL));
|
||||
OreDictionary.registerOre(name, fromOne(coke, EnumCokeType.LIGNITE));
|
||||
OreDictionary.registerOre(name, fromOne(coke, EnumCokeType.PETROLEUM));
|
||||
}
|
||||
|
||||
|
||||
OreDictionary.registerOre("briquetteCoal", fromOne(briquette, EnumBriquetteType.COAL));
|
||||
OreDictionary.registerOre("briquetteLignite", fromOne(briquette, EnumBriquetteType.LIGNITE));
|
||||
OreDictionary.registerOre("briquetteWood", fromOne(briquette, EnumBriquetteType.WOOD));
|
||||
|
||||
|
||||
OreDictionary.registerOre(getReflector(), neutron_reflector);
|
||||
|
||||
OreDictionary.registerOre("logWood", pink_log);
|
||||
@ -595,13 +599,13 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre("slabWoodPink", pink_slab);
|
||||
OreDictionary.registerOre("stairWood", pink_stairs);
|
||||
OreDictionary.registerOre("stairWoodPink", pink_stairs);
|
||||
|
||||
|
||||
String[] dyes = { "Black", "Red", "Green", "Brown", "Blue", "Purple", "Cyan", "LightGray", "Gray", "Pink", "Lime", "Yellow", "LightBlue", "Magenta", "Orange", "White" };
|
||||
for(int i = 0; i < 16; i++) {
|
||||
String dyeName = "dye" + dyes[i];
|
||||
|
||||
|
||||
OreDictionary.registerOre(dyeName, new ItemStack(ModItems.chemical_dye, 1, i));
|
||||
|
||||
|
||||
OreDictionary.registerOre(dyeName, new ItemStack(ModItems.crayon, 1, i));
|
||||
}
|
||||
OreDictionary.registerOre("dye", new ItemStack(chemical_dye, 1, OreDictionary.WILDCARD_VALUE));
|
||||
@ -651,7 +655,7 @@ public class OreDictManager {
|
||||
|
||||
OreDictionary.registerOre("container1000lubricant", bdcl);
|
||||
OreDictionary.registerOre("itemSilicon", billet_silicon);
|
||||
|
||||
|
||||
for(NTMMaterial mat : Mats.orderedList) {
|
||||
if(mat.autogen.contains(MaterialShapes.FRAGMENT)) {
|
||||
String name = mat.names[0];
|
||||
@ -663,15 +667,15 @@ public class OreDictManager {
|
||||
else MineralRecipes.add9To1(mat.make(ModItems.bedrock_ore_fragment), new ItemStack(ModItems.nothing));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
MaterialShapes.registerCompatShapes();
|
||||
compensateMojangSpaghettiBullshit();
|
||||
}
|
||||
|
||||
|
||||
public static String getReflector() {
|
||||
return GeneralConfig.enableReflectorCompat ? "plateDenseLead" : "plateTungCar"; //let's just mangle the name into "tungCar" so that it can't conflict with anything ever
|
||||
}
|
||||
|
||||
|
||||
public static void registerGroups() {
|
||||
ANY_RUBBER.addPrefix(INGOT, true);
|
||||
ANY_PLASTIC.addPrefix(INGOT, true).addPrefix(DUST, true).addPrefix(BLOCK, true).addPrefix(GRIP, true).addPrefix(STOCK, true);
|
||||
@ -681,24 +685,24 @@ public class OreDictManager {
|
||||
ANY_BISMOIDBRONZE.addPrefix(INGOT, true).addPrefix(CASTPLATE, true).addPrefix(LIGHTBARREL, true).addPrefix(HEAVYBARREL, true).addPrefix(LIGHTRECEIVER, true).addPrefix(HEAVYRECEIVER, true);
|
||||
ANY_TAR.addPrefix(ANY, false);
|
||||
}
|
||||
|
||||
|
||||
private static boolean recursionBrake = false;
|
||||
|
||||
|
||||
@SubscribeEvent
|
||||
public void onRegisterOre(OreRegisterEvent event) {
|
||||
if(recursionBrake) return;
|
||||
|
||||
|
||||
recursionBrake = true;
|
||||
|
||||
|
||||
HashSet<String> strings = reRegistration.get(event.Name);
|
||||
|
||||
|
||||
if(strings != null) {
|
||||
for(String name : strings) {
|
||||
OreDictionary.registerOre(name, event.Ore);
|
||||
MainRegistry.logger.info("Re-registration for " + event.Name + " to " + name);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
recursionBrake = false;
|
||||
|
||||
if(event.Name.startsWith("ingot") || event.Name.startsWith("ore") || event.Name.startsWith("plate") || event.Name.startsWith("block")) {
|
||||
@ -707,7 +711,7 @@ public class OreDictManager {
|
||||
}
|
||||
|
||||
public static final HashSet<ComparableStack> arcSmeltable = new HashSet();
|
||||
|
||||
|
||||
/** Vanilla item ore dict registration events never actually register in the ODM because vanilla items are registered so early that the ODM event handler doesn't exist yet. */
|
||||
public static void compensateMojangSpaghettiBullshit() {
|
||||
|
||||
@ -730,12 +734,12 @@ public class OreDictManager {
|
||||
arcSmeltable.add(new ComparableStack(Items.brick));
|
||||
arcSmeltable.add(new ComparableStack(Items.netherbrick));
|
||||
}
|
||||
|
||||
|
||||
public static class DictFrame {
|
||||
public String[] mats;
|
||||
float hazMult = 1.0F;
|
||||
List<HazardEntry> hazards = new ArrayList();
|
||||
|
||||
|
||||
public DictFrame(String... mats) {
|
||||
this.mats = mats;
|
||||
}
|
||||
@ -772,14 +776,14 @@ public class OreDictManager {
|
||||
public String stock() { return STOCK.name() + mats[0]; }
|
||||
public String grip() { return GRIP.name() + mats[0]; }
|
||||
public String[] all(MaterialShapes shape) { return appendToAll(shape.prefixes); }
|
||||
|
||||
|
||||
/** Returns cast (triple) plates if 528 mode is enabled or normal plates if not */
|
||||
public String plate528() { return GeneralConfig.enable528 ? plateCast() : plate(); }
|
||||
|
||||
|
||||
private String[] appendToAll(String... prefix) {
|
||||
|
||||
|
||||
String[] names = new String[mats.length * prefix.length];
|
||||
|
||||
|
||||
for(int i = 0; i < mats.length; i++) {
|
||||
for(int j = 0; j < prefix.length; j++) {
|
||||
names[i * prefix.length + j] = prefix[j] + mats[i];
|
||||
@ -793,12 +797,12 @@ public class OreDictManager {
|
||||
public DictFrame blinding(float time) { return this.haz(new HazardEntry(HazardRegistry.BLINDING, time)); }
|
||||
public DictFrame asbestos(float asb) { return this.haz(new HazardEntry(HazardRegistry.ASBESTOS, asb)); }
|
||||
public DictFrame hydro(float h) { return this.haz(new HazardEntry(HazardRegistry.HYDROACTIVE, h)); }
|
||||
|
||||
|
||||
public DictFrame haz(HazardEntry hazard) {
|
||||
hazards.add(hazard);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/** Returns an ItemStack composed of the supplied item with the meta being the enum's ordinal. Purely syntactic candy */
|
||||
public static ItemStack fromOne(Item item, Enum en) {
|
||||
return new ItemStack(item, 1, en.ordinal());
|
||||
@ -816,7 +820,7 @@ public class OreDictManager {
|
||||
public static Object[] fromAll(Item item, Class<? extends Enum> en) {
|
||||
Enum[] vals = en.getEnumConstants();
|
||||
Object[] stacks = new Object[vals.length];
|
||||
|
||||
|
||||
for(int i = 0; i < vals.length; i++) {
|
||||
stacks[i] = new ItemStack(item, 1, vals[i].ordinal());
|
||||
}
|
||||
@ -825,13 +829,13 @@ public class OreDictManager {
|
||||
public static Object[] fromAll(Block block, Class<? extends Enum> en) {
|
||||
Enum[] vals = en.getEnumConstants();
|
||||
Object[] stacks = new Object[vals.length];
|
||||
|
||||
|
||||
for(int i = 0; i < vals.length; i++) {
|
||||
stacks[i] = new ItemStack(block, 1, vals[i].ordinal());
|
||||
}
|
||||
return stacks;
|
||||
}
|
||||
|
||||
|
||||
public DictFrame any(Object... thing) {
|
||||
return makeObject(ANY, thing);
|
||||
}
|
||||
@ -871,7 +875,7 @@ public class OreDictManager {
|
||||
hazMult = HazardRegistry.billet;
|
||||
return makeObject(BILLET, billet);
|
||||
}
|
||||
|
||||
|
||||
public DictFrame block(Object... block) {
|
||||
hazMult = HazardRegistry.block;
|
||||
return makeObject(BLOCK, block);
|
||||
@ -886,17 +890,17 @@ public class OreDictManager {
|
||||
}
|
||||
|
||||
public DictFrame makeObject(MaterialShapes shape, Object... objects) {
|
||||
|
||||
|
||||
String tag = shape.name();
|
||||
for(Object o : objects) {
|
||||
if(o instanceof Item) registerStack(tag, new ItemStack((Item) o));
|
||||
if(o instanceof Block) registerStack(tag, new ItemStack((Block) o));
|
||||
if(o instanceof ItemStack) registerStack(tag, (ItemStack) o);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public DictFrame makeItem(String tag, Item... items) {
|
||||
for(Item i : items) registerStack(tag, new ItemStack(i));
|
||||
return this;
|
||||
@ -909,26 +913,26 @@ public class OreDictManager {
|
||||
for(Block b : blocks) registerStack(tag, new ItemStack(b));
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public static void registerHazards(List<HazardEntry> hazards, float hazMult, String dictKey) {
|
||||
|
||||
|
||||
if(!hazards.isEmpty() && hazMult > 0F) {
|
||||
HazardData data = new HazardData().setMutex(0b1);
|
||||
|
||||
|
||||
for(HazardEntry hazard : hazards) {
|
||||
data.addEntry(hazard.clone(hazMult));
|
||||
}
|
||||
|
||||
|
||||
HazardSystem.register(dictKey, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public void registerStack(String tag, ItemStack stack) {
|
||||
for(String mat : mats) {
|
||||
OreDictionary.registerOre(tag + mat, stack);
|
||||
registerHazards(hazards, hazMult, tag + mat);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Fix for a small oddity in nuclearcraft: many radioactive elements do not have an ore prefix and the sizes
|
||||
* seem generally inconsistent (TH and U are 20 "tiny"s per ingot while boron is 12), so we assume those to be ingots.
|
||||
@ -940,12 +944,12 @@ public class OreDictManager {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class DictGroup {
|
||||
|
||||
|
||||
private String groupName;
|
||||
private HashSet<String> names = new HashSet();
|
||||
|
||||
|
||||
public DictGroup(String groupName) {
|
||||
this.groupName = groupName;
|
||||
}
|
||||
@ -957,7 +961,7 @@ public class OreDictManager {
|
||||
this(groupName);
|
||||
this.addFrames(frames);
|
||||
}
|
||||
|
||||
|
||||
public DictGroup addNames(String... names) {
|
||||
for(String mat : names) this.names.add(mat);
|
||||
return this;
|
||||
@ -966,22 +970,22 @@ public class OreDictManager {
|
||||
for(DictFrame frame : frames) this.addNames(frame.mats);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Will add a reregistration entry for every mat name of every added DictFrame for the given prefix
|
||||
* @param prefix The prefix of both the input and result of the reregistration
|
||||
* @return
|
||||
*/
|
||||
public DictGroup addPrefix(MaterialShapes shape, boolean inputPrefix) {
|
||||
|
||||
|
||||
String prefix = shape.name();
|
||||
String group = prefix + groupName;
|
||||
|
||||
|
||||
for(String name : names) {
|
||||
String original = (inputPrefix ? prefix : "") + name;
|
||||
addReRegistration(original, group);
|
||||
}
|
||||
|
||||
|
||||
return this;
|
||||
}
|
||||
/**
|
||||
@ -991,12 +995,12 @@ public class OreDictManager {
|
||||
* @return
|
||||
*/
|
||||
public DictGroup addFixed(String prefix, String original) {
|
||||
|
||||
|
||||
String group = prefix + groupName;
|
||||
addReRegistration(original, group);
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public String any() { return ANY.name() + groupName; }
|
||||
public String nugget() { return NUGGET.name() + groupName; }
|
||||
public String tiny() { return TINY.name() + groupName; }
|
||||
@ -1023,16 +1027,16 @@ public class OreDictManager {
|
||||
public String stock() { return STOCK.name() + groupName; }
|
||||
public String grip() { return GRIP.name() + groupName; }
|
||||
}
|
||||
|
||||
|
||||
private static void addReRegistration(String original, String additional) {
|
||||
|
||||
|
||||
HashSet<String> strings = reRegistration.get(original);
|
||||
|
||||
|
||||
if(strings == null)
|
||||
strings = new HashSet();
|
||||
|
||||
|
||||
strings.add(additional);
|
||||
|
||||
|
||||
reRegistration.put(original, strings);
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,85 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotNonRetarded;
|
||||
import com.hbm.items.tool.ItemCasingBag.InventoryCasingBag;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
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 ContainerCasingBag extends Container {
|
||||
|
||||
private InventoryCasingBag bag;
|
||||
|
||||
public ContainerCasingBag(InventoryPlayer invPlayer, InventoryCasingBag box) {
|
||||
this.bag = box;
|
||||
this.bag.openInventory();
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 5; j++) {
|
||||
this.addSlotToContainer(new SlotNonRetarded(box, j + i * 5, 44 + j * 18, 18 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
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, 100 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 158));
|
||||
}
|
||||
}
|
||||
|
||||
@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 <= bag.getSizeInventory() - 1) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, bag.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, bag.getSizeInventory(), false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
|
||||
var4.onPickupFromSlot(p_82846_1_, var5);
|
||||
}
|
||||
|
||||
return var3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
|
||||
// prevents the player from moving around the currently open box
|
||||
if(mode == 2 && button == player.inventory.currentItem) return null;
|
||||
if(index == player.inventory.currentItem + 27 + bag.getSizeInventory()) return null;
|
||||
return super.slotClick(index, button, mode, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return bag.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onContainerClosed(EntityPlayer player) {
|
||||
super.onContainerClosed(player);
|
||||
this.bag.closeInventory();
|
||||
}
|
||||
}
|
||||
@ -38,6 +38,12 @@ public class ContainerCrucible extends Container {
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack slotClick(int slot, int button, int mode, EntityPlayer player) {
|
||||
if(mode == 2) return null;
|
||||
return super.slotClick(slot, button, mode, player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack stack = null;
|
||||
|
||||
@ -42,8 +42,8 @@ public class ContainerFEL extends Container {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index == 0) {
|
||||
if(!this.mergeItemStack(stack, 1, this.inventorySlots.size(), false)) {
|
||||
if(index <= 1) {
|
||||
if(!this.mergeItemStack(stack, 2, this.inventorySlots.size(), false)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
338
src/main/java/com/hbm/inventory/container/ContainerNT.java
Normal file
338
src/main/java/com/hbm/inventory/container/ContainerNT.java
Normal file
@ -0,0 +1,338 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
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.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class ContainerNT extends Container {
|
||||
|
||||
/**
|
||||
* Fix: mergeItemStack does not respect inventory or slot stack limitations.
|
||||
* We simply intercept the method and call InventoryUtil.mergeItemStack which
|
||||
* runs the same logic but respecting stack limits.
|
||||
*/
|
||||
@Override
|
||||
protected boolean mergeItemStack(ItemStack stack, int start, int end, boolean reverse) {
|
||||
return InventoryUtil.mergeItemStack(inventorySlots, stack, start, end, reverse);
|
||||
}
|
||||
|
||||
/**
|
||||
* Fix: the default behavior of transferStackInSlot simply crashes the game.
|
||||
* We intercept this part and return null, which means that by default, the
|
||||
* shift click function does nothing.
|
||||
*/
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
return null;
|
||||
}
|
||||
|
||||
// fuck you mojang
|
||||
@Override
|
||||
public ItemStack slotClick(int index, int button, int mode, EntityPlayer player) {
|
||||
|
||||
/*
|
||||
* INDEX
|
||||
* -999: Mouse outside GUI
|
||||
* MODE
|
||||
* 2: Hotbar keys
|
||||
* 3: Duplicate item
|
||||
* 4: Drop item
|
||||
* 5: Drag
|
||||
*/
|
||||
|
||||
ItemStack returnStack = null;
|
||||
InventoryPlayer invPlayer = player.inventory;
|
||||
Slot slot = index >= 0 && index < this.inventorySlots.size() ? (Slot) this.inventorySlots.get(index) : null;
|
||||
|
||||
int i1;
|
||||
ItemStack itemstack3;
|
||||
|
||||
/// DRAG ///
|
||||
if(mode == 5) {
|
||||
int l = this.field_94536_g;
|
||||
this.field_94536_g = func_94532_c(button);
|
||||
|
||||
if((l != 1 || this.field_94536_g != 2) && l != this.field_94536_g) {
|
||||
this.func_94533_d();
|
||||
} else if(invPlayer.getItemStack() == null) {
|
||||
this.func_94533_d();
|
||||
} else if(this.field_94536_g == 0) {
|
||||
this.field_94535_f = func_94529_b(button);
|
||||
|
||||
if(func_94528_d(this.field_94535_f)) {
|
||||
this.field_94536_g = 1;
|
||||
this.field_94537_h.clear();
|
||||
} else {
|
||||
this.func_94533_d();
|
||||
}
|
||||
} else if(this.field_94536_g == 1) {
|
||||
|
||||
if(slot != null && func_94527_a(slot, invPlayer.getItemStack(), true) && slot.isItemValid(invPlayer.getItemStack())
|
||||
&& invPlayer.getItemStack().stackSize > this.field_94537_h.size() && this.canDragIntoSlot(slot)) {
|
||||
this.field_94537_h.add(slot);
|
||||
}
|
||||
} else if(this.field_94536_g == 2) {
|
||||
if(!this.field_94537_h.isEmpty()) {
|
||||
itemstack3 = invPlayer.getItemStack().copy();
|
||||
i1 = invPlayer.getItemStack().stackSize;
|
||||
Iterator iterator = this.field_94537_h.iterator();
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
Slot slot1 = (Slot) iterator.next();
|
||||
|
||||
if(slot1 != null && func_94527_a(slot1, invPlayer.getItemStack(), true) && slot1.isItemValid(invPlayer.getItemStack())
|
||||
&& invPlayer.getItemStack().stackSize >= this.field_94537_h.size() && this.canDragIntoSlot(slot1)) {
|
||||
ItemStack stackCopy = itemstack3.copy();
|
||||
int j1 = slot1.getHasStack() ? slot1.getStack().stackSize : 0;
|
||||
func_94525_a(this.field_94537_h, this.field_94535_f, stackCopy, j1);
|
||||
|
||||
if(stackCopy.stackSize > stackCopy.getMaxStackSize()) {
|
||||
stackCopy.stackSize = stackCopy.getMaxStackSize();
|
||||
}
|
||||
|
||||
if(stackCopy.stackSize > slot1.getSlotStackLimit()) {
|
||||
stackCopy.stackSize = slot1.getSlotStackLimit();
|
||||
}
|
||||
|
||||
i1 -= stackCopy.stackSize - j1;
|
||||
slot1.putStack(stackCopy);
|
||||
}
|
||||
}
|
||||
|
||||
itemstack3.stackSize = i1;
|
||||
|
||||
if(itemstack3.stackSize <= 0) {
|
||||
itemstack3 = null;
|
||||
}
|
||||
|
||||
invPlayer.setItemStack(itemstack3);
|
||||
}
|
||||
|
||||
this.func_94533_d();
|
||||
} else {
|
||||
this.func_94533_d();
|
||||
}
|
||||
/// NOBODY KNOWS ///
|
||||
} else if(this.field_94536_g != 0) {
|
||||
this.func_94533_d();
|
||||
|
||||
/// NON-DRAG ///
|
||||
} else {
|
||||
|
||||
int l1;
|
||||
ItemStack itemstack5;
|
||||
|
||||
/// LMB/RMB ///
|
||||
if((mode == 0 || mode == 1) && (button == 0 || button == 1)) {
|
||||
if(index == -999) {
|
||||
if(invPlayer.getItemStack() != null && index == -999) {
|
||||
if(button == 0) {
|
||||
player.dropPlayerItemWithRandomChoice(invPlayer.getItemStack(), true);
|
||||
invPlayer.setItemStack((ItemStack) null);
|
||||
}
|
||||
|
||||
if(button == 1) {
|
||||
player.dropPlayerItemWithRandomChoice(invPlayer.getItemStack().splitStack(1), true);
|
||||
|
||||
if(invPlayer.getItemStack().stackSize == 0) {
|
||||
invPlayer.setItemStack((ItemStack) null);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(mode == 1) {
|
||||
if(index < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.canTakeStack(player)) {
|
||||
itemstack3 = this.transferStackInSlot(player, index);
|
||||
|
||||
if(itemstack3 != null) {
|
||||
Item item = itemstack3.getItem();
|
||||
returnStack = itemstack3.copy();
|
||||
|
||||
if(slot.getStack() != null && slot.getStack().getItem() == item) {
|
||||
this.retrySlotClick(index, button, true, player);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(index < 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null) {
|
||||
itemstack3 = slot.getStack();
|
||||
ItemStack draggedStack = invPlayer.getItemStack();
|
||||
|
||||
if(itemstack3 != null) {
|
||||
returnStack = itemstack3.copy();
|
||||
}
|
||||
|
||||
if(itemstack3 == null) {
|
||||
if(draggedStack != null && slot.isItemValid(draggedStack)) {
|
||||
l1 = button == 0 ? draggedStack.stackSize : 1;
|
||||
|
||||
if(l1 > slot.getSlotStackLimit()) {
|
||||
l1 = slot.getSlotStackLimit();
|
||||
}
|
||||
|
||||
if(draggedStack.stackSize >= l1) {
|
||||
slot.putStack(draggedStack.splitStack(l1));
|
||||
}
|
||||
|
||||
if(draggedStack.stackSize == 0) {
|
||||
invPlayer.setItemStack((ItemStack) null);
|
||||
}
|
||||
}
|
||||
} else if(slot.canTakeStack(player)) {
|
||||
if(draggedStack == null) {
|
||||
l1 = button == 0 ? itemstack3.stackSize : (itemstack3.stackSize + 1) / 2;
|
||||
itemstack5 = slot.decrStackSize(l1);
|
||||
invPlayer.setItemStack(itemstack5);
|
||||
|
||||
if(itemstack3.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, invPlayer.getItemStack());
|
||||
} else if(slot.isItemValid(draggedStack)) {
|
||||
if(itemstack3.getItem() == draggedStack.getItem() && itemstack3.getItemDamage() == draggedStack.getItemDamage()
|
||||
&& ItemStack.areItemStackTagsEqual(itemstack3, draggedStack)) {
|
||||
l1 = button == 0 ? draggedStack.stackSize : 1;
|
||||
|
||||
if(l1 > slot.getSlotStackLimit() - itemstack3.stackSize) {
|
||||
l1 = slot.getSlotStackLimit() - itemstack3.stackSize;
|
||||
}
|
||||
|
||||
if(l1 > draggedStack.getMaxStackSize() - itemstack3.stackSize) {
|
||||
l1 = draggedStack.getMaxStackSize() - itemstack3.stackSize;
|
||||
}
|
||||
|
||||
draggedStack.splitStack(l1);
|
||||
|
||||
if(draggedStack.stackSize == 0) {
|
||||
invPlayer.setItemStack((ItemStack) null);
|
||||
}
|
||||
|
||||
itemstack3.stackSize += l1;
|
||||
} else if(draggedStack.stackSize <= slot.getSlotStackLimit()) {
|
||||
slot.putStack(draggedStack);
|
||||
invPlayer.setItemStack(itemstack3);
|
||||
}
|
||||
} else if(itemstack3.getItem() == draggedStack.getItem() && draggedStack.getMaxStackSize() > 1
|
||||
&& (!itemstack3.getHasSubtypes() || itemstack3.getItemDamage() == draggedStack.getItemDamage()) && ItemStack.areItemStackTagsEqual(itemstack3, draggedStack)) {
|
||||
l1 = itemstack3.stackSize;
|
||||
|
||||
if(l1 > 0 && l1 + draggedStack.stackSize <= draggedStack.getMaxStackSize()) {
|
||||
draggedStack.stackSize += l1;
|
||||
itemstack3 = slot.decrStackSize(l1);
|
||||
|
||||
if(itemstack3.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
}
|
||||
|
||||
slot.onPickupFromSlot(player, invPlayer.getItemStack());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
} else if(mode == 2 && button >= 0 && button < 9) {
|
||||
slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot.canTakeStack(player)) {
|
||||
itemstack3 = invPlayer.getStackInSlot(button);
|
||||
boolean flag = itemstack3 == null || slot.inventory == invPlayer && slot.isItemValid(itemstack3);
|
||||
l1 = -1;
|
||||
|
||||
if(!flag) {
|
||||
l1 = invPlayer.getFirstEmptyStack();
|
||||
flag |= l1 > -1;
|
||||
}
|
||||
|
||||
if(slot.getHasStack() && flag) {
|
||||
itemstack5 = slot.getStack();
|
||||
invPlayer.setInventorySlotContents(button, itemstack5.copy());
|
||||
|
||||
if((slot.inventory != invPlayer || !slot.isItemValid(itemstack3)) && itemstack3 != null) {
|
||||
if(l1 > -1) {
|
||||
invPlayer.addItemStackToInventory(itemstack3);
|
||||
slot.decrStackSize(itemstack5.stackSize);
|
||||
slot.putStack((ItemStack) null);
|
||||
slot.onPickupFromSlot(player, itemstack5);
|
||||
}
|
||||
} else {
|
||||
slot.decrStackSize(itemstack5.stackSize);
|
||||
slot.putStack(itemstack3);
|
||||
slot.onPickupFromSlot(player, itemstack5);
|
||||
}
|
||||
} else if(!slot.getHasStack() && itemstack3 != null && slot.isItemValid(itemstack3)) {
|
||||
invPlayer.setInventorySlotContents(button, (ItemStack) null);
|
||||
slot.putStack(itemstack3);
|
||||
}
|
||||
}
|
||||
} else if(mode == 3 && player.capabilities.isCreativeMode && invPlayer.getItemStack() == null && index >= 0) {
|
||||
slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
itemstack3 = slot.getStack().copy();
|
||||
itemstack3.stackSize = itemstack3.getMaxStackSize();
|
||||
invPlayer.setItemStack(itemstack3);
|
||||
}
|
||||
} else if(mode == 4 && invPlayer.getItemStack() == null && index >= 0) {
|
||||
slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack() && slot.canTakeStack(player)) {
|
||||
itemstack3 = slot.decrStackSize(button == 0 ? 1 : slot.getStack().stackSize);
|
||||
slot.onPickupFromSlot(player, itemstack3);
|
||||
player.dropPlayerItemWithRandomChoice(itemstack3, true);
|
||||
}
|
||||
} else if(mode == 6 && index >= 0) {
|
||||
slot = (Slot) this.inventorySlots.get(index);
|
||||
itemstack3 = invPlayer.getItemStack();
|
||||
|
||||
if(itemstack3 != null && (slot == null || !slot.getHasStack() || !slot.canTakeStack(player))) {
|
||||
i1 = button == 0 ? 0 : this.inventorySlots.size() - 1;
|
||||
l1 = button == 0 ? 1 : -1;
|
||||
|
||||
for(int i2 = 0; i2 < 2; ++i2) {
|
||||
for(int j2 = i1; j2 >= 0 && j2 < this.inventorySlots.size() && itemstack3.stackSize < itemstack3.getMaxStackSize(); j2 += l1) {
|
||||
Slot slot3 = (Slot) this.inventorySlots.get(j2);
|
||||
|
||||
if(slot3.getHasStack() && func_94527_a(slot3, itemstack3, true) && slot3.canTakeStack(player) && this.func_94530_a(itemstack3, slot3)
|
||||
&& (i2 != 0 || slot3.getStack().stackSize != slot3.getStack().getMaxStackSize())) {
|
||||
int k1 = Math.min(itemstack3.getMaxStackSize() - itemstack3.stackSize, slot3.getStack().stackSize);
|
||||
ItemStack itemstack2 = slot3.decrStackSize(k1);
|
||||
itemstack3.stackSize += k1;
|
||||
|
||||
if(itemstack2.stackSize <= 0) {
|
||||
slot3.putStack((ItemStack) null);
|
||||
}
|
||||
|
||||
slot3.onPickupFromSlot(player, itemstack2);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this.detectAndSendChanges();
|
||||
}
|
||||
}
|
||||
|
||||
return returnStack;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,77 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPADetector;
|
||||
|
||||
import api.hbm.energymk2.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 ContainerPADetector extends Container {
|
||||
|
||||
private TileEntityPADetector detector;
|
||||
|
||||
public ContainerPADetector(InventoryPlayer playerInv, TileEntityPADetector tile) {
|
||||
detector = tile;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 0, 8, 72));
|
||||
//Containers
|
||||
this.addSlotToContainer(new Slot(tile, 1, 62, 18));
|
||||
this.addSlotToContainer(new Slot(tile, 2, 80, 18));
|
||||
//Outputs
|
||||
this.addSlotToContainer(new SlotTakeOnly(tile, 3, 62, 45));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tile, 4, 80, 45));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return detector.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack rStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index <= 5) {
|
||||
if(!this.mergeItemStack(stack, 6, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) {
|
||||
if(!this.mergeItemStack(stack, 0, 1, false)) return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(stack, 1, 3, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return rStack;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPADipole;
|
||||
|
||||
import api.hbm.energymk2.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 ContainerPADipole extends Container {
|
||||
|
||||
private TileEntityPADipole quadrupole;
|
||||
|
||||
public ContainerPADipole(InventoryPlayer playerInv, TileEntityPADipole tile) {
|
||||
quadrupole = tile;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 0, 8, 72));
|
||||
//Coil
|
||||
this.addSlotToContainer(new Slot(tile, 1, 89, 26));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return quadrupole.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack rStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index <= 1) {
|
||||
if(!this.mergeItemStack(stack, 2, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) {
|
||||
if(!this.mergeItemStack(stack, 0, 1, false)) return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(stack, 1, 2, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return rStack;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,72 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPAQuadrupole;
|
||||
|
||||
import api.hbm.energymk2.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 ContainerPAQuadrupole extends Container {
|
||||
|
||||
private TileEntityPAQuadrupole quadrupole;
|
||||
|
||||
public ContainerPAQuadrupole(InventoryPlayer playerInv, TileEntityPAQuadrupole tile) {
|
||||
quadrupole = tile;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 0, 26, 72));
|
||||
//Coil
|
||||
this.addSlotToContainer(new Slot(tile, 1, 71, 36));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return quadrupole.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack rStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index <= 1) {
|
||||
if(!this.mergeItemStack(stack, 2, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) {
|
||||
if(!this.mergeItemStack(stack, 0, 1, false)) return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(stack, 1, 2, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return rStack;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,63 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPARFC;
|
||||
|
||||
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 ContainerPARFC extends Container {
|
||||
|
||||
private TileEntityPARFC rfc;
|
||||
|
||||
public ContainerPARFC(InventoryPlayer playerInv, TileEntityPARFC tile) {
|
||||
rfc = tile;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 0, 53, 72));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return rfc.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack rStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index <= 0) {
|
||||
if(!this.mergeItemStack(stack, 1, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
if(!this.mergeItemStack(stack, 0, 1, false)) return null;
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return rStack;
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,78 @@
|
||||
package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotTakeOnly;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import api.hbm.energymk2.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 ContainerPASource extends Container {
|
||||
|
||||
private TileEntityPASource source;
|
||||
|
||||
public ContainerPASource(InventoryPlayer playerInv, TileEntityPASource tile) {
|
||||
source = tile;
|
||||
|
||||
//Battery
|
||||
this.addSlotToContainer(new Slot(tile, 0, 8, 72));
|
||||
//Inputs
|
||||
this.addSlotToContainer(new Slot(tile, 1, 62, 18));
|
||||
this.addSlotToContainer(new Slot(tile, 2, 80, 18));
|
||||
//Containers
|
||||
this.addSlotToContainer(new SlotTakeOnly(tile, 3, 62, 45));
|
||||
this.addSlotToContainer(new SlotTakeOnly(tile, 4, 80, 45));
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 8 + j * 18, 122 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(playerInv, i, 8 + i * 18, 180));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return source.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||
ItemStack rStack = null;
|
||||
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||
|
||||
if(slot != null && slot.getHasStack()) {
|
||||
ItemStack stack = slot.getStack();
|
||||
rStack = stack.copy();
|
||||
|
||||
if(index <= 5) {
|
||||
if(!this.mergeItemStack(stack, 6, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
|
||||
if(rStack.getItem() instanceof IBatteryItem || rStack.getItem() == ModItems.battery_creative) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 0, 1, false)) return null;
|
||||
} else {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, stack, 1, 3, false)) return null;
|
||||
}
|
||||
}
|
||||
|
||||
if(stack.stackSize == 0) {
|
||||
slot.putStack((ItemStack) null);
|
||||
} else {
|
||||
slot.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
return rStack;
|
||||
}
|
||||
}
|
||||
@ -44,6 +44,9 @@ public class Fluids {
|
||||
public static FluidType ULTRAHOTSTEAM;
|
||||
public static FluidType COOLANT;
|
||||
public static FluidType COOLANT_HOT;
|
||||
public static FluidType PERFLUOROMETHYL;
|
||||
public static FluidType PERFLUOROMETHYL_COLD;
|
||||
public static FluidType PERFLUOROMETHYL_HOT;
|
||||
public static FluidType LAVA;
|
||||
public static FluidType DEUTERIUM;
|
||||
public static FluidType TRITIUM;
|
||||
@ -180,6 +183,10 @@ public class Fluids {
|
||||
public static FluidType STELLAR_FLUX;
|
||||
public static FluidType VITRIOL;
|
||||
public static FluidType SLOP;
|
||||
public static FluidType LYE;
|
||||
public static FluidType SODIUM_ALUMINATE;
|
||||
public static FluidType BAUXITE_SOLUTION;
|
||||
public static FluidType ALUMINA;
|
||||
|
||||
/* Lagacy names for compatibility purposes */
|
||||
@Deprecated public static FluidType ACID; //JAOPCA uses this, apparently
|
||||
@ -384,7 +391,14 @@ public class Fluids {
|
||||
VITRIOL = new FluidType("VITRIOL", 0x6E5222, 2, 0, 1, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
SLOP = new FluidType("SLOP", 0x929D45, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID, VISCOUS);
|
||||
LEAD = new FluidType("LEAD", 0x666672, 4, 0, 0, EnumSymbol.NONE).setTemp(350).addTraits(LIQUID, VISCOUS);
|
||||
LEAD_HOT = new FluidType(143, "LEAD_HOT", 0x776563, 4, 0, 0, EnumSymbol.NONE).setTemp(1500).addTraits(LIQUID, VISCOUS);
|
||||
LEAD_HOT = new FluidType("LEAD_HOT", 0x776563, 4, 0, 0, EnumSymbol.NONE).setTemp(1500).addTraits(LIQUID, VISCOUS);
|
||||
PERFLUOROMETHYL = new FluidType("PERFLUOROMETHYL", 0xBDC8DC, 1, 0, 1, EnumSymbol.NONE).setTemp(15).addTraits(LIQUID);
|
||||
PERFLUOROMETHYL_COLD = new FluidType("PERFLUOROMETHYL_COLD",0x99DADE, 1, 0, 1, EnumSymbol.NONE).setTemp(-150).addTraits(LIQUID);
|
||||
PERFLUOROMETHYL_HOT = new FluidType("PERFLUOROMETHYL_HOT",0xB899DE, 1, 0, 1, EnumSymbol.NONE).setTemp(250).addTraits(LIQUID);
|
||||
LYE = new FluidType("LYE", 0xFFECCC, 3, 0, 1, EnumSymbol.ACID).addTraits(new FT_Corrosive(40), LIQUID);
|
||||
SODIUM_ALUMINATE = new FluidType("SODIUM_ALUMINATE", 0xFFD191, 3, 0, 1, EnumSymbol.ACID).addTraits(new FT_Corrosive(30), LIQUID);
|
||||
BAUXITE_SOLUTION = new FluidType("BAUXITE_SOLUTION", 0xE2560F, 3, 0, 3, EnumSymbol.ACID).addTraits(new FT_Corrosive(40), LIQUID, VISCOUS);
|
||||
ALUMINA = new FluidType(150,"ALUMINA", 0xDDFFFF, 0, 0, 0, EnumSymbol.NONE).addTraits(LIQUID);
|
||||
|
||||
// ^ ^ ^ ^ ^ ^ ^ ^
|
||||
//ADD NEW FLUIDS HERE
|
||||
@ -414,6 +428,9 @@ public class Fluids {
|
||||
metaOrder.add(CARBONDIOXIDE);
|
||||
metaOrder.add(COOLANT);
|
||||
metaOrder.add(COOLANT_HOT);
|
||||
metaOrder.add(PERFLUOROMETHYL);
|
||||
metaOrder.add(PERFLUOROMETHYL_COLD);
|
||||
metaOrder.add(PERFLUOROMETHYL_HOT);
|
||||
metaOrder.add(CRYOGEL);
|
||||
metaOrder.add(MUG);
|
||||
metaOrder.add(MUG_HOT);
|
||||
@ -525,8 +542,12 @@ public class Fluids {
|
||||
metaOrder.add(POTASSIUM_CHLORIDE);
|
||||
metaOrder.add(CALCIUM_CHLORIDE);
|
||||
metaOrder.add(CALCIUM_SOLUTION);
|
||||
metaOrder.add(SODIUM_ALUMINATE);
|
||||
metaOrder.add(BAUXITE_SOLUTION);
|
||||
metaOrder.add(ALUMINA);
|
||||
//solutions and working fluids
|
||||
metaOrder.add(FRACKSOL);
|
||||
metaOrder.add(LYE);
|
||||
//the fun guys
|
||||
metaOrder.add(PHOSGENE);
|
||||
metaOrder.add(MUSTARDGAS);
|
||||
@ -608,6 +629,10 @@ public class Fluids {
|
||||
COOLANT.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.0D).addStep(300, 1, COOLANT_HOT, 1));
|
||||
COOLANT_HOT.addTraits(new FT_Coolable(COOLANT, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
|
||||
|
||||
PERFLUOROMETHYL_COLD.addTraits(new FT_Heatable().setEff(HeatingType.PA, 1.0D).addStep(300, 1, PERFLUOROMETHYL, 1));
|
||||
PERFLUOROMETHYL.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.0D).addStep(300, 1, PERFLUOROMETHYL_HOT, 1));
|
||||
PERFLUOROMETHYL_HOT.addTraits(new FT_Coolable(PERFLUOROMETHYL, 1, 1, 300).setEff(CoolingType.HEATEXCHANGER, 1.0D));
|
||||
|
||||
MUG.addTraits(new FT_Heatable().setEff(HeatingType.HEATEXCHANGER, 1.0D).setEff(HeatingType.PWR, 1.0D).setEff(HeatingType.ICF, 1.25D).addStep(400, 1, MUG_HOT, 1), new FT_PWRModerator(1.15D));
|
||||
MUG_HOT.addTraits(new FT_Coolable(MUG, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));
|
||||
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.gui.GuiInfoContainer;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.IItemFluidIdentifier;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -253,6 +254,7 @@ public class FluidTank {
|
||||
|
||||
if(this.pressure != 0) {
|
||||
list.add(EnumChatFormatting.RED + "Pressure: " + this.pressure + " PU");
|
||||
list.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_RED) + "Pressurized, use compressor!");
|
||||
}
|
||||
|
||||
type.addInfo(list);
|
||||
|
||||
@ -71,7 +71,8 @@ public class FT_Heatable extends FluidTrait {
|
||||
BOILER("Boilable"),
|
||||
HEATEXCHANGER("Heatable"),
|
||||
PWR("PWR Coolant"),
|
||||
ICF("ICF Coolant");
|
||||
ICF("ICF Coolant"),
|
||||
PA("Particle Accelerator Coolant");
|
||||
|
||||
public String name;
|
||||
|
||||
|
||||
51
src/main/java/com/hbm/inventory/gui/GUICasingBag.java
Normal file
51
src/main/java/com/hbm/inventory/gui/GUICasingBag.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCasingBag;
|
||||
import com.hbm.items.tool.ItemCasingBag.InventoryCasingBag;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUICasingBag extends GuiContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/gui_casing_bag.png");
|
||||
private final InventoryCasingBag inventory;
|
||||
|
||||
public GUICasingBag(InventoryPlayer invPlayer, InventoryCasingBag bag) {
|
||||
super(new ContainerCasingBag(invPlayer, bag));
|
||||
this.inventory = bag;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 186;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int x, int y, float interp) {
|
||||
super.drawScreen(x, y, interp);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||
String name = I18n.format(this.inventory.getInventoryName());
|
||||
|
||||
if(inventory.hasCustomInventoryName()) {
|
||||
name = inventory.box.getDisplayName();
|
||||
}
|
||||
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2, 6, 0xffffff);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 98, 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);
|
||||
}
|
||||
}
|
||||
66
src/main/java/com/hbm/inventory/gui/GUIPADetector.java
Normal file
66
src/main/java/com/hbm/inventory/gui/GUIPADetector.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPADetector;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPADetector;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIPADetector extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/particleaccelerator/gui_detector.png");
|
||||
private TileEntityPADetector source;
|
||||
|
||||
public GUIPADetector(InventoryPlayer player, TileEntityPADetector source) {
|
||||
super(new ContainerPADetector(player, source));
|
||||
this.source = source;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
source.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 36, 16, 52);
|
||||
source.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 52, source.power, source.getMaxPower());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
|
||||
String name = this.source.hasCustomInventoryName() ? this.source.getInventoryName() : I18n.format(this.source.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 9, 4, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(EnumChatFormatting.AQUA + "/123K", 136, 22, 4210752);
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
String label = (heat > 123 ? EnumChatFormatting.RED : EnumChatFormatting.AQUA) + "" + heat + "K";
|
||||
this.fontRendererObj.drawString(label, 166 - this.fontRendererObj.getStringWidth(label), 12, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int j = (int) (source.power * 52 / source.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 70 - j, 184, 52 - j, 16, j);
|
||||
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 8, 8, 8);
|
||||
if(source.power >= source.usage) drawTexturedModalRect(guiLeft + 44, guiTop + 43, 176, 8, 8, 8);
|
||||
|
||||
source.tanks[0].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
source.tanks[1].renderTank(guiLeft + 152, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
179
src/main/java/com/hbm/inventory/gui/GUIPADipole.java
Normal file
179
src/main/java/com/hbm/inventory/gui/GUIPADipole.java
Normal file
@ -0,0 +1,179 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.apache.commons.lang3.math.NumberUtils;
|
||||
import org.lwjgl.input.Keyboard;
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPADipole;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPADipole;
|
||||
import com.hbm.util.Vec3NT;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.audio.PositionedSoundRecord;
|
||||
import net.minecraft.client.gui.GuiTextField;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
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 GUIPADipole extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/particleaccelerator/gui_dipole.png");
|
||||
private TileEntityPADipole dipole;
|
||||
|
||||
protected GuiTextField threshold;
|
||||
|
||||
public GUIPADipole(InventoryPlayer player, TileEntityPADipole dipole) {
|
||||
super(new ContainerPADipole(player, dipole));
|
||||
this.dipole = dipole;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void initGui() {
|
||||
super.initGui();
|
||||
|
||||
Keyboard.enableRepeatEvents(true);
|
||||
|
||||
this.threshold = new GuiTextField(this.fontRendererObj, guiLeft + 47, guiTop + 77, 66, 8);
|
||||
this.threshold.setTextColor(0x00ff00);
|
||||
this.threshold.setDisabledTextColour(0x00ff00);
|
||||
this.threshold.setEnableBackgroundDrawing(false);
|
||||
this.threshold.setMaxStringLength(9);
|
||||
this.threshold.setText("" + dipole.threshold);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
dipole.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 36, 16, 52);
|
||||
dipole.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 52, dipole.power, dipole.getMaxPower());
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 62, guiTop + 29, 12, 12, mouseX, mouseY, EnumChatFormatting.BLUE + "Player orientation", EnumChatFormatting.RED + "Output orientation:", dipole.ditToForgeDir(dipole.dirLower).name());
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 62, guiTop + 43, 12, 12, mouseX, mouseY, EnumChatFormatting.BLUE + "Player orientation", EnumChatFormatting.RED + "Output orientation:", dipole.ditToForgeDir(dipole.dirUpper).name());
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 62, guiTop + 57, 12, 12, mouseX, mouseY, EnumChatFormatting.BLUE + "Player orientation", EnumChatFormatting.RED + "Output orientation:", dipole.ditToForgeDir(dipole.dirRedstone).name());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
this.threshold.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 62 <= x && guiLeft + 62 + 12 > x && guiTop + 29 < y && guiTop + 29 + 12 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("lower", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, dipole.xCoord, dipole.yCoord, dipole.zCoord));
|
||||
}
|
||||
|
||||
if(guiLeft + 62 <= x && guiLeft + 62 + 12 > x && guiTop + 43 < y && guiTop + 43 + 12 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("upper", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, dipole.xCoord, dipole.yCoord, dipole.zCoord));
|
||||
}
|
||||
|
||||
if(guiLeft + 62 <= x && guiLeft + 62 + 12 > x && guiTop + 57 < y && guiTop + 57 + 12 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("redstone", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, dipole.xCoord, dipole.yCoord, dipole.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
|
||||
String name = this.dipole.hasCustomInventoryName() ? this.dipole.getInventoryName() : I18n.format(this.dipole.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 9, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(EnumChatFormatting.AQUA + "/123K", 136, 22, 4210752);
|
||||
int heat = (int) Math.ceil(dipole.temperature);
|
||||
String label = (heat > 123 ? EnumChatFormatting.RED : EnumChatFormatting.AQUA) + "" + heat + "K";
|
||||
this.fontRendererObj.drawString(label, 166 - this.fontRendererObj.getStringWidth(label), 12, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int j = (int) (dipole.power * 52 / dipole.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 70 - j, 184, 52 - j, 16, j);
|
||||
|
||||
int heat = (int) Math.ceil(dipole.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 93, guiTop + 54, 176, 8, 8, 8);
|
||||
if(dipole.slots[1] != null && dipole.slots[1].getItem() == ModItems.pa_coil) drawTexturedModalRect(guiLeft + 103, guiTop + 54, 176, 8, 8, 8);
|
||||
if(dipole.power >= dipole.usage) drawTexturedModalRect(guiLeft + 83, guiTop + 54, 176, 8, 8, 8);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glDisable(GL11.GL_LIGHTING);
|
||||
GL11.glLineWidth(3F);
|
||||
|
||||
Vec3NT vec = new Vec3NT(0, 0, 0);
|
||||
vec.rotateAroundZDeg(MainRegistry.proxy.me().rotationYaw);
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawing(1);
|
||||
addLine(tessellator, 68, 35, 0x8080ff, vec, 180);
|
||||
addLine(tessellator, 68, 35, 0xff0000, vec, MainRegistry.proxy.me().rotationYaw - dipole.dirLower * 90);
|
||||
addLine(tessellator, 68, 49, 0x8080ff, vec, 180);
|
||||
addLine(tessellator, 68, 49, 0xff0000, vec, MainRegistry.proxy.me().rotationYaw - dipole.dirUpper * 90);
|
||||
addLine(tessellator, 68, 63, 0x8080ff, vec, 180);
|
||||
addLine(tessellator, 68, 63, 0xff0000, vec, MainRegistry.proxy.me().rotationYaw - dipole.dirRedstone * 90);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
this.threshold.drawTextBox();
|
||||
|
||||
dipole.tanks[0].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
dipole.tanks[1].renderTank(guiLeft + 152, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
|
||||
public void addLine(Tessellator tess, int x, int y, int color, Vec3NT vec, float yaw) {
|
||||
vec.setComponents(0, 6, 0);
|
||||
vec.rotateAroundZDeg(yaw);
|
||||
tess.setColorOpaque_I(color);
|
||||
tess.addVertex(guiLeft + x, guiTop + y, this.zLevel);
|
||||
tess.addVertex(guiLeft + x + vec.xCoord, guiTop + y + vec.yCoord, this.zLevel);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void keyTyped(char c, int i) {
|
||||
if(this.threshold.textboxKeyTyped(c, i)) {
|
||||
String text = this.threshold.getText();
|
||||
if(text.startsWith("0")) this.threshold.setText(text.substring(1));
|
||||
if(this.threshold.getText().isEmpty()) this.threshold.setText("0");
|
||||
if(NumberUtils.isDigits(this.threshold.getText())) {
|
||||
int num = NumberUtils.toInt(this.threshold.getText());
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setInteger("threshold", num);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, dipole.xCoord, dipole.yCoord, dipole.zCoord));
|
||||
}
|
||||
return;
|
||||
}
|
||||
super.keyTyped(c, i);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onGuiClosed() {
|
||||
super.onGuiClosed();
|
||||
Keyboard.enableRepeatEvents(false);
|
||||
}
|
||||
}
|
||||
68
src/main/java/com/hbm/inventory/gui/GUIPAQuadrupole.java
Normal file
68
src/main/java/com/hbm/inventory/gui/GUIPAQuadrupole.java
Normal file
@ -0,0 +1,68 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPAQuadrupole;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPAQuadrupole;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIPAQuadrupole extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/particleaccelerator/gui_quadrupole.png");
|
||||
private TileEntityPAQuadrupole quadrupole;
|
||||
|
||||
public GUIPAQuadrupole(InventoryPlayer player, TileEntityPAQuadrupole slopper) {
|
||||
super(new ContainerPAQuadrupole(player, slopper));
|
||||
this.quadrupole = slopper;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
quadrupole.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 116, guiTop + 36, 16, 52);
|
||||
quadrupole.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 26, guiTop + 18, 16, 52, quadrupole.power, quadrupole.getMaxPower());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
|
||||
String name = this.quadrupole.hasCustomInventoryName() ? this.quadrupole.getInventoryName() : I18n.format(this.quadrupole.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 9, 6, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(EnumChatFormatting.AQUA + "/123K", 118, 22, 4210752);
|
||||
int heat = (int) Math.ceil(quadrupole.temperature);
|
||||
String label = (heat > 123 ? EnumChatFormatting.RED : EnumChatFormatting.AQUA) + "" + heat + "K";
|
||||
this.fontRendererObj.drawString(label, 148 - this.fontRendererObj.getStringWidth(label), 12, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int j = (int) (quadrupole.power * 52 / quadrupole.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 26, guiTop + 70 - j, 184, 52 - j, 16, j);
|
||||
|
||||
int heat = (int) Math.ceil(quadrupole.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 75, guiTop + 64, 176, 8, 8, 8);
|
||||
if(quadrupole.slots[1] != null && quadrupole.slots[1].getItem() == ModItems.pa_coil) drawTexturedModalRect(guiLeft + 85, guiTop + 64, 176, 8, 8, 8);
|
||||
if(quadrupole.power >= quadrupole.usage) drawTexturedModalRect(guiLeft + 65, guiTop + 64, 176, 8, 8, 8);
|
||||
|
||||
quadrupole.tanks[0].renderTank(guiLeft + 116, guiTop + 88, this.zLevel, 16, 52);
|
||||
quadrupole.tanks[1].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
59
src/main/java/com/hbm/inventory/gui/GUIPARFC.java
Normal file
59
src/main/java/com/hbm/inventory/gui/GUIPARFC.java
Normal file
@ -0,0 +1,59 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPARFC;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPARFC;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class GUIPARFC extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/particleaccelerator/gui_rfc.png");
|
||||
private TileEntityPARFC quadrupole;
|
||||
|
||||
public GUIPARFC(InventoryPlayer player, TileEntityPARFC slopper) {
|
||||
super(new ContainerPARFC(player, slopper));
|
||||
this.quadrupole = slopper;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
quadrupole.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 89, guiTop + 36, 16, 52);
|
||||
quadrupole.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 107, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 53, guiTop + 18, 16, 52, quadrupole.power, quadrupole.getMaxPower());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(EnumChatFormatting.AQUA + "/123K", 91, 22, 4210752);
|
||||
int heat = (int) Math.ceil(quadrupole.temperature);
|
||||
String label = (heat > 123 ? EnumChatFormatting.RED : EnumChatFormatting.AQUA) + "" + heat + "K";
|
||||
this.fontRendererObj.drawString(label, 121 - this.fontRendererObj.getStringWidth(label), 12, 4210752);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int j = (int) (quadrupole.power * 52 / quadrupole.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 53, guiTop + 70 - j, 184, 52 - j, 16, j);
|
||||
|
||||
quadrupole.tanks[0].renderTank(guiLeft + 89, guiTop + 88, this.zLevel, 16, 52);
|
||||
quadrupole.tanks[1].renderTank(guiLeft + 107, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
106
src/main/java/com/hbm/inventory/gui/GUIPASource.java
Normal file
106
src/main/java/com/hbm/inventory/gui/GUIPASource.java
Normal file
@ -0,0 +1,106 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPASource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toserver.NBTControlPacket;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource;
|
||||
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 GUIPASource extends GuiInfoContainer {
|
||||
|
||||
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/particleaccelerator/gui_source.png");
|
||||
private TileEntityPASource source;
|
||||
|
||||
public GUIPASource(InventoryPlayer player, TileEntityPASource source) {
|
||||
super(new ContainerPASource(player, source));
|
||||
this.source = source;
|
||||
|
||||
this.xSize = 176;
|
||||
this.ySize = 204;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||
super.drawScreen(mouseX, mouseY, f);
|
||||
|
||||
source.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 36, 16, 52);
|
||||
source.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 52, source.power, source.getMaxPower());
|
||||
|
||||
List<String> info = new ArrayList();
|
||||
info.add(EnumChatFormatting.BLUE + "Last momentum: " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", source.lastSpeed));
|
||||
String[] message = I18nUtil.resolveKeyArray("pa." + this.source.state.name().toLowerCase(Locale.US) + ".desc");
|
||||
for(String s : message) info.add(EnumChatFormatting.YELLOW + s);
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 105, guiTop + 18, 10, 10, mouseX, mouseY, info);
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 105, guiTop + 30, 10, 10, mouseX, mouseY, EnumChatFormatting.RED + "Cancel operation");
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void mouseClicked(int x, int y, int i) {
|
||||
super.mouseClicked(x, y, i);
|
||||
|
||||
if(guiLeft + 105 <= x && guiLeft + 105 + 10 > x && guiTop + 30 < y && guiTop + 30 + 10 >= y) {
|
||||
mc.getSoundHandler().playSound(PositionedSoundRecord.func_147674_a(new ResourceLocation("gui.button.press"), 1.0F));
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setBoolean("cancel", true);
|
||||
PacketDispatcher.wrapper.sendToServer(new NBTControlPacket(data, source.xCoord, source.yCoord, source.zCoord));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerForegroundLayer( int i, int j) {
|
||||
|
||||
String name = this.source.hasCustomInventoryName() ? this.source.getInventoryName() : I18n.format(this.source.getInventoryName());
|
||||
this.fontRendererObj.drawString(name, this.xSize / 2 - this.fontRendererObj.getStringWidth(name) / 2 - 9, 4, 4210752);
|
||||
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||
|
||||
this.fontRendererObj.drawString(EnumChatFormatting.AQUA + "/123K", 136, 22, 4210752);
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
String label = (heat > 123 ? EnumChatFormatting.RED : EnumChatFormatting.AQUA) + "" + heat + "K";
|
||||
this.fontRendererObj.drawString(label, 166 - this.fontRendererObj.getStringWidth(label), 12, 4210752);
|
||||
|
||||
String state = I18n.format("pa." + this.source.state.name().toLowerCase(Locale.US));
|
||||
this.fontRendererObj.drawString(state, 79 - this.fontRendererObj.getStringWidth(state) / 2, 76, this.source.state.color);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void drawGuiContainerBackgroundLayer(float interp, int x, int y) {
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||
|
||||
int j = (int) (source.power * 52 / source.getMaxPower());
|
||||
drawTexturedModalRect(guiLeft + 8, guiTop + 70 - j, 184, 52 - j, 16, j);
|
||||
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 8, 8, 8);
|
||||
if(source.power >= source.usage) drawTexturedModalRect(guiLeft + 44, guiTop + 43, 176, 8, 8, 8);
|
||||
|
||||
int color = source.state.color;
|
||||
float red = (color & 0xff0000) >> 16;
|
||||
float green = (color & 0x00ff00) >> 8;
|
||||
float blue = (color & 0x0000ff);
|
||||
|
||||
GL11.glColor4f(red, green, blue, 1.0F);
|
||||
drawTexturedModalRect(guiLeft + 45, guiTop + 73, 176, 52, 68, 14);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
source.tanks[0].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
source.tanks[1].renderTank(guiLeft + 152, guiTop + 88, this.zLevel, 16, 52);
|
||||
}
|
||||
}
|
||||
@ -78,7 +78,7 @@ public class GUIRBMKControlAuto extends GuiInfoContainer {
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 61, guiTop + 70, 22, 10, mouseX, mouseY, new String[]{ "Select inverse quadratic interpolation" } );
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 26, 30, 10, mouseX, mouseY, new String[]{ "Level at max heat", "Should be smaller than level at min heat" } );
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 37, 30, 10, mouseX, mouseY, new String[]{ "Level at min heat", "Should be larger than level at min heat" } );
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 37, 30, 10, mouseX, mouseY, new String[]{ "Level at min heat", "Should be larger than level at max heat" } );
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 48, 30, 10, mouseX, mouseY, new String[]{ "Max heat", "Must be larger than min heat" } );
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 59, 30, 10, mouseX, mouseY, new String[]{ "Min heat", "Must be smaller than max heat" } );
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 70, 30, 10, mouseX, mouseY, new String[]{ "Save parameters" } );
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ItemEnums.EnumCasingType;
|
||||
@ -44,7 +45,7 @@ public class MatDistribution extends SerializableRecipe {
|
||||
registerEntry(Blocks.golden_rail, MAT_GOLD, INGOT.q(6, 6), MAT_REDSTONE, DUST.q(1, 6));
|
||||
registerEntry(Blocks.detector_rail, MAT_IRON, INGOT.q(6, 6), MAT_REDSTONE, DUST.q(1, 6));
|
||||
registerEntry(Items.minecart, MAT_IRON, INGOT.q(5));
|
||||
|
||||
|
||||
//castables
|
||||
registerEntry(ModItems.blade_titanium, MAT_TITANIUM, INGOT.q(2));
|
||||
registerEntry(ModItems.blade_tungsten, MAT_TUNGSTEN, INGOT.q(2));
|
||||
@ -62,15 +63,15 @@ public class MatDistribution extends SerializableRecipe {
|
||||
registerEntry(DictFrame.fromOne(ModItems.casing, EnumCasingType.SMALL_STEEL), MAT_WEAPONSTEEL, PLATE.q(1, 4));
|
||||
registerEntry(DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE), MAT_GUNMETAL, PLATE.q(1, 2));
|
||||
registerEntry(DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE_STEEL), MAT_WEAPONSTEEL, PLATE.q(1, 2));
|
||||
|
||||
registerEntry(Items.minecart, MAT_IRON, INGOT.q(5));
|
||||
registerEntry(DictFrame.fromOne(ModItems.chunk_ore, ItemEnums.EnumChunkType.CRYOLITE), MAT_ALUMINIUM, INGOT.q(1), MAT_SODIUM, INGOT.q(1));
|
||||
//actual ores
|
||||
if(!Compat.isModLoaded(Compat.MOD_GT6)) {
|
||||
registerOre(OreDictManager.IRON.ore(), MAT_IRON, INGOT.q(2), MAT_TITANIUM, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||
registerOre(OreDictManager.TI.ore(), MAT_TITANIUM, INGOT.q(2), MAT_IRON, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||
registerOre(OreDictManager.W.ore(), MAT_TUNGSTEN, INGOT.q(2), MAT_STONE, QUART.q(1));
|
||||
registerOre(OreDictManager.AL.ore(), MAT_ALUMINIUM, INGOT.q(2), MAT_STONE, QUART.q(1));
|
||||
}
|
||||
|
||||
|
||||
registerOre(OreDictManager.COAL.ore(), MAT_CARBON, GEM.q(3), MAT_STONE, QUART.q(1));
|
||||
registerOre(OreDictManager.GOLD.ore(), MAT_GOLD, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||
registerOre(OreDictManager.U.ore(), MAT_URANIUM, INGOT.q(2), MAT_LEAD, NUGGET.q(3), MAT_STONE, QUART.q(1));
|
||||
@ -82,8 +83,8 @@ public class MatDistribution extends SerializableRecipe {
|
||||
registerOre(OreDictManager.REDSTONE.ore(), MAT_REDSTONE, INGOT.q(4), MAT_STONE, QUART.q(1));
|
||||
|
||||
registerOre(OreDictManager.HEMATITE.ore(), MAT_HEMATITE, INGOT.q(1));
|
||||
registerOre(OreDictManager.MALACHITE.ore(), MAT_MALACHITE, INGOT.q(1));
|
||||
|
||||
registerOre(OreDictManager.MALACHITE.ore(), MAT_MALACHITE, INGOT.q(6));
|
||||
|
||||
registerEntry(DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.LIMESTONE), MAT_FLUX, DUST.q(10));
|
||||
registerEntry(ModItems.powder_flux, MAT_FLUX, DUST.q(1));
|
||||
registerEntry(new ItemStack(Items.coal, 1, 1), MAT_CARBON, NUGGET.q(3));
|
||||
@ -92,7 +93,7 @@ public class MatDistribution extends SerializableRecipe {
|
||||
registerEntry(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.COAL), MAT_CARBON, NUGGET.q(2));
|
||||
registerEntry(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.MISC), MAT_CARBON, NUGGET.q(1));
|
||||
}
|
||||
|
||||
|
||||
public static void registerEntry(Object key, Object... matDef) {
|
||||
ComparableStack comp = null;
|
||||
|
||||
@ -100,32 +101,32 @@ public class MatDistribution extends SerializableRecipe {
|
||||
if(key instanceof Block) comp = new ComparableStack((Block) key);
|
||||
if(key instanceof ItemStack) comp = new ComparableStack((ItemStack) key);
|
||||
if(key instanceof ComparableStack) comp = (ComparableStack) key;
|
||||
|
||||
|
||||
if(comp == null) return;
|
||||
if(matDef.length % 2 == 1) return;
|
||||
|
||||
|
||||
List<MaterialStack> stacks = new ArrayList();
|
||||
|
||||
|
||||
for(int i = 0; i < matDef.length; i += 2) {
|
||||
stacks.add(new MaterialStack((NTMMaterial) matDef[i], (int) matDef[i + 1]));
|
||||
}
|
||||
|
||||
|
||||
if(stacks.isEmpty()) return;
|
||||
|
||||
|
||||
materialEntries.put(comp, stacks);
|
||||
}
|
||||
|
||||
|
||||
public static void registerOre(String key, Object... matDef) {
|
||||
if(matDef.length % 2 == 1) return;
|
||||
|
||||
|
||||
List<MaterialStack> stacks = new ArrayList();
|
||||
|
||||
|
||||
for(int i = 0; i < matDef.length; i += 2) {
|
||||
stacks.add(new MaterialStack((NTMMaterial) matDef[i], (int) matDef[i + 1]));
|
||||
}
|
||||
|
||||
|
||||
if(stacks.isEmpty()) return;
|
||||
|
||||
|
||||
materialOreEntries.put(key, stacks);
|
||||
}
|
||||
|
||||
@ -190,7 +191,7 @@ public class MatDistribution extends SerializableRecipe {
|
||||
Mats.materialEntries.clear();
|
||||
Mats.materialOreEntries.clear();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "Defines a set of items that can be smelted. Smelting generated from the ore dictionary (prefix + material) is auto-generated and cannot be "
|
||||
|
||||
@ -10,6 +10,7 @@ public class MaterialShapes {
|
||||
public static final List<MaterialShapes> allShapes = new ArrayList();
|
||||
|
||||
public static final MaterialShapes ANY = new MaterialShapes(0).noAutogen();
|
||||
public static final MaterialShapes ONLY_ORE = new MaterialShapes(0, "ore").noAutogen();
|
||||
public static final MaterialShapes ORE = new MaterialShapes(0, "ore", "oreNether").noAutogen();
|
||||
public static final MaterialShapes ORENETHER = new MaterialShapes(0, "oreNether").noAutogen();
|
||||
|
||||
|
||||
@ -33,19 +33,19 @@ public class Mats {
|
||||
public static HashMap<String, NTMMaterial> matByName = new HashMap();
|
||||
public static HashMap<ComparableStack, List<MaterialStack>> materialEntries = new HashMap();
|
||||
public static HashMap<String, List<MaterialStack>> materialOreEntries = new HashMap();
|
||||
|
||||
|
||||
/*
|
||||
* ItemStacks are saved with their metadata being truncated to a short, so the max meta is 32767
|
||||
* Format for elements: Atomic number *100, plus the last two digits of the mass number. Mass number is 0 for generic/undefined/mixed materials.
|
||||
* Vanilla numbers are in vanilla space (0-29), basic alloys use alloy space (30-99)
|
||||
*/
|
||||
|
||||
|
||||
/* Vanilla Space, up to 30 materials, */
|
||||
public static final int _VS = 0;
|
||||
/* Alloy Space, up to 70 materials. Use >20_000 as an extension.*/
|
||||
public static final int _AS = 30;
|
||||
public static final int _ES = 20_000;
|
||||
|
||||
|
||||
//Vanilla and vanilla-like
|
||||
public static final NTMMaterial MAT_WOOD = makeNonSmeltable(_VS + 03, WOOD, 0x896727, 0x281E0B, 0x896727).setAutogen(STOCK, GRIP).n();
|
||||
public static final NTMMaterial MAT_IVORY = makeNonSmeltable(_VS + 04, BONE, 0xFFFEEE, 0x797870, 0xEDEBCA).setAutogen(GRIP).n();
|
||||
@ -67,6 +67,8 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_PIGIRON = makeSmeltable(2603, df("PigIron"), 0xFF8B59).m();
|
||||
public static final NTMMaterial MAT_METEORICIRON = makeSmeltable(2604, df("MeteoricIron"), 0x715347).m();
|
||||
public static final NTMMaterial MAT_MALACHITE = makeAdditive( 2901, MALACHITE, 0xA2F0C8, 0x227048, 0x61AF87).m();
|
||||
public static final NTMMaterial MAT_BAUXITE = makeNonSmeltable(2902, BAUXITE, 0xF4BA30, 0xAA320A, 0xE2560F).setAutogen(FRAGMENT).n();
|
||||
public static final NTMMaterial MAT_CRYOLITE = makeNonSmeltable(2903, CRYOLITE, 0xCBC2A4, 0x8B711F, 0x8B701A).setAutogen(FRAGMENT).n();
|
||||
|
||||
//Radioactive
|
||||
public static final NTMMaterial MAT_URANIUM = makeSmeltable(9200, U, 0xC1C7BD, 0x2B3227, 0x9AA196).setAutogen(FRAGMENT, NUGGET, BILLET, DUST, BLOCK).m();
|
||||
@ -98,8 +100,8 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_GHIORSIUM = makeSmeltable(12836, GH336, 0xF4EFE1, 0x2A3306, 0xC6C6A1).setAutogen(NUGGET, BILLET, BLOCK).m();
|
||||
|
||||
//Base metals
|
||||
public static final NTMMaterial MAT_TITANIUM = makeSmeltable(2200, TI, 0xF7F3F2, 0x4F4C4B, 0xA99E79).setAutogen(FRAGMENT, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, BLOCK, HEAVY_COMPONENT).m();
|
||||
public static final NTMMaterial MAT_COPPER = makeSmeltable(2900, CU, 0xFDCA88, 0x601E0D, 0xC18336).setAutogen(FRAGMENT, WIRE, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT).m();
|
||||
public static final NTMMaterial MAT_TITANIUM = makeSmeltable(2200, TI, 0xF7F3F2, 0x4F4C4B, 0xA99E79).setAutogen(FRAGMENT, DUST, PLATE, DENSEWIRE, CASTPLATE, WELDEDPLATE, SHELL, BLOCK, HEAVY_COMPONENT).m();
|
||||
public static final NTMMaterial MAT_COPPER = makeSmeltable(2900, CU, 0xFDCA88, 0x601E0D, 0xC18336).setAutogen(FRAGMENT, WIRE, DUST, PLATE, DENSEWIRE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT).m();
|
||||
public static final NTMMaterial MAT_TUNGSTEN = makeSmeltable(7400, W, 0x868686, 0x000000, 0x977474).setAutogen(FRAGMENT, WIRE, BOLT, DUST, DENSEWIRE, CASTPLATE, WELDEDPLATE, BLOCK, HEAVY_COMPONENT).m();
|
||||
public static final NTMMaterial MAT_ALUMINIUM = makeSmeltable(1300, AL, 0xFFFFFF, 0x344550, 0xD0B8EB).setAutogen(FRAGMENT, WIRE, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT).m();
|
||||
public static final NTMMaterial MAT_LEAD = makeSmeltable(8200, PB, 0xA6A6B2, 0x03030F, 0x646470).setAutogen(FRAGMENT, NUGGET, WIRE, BOLT, DUST, PLATE, CASTPLATE, PIPE, BLOCK, HEAVY_COMPONENT).m();
|
||||
@ -107,7 +109,7 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_ARSENIC = makeSmeltable(3300, AS, 0x6CBABA, 0x242525, 0x558080).setAutogen(NUGGET).m();
|
||||
public static final NTMMaterial MAT_TANTALIUM = makeSmeltable(7300, TA, 0xFFFFFF, 0x1D1D36, 0xA89B74).setAutogen(NUGGET, DUST, BLOCK).m();
|
||||
public static final NTMMaterial MAT_NEODYMIUM = makeSmeltable(6000, ND, 0xE6E6B6, 0x1C1C00, 0x8F8F5F).setAutogen(FRAGMENT, NUGGET, DUSTTINY, INGOT, DUST, DENSEWIRE, BLOCK).m();
|
||||
public static final NTMMaterial MAT_NIOBIUM = makeSmeltable(4100, NB, 0xB76EC9, 0x2F2D42, 0xD576B1).setAutogen(FRAGMENT, NUGGET, DUSTTINY, DUST, BLOCK).m();
|
||||
public static final NTMMaterial MAT_NIOBIUM = makeSmeltable(4100, NB, 0xB76EC9, 0x2F2D42, 0xD576B1).setAutogen(FRAGMENT, NUGGET, DUSTTINY, DUST, DENSEWIRE, BLOCK).m();
|
||||
public static final NTMMaterial MAT_BERYLLIUM = makeSmeltable(400, BE, 0xB2B2A6, 0x0F0F03, 0xAE9572).setAutogen(FRAGMENT, NUGGET, DUST, BLOCK).m();
|
||||
public static final NTMMaterial MAT_EMERALD = makeNonSmeltable(401, EMERALD, 0xBAFFD4, 0x003900, 0x17DD62).setConversion(MAT_BERYLLIUM, 4, 3).setAutogen(FRAGMENT, DUST, GEM, BLOCK).n();
|
||||
public static final NTMMaterial MAT_COBALT = makeSmeltable(2700, CO, 0xC2D1EE, 0x353554, 0x8F72AE).setAutogen(FRAGMENT, NUGGET, DUSTTINY, BILLET, DUST, BLOCK).m();
|
||||
@ -131,7 +133,7 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_SILICON = makeSmeltable(1400, SI, 0xD1D7DF, 0x1A1A3D, 0x878B9E).setAutogen(FRAGMENT, NUGGET, BILLET).m();
|
||||
public static final NTMMaterial MAT_ASBESTOS = makeSmeltable(1401, ASBESTOS, 0xD8D9CF, 0x616258, 0xB0B3A8).setAutogen(FRAGMENT, BLOCK).n();
|
||||
public static final NTMMaterial MAT_OSMIRIDIUM = makeSmeltable(7699, OSMIRIDIUM, 0xDBE3EF, 0x7891BE, 0xACBDD9).setAutogen(NUGGET, CASTPLATE, WELDEDPLATE).m();
|
||||
|
||||
|
||||
//Alloys
|
||||
public static final NTMMaterial MAT_STEEL = makeSmeltable(_AS + 0, STEEL, 0xAFAFAF, 0x0F0F0F, 0x4A4A4A).setAutogen(DUSTTINY, BOLT, WIRE, DUST, PLATE, CASTPLATE, WELDEDPLATE, SHELL, PIPE, BLOCK, HEAVY_COMPONENT, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, GRIP).m();
|
||||
public static final NTMMaterial MAT_MINGRADE = makeSmeltable(_AS + 1, MINGRADE, 0xFFBA7D, 0xAF1700, 0xE44C0F).setAutogen(WIRE, DUST, BLOCK).m();
|
||||
@ -154,7 +156,7 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_GUNMETAL = makeSmeltable(_AS + 19, GUNMETAL, 0xFFEF3F, 0xAD3600, 0xF9C62C).setAutogen(LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
|
||||
public static final NTMMaterial MAT_WEAPONSTEEL = makeSmeltable(_AS + 20, WEAPONSTEEL, 0xA0A0A0, 0x000000, 0x808080).setAutogen(SHELL, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).n();
|
||||
public static final NTMMaterial MAT_SATURN = makeSmeltable(_AS + 4, BIGMT, 0x3AC4DA, 0x09282C, 0x30A4B7).setAutogen(PLATE, CASTPLATE, SHELL, BLOCK, LIGHTBARREL, HEAVYBARREL, LIGHTRECEIVER, HEAVYRECEIVER, MECHANISM, STOCK, GRIP).m();
|
||||
|
||||
|
||||
//Extension
|
||||
public static final NTMMaterial MAT_RAREEARTH = makeNonSmeltable(_ES + 00, RAREEARTH, 0xC1BDBD, 0x384646, 0x7B7F7F).setAutogen(FRAGMENT).n();
|
||||
public static final NTMMaterial MAT_POLYMER = makeNonSmeltable(_ES + 01, POLYMER, 0x363636, 0x040404, 0x272727).setAutogen(STOCK, GRIP).n();
|
||||
@ -162,52 +164,52 @@ public class Mats {
|
||||
public static final NTMMaterial MAT_RUBBER = makeNonSmeltable(_ES + 03, RUBBER, 0x817F75, 0x0F0D03, 0x4B4A3F).setAutogen(PIPE, GRIP).n();
|
||||
public static final NTMMaterial MAT_HARDPLASTIC = makeNonSmeltable(_ES + 04, PC, 0xEDE7C4, 0x908A67, 0xE1DBB8).setAutogen(STOCK, GRIP).n();
|
||||
public static final NTMMaterial MAT_PVC = makeNonSmeltable(_ES + 05, PVC, 0xFCFCFC, 0x9F9F9F, 0xF0F0F0).setAutogen(STOCK, GRIP).n();
|
||||
|
||||
|
||||
public static NTMMaterial makeSmeltable(int id, DictFrame dict, int color) { return makeSmeltable(id, dict, color, color, color); }
|
||||
|
||||
public static NTMMaterial make(int id, DictFrame dict) {
|
||||
return new NTMMaterial(id, dict);
|
||||
}
|
||||
|
||||
|
||||
public static NTMMaterial makeSmeltable(int id, DictFrame dict, int solidColorLight, int solidColorDark, int moltenColor) {
|
||||
return new NTMMaterial(id, dict).smeltable(SmeltingBehavior.SMELTABLE).setSolidColor(solidColorLight, solidColorDark).setMoltenColor(moltenColor);
|
||||
}
|
||||
|
||||
|
||||
public static NTMMaterial makeAdditive(int id, DictFrame dict, int solidColorLight, int solidColorDark, int moltenColor) {
|
||||
return new NTMMaterial(id, dict).smeltable(SmeltingBehavior.ADDITIVE).setSolidColor(solidColorLight, solidColorDark).setMoltenColor(moltenColor);
|
||||
}
|
||||
|
||||
|
||||
public static NTMMaterial makeNonSmeltable(int id, DictFrame dict, int solidColorLight, int solidColorDark, int moltenColor) {
|
||||
return new NTMMaterial(id, dict).smeltable(SmeltingBehavior.NOT_SMELTABLE).setSolidColor(solidColorLight, solidColorDark).setMoltenColor(moltenColor);
|
||||
}
|
||||
|
||||
|
||||
public static DictFrame df(String string) {
|
||||
return new DictFrame(string);
|
||||
}
|
||||
|
||||
|
||||
/** will not respect stacksizes - all stacks will be treated as a singular */
|
||||
public static List<MaterialStack> getMaterialsFromItem(ItemStack stack) {
|
||||
List<MaterialStack> list = new ArrayList();
|
||||
List<String> names = ItemStackUtil.getOreDictNames(stack);
|
||||
|
||||
|
||||
if(!names.isEmpty()) {
|
||||
outer:
|
||||
for(String name : names) {
|
||||
|
||||
|
||||
List<MaterialStack> oreEntries = materialOreEntries.get(name);
|
||||
|
||||
|
||||
if(oreEntries != null) {
|
||||
list.addAll(oreEntries);
|
||||
break outer;
|
||||
}
|
||||
|
||||
|
||||
for(Entry<String, MaterialShapes> prefixEntry : prefixByName.entrySet()) {
|
||||
String prefix = prefixEntry.getKey();
|
||||
|
||||
|
||||
if(name.startsWith(prefix)) {
|
||||
String materialName = name.substring(prefix.length());
|
||||
NTMMaterial material = matByName.get(materialName);
|
||||
|
||||
|
||||
if(material != null && (material.smeltsInto.smeltable == SmeltingBehavior.SMELTABLE || material.smeltsInto.smeltable == SmeltingBehavior.ADDITIVE)) {
|
||||
list.add(new MaterialStack(material, prefixEntry.getValue().q(1)));
|
||||
break outer;
|
||||
@ -216,17 +218,17 @@ public class Mats {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
List<MaterialStack> entries = materialEntries.get(new ComparableStack(stack).makeSingular());
|
||||
|
||||
|
||||
if(entries != null) {
|
||||
entries.forEach(x -> { if(x != null) list.add(x); });
|
||||
}
|
||||
|
||||
|
||||
if(stack.getItem() == ModItems.scraps) {
|
||||
list.add(ItemScraps.getMats(stack));
|
||||
}
|
||||
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
@ -236,28 +238,28 @@ public class Mats {
|
||||
baseMats.forEach(x -> smelting.add(new MaterialStack(x.material.smeltsInto, (int) (x.amount * x.material.convOut / x.material.convIn))));
|
||||
return smelting;
|
||||
}
|
||||
|
||||
|
||||
public static class MaterialStack {
|
||||
//final fields to prevent accidental changing
|
||||
public final NTMMaterial material;
|
||||
public int amount;
|
||||
|
||||
|
||||
public MaterialStack(NTMMaterial material, int amount) {
|
||||
this.material = material;
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
|
||||
public MaterialStack copy() {
|
||||
return new MaterialStack(material, amount);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static String formatAmount(int amount, boolean showInMb) {
|
||||
|
||||
|
||||
if(showInMb) return (amount * 2) + "mB";
|
||||
|
||||
|
||||
String format = "";
|
||||
|
||||
|
||||
int blocks = amount / BLOCK.q(1);
|
||||
amount -= BLOCK.q(blocks);
|
||||
int ingots = amount / INGOT.q(1);
|
||||
@ -265,12 +267,12 @@ public class Mats {
|
||||
int nuggets = amount / NUGGET.q(1);
|
||||
amount -= NUGGET.q(nuggets);
|
||||
int quanta = amount;
|
||||
|
||||
|
||||
if(blocks > 0) format += (blocks == 1 ? I18nUtil.resolveKey("matshape.block", blocks) : I18nUtil.resolveKey("matshape.blocks", blocks)) + " ";
|
||||
if(ingots > 0) format += (ingots == 1 ? I18nUtil.resolveKey("matshape.ingot", ingots) : I18nUtil.resolveKey("matshape.ingots", ingots)) + " ";
|
||||
if(nuggets > 0) format += (nuggets == 1 ? I18nUtil.resolveKey("matshape.nugget", nuggets) : I18nUtil.resolveKey("matshape.nuggets", nuggets)) + " ";
|
||||
if(quanta > 0) format += (quanta == 1 ? I18nUtil.resolveKey("matshape.quantum", quanta) : I18nUtil.resolveKey("matshape.quanta", quanta)) + " ";
|
||||
|
||||
|
||||
return format.trim();
|
||||
}
|
||||
}
|
||||
|
||||
@ -41,6 +41,7 @@ public class AmmoPressRecipes extends SerializableRecipe {
|
||||
OreDictStack uranium = new OreDictStack(U238.ingot());
|
||||
ComparableStack smokeful = new ComparableStack(Items.gunpowder);
|
||||
OreDictStack smokeless = new OreDictStack(ANY_SMOKELESS.dust());
|
||||
ComparableStack rocket = new ComparableStack(ModItems.rocket_fuel);
|
||||
OreDictStack he = new OreDictStack(ANY_HIGHEXPLOSIVE.ingot());
|
||||
OreDictStack wp = new OreDictStack(P_WHITE.ingot());
|
||||
OreDictStack rp = new OreDictStack(P_RED.dust());
|
||||
@ -285,23 +286,43 @@ public class AmmoPressRecipes extends SerializableRecipe {
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HE, 2),
|
||||
null, dyn, null,
|
||||
null, cBig, null,
|
||||
null, smokeless.copy(2), null));
|
||||
null, smokeless.copy(3), null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HE, 2),
|
||||
null, dyn, null,
|
||||
null, cBig, null,
|
||||
null, rocket, null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HEAT, 2),
|
||||
coplate, he, null,
|
||||
null, cBig, null,
|
||||
null, smokeless.copy(2), null));
|
||||
null, smokeless.copy(3), null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HEAT, 2),
|
||||
coplate, he, null,
|
||||
null, cBig, null,
|
||||
null, rocket, null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_DEMO, 2),
|
||||
null, he.copy(2), null,
|
||||
null, cBig, null,
|
||||
null, smokeless.copy(2), null));
|
||||
null, smokeless.copy(3), null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_DEMO, 2),
|
||||
null, he.copy(2), null,
|
||||
null, cBig, null,
|
||||
null, rocket, null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_INC, 2),
|
||||
diesel, dyn, null,
|
||||
null, cBig, null,
|
||||
null, smokeless.copy(2), null));
|
||||
null, smokeless.copy(3), null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_INC, 2),
|
||||
diesel, dyn, null,
|
||||
null, cBig, null,
|
||||
null, rocket, null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_PHOSPHORUS, 2),
|
||||
wp, he, null,
|
||||
null, cBig, null,
|
||||
null, smokeless.copy(2), null));
|
||||
null, smokeless.copy(3), null));
|
||||
recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_PHOSPHORUS, 2),
|
||||
wp, he, null,
|
||||
null, cBig, null,
|
||||
null, rocket, null));
|
||||
|
||||
OreDictStack sPlate = new OreDictStack(STEEL.plate());
|
||||
ComparableStack napalm = new ComparableStack(ModItems.canister_napalm);
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.inventory.recipes;
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
@ -28,6 +29,7 @@ import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.items.special.ItemBedrockOreNew;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -36,43 +38,47 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<AStack, ArcFurnaceRecipe> recipes = new HashMap();
|
||||
public static List<Pair<AStack, ArcFurnaceRecipe>> recipeList = new ArrayList();
|
||||
/* quick lookup for translating input stacks into the output, created lazily whenever a recipe is checked for the first time */
|
||||
public static HashMap<ComparableStack, ArcFurnaceRecipe> fastCacheSolid = new HashMap();
|
||||
public static HashMap<ComparableStack, ArcFurnaceRecipe> fastCacheLiquid = new HashMap();
|
||||
/* used for the recipe creation process to cache which inputs are already in use to prevent input collisions */
|
||||
public static HashSet<ComparableStack> occupiedSolid = new HashSet();
|
||||
public static HashSet<ComparableStack> occupiedLiquid = new HashSet();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
recipes.put(new OreDictStack(KEY_SAND), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(1))));
|
||||
recipes.put(new ComparableStack(Items.flint), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(QUARTZ.gem()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 3)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(3))));
|
||||
recipes.put(new OreDictStack(QUARTZ.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 3)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(3))));
|
||||
recipes.put(new OreDictStack(QUARTZ.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 12)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(12))));
|
||||
recipes.put(new OreDictStack(FIBER.ingot()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(FIBER.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 40)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(9, 2))));
|
||||
recipes.put(new OreDictStack(ASBESTOS.ingot()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(ASBESTOS.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
recipes.put(new OreDictStack(ASBESTOS.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 40)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(9, 2))));
|
||||
register(new OreDictStack(KEY_SAND), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(1))));
|
||||
register(new ComparableStack(Items.flint), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
register(new OreDictStack(QUARTZ.gem()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 3)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(3))));
|
||||
register(new OreDictStack(QUARTZ.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 3)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(3))));
|
||||
register(new OreDictStack(QUARTZ.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 12)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.NUGGET.q(12))));
|
||||
register(new OreDictStack(FIBER.ingot()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
register(new OreDictStack(FIBER.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 40)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(9, 2))));
|
||||
register(new OreDictStack(ASBESTOS.ingot()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
register(new OreDictStack(ASBESTOS.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 4)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(1, 2))));
|
||||
register(new OreDictStack(ASBESTOS.block()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.nugget_silicon, 40)) .fluid(new MaterialStack(Mats.MAT_SILICON, MaterialShapes.INGOT.q(9, 2))));
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.sand_quartz), new ArcFurnaceRecipe().solid(new ItemStack(ModBlocks.glass_quartz)));
|
||||
recipes.put(new OreDictStack(BORAX.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.powder_boron_tiny, 3)).fluid(new MaterialStack(Mats.MAT_BORON, MaterialShapes.NUGGET.q(3))));
|
||||
register(new ComparableStack(ModBlocks.sand_quartz), new ArcFurnaceRecipe().solid(new ItemStack(ModBlocks.glass_quartz)));
|
||||
register(new OreDictStack(BORAX.dust()), new ArcFurnaceRecipe().solid(new ItemStack(ModItems.powder_boron_tiny, 3)).fluid(new MaterialStack(Mats.MAT_BORON, MaterialShapes.NUGGET.q(3))));
|
||||
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_BYPRODUCT, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ARC, type, 2)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ROASTED, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ARC, type, 4)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_BYPRODUCT, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ARC, type, 2)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ROASTED, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ARC, type, 4)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_BYPRODUCT, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ARC, type, 2)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ROASTED, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ARC, type, 4)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_BYPRODUCT, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ARC, type, 2)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ROASTED, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_ARC, type, 4)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_BYPRODUCT, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ARC, type, 2)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ROASTED, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_ARC, type, 4)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_BYPRODUCT, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ARC, type, 2)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ROASTED, type)), new ArcFurnaceRecipe().solid(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ARC, type, 4)));
|
||||
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_FIRST, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 5), ItemBedrockOreNew.toFluid(type.primary2, 2)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SECOND, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 2), ItemBedrockOreNew.toFluid(type.primary2, 5)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.CRUMBS, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 1), ItemBedrockOreNew.toFluid(type.primary2, 1)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_FIRST, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 5), ItemBedrockOreNew.toFluid(type.primary2, 2)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SECOND, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 2), ItemBedrockOreNew.toFluid(type.primary2, 5)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.CRUMBS, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 1), ItemBedrockOreNew.toFluid(type.primary2, 1)));
|
||||
|
||||
int i3 = 3;
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.byproductAcid1, i3), ItemBedrockOreNew.toFluid(type.byproductAcid2, i3), ItemBedrockOreNew.toFluid(type.byproductAcid3, i3)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.byproductSolvent1, i3), ItemBedrockOreNew.toFluid(type.byproductSolvent2, i3), ItemBedrockOreNew.toFluid(type.byproductSolvent3, i3)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.byproductRad1, i3), ItemBedrockOreNew.toFluid(type.byproductRad2, i3), ItemBedrockOreNew.toFluid(type.byproductRad3, i3)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SULFURIC_WASHED, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.byproductAcid1, i3), ItemBedrockOreNew.toFluid(type.byproductAcid2, i3), ItemBedrockOreNew.toFluid(type.byproductAcid3, i3)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.byproductSolvent1, i3), ItemBedrockOreNew.toFluid(type.byproductSolvent2, i3), ItemBedrockOreNew.toFluid(type.byproductSolvent3, i3)));
|
||||
register(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.byproductRad1, i3), ItemBedrockOreNew.toFluid(type.byproductRad2, i3), ItemBedrockOreNew.toFluid(type.byproductRad3, i3)));
|
||||
}
|
||||
|
||||
// Autogen for simple single type items
|
||||
@ -86,12 +92,9 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
String name = shape.name() + material.names[0];
|
||||
if(!OreDictionary.getOres(name).isEmpty()) {
|
||||
OreDictStack dict = new OreDictStack(name);
|
||||
ArcFurnaceRecipe recipe = recipes.get(dict);
|
||||
if(recipe == null) recipe = new ArcFurnaceRecipe();
|
||||
if(recipe.fluidOutput == null) {
|
||||
recipe.fluid(new MaterialStack(convert, (int) (shape.q(1) * out / in)));
|
||||
recipes.put(dict, recipe);
|
||||
}
|
||||
ArcFurnaceRecipe recipe = new ArcFurnaceRecipe();
|
||||
recipe.fluid(new MaterialStack(convert, (int) (shape.q(1) * out / in)));
|
||||
register(dict, recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -116,17 +119,31 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
if(input != null && output != null) {
|
||||
ComparableStack comp = new ComparableStack(input);
|
||||
if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) {
|
||||
ArcFurnaceRecipe recipe = recipes.get(comp);
|
||||
if(recipe == null) recipe = new ArcFurnaceRecipe();
|
||||
if(recipe.solidOutput == null) {
|
||||
recipe.solid(output.copy());
|
||||
recipes.put(comp, recipe);
|
||||
}
|
||||
ArcFurnaceRecipe recipe = new ArcFurnaceRecipe();
|
||||
recipe.solid(output.copy());
|
||||
register(comp, recipe);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void register(AStack input, ArcFurnaceRecipe output) {
|
||||
List<ItemStack> inputs = input.extractForNEI();
|
||||
for(ItemStack stack : inputs) {
|
||||
ComparableStack compStack = new ComparableStack(stack);
|
||||
if(compStack.meta == OreDictionary.WILDCARD_VALUE) compStack.meta = 0;
|
||||
if(output.solidOutput != null) if(occupiedSolid.contains(compStack)) return;
|
||||
if(output.fluidOutput != null) if(occupiedLiquid.contains(compStack)) return;
|
||||
}
|
||||
recipeList.add(new Pair(input, output));
|
||||
for(ItemStack stack : inputs) {
|
||||
ComparableStack compStack = new ComparableStack(stack);
|
||||
if(compStack.meta == OreDictionary.WILDCARD_VALUE) compStack.meta = 0;
|
||||
if(output.solidOutput != null) occupiedSolid.add(compStack);
|
||||
if(output.fluidOutput != null) occupiedLiquid.add(compStack);
|
||||
}
|
||||
}
|
||||
|
||||
private static void addCustomSmeltable(AStack astack, List<MaterialStack> mats) {
|
||||
List<MaterialStack> smeltables = new ArrayList();
|
||||
for(MaterialStack mat : mats) {
|
||||
@ -135,12 +152,9 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
}
|
||||
}
|
||||
if(smeltables.isEmpty()) return;
|
||||
ArcFurnaceRecipe recipe = recipes.get(astack);
|
||||
if(recipe == null) recipe = new ArcFurnaceRecipe();
|
||||
if(recipe.fluidOutput == null) {
|
||||
recipe.fluid(smeltables.toArray(new MaterialStack[0]));
|
||||
recipes.put(astack, recipe);
|
||||
}
|
||||
ArcFurnaceRecipe recipe = new ArcFurnaceRecipe();
|
||||
recipe.fluid(smeltables.toArray(new MaterialStack[0]));
|
||||
register(astack, recipe);
|
||||
}
|
||||
|
||||
public static ArcFurnaceRecipe getOutput(ItemStack stack, boolean liquid) {
|
||||
@ -160,7 +174,7 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
if(!liquid && fastCacheSolid.containsKey(cacheKey)) return fastCacheSolid.get(cacheKey);
|
||||
if(liquid && fastCacheLiquid.containsKey(cacheKey)) return fastCacheLiquid.get(cacheKey);
|
||||
|
||||
for(Entry<AStack, ArcFurnaceRecipe> entry : recipes.entrySet()) {
|
||||
for(Pair<AStack, ArcFurnaceRecipe> entry : recipeList) {
|
||||
if(entry.getKey().matchesRecipe(stack, true)) {
|
||||
ArcFurnaceRecipe rec = entry.getValue();
|
||||
if((liquid && rec.fluidOutput != null) || (!liquid && rec.solidOutput != null)) {
|
||||
@ -179,7 +193,7 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap getSolidRecipes() {
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
for(Entry<AStack, ArcFurnaceRecipe> recipe : ArcFurnaceRecipes.recipes.entrySet()) {
|
||||
for(Pair<AStack, ArcFurnaceRecipe> recipe : ArcFurnaceRecipes.recipeList) {
|
||||
if(recipe.getValue().solidOutput != null) recipes.put(recipe.getKey().copy(), recipe.getValue().solidOutput.copy());
|
||||
}
|
||||
return recipes;
|
||||
@ -187,7 +201,7 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap getFluidRecipes() {
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
for(Entry<AStack, ArcFurnaceRecipe> recipe : ArcFurnaceRecipes.recipes.entrySet()) {
|
||||
for(Pair<AStack, ArcFurnaceRecipe> recipe : ArcFurnaceRecipes.recipeList) {
|
||||
if(recipe.getValue().fluidOutput != null && recipe.getValue().fluidOutput.length > 0) {
|
||||
Object[] out = new Object[recipe.getValue().fluidOutput.length];
|
||||
for(int i = 0; i < out.length; i++) out[i] = ItemScraps.create(recipe.getValue().fluidOutput[i], true);
|
||||
@ -209,12 +223,14 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
return recipeList;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
occupiedSolid.clear();
|
||||
occupiedLiquid.clear();
|
||||
recipeList.clear();
|
||||
fastCacheSolid.clear();
|
||||
fastCacheLiquid.clear();
|
||||
}
|
||||
@ -245,12 +261,12 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
|
||||
}
|
||||
}
|
||||
|
||||
this.recipes.put(input, arc);
|
||||
register(input, arc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<AStack, ArcFurnaceRecipe> rec = (Entry<AStack, ArcFurnaceRecipe>) recipe;
|
||||
Pair<AStack, ArcFurnaceRecipe> rec = (Pair<AStack, ArcFurnaceRecipe>) recipe;
|
||||
|
||||
writer.name("input");
|
||||
this.writeAStack(rec.getKey(), writer);
|
||||
|
||||
@ -32,6 +32,7 @@ import com.hbm.items.ItemGenericPart.EnumPartType;
|
||||
import com.hbm.items.machine.ItemAssemblyTemplate;
|
||||
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||
import com.hbm.items.machine.ItemDrillbit.EnumDrillType;
|
||||
import com.hbm.items.machine.ItemPACoil.EnumCoilType;
|
||||
import com.hbm.items.machine.ItemPistons.EnumPistonType;
|
||||
import com.hbm.items.weapon.ItemAmmoHIMARS;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
@ -107,7 +108,7 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
makeRecipe(new ComparableStack(ModItems.tritium_deuterium_cake, 1), new AStack[] {new ComparableStack(ModItems.cell_deuterium, 6), new ComparableStack(ModItems.cell_tritium, 2), new OreDictStack(LI.ingot(), 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_cluster, 1), new AStack[] {new OreDictStack(STEEL.plate(), 4), new ComparableStack(Blocks.tnt, 1), }, 50);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_buckshot, 1), new AStack[] {new OreDictStack(PB.nugget(), 6), }, 50);
|
||||
makeRecipe(new ComparableStack(ModItems.magnetron, 1), new AStack[] {new OreDictStack(ALLOY.plate(), 3), new OreDictStack(W.wireFine(), 1), new ComparableStack(ModItems.coil_tungsten, 1), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.magnetron, 1), new AStack[] {new OreDictStack(CU.plate(), 3), new OreDictStack(W.wireFine(), 4), }, 40);
|
||||
makeRecipe(new ComparableStack(ModItems.redcoil_capacitor, 1), new AStack[] {new OreDictStack(GOLD.plate(), 3), new ComparableStack(ModItems.fuse, 1), new OreDictStack(ALLOY.wireFine(), 4), new ComparableStack(ModItems.coil_advanced_alloy, 6), new ComparableStack(Blocks.redstone_block, 2), },200);
|
||||
makeRecipe(new ComparableStack(ModItems.part_lithium, 8), new AStack[] {new OreDictStack(ANY_RUBBER.ingot(), 1), new OreDictStack(LI.dust(), 1), },50);
|
||||
makeRecipe(new ComparableStack(ModItems.part_beryllium, 8), new AStack[] {new OreDictStack(ANY_RUBBER.ingot(), 1), new OreDictStack(BE.dust(), 1), },50);
|
||||
@ -123,7 +124,6 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
makeRecipe(new ComparableStack(ModBlocks.seal_controller, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 3), new OreDictStack(ANY_PLASTIC.ingot(), 4), new OreDictStack(MINGRADE.ingot(), 1), new OreDictStack(REDSTONE.dust(), 4), new ComparableStack(ModBlocks.steel_roof, 5), },100);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_centrifuge, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_element, 1), new OreDictStack(ANY_PLASTIC.ingot(), 2), new OreDictStack(STEEL.plate528(), 8), new OreDictStack(CU.plate(), 8), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ANALOG), }, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_gascent, 1), new AStack[] {new ComparableStack(ModItems.centrifuge_element, 4), new OreDictStack(ANY_PLASTIC.ingot(), 4), new OreDictStack(DESH.ingot(), 2), new OreDictStack(STEEL.plate528(), 8), new ComparableStack(ModItems.coil_tungsten, 4), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.ADVANCED.ordinal()) }, 300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_furnace_off, 1), new AStack[] {new ComparableStack(Blocks.furnace, 1), new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(PB.plate528(), 6), new OreDictStack(OreDictManager.getReflector(), 4), new OreDictStack(CU.plate(), 2), },150);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_diesel, 1), new AStack[] {new OreDictStack(STEEL.shell(), 1), new ComparableStack(ModItems.piston_selenium, 1), new OreDictStack(STEEL.plateCast(), 1), new ComparableStack(ModItems.coil_copper, 4), }, 60);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_rtg_grey, 1), new AStack[] {new ComparableStack(ModItems.rtg_unit, 3), new OreDictStack(STEEL.plate528(), 4), new OreDictStack(MINGRADE.wireFine(), 4), new OreDictStack(ANY_PLASTIC.ingot(), 3), },200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_battery, 1), new AStack[] {new OreDictStack(STEEL.plateWelded(), 1), new OreDictStack(S.dust(), 12), new OreDictStack(PB.dust(), 12) },100);
|
||||
@ -549,14 +549,6 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
new OreDictStack(STEEL.pipe(), 24),
|
||||
new OreDictStack(Fluids.LUBRICANT.getDict(1_000), 4)
|
||||
}, 600);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_chlorophyte, 2), new AStack[] {
|
||||
new ComparableStack(ModItems.powder_chlorophyte, 1),
|
||||
new OreDictStack(PB.nugget(), 12),
|
||||
}, 50);
|
||||
makeRecipe(new ComparableStack(ModItems.pellet_canister, 2), new AStack[] {
|
||||
new OreDictStack(IRON.ingot(), 3),
|
||||
}, 50);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_cyclotron, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_lithium_battery, 3),
|
||||
@ -947,6 +939,50 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.BASIC)
|
||||
}, 200);
|
||||
|
||||
makeRecipe(new ComparableStack(ModItems.pa_coil, 1, EnumCoilType.GOLD), new AStack[] { new OreDictStack(GOLD.wireDense(), 128) }, 400);
|
||||
makeRecipe(new ComparableStack(ModItems.pa_coil, 1, EnumCoilType.NIOBIUM), new AStack[] { new OreDictStack(NB.wireDense(), 64), new OreDictStack(TI.wireDense(), 64) }, 400);
|
||||
makeRecipe(new ComparableStack(ModItems.pa_coil, 1, EnumCoilType.BSCCO), new AStack[] { new OreDictStack(BSCCO.wireDense(), 64), new OreDictStack(ANY_PLASTIC.ingot(), 64) }, 400);
|
||||
makeRecipe(new ComparableStack(ModItems.pa_coil, 1, EnumCoilType.CHLOROPHYTE), new AStack[] { new OreDictStack(CU.wireDense(), 128), new ComparableStack(ModItems.powder_chlorophyte, 16) }, 400);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.pa_beamline), new AStack[] {
|
||||
new OreDictStack(STEEL.plateCast(), 8),
|
||||
new OreDictStack(CU.plate(), 16),
|
||||
new OreDictStack(GOLD.wireDense(), 4)
|
||||
}, 200);
|
||||
makeRecipe(new ComparableStack(ModBlocks.pa_rfc), new AStack[] {
|
||||
new ComparableStack(ModBlocks.pa_beamline, 3),
|
||||
new OreDictStack(STEEL.plateCast(), 16),
|
||||
new OreDictStack(CU.plate(), 64),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
|
||||
new ComparableStack(ModItems.magnetron, 16),
|
||||
}, 400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.pa_quadrupole), new AStack[] {
|
||||
new ComparableStack(ModBlocks.pa_beamline, 1),
|
||||
new OreDictStack(STEEL.plateCast(), 16),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
|
||||
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BISMOID),
|
||||
}, 400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.pa_dipole), new AStack[] {
|
||||
new ComparableStack(ModBlocks.pa_beamline, 2),
|
||||
new OreDictStack(STEEL.plateCast(), 16),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 32),
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.BISMOID),
|
||||
}, 400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.pa_source), new AStack[] {
|
||||
new ComparableStack(ModBlocks.pa_beamline, 3),
|
||||
new OreDictStack(STEEL.plateCast(), 16),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
|
||||
new ComparableStack(ModItems.magnetron, 16),
|
||||
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.QUANTUM),
|
||||
}, 400);
|
||||
makeRecipe(new ComparableStack(ModBlocks.pa_detector), new AStack[] {
|
||||
new ComparableStack(ModBlocks.pa_beamline, 3),
|
||||
new OreDictStack(STEEL.plateCast(), 24),
|
||||
new OreDictStack(GOLD.wireDense(), 16),
|
||||
new OreDictStack(ANY_HARDPLASTIC.ingot(), 16),
|
||||
new ComparableStack(ModItems.circuit, 4, EnumCircuitType.QUANTUM),
|
||||
}, 400);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_exposure_chamber, 1), new AStack[] {
|
||||
!exp ? new OreDictStack(AL.plateCast(), 12) : new OreDictStack(AL.heavyComp(), 1),
|
||||
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4),
|
||||
|
||||
@ -22,6 +22,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ItemEnums.EnumChunkType;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -46,21 +47,21 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
|
||||
boolean lbs = GeneralConfig.enableLBSM && GeneralConfig.enableLBSMSimpleCentrifuge;
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_natural_uranium), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_u238, 1),
|
||||
new ItemStack(ModItems.nugget_pu_mix, 2),
|
||||
new ItemStack(ModItems.nugget_pu239, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 2) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_uranium), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_pu_mix, 2),
|
||||
new ItemStack(ModItems.nugget_plutonium, 1),
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 2) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_thorium), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_u238, 1),
|
||||
new ItemStack(ModItems.nugget_th232, 1),
|
||||
@ -72,73 +73,73 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.nugget_u238, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 3) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plutonium), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_pu_mix, 1),
|
||||
new ItemStack(ModItems.nugget_pu_mix, 1),
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 3) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_u233), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_u235, 1),
|
||||
new ItemStack(ModItems.nugget_neptunium, 1),
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 3) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_u235), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_pu238, 1),
|
||||
new ItemStack(ModItems.nugget_neptunium, 1),
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 3) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_schrabidium), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_beryllium, 2),
|
||||
new ItemStack(ModItems.nugget_pu239, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 2) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_zfb_mox), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_zirconium, 3),
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.nugget_pu_mix, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 1) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_mox), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_sr90_tiny, 1),
|
||||
new ItemStack(ModItems.nugget_pu_mix, 3),
|
||||
new ItemStack(ModItems.powder_cs137_tiny, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 4) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_pu238be), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_beryllium, 1),
|
||||
new ItemStack(ModItems.nugget_pu238, 1),
|
||||
new ItemStack(ModItems.powder_coal_tiny, 2),
|
||||
new ItemStack(ModItems.nugget_lead, 2) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_pu239), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_pu240, 2),
|
||||
new ItemStack(ModItems.nugget_technetium, 1),
|
||||
new ItemStack(ModItems.powder_cs137_tiny, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 5) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_ra226be), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_beryllium, 2),
|
||||
new ItemStack(ModItems.nugget_polonium, 2),
|
||||
new ItemStack(ModItems.powder_coal_tiny, 1),
|
||||
new ItemStack(ModItems.nugget_lead, 1) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_sa326), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_solinium, 1),
|
||||
new ItemStack(ModItems.powder_neodymium_tiny, 1),
|
||||
new ItemStack(ModItems.nugget_tantalium, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 6) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_u233), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_u235, 1),
|
||||
new ItemStack(ModItems.powder_i131_tiny, 1),
|
||||
new ItemStack(ModItems.powder_sr90_tiny, 1),
|
||||
new ItemStack(ModItems.nuclear_waste_tiny, 6) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.waste_plate_u235), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_neptunium, 1),
|
||||
new ItemStack(ModItems.nugget_pu238, 1),
|
||||
@ -283,7 +284,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
new ItemStack(ModItems.powder_boron_tiny, 2),
|
||||
new ItemStack(ModItems.powder_niobium_tiny, 2),
|
||||
new ItemStack(ModItems.nugget_zirconium, 3) });
|
||||
|
||||
|
||||
ArrayList<ItemStack> naquadriaNuggets = OreDictionary.getOres("nuggetNaquadria");
|
||||
if(naquadriaNuggets.size() != 0) {
|
||||
ItemStack nuggetNQR = naquadriaNuggets.get(0);
|
||||
@ -300,195 +301,195 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
new ItemStack(ModItems.nugget_euphemium, 6),
|
||||
new ItemStack(ModItems.nuclear_waste, 2) });
|
||||
}
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(COAL.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_coal, 2),
|
||||
new ItemStack(ModItems.powder_coal, 2),
|
||||
new ItemStack(ModItems.powder_coal, 2),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(LIGNITE.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_lignite, 2),
|
||||
new ItemStack(ModItems.powder_lignite, 2),
|
||||
new ItemStack(ModItems.powder_lignite, 2),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(IRON.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(GOLD.ore()), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_gold, 2) : new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(ModItems.powder_gold, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_bismuth, 1) : new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(DIAMOND.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_diamond, 1),
|
||||
new ItemStack(ModItems.powder_diamond, 1),
|
||||
new ItemStack(ModItems.powder_diamond, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(EMERALD.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(TI.ore()), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_titanium, 2) : new ItemStack(ModItems.powder_titanium, 1),
|
||||
lbs ? new ItemStack(ModItems.powder_titanium, 2) : new ItemStack(ModItems.powder_titanium, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(NETHERQUARTZ.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_quartz, 1),
|
||||
new ItemStack(ModItems.powder_quartz, 1),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 1),
|
||||
new ItemStack(Blocks.netherrack, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(W.ore()), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_tungsten, 2) : new ItemStack(ModItems.powder_tungsten, 1),
|
||||
new ItemStack(ModItems.powder_tungsten, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(CU.ore()), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_copper, 2) : new ItemStack(ModItems.powder_copper, 1),
|
||||
new ItemStack(ModItems.powder_copper, 1),
|
||||
new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(AL.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_aluminium, 1),
|
||||
new ItemStack(ModItems.powder_aluminium, 1),
|
||||
new ItemStack(ModItems.chunk_ore, 2, ItemEnums.EnumChunkType.CRYOLITE.ordinal()),
|
||||
new ItemStack(ModItems.powder_titanium, 1),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(PB.ore()), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_lead, 2) : new ItemStack(ModItems.powder_lead, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_bismuth, 1) : new ItemStack(ModItems.powder_lead, 1),
|
||||
new ItemStack(ModItems.powder_gold, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(SA326.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_schrabidium, 1),
|
||||
new ItemStack(ModItems.powder_schrabidium, 1),
|
||||
new ItemStack(ModItems.nugget_solinium, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack("oreRareEarth"), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_desh_mix, 1),
|
||||
new ItemStack(ModItems.nugget_zirconium, 1),
|
||||
new ItemStack(ModItems.nugget_zirconium, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(PU.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_plutonium, 1),
|
||||
new ItemStack(ModItems.powder_plutonium, 1),
|
||||
new ItemStack(ModItems.nugget_polonium, 3),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(U.ore()), new ItemStack[] {
|
||||
lbs ? new ItemStack(ModItems.powder_uranium, 2) : new ItemStack(ModItems.powder_uranium, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_technetium, 2) : new ItemStack(ModItems.powder_uranium, 1),
|
||||
lbs ? new ItemStack(ModItems.nugget_ra226, 2) : new ItemStack(ModItems.nugget_ra226, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) recipes.put(new OreDictStack(ore), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_thorium, 1),
|
||||
new ItemStack(ModItems.powder_thorium, 1),
|
||||
new ItemStack(ModItems.powder_uranium, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(BE.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_beryllium, 1),
|
||||
new ItemStack(ModItems.powder_beryllium, 1),
|
||||
new ItemStack(ModItems.powder_emerald, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(F.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.fluorite, 3),
|
||||
new ItemStack(ModItems.fluorite, 3),
|
||||
new ItemStack(ModItems.gem_sodalite, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(REDSTONE.ore()), new ItemStack[] {
|
||||
new ItemStack(Items.redstone, 3),
|
||||
new ItemStack(Items.redstone, 3),
|
||||
lbs ? new ItemStack(ModItems.ingot_mercury, 3) : new ItemStack(ModItems.ingot_mercury, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.ore_tikite), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_plutonium, 1),
|
||||
new ItemStack(ModItems.powder_cobalt, 2),
|
||||
new ItemStack(ModItems.powder_niobium, 2),
|
||||
new ItemStack(Blocks.end_stone, 1) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(LAPIS.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_lapis, 6),
|
||||
new ItemStack(ModItems.powder_cobalt_tiny, 1),
|
||||
new ItemStack(ModItems.gem_sodalite, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.block_euphemium_cluster), new ItemStack[] {
|
||||
new ItemStack(ModItems.nugget_euphemium, 7),
|
||||
new ItemStack(ModItems.powder_schrabidium, 4),
|
||||
new ItemStack(ModItems.ingot_starmetal, 2),
|
||||
new ItemStack(ModItems.nugget_solinium, 2) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.ore_nether_fire), new ItemStack[] {
|
||||
new ItemStack(Items.blaze_powder, 2),
|
||||
new ItemStack(ModItems.powder_fire, 2),
|
||||
new ItemStack(ModItems.ingot_phosphorus),
|
||||
new ItemStack(Blocks.netherrack) });
|
||||
|
||||
|
||||
recipes.put(new OreDictStack(CO.ore()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_cobalt, 2),
|
||||
new ItemStack(ModItems.powder_iron, 1),
|
||||
new ItemStack(ModItems.powder_copper, 1),
|
||||
new ItemStack(Blocks.gravel, 1) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.powder_tektite), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_meteorite_tiny, 1),
|
||||
new ItemStack(ModItems.powder_paleogenite_tiny, 1),
|
||||
new ItemStack(ModItems.powder_meteorite_tiny, 1),
|
||||
new ItemStack(ModItems.dust, 6) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.block_slag), new ItemStack[] {
|
||||
new ItemStack(Blocks.gravel, 1),
|
||||
new ItemStack(ModItems.powder_fire, 1),
|
||||
new ItemStack(ModItems.powder_calcium),
|
||||
new ItemStack(ModItems.dust) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.powder_ash, 1, EnumAshType.COAL.ordinal()), new ItemStack[] {
|
||||
new ItemStack(ModItems.powder_coal_tiny, 2),
|
||||
new ItemStack(ModItems.powder_boron_tiny, 1),
|
||||
new ItemStack(ModItems.dust_tiny, 6)});
|
||||
|
||||
|
||||
for(EnumBedrockOre ore : EnumBedrockOre.values()) {
|
||||
int i = ore.ordinal();
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ore_bedrock, 1, i), new ItemStack[] {
|
||||
new ItemStack(ModItems.ore_centrifuged, 1, i),
|
||||
new ItemStack(ModItems.ore_centrifuged, 1, i),
|
||||
new ItemStack(ModItems.ore_centrifuged, 1, i),
|
||||
new ItemStack(ModItems.ore_centrifuged, 1, i) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ore_cleaned, 1, i), new ItemStack[] {
|
||||
new ItemStack(ModItems.ore_separated, 1, i),
|
||||
new ItemStack(ModItems.ore_separated, 1, i),
|
||||
new ItemStack(ModItems.ore_separated, 1, i),
|
||||
new ItemStack(ModItems.ore_separated, 1, i) });
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ore_purified, 1, i), new ItemStack[] {
|
||||
new ItemStack(ModItems.ore_enriched, 1, i),
|
||||
new ItemStack(ModItems.ore_enriched, 1, i),
|
||||
new ItemStack(ModItems.ore_enriched, 1, i),
|
||||
new ItemStack(ModItems.ore_enriched, 1, i) });
|
||||
|
||||
|
||||
EnumByproduct tier1 = ore.byproducts[0];
|
||||
ItemStack by1 = tier1 == null ? new ItemStack(ModItems.dust) : DictFrame.fromOne(ModItems.ore_byproduct, tier1, 1);
|
||||
recipes.put(new ComparableStack(ModItems.ore_nitrated, 1, i), new ItemStack[] {
|
||||
@ -496,7 +497,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
new ItemStack(ModItems.ore_nitrocrystalline, 1, i),
|
||||
ItemStackUtil.carefulCopy(by1),
|
||||
ItemStackUtil.carefulCopy(by1) });
|
||||
|
||||
|
||||
EnumByproduct tier2 = ore.byproducts[1];
|
||||
ItemStack by2 = tier2 == null ? new ItemStack(ModItems.dust) : DictFrame.fromOne(ModItems.ore_byproduct, tier2, 1);
|
||||
recipes.put(new ComparableStack(ModItems.ore_deepcleaned, 1, i), new ItemStack[] {
|
||||
@ -504,7 +505,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
new ItemStack(ModItems.ore_enriched, 1, i),
|
||||
ItemStackUtil.carefulCopy(by2),
|
||||
ItemStackUtil.carefulCopy(by2) });
|
||||
|
||||
|
||||
EnumByproduct tier3 = ore.byproducts[2];
|
||||
ItemStack by3 = tier3 == null ? new ItemStack(ModItems.dust) : DictFrame.fromOne(ModItems.ore_byproduct, tier3, 1);
|
||||
recipes.put(new ComparableStack(ModItems.ore_seared, 1, i), new ItemStack[] {
|
||||
@ -513,7 +514,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
ItemStackUtil.carefulCopy(by3),
|
||||
ItemStackUtil.carefulCopy(by3) });
|
||||
}
|
||||
|
||||
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type)), new ItemStack[] {ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY, type), new ItemStack(Blocks.gravel)});
|
||||
@ -536,20 +537,20 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.SOLVENT_WASHED, type)), new ItemStack[] {ItemBedrockOreNew.extract(type.byproductSolvent1, 1), ItemBedrockOreNew.extract(type.byproductSolvent2, 1), ItemBedrockOreNew.extract(type.byproductSolvent3, 1), ItemBedrockOreNew.make(BedrockOreGrade.CRUMBS, type)});
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_WASHED, type)), new ItemStack[] {ItemBedrockOreNew.extract(type.byproductRad1, 1), ItemBedrockOreNew.extract(type.byproductRad2, 1), ItemBedrockOreNew.extract(type.byproductRad3, 1), ItemBedrockOreNew.make(BedrockOreGrade.CRUMBS, type)});
|
||||
}
|
||||
|
||||
|
||||
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");
|
||||
|
||||
|
||||
if(quartz != null && !quartz.isEmpty()) {
|
||||
ItemStack qItem = quartz.get(0).copy();
|
||||
qItem.stackSize = 2;
|
||||
|
||||
|
||||
recipes.put(new OreDictStack("oreCertusQuartz"), new ItemStack[] {
|
||||
qItem.copy(),
|
||||
qItem.copy(),
|
||||
qItem.copy(),
|
||||
qItem.copy() });
|
||||
}
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(Items.blaze_rod), new ItemStack[] {new ItemStack(Items.blaze_powder, 1), new ItemStack(Items.blaze_powder, 1), new ItemStack(ModItems.powder_fire, 1), new ItemStack(ModItems.powder_fire, 1) });
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ingot_schraranium), new ItemStack[] { new ItemStack(ModItems.nugget_schrabidium, 2), new ItemStack(ModItems.nugget_schrabidium, 1), new ItemStack(ModItems.nugget_uranium, 3), new ItemStack(ModItems.nugget_neptunium, 2) });
|
||||
@ -568,7 +569,7 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
recipes.put(new ComparableStack(ModItems.crystal_niter), new ItemStack[] { new ItemStack(ModItems.niter, 3), new ItemStack(ModItems.niter, 3), new ItemStack(ModItems.niter, 3), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_copper), new ItemStack[] { new ItemStack(ModItems.powder_copper, 2), new ItemStack(ModItems.powder_copper, 2), new ItemStack(ModItems.sulfur, 1), new ItemStack(ModItems.powder_cobalt_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_tungsten), new ItemStack[] { new ItemStack(ModItems.powder_tungsten, 2), new ItemStack(ModItems.powder_tungsten, 2), new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_aluminium), new ItemStack[] { new ItemStack(ModItems.powder_aluminium, 2), new ItemStack(ModItems.powder_aluminium, 2), new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_aluminium), new ItemStack[] { new ItemStack(ModItems.chunk_ore, 3, ItemEnums.EnumChunkType.CRYOLITE.ordinal()), new ItemStack(ModItems.powder_titanium, 1), new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_fluorite), new ItemStack[] { new ItemStack(ModItems.fluorite, 4), new ItemStack(ModItems.fluorite, 4), new ItemStack(ModItems.gem_sodalite, 2), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_beryllium), new ItemStack[] { new ItemStack(ModItems.powder_beryllium, 2), new ItemStack(ModItems.powder_beryllium, 2), new ItemStack(ModItems.powder_quartz, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_lead), new ItemStack[] { new ItemStack(ModItems.powder_lead, 2), new ItemStack(ModItems.powder_lead, 2), new ItemStack(ModItems.powder_gold, 1), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
@ -581,44 +582,44 @@ public class CentrifugeRecipes extends SerializableRecipe {
|
||||
recipes.put(new ComparableStack(ModItems.crystal_starmetal), new ItemStack[] { new ItemStack(ModItems.powder_dura_steel, 3), new ItemStack(ModItems.powder_cobalt, 3), new ItemStack(ModItems.powder_astatine, 2), new ItemStack(ModItems.ingot_mercury, 5) });
|
||||
recipes.put(new ComparableStack(ModItems.crystal_cobalt), new ItemStack[] { new ItemStack(ModItems.powder_cobalt, 2), new ItemStack(ModItems.powder_iron, 3), new ItemStack(ModItems.powder_copper, 3), new ItemStack(ModItems.powder_lithium_tiny, 1) });
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void registerPost() {
|
||||
|
||||
|
||||
if(!IMCCentrifuge.buffer.isEmpty()) {
|
||||
recipes.putAll(IMCCentrifuge.buffer);
|
||||
MainRegistry.logger.info("Fetched " + IMCCentrifuge.buffer.size() + " IMC centrifuge recipes!");
|
||||
IMCCentrifuge.buffer.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack[] getOutput(ItemStack stack) {
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack).makeSingular();
|
||||
|
||||
|
||||
if(recipes.containsKey(comp))
|
||||
return RecipesCommon.copyStackArray(recipes.get(comp));
|
||||
|
||||
|
||||
for(Entry<AStack, ItemStack[]> entry : recipes.entrySet()) {
|
||||
if(entry.getKey().isApplicable(stack)) {
|
||||
return RecipesCommon.copyStackArray(entry.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
|
||||
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
|
||||
|
||||
for(Entry<AStack, ItemStack[]> entry : CentrifugeRecipes.recipes.entrySet()) {
|
||||
recipes.put(entry.getKey(), entry.getValue());
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
@ -26,7 +26,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ChemplantRecipes extends SerializableRecipe {
|
||||
|
||||
|
||||
/**
|
||||
* Nice order: The order in which the ChemRecipe are added to the recipes list
|
||||
* Meta order: Fixed using the id param, saved in indexMapping
|
||||
@ -34,13 +34,13 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<Integer, ChemRecipe> indexMapping = new HashMap();
|
||||
public static List<ChemRecipe> recipes = new ArrayList();
|
||||
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
|
||||
//6-30, formerly oil cracking, coal liquefaction and solidifciation
|
||||
registerOtherOil();
|
||||
|
||||
|
||||
recipes.add(new ChemRecipe(36, "COOLANT", 50)
|
||||
.inputItems(new OreDictStack(KNO.dust()))
|
||||
.inputFluids(new FluidStack(Fluids.WATER, 1800))
|
||||
@ -99,7 +99,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
new FluidStack(Fluids.XYLENE, 500),
|
||||
new FluidStack(Fluids.OXYGEN, 100))
|
||||
.outputItems(new ItemStack(ModItems.ingot_pet)));*/
|
||||
|
||||
|
||||
//Laminate Glass going here
|
||||
recipes.add(new ChemRecipe(97, "LAMINATE", 100)
|
||||
.inputFluids(
|
||||
@ -374,7 +374,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
recipes.add(new ChemRecipe(101, "CC_CENTRIFUGE", 200)
|
||||
.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, "THORIUM_SALT", 60)
|
||||
.inputFluids(new FluidStack(Fluids.THORIUM_SALT_DEPLETED, 16_000))
|
||||
.inputItems(new OreDictStack(TH232.nugget(), 2))
|
||||
@ -411,7 +411,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
.inputFluids(new FluidStack(1000, Fluids.BITUMEN))
|
||||
.outputItems(new ItemStack(ModBlocks.asphalt, 16)));
|
||||
}
|
||||
|
||||
|
||||
public static class ChemRecipe {
|
||||
|
||||
public int listing;
|
||||
@ -422,49 +422,49 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
public ItemStack[] outputs;
|
||||
public FluidStack[] outputFluids;
|
||||
private int duration;
|
||||
|
||||
|
||||
public ChemRecipe(int index, String name, int duration) {
|
||||
this.id = index;
|
||||
this.name = name;
|
||||
this.duration = duration;
|
||||
this.listing = recipes.size();
|
||||
|
||||
|
||||
this.inputs = new AStack[4];
|
||||
this.outputs = new ItemStack[4];
|
||||
this.inputFluids = new FluidStack[2];
|
||||
this.outputFluids = new FluidStack[2];
|
||||
|
||||
|
||||
if(!indexMapping.containsKey(id)) {
|
||||
indexMapping.put(id, this);
|
||||
} else {
|
||||
throw new IllegalStateException("Chemical plant recipe " + name + " has been registered with duplicate id " + id + " used by " + indexMapping.get(id).name + "!");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public ChemRecipe inputItems(AStack... in) {
|
||||
for(int i = 0; i < in.length; i++) this.inputs[i] = in[i];
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ChemRecipe inputFluids(FluidStack... in) {
|
||||
for(int i = 0; i < in.length; i++) this.inputFluids[i] = in[i];
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ChemRecipe outputItems(ItemStack... out) {
|
||||
for(int i = 0; i < out.length; i++) this.outputs[i] = out[i];
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public ChemRecipe outputFluids(FluidStack... out) {
|
||||
for(int i = 0; i < out.length; i++) this.outputFluids[i] = out[i];
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public int getId() {
|
||||
return this.id;
|
||||
}
|
||||
|
||||
|
||||
public int getDuration() {
|
||||
return this.duration;
|
||||
}
|
||||
@ -486,7 +486,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
int id = obj.get("id").getAsInt();
|
||||
String name = obj.get("name").getAsString();
|
||||
int duration = obj.get("duration").getAsInt();
|
||||
|
||||
|
||||
recipes.add(new ChemRecipe(id, name, duration)
|
||||
.inputFluids( this.readFluidArray( (JsonArray) obj.get("fluidInput")))
|
||||
.inputItems( this.readAStackArray( (JsonArray) obj.get("itemInput")))
|
||||
@ -522,7 +522,7 @@ public class ChemplantRecipes extends SerializableRecipe {
|
||||
ex.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public String getComment() {
|
||||
return "Rules: All in- and output arrays need to be present, even if empty. IDs need to be unique, but not sequential. It's safe if you add your own"
|
||||
+ " recipes starting with ID 1000. Template order depends on the order of the recipes in this JSON file. The 'name' field is responsible for"
|
||||
|
||||
@ -24,7 +24,7 @@ import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CokerRecipes extends SerializableRecipe {
|
||||
|
||||
|
||||
private static HashMap<FluidType, Triplet<Integer, ItemStack, FluidStack>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
@ -58,7 +58,7 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
registerSFAuto(WOODOIL, 340_000L, new ItemStack(Items.coal, 1, 1), GAS_COKER);
|
||||
|
||||
registerRecipe(WATZ, 4_000, new ItemStack(ModItems.ingot_mud, 4), null);
|
||||
registerRecipe(REDMUD, 1_000, new ItemStack(Items.iron_ingot, 1), new FluidStack(MERCURY, 50));
|
||||
registerRecipe(REDMUD, 450, new ItemStack(Items.iron_ingot, 1), new FluidStack(MERCURY, 50));
|
||||
registerRecipe(BITUMEN, 16_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_600));
|
||||
registerRecipe(LUBRICANT, 12_000, DictFrame.fromOne(ModItems.coke, EnumCokeType.PETROLEUM), new FluidStack(OIL_COKER, 1_200));
|
||||
registerRecipe(CALCIUM_SOLUTION, 125, new ItemStack(ModItems.powder_calcium), new FluidStack(SPENTSTEAM, 100));
|
||||
@ -74,17 +74,17 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, ItemStack fuel, FluidType type) {
|
||||
long tuFlammable = fluid.hasTrait(FT_Flammable.class) ? fluid.getTrait(FT_Flammable.class).getHeatEnergy() : 0;
|
||||
long tuCombustible = fluid.hasTrait(FT_Combustible.class) ? fluid.getTrait(FT_Combustible.class).getCombustionEnergy() : 0;
|
||||
|
||||
|
||||
long tuPerBucket = Math.max(tuFlammable, tuCombustible);
|
||||
|
||||
|
||||
double penalty = 1;//1.1D; //no penalty
|
||||
|
||||
|
||||
int mB = (int) (tuPerSF * 1000L * penalty / tuPerBucket);
|
||||
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
|
||||
FluidStack byproduct = type == null ? null : new FluidStack(type, Math.max(10, mB / 10));
|
||||
|
||||
registerRecipe(fluid, mB, fuel, byproduct);
|
||||
@ -92,28 +92,28 @@ public class CokerRecipes extends SerializableRecipe {
|
||||
private static void registerRecipe(FluidType type, int quantity, ItemStack output, FluidStack byproduct) {
|
||||
recipes.put(type, new Triplet(quantity, output, byproduct));
|
||||
}
|
||||
|
||||
|
||||
public static Triplet<Integer, ItemStack, FluidStack> getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
public static HashMap<ItemStack, ItemStack[]> getRecipes() {
|
||||
|
||||
|
||||
HashMap<ItemStack, ItemStack[]> recipes = new HashMap<ItemStack, ItemStack[]>();
|
||||
|
||||
|
||||
for(Entry<FluidType, Triplet<Integer, ItemStack, FluidStack>> entry : CokerRecipes.recipes.entrySet()) {
|
||||
|
||||
|
||||
FluidType type = entry.getKey();
|
||||
int amount = entry.getValue().getX();
|
||||
ItemStack out = entry.getValue().getY().copy();
|
||||
FluidStack byproduct = entry.getValue().getZ();
|
||||
|
||||
|
||||
|
||||
if(out != null && byproduct != null) recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {out, ItemFluidIcon.make(byproduct)});
|
||||
if(out != null && byproduct == null) recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {out});
|
||||
if(out == null && byproduct != null) recipes.put(ItemFluidIcon.make(type, amount), new ItemStack[] {ItemFluidIcon.make(byproduct)});
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
@ -9,8 +9,6 @@ import static com.hbm.inventory.OreDictManager.*;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockEnums.EnumStoneType;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
@ -18,6 +16,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ItemEnums.EnumBriquetteType;
|
||||
import com.hbm.items.ItemEnums.EnumCokeType;
|
||||
@ -42,7 +41,7 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
recipes.put(COAL.gem(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), new FluidStack(Fluids.COALCREOSOTE, 100)));
|
||||
recipes.put(COAL.dust(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), new FluidStack(Fluids.COALCREOSOTE, 100)));
|
||||
recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.briquette, EnumBriquetteType.COAL)), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.COAL), new FluidStack(Fluids.COALCREOSOTE, 150)));
|
||||
|
||||
|
||||
recipes.put(LIGNITE.gem(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 50)));
|
||||
recipes.put(LIGNITE.dust(), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 50)));
|
||||
recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.briquette, EnumBriquetteType.LIGNITE)), new Pair(DictFrame.fromOne(ModItems.coke, EnumCokeType.LIGNITE), new FluidStack(Fluids.COALCREOSOTE, 100)));
|
||||
@ -52,7 +51,7 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
recipes.put(CINNABAR.crystal(), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.MERCURY, 100)));
|
||||
recipes.put(new ComparableStack(Items.glowstone_dust), new Pair(new ItemStack(ModItems.sulfur), new FluidStack(Fluids.CHLORINE, 100)));
|
||||
recipes.put(SODALITE.gem(), new Pair(new ItemStack(ModItems.powder_sodium), new FluidStack(Fluids.CHLORINE, 100)));
|
||||
recipes.put(new ComparableStack(DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.BAUXITE)), new Pair(new ItemStack(ModItems.ingot_aluminium, 2), new FluidStack(Fluids.REDMUD, 250)));
|
||||
recipes.put(new ComparableStack(DictFrame.fromOne(ModItems.chunk_ore, ItemEnums.EnumChunkType.CRYOLITE)), new Pair(new ItemStack(ModItems.powder_aluminium, 1), new FluidStack(Fluids.LYE, 150)));
|
||||
recipes.put(NA.dust(), new Pair(null, new FluidStack(Fluids.SODIUM, 100)));
|
||||
recipes.put(LIMESTONE.dust(), new Pair(new ItemStack(ModItems.powder_calcium), new FluidStack(Fluids.CARBONDIOXIDE, 50)));
|
||||
|
||||
@ -67,7 +66,7 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
|
||||
recipes.put(new ComparableStack(Items.reeds), new Pair(new ItemStack(Items.sugar, 2), new FluidStack(Fluids.ETHANOL, 50)));
|
||||
recipes.put(new ComparableStack(Blocks.clay), new Pair(new ItemStack(Blocks.brick_block, 1), null));
|
||||
|
||||
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type)), new Pair(ItemBedrockOreNew.make(BedrockOreGrade.BASE_ROASTED, type), new FluidStack(Fluids.VITRIOL, 50)));
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY, type)), new Pair(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_ROASTED, type), new FluidStack(Fluids.VITRIOL, 50)));
|
||||
@ -76,21 +75,21 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
recipes.put(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.RAD_BYPRODUCT, type)), new Pair(ItemBedrockOreNew.make(BedrockOreGrade.RAD_ROASTED, type), new FluidStack(Fluids.VITRIOL, 50)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Pair<ItemStack, FluidStack> getOutput(ItemStack stack) {
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
|
||||
|
||||
if(recipes.containsKey(comp)) {
|
||||
Pair<ItemStack, FluidStack> out = recipes.get(comp);
|
||||
return new Pair(out.getKey() == null ? null : out.getKey().copy(), out.getValue());
|
||||
}
|
||||
|
||||
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
|
||||
for(String key : dictKeys) {
|
||||
|
||||
if(recipes.containsKey(key)) {
|
||||
@ -98,19 +97,19 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
return new Pair(out.getKey() == null ? null : out.getKey().copy(), out.getValue());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
|
||||
HashMap<Object, Object[]> recipes = new HashMap<Object, Object[]>();
|
||||
|
||||
|
||||
for(Entry<Object, Pair<ItemStack, FluidStack>> entry : CombinationRecipes.recipes.entrySet()) {
|
||||
Object key = entry.getKey();
|
||||
Pair<ItemStack, FluidStack> val = entry.getValue();
|
||||
Object o = key instanceof String ? new OreDictStack((String) key) : key;
|
||||
|
||||
|
||||
if(val.getKey() != null && val.getValue() != null) {
|
||||
recipes.put(o, new ItemStack[] {val.getKey(), ItemFluidIcon.make(val.getValue())});
|
||||
} else if(val.getKey() != null) {
|
||||
@ -119,7 +118,7 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
recipes.put(o, new ItemStack[] {ItemFluidIcon.make(val.getValue())});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@ -139,10 +138,10 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
AStack in = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
FluidStack fluid = null;
|
||||
ItemStack out = null;
|
||||
|
||||
|
||||
if(obj.has("fluid")) fluid = this.readFluidStack(obj.get("fluid").getAsJsonArray());
|
||||
if(obj.has("output")) out = this.readItemStack(obj.get("output").getAsJsonArray());
|
||||
|
||||
|
||||
if(in instanceof ComparableStack) {
|
||||
recipes.put(((ComparableStack) in).makeSingular(), new Pair(out, fluid));
|
||||
} else if(in instanceof OreDictStack) {
|
||||
@ -157,7 +156,7 @@ public class CombinationRecipes extends SerializableRecipe {
|
||||
Pair<ItemStack, FluidStack> Pair = rec.getValue();
|
||||
ItemStack output = Pair.key;
|
||||
FluidStack fluid = Pair.value;
|
||||
|
||||
|
||||
writer.name("input");
|
||||
if(in instanceof String) {
|
||||
this.writeAStack(new OreDictStack((String) in), writer);
|
||||
|
||||
@ -11,22 +11,38 @@ import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class CompressorRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<Pair<FluidType, Integer>, CompressorRecipe> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
recipes.put(new Pair(Fluids.STEAM, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.HOTSTEAM, 100)));
|
||||
recipes.put(new Pair(Fluids.HOTSTEAM, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.SUPERHOTSTEAM, 100)));
|
||||
recipes.put(new Pair(Fluids.SUPERHOTSTEAM, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.ULTRAHOTSTEAM, 100)));
|
||||
|
||||
recipes.put(new Pair(Fluids.PETROLEUM, 0), new CompressorRecipe(2_000, new FluidStack(Fluids.PETROLEUM, 2_000, 1), 20));
|
||||
recipes.put(new Pair(Fluids.PETROLEUM, 1), new CompressorRecipe(2_000, new FluidStack(Fluids.LPG, 1_000, 0), 20));
|
||||
|
||||
recipes.put(new Pair(Fluids.BLOOD, 3), new CompressorRecipe(1_000, new FluidStack(Fluids.HEAVYOIL, 250, 0), 200));
|
||||
|
||||
recipes.put(new Pair(Fluids.PERFLUOROMETHYL, 0), new CompressorRecipe(1_000, new FluidStack(Fluids.PERFLUOROMETHYL, 1_000, 1), 50));
|
||||
recipes.put(new Pair(Fluids.PERFLUOROMETHYL, 1), new CompressorRecipe(1_000, new FluidStack(Fluids.PERFLUOROMETHYL_COLD, 1_000, 0), 50));
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
|
||||
for(Entry<Pair<FluidType, Integer>, CompressorRecipe> entry : CompressorRecipes.recipes.entrySet()) {
|
||||
ItemStack input = ItemFluidIcon.make(entry.getKey().getKey(), entry.getValue().inputAmount, entry.getKey().getValue());
|
||||
ItemStack output = ItemFluidIcon.make(entry.getValue().output);
|
||||
if(input.getItemDamage() == output.getItemDamage()) continue;
|
||||
recipes.put(input, output);
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static class CompressorRecipe {
|
||||
|
||||
@ -20,6 +20,8 @@ import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
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.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.ItemEnums.EnumPlantType;
|
||||
@ -27,6 +29,7 @@ import com.hbm.items.ItemEnums.EnumTarType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemChemicalDye.EnumChemDye;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
import com.hbm.items.special.ItemBedrockOreNew;
|
||||
import com.hbm.items.special.ItemBedrockOre.EnumBedrockOre;
|
||||
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
|
||||
@ -45,7 +48,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
//This time we're doing this right
|
||||
//...right?
|
||||
public class CrystallizerRecipes extends SerializableRecipe {
|
||||
|
||||
|
||||
//'Object' is either a ComparableStack or the key for the ore dict
|
||||
private static HashMap<Pair<Object, FluidType>, CrystallizerRecipe> recipes = new HashMap();
|
||||
private static HashMap<Object, Integer> amounts = new HashMap(); // for use in the partitioner
|
||||
@ -65,7 +68,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime));
|
||||
registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime));
|
||||
registerRecipe(U.ore(), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime), sulfur);
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ORE)) registerRecipe(ore, new CrystallizerRecipe(ModItems.crystal_thorium, baseTime), sulfur);
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ONLY_ORE)) registerRecipe(ore, new CrystallizerRecipe(ModItems.crystal_thorium, baseTime), sulfur);
|
||||
registerRecipe(PU.ore(), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime), sulfur);
|
||||
registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime), sulfur);
|
||||
registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime));
|
||||
@ -80,10 +83,13 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(LI.ore(), new CrystallizerRecipe(ModItems.crystal_lithium, baseTime), sulfur);
|
||||
//registerRecipe(STAR.ore(), new CrystallizerRecipe(ModItems.crystal_starmetal, baseTime), sulfur);
|
||||
registerRecipe(CO.ore(), new CrystallizerRecipe(ModItems.crystal_cobalt, baseTime), sulfur);
|
||||
|
||||
|
||||
registerRecipe(new ComparableStack(ModItems.powder_calcium), new CrystallizerRecipe(new ItemStack(ModItems.powder_cement, 8), utilityTime), new FluidStack(Fluids.REDMUD, 75));
|
||||
registerRecipe(MALACHITE.ingot(), new CrystallizerRecipe(ItemScraps.create(new MaterialStack(Mats.MAT_COPPER, MaterialShapes.INGOT.q(1))), 300), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
|
||||
registerRecipe("oreRareEarth", new CrystallizerRecipe(ModItems.crystal_rare, baseTime), sulfur);
|
||||
registerRecipe("oreCinnabar", new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime));
|
||||
|
||||
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_nether_fire), new CrystallizerRecipe(ModItems.crystal_phosphorus, baseTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_tikite), new CrystallizerRecipe(ModItems.crystal_trixite, baseTime), sulfur);
|
||||
registerRecipe(new ComparableStack(ModBlocks.gravel_diamond), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime));
|
||||
@ -106,7 +112,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.plant_item, EnumPlantType.MUSTARDWILLOW)), new CrystallizerRecipe(new ItemStack(ModItems.powder_cadmium), 100).setReq(10), new FluidStack(Fluids.RADIOSOLVENT, 250));
|
||||
registerRecipe(new ComparableStack(ModItems.scrap_oil), new CrystallizerRecipe(new ItemStack(ModItems.nugget_arsenic), 100).setReq(16), new FluidStack(Fluids.RADIOSOLVENT, 100));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.FULLERENE)), new CrystallizerRecipe(new ItemStack(ModItems.ingot_cft), baseTime).setReq(4), new FluidStack(Fluids.XYLENE, 1_000));
|
||||
|
||||
|
||||
registerRecipe(DIAMOND.dust(), new CrystallizerRecipe(Items.diamond, utilityTime));
|
||||
registerRecipe(EMERALD.dust(), new CrystallizerRecipe(Items.emerald, utilityTime));
|
||||
registerRecipe(LAPIS.dust(), new CrystallizerRecipe(new ItemStack(Items.dye, 1, 4), utilityTime));
|
||||
@ -116,10 +122,10 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(CD.dust(), new CrystallizerRecipe(ModItems.ingot_rubber, utilityTime), new FluidStack(Fluids.FISHOIL, 250));
|
||||
registerRecipe(LATEX.ingot(), new CrystallizerRecipe(ModItems.ingot_rubber, mixingTime), new FluidStack(Fluids.SOURGAS, 25));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_sawdust), new CrystallizerRecipe(ModItems.cordite, mixingTime), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
|
||||
|
||||
registerRecipe(new ComparableStack(ModItems.meteorite_sword_treated), new CrystallizerRecipe(ModItems.meteorite_sword_etched, baseTime));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_impure_osmiridium), new CrystallizerRecipe(ModItems.crystal_osmiridium, baseTime), new FluidStack(Fluids.SCHRABIDIC, 1_000));
|
||||
|
||||
|
||||
for(int i = 0; i < ScrapType.values().length; i++) {
|
||||
registerRecipe(new ComparableStack(ModItems.scrap_plastic, 1, i), new CrystallizerRecipe(new ItemStack(ModItems.circuit_star_piece, 1, i), baseTime));
|
||||
}
|
||||
@ -127,9 +133,9 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
FluidStack nitric = new FluidStack(Fluids.NITRIC_ACID, 500);
|
||||
FluidStack organic = new FluidStack(Fluids.SOLVENT, 500);
|
||||
FluidStack hiperf = new FluidStack(Fluids.RADIOSOLVENT, 500);
|
||||
|
||||
|
||||
int oreTime = 200;
|
||||
|
||||
|
||||
for(EnumBedrockOre ore : EnumBedrockOre.values()) {
|
||||
int i = ore.ordinal();
|
||||
|
||||
@ -145,7 +151,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.BASE_WASHED, type), washing), new FluidStack(Fluids.WATER, 250));
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.BASE_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.BASE_WASHED, type), washing), new FluidStack(Fluids.WATER, 250));
|
||||
|
||||
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SULFURIC, type), bedrock), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_ROASTED, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SULFURIC, type), bedrock), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
|
||||
@ -192,10 +198,10 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_NOSOLVENT, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SECOND, type), bedrock), secondary);
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_RAD, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SECOND, type), bedrock), secondary);
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_NORAD, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.PRIMARY_SECOND, type), bedrock), secondary);
|
||||
|
||||
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.CRUMBS, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type), bedrock).setReq(64), new FluidStack(Fluids.NITRIC_ACID, 1000));
|
||||
}
|
||||
|
||||
|
||||
FluidStack[] dyes = new FluidStack[] {new FluidStack(Fluids.WOODOIL, 100), new FluidStack(Fluids.FISHOIL, 100)};
|
||||
for(FluidStack dye : dyes) {
|
||||
registerRecipe(COAL.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLACK, 4), mixingTime), dye);
|
||||
@ -215,7 +221,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(KEY_SAND, new CrystallizerRecipe(Blocks.clay, 20), new FluidStack(Fluids.COLLOID, 1_000));
|
||||
registerRecipe(new ComparableStack(ModBlocks.sand_quartz), new CrystallizerRecipe(new ItemStack(ModItems.ball_dynamite, 16), 20), new FluidStack(Fluids.NITROGLYCERIN, 1_000));
|
||||
registerRecipe(NETHERQUARTZ.dust(), new CrystallizerRecipe(new ItemStack(ModItems.ball_dynamite, 4), 20), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
|
||||
|
||||
/// COMPAT CERTUS QUARTZ ///
|
||||
List<ItemStack> quartz = OreDictionary.getOres("crystalCertusQuartz");
|
||||
if(quartz != null && !quartz.isEmpty()) {
|
||||
@ -229,69 +235,69 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
if(dustWhitePhosphorus != null && !dustWhitePhosphorus.isEmpty()) {
|
||||
registerRecipe(P_WHITE.dust(), new CrystallizerRecipe(new ItemStack(ModItems.ingot_phosphorus), utilityTime), new FluidStack(Fluids.AROMATICS, 50));
|
||||
}
|
||||
|
||||
|
||||
if(!IMCCrystallizer.buffer.isEmpty()) {
|
||||
recipes.putAll(IMCCrystallizer.buffer);
|
||||
MainRegistry.logger.info("Fetched " + IMCCrystallizer.buffer.size() + " IMC crystallizer recipes!");
|
||||
IMCCrystallizer.buffer.clear();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static CrystallizerRecipe getOutput(ItemStack stack, FluidType type) {
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
Pair compKey = new Pair(comp, type);
|
||||
|
||||
if(recipes.containsKey(compKey)) return recipes.get(compKey);
|
||||
|
||||
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
|
||||
for(String key : dictKeys) {
|
||||
Pair dictKey = new Pair(key, type);
|
||||
if(recipes.containsKey(dictKey)) return recipes.get(dictKey);
|
||||
}
|
||||
|
||||
|
||||
comp.meta = OreDictionary.WILDCARD_VALUE;
|
||||
if(recipes.containsKey(compKey)) return recipes.get(compKey);
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static int getAmount(ItemStack stack) {
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return 0;
|
||||
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
if(amounts.containsKey(comp)) return amounts.get(comp);
|
||||
|
||||
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
|
||||
for(String key : dictKeys) {
|
||||
if(amounts.containsKey(key)) return amounts.get(key);
|
||||
}
|
||||
|
||||
|
||||
comp.meta = OreDictionary.WILDCARD_VALUE;
|
||||
if(amounts.containsKey(comp)) return amounts.get(comp);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
|
||||
|
||||
for(Entry<Pair<Object, FluidType>, CrystallizerRecipe> entry : CrystallizerRecipes.recipes.entrySet()) {
|
||||
|
||||
|
||||
CrystallizerRecipe recipe = entry.getValue();
|
||||
|
||||
|
||||
Pair<Object, FluidType> key = entry.getKey();
|
||||
Object input = key.getKey();
|
||||
FluidType acid = key.getValue();
|
||||
|
||||
|
||||
if(input instanceof String) {
|
||||
OreDictStack stack = new OreDictStack((String) input, recipe.itemAmount);
|
||||
recipes.put(new Object[] {ItemFluidIcon.make(acid, recipe.acidAmount), stack}, recipe.output);
|
||||
@ -303,34 +309,34 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
recipes.put(new Object[] {ItemFluidIcon.make(acid, recipe.acidAmount), stack}, recipe.output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
public static void registerRecipe(Object input, CrystallizerRecipe recipe) {
|
||||
registerRecipe(input, recipe, new FluidStack(Fluids.PEROXIDE, 500));
|
||||
}
|
||||
|
||||
|
||||
public static void registerRecipe(Object input, CrystallizerRecipe recipe, FluidStack stack) {
|
||||
recipe.acidAmount = stack.fill;
|
||||
recipes.put(new Pair(input, stack.type), recipe);
|
||||
amounts.put(input, recipe.itemAmount);
|
||||
}
|
||||
|
||||
|
||||
public static class CrystallizerRecipe {
|
||||
public int acidAmount;
|
||||
public int itemAmount = 1;
|
||||
public int duration;
|
||||
public ItemStack output;
|
||||
|
||||
|
||||
public CrystallizerRecipe(Block output, int duration) { this(new ItemStack(output), duration); }
|
||||
public CrystallizerRecipe(Item output, int duration) { this(new ItemStack(output), duration); }
|
||||
|
||||
|
||||
public CrystallizerRecipe setReq(int amount) {
|
||||
this.itemAmount = amount;
|
||||
return this;
|
||||
}
|
||||
|
||||
|
||||
public CrystallizerRecipe(ItemStack output, int duration) {
|
||||
this.output = output;
|
||||
this.duration = duration;
|
||||
@ -356,7 +362,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
AStack input = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
FluidStack fluid = this.readFluidStack(obj.get("fluid").getAsJsonArray());
|
||||
int duration = obj.get("duration").getAsInt();
|
||||
|
||||
|
||||
CrystallizerRecipe cRecipe = new CrystallizerRecipe(output, duration).setReq(input.stacksize);
|
||||
input.stacksize = 1;
|
||||
cRecipe.acidAmount = fluid.fill;
|
||||
|
||||
@ -19,7 +19,7 @@ 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
|
||||
@ -28,27 +28,29 @@ public class ElectrolyserFluidRecipes extends SerializableRecipe {
|
||||
recipes.put(Fluids.HEAVYWATER, new ElectrolysisRecipe(2_000, new FluidStack(Fluids.DEUTERIUM, 200), new FluidStack(Fluids.OXYGEN, 200), 10));
|
||||
recipes.put(Fluids.VITRIOL, new ElectrolysisRecipe(1_000, new FluidStack(Fluids.SULFURIC_ACID, 500), new FluidStack(Fluids.CHLORINE, 500), new ItemStack(ModItems.powder_iron), new ItemStack(ModItems.ingot_mercury)));
|
||||
recipes.put(Fluids.SLOP, new ElectrolysisRecipe(1_000, new FluidStack(Fluids.MERCURY, 250), new FluidStack(Fluids.NONE, 0), new ItemStack(ModItems.niter, 2), new ItemStack(ModItems.powder_limestone, 2), new ItemStack(ModItems.sulfur)));
|
||||
recipes.put(Fluids.REDMUD, new ElectrolysisRecipe(450, new FluidStack(Fluids.MERCURY, 150), new FluidStack(Fluids.LYE, 50), new ItemStack(ModItems.powder_titanium, 3), new ItemStack(ModItems.powder_iron, 3), new ItemStack(ModItems.powder_aluminium, 2)));
|
||||
recipes.put(Fluids.ALUMINA, new ElectrolysisRecipe(200, new FluidStack(Fluids.CARBONDIOXIDE, 100), new FluidStack(Fluids.NONE, 0),40, new ItemStack(ModItems.powder_aluminium, 7), new ItemStack(ModItems.fluorite, 2)));
|
||||
|
||||
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(ItemFluidIcon.make(input), outputs.toArray());
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
public static ElectrolysisRecipe getRecipe(FluidType type) {
|
||||
@ -79,30 +81,30 @@ public class ElectrolyserFluidRecipes extends SerializableRecipe {
|
||||
FluidStack input = this.readFluidStack(obj.get("input").getAsJsonArray());
|
||||
FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
|
||||
FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
|
||||
|
||||
|
||||
int duration = 20;
|
||||
if(obj.has("duraion")) duration = obj.get("duration").getAsInt();
|
||||
|
||||
|
||||
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, duration, 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();
|
||||
}
|
||||
|
||||
|
||||
writer.name("duration").value(rec.getValue().duration);
|
||||
}
|
||||
|
||||
@ -112,7 +114,7 @@ public class ElectrolyserFluidRecipes extends SerializableRecipe {
|
||||
public int amount;
|
||||
public ItemStack[] byproduct;
|
||||
public int duration;
|
||||
|
||||
|
||||
public ElectrolysisRecipe(int amount, FluidStack output1, FluidStack output2, ItemStack... byproduct) {
|
||||
this.output1 = output1;
|
||||
this.output2 = output2;
|
||||
|
||||
@ -16,6 +16,7 @@ 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.ItemEnums;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
import com.hbm.items.machine.ItemScraps;
|
||||
@ -29,7 +30,7 @@ import com.hbm.util.Tuple.*;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
|
||||
|
||||
public static HashMap<AStack, ElectrolysisMetalRecipe> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
@ -39,99 +40,101 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_TITANIUM, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_gold), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_GOLD, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_LEAD, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3),
|
||||
new ItemStack(ModItems.ingot_mercury, 2)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_uranium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_URANIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_RADIUM, MaterialShapes.NUGGET.q(4)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_thorium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_THORIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_URANIUM, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_plutonium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_PLUTONIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_POLONIUM, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_titanium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_TITANIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_copper), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_COPPER, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_LEAD, MaterialShapes.NUGGET.q(4)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3),
|
||||
new ItemStack(ModItems.sulfur, 2)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_tungsten), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_TUNGSTEN, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_aluminium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_ALUMINIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_ALUMINIUM, MaterialShapes.INGOT.q(2)),
|
||||
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.chunk_ore, 4, ItemEnums.EnumChunkType.CRYOLITE.ordinal()),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_beryllium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_BERYLLIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_LEAD, MaterialShapes.NUGGET.q(4)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3),
|
||||
new ItemStack(ModItems.powder_quartz, 2)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_lead), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_LEAD, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_GOLD, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_schraranium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_SCHRABIDIUM, MaterialShapes.NUGGET.q(5)),
|
||||
new MaterialStack(Mats.MAT_URANIUM, MaterialShapes.NUGGET.q(2)),
|
||||
new ItemStack(ModItems.nugget_neptunium, 2)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_schrabidium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_SCHRABIDIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_PLUTONIUM, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_rare), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_ZIRCONIUM, MaterialShapes.NUGGET.q(6)),
|
||||
new MaterialStack(Mats.MAT_BORON, MaterialShapes.NUGGET.q(2)),
|
||||
new ItemStack(ModItems.powder_desh_mix, 3)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_trixite), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_PLUTONIUM, MaterialShapes.INGOT.q(3)),
|
||||
new MaterialStack(Mats.MAT_COBALT, MaterialShapes.INGOT.q(4)),
|
||||
new ItemStack(ModItems.powder_niobium, 4),
|
||||
new ItemStack(ModItems.powder_nitan_mix, 2)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_lithium), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_LITHIUM, MaterialShapes.INGOT.q(6)),
|
||||
new MaterialStack(Mats.MAT_BORON, MaterialShapes.INGOT.q(2)),
|
||||
new ItemStack(ModItems.powder_quartz, 2),
|
||||
new ItemStack(ModItems.fluorite, 2)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_starmetal), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_DURA, MaterialShapes.INGOT.q(4)),
|
||||
new MaterialStack(Mats.MAT_COBALT, MaterialShapes.INGOT.q(4)),
|
||||
new ItemStack(ModItems.powder_astatine, 3),
|
||||
new ItemStack(ModItems.ingot_mercury, 8)));
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_cobalt), new ElectrolysisMetalRecipe(
|
||||
new MaterialStack(Mats.MAT_COBALT, MaterialShapes.INGOT.q(3)),
|
||||
new MaterialStack(Mats.MAT_IRON, MaterialShapes.INGOT.q(4)),
|
||||
new ItemStack(ModItems.powder_copper, 4),
|
||||
new ItemStack(ModItems.powder_lithium_tiny, 3)));
|
||||
|
||||
|
||||
for(BedrockOreType type : BedrockOreType.values()) {
|
||||
ArrayList<Pair<Object, Integer>> productsF = new ArrayList<>();
|
||||
productsF.add(new Pair(type.primary1, 8));
|
||||
@ -166,7 +169,7 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(product.getKey() instanceof BedrockOreOutput) solidProducts.add(ItemBedrockOreNew.extract((BedrockOreOutput) product.getKey(), product.getValue()));
|
||||
if(product.getKey() instanceof ItemStack) solidProducts.add(((ItemStack) product.getKey()).copy());
|
||||
}
|
||||
@ -178,39 +181,39 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
20,
|
||||
solidProducts.toArray(new ItemStack[0]));
|
||||
}
|
||||
|
||||
|
||||
public static ElectrolysisMetalRecipe getRecipe(ItemStack stack) {
|
||||
if(stack == null || stack.getItem() == null) return null;
|
||||
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(), 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;
|
||||
}
|
||||
|
||||
@ -232,7 +235,7 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
|
||||
AStack input = this.readAStack(obj.get("input").getAsJsonArray());
|
||||
|
||||
MaterialStack output1 = null;
|
||||
@ -251,22 +254,22 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
int amount2 = out2.get(1).getAsInt();
|
||||
output2 = new MaterialStack(Mats.matByName.get(name2), amount2);
|
||||
}
|
||||
|
||||
|
||||
ItemStack[] byproducts = new ItemStack[0];
|
||||
if(obj.has("byproducts")) byproducts = this.readItemStackArray(obj.get("byproducts").getAsJsonArray());
|
||||
|
||||
|
||||
int duration = 600;
|
||||
if(obj.has("duration")) duration = obj.get("duration").getAsInt();
|
||||
|
||||
|
||||
recipes.put(input, new ElectrolysisMetalRecipe(output1, output2, duration, 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);
|
||||
|
||||
|
||||
if(rec.getValue().output1 != null) {
|
||||
writer.name("output1");
|
||||
writer.beginArray();
|
||||
@ -284,23 +287,23 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
|
||||
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();
|
||||
}
|
||||
|
||||
|
||||
writer.name("duration").value(rec.getValue().duration);
|
||||
}
|
||||
|
||||
|
||||
public static class ElectrolysisMetalRecipe {
|
||||
|
||||
|
||||
public MaterialStack output1;
|
||||
public MaterialStack output2;
|
||||
public ItemStack[] byproduct;
|
||||
public int duration;
|
||||
|
||||
|
||||
public ElectrolysisMetalRecipe(MaterialStack output1, MaterialStack output2, ItemStack... byproduct) {
|
||||
this.output1 = output1;
|
||||
this.output2 = output2;
|
||||
|
||||
@ -20,7 +20,7 @@ import net.minecraft.item.ItemStack;
|
||||
public class FractionRecipes extends SerializableRecipe {
|
||||
|
||||
private static Map<FluidType, Pair<FluidStack, FluidStack>> fractions = new HashMap();
|
||||
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
fractions.put(Fluids.HEAVYOIL, new Pair(new FluidStack(Fluids.BITUMEN, 30), new FluidStack(Fluids.SMEAR, 70)));
|
||||
@ -41,38 +41,39 @@ public class FractionRecipes extends SerializableRecipe {
|
||||
fractions.put(Fluids.NAPHTHA_COKER, new Pair(new FluidStack(Fluids.NAPHTHA_CRACK, 75), new FluidStack(Fluids.LIGHTOIL_CRACK, 25)));
|
||||
fractions.put(Fluids.GAS_COKER, new Pair(new FluidStack(Fluids.AROMATICS, 25), new FluidStack(Fluids.CARBONDIOXIDE, 75)));
|
||||
fractions.put(Fluids.CHLOROCALCITE_MIX, new Pair(new FluidStack(Fluids.CHLOROCALCITE_CLEANED, 50), new FluidStack(Fluids.COLLOID, 50)));
|
||||
fractions.put(Fluids.BAUXITE_SOLUTION, new Pair(new FluidStack(Fluids.REDMUD, 50), new FluidStack(Fluids.SODIUM_ALUMINATE, 50)));
|
||||
}
|
||||
|
||||
|
||||
public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {
|
||||
return fractions.get(oil);
|
||||
}
|
||||
|
||||
|
||||
public static HashMap<Object, Object> getFractionRecipesForNEI() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap();
|
||||
|
||||
|
||||
for(Entry<FluidType, Pair<FluidStack, FluidStack>> recipe : fractions.entrySet()) {
|
||||
ItemStack[] out = new ItemStack[] {
|
||||
ItemFluidIcon.make(recipe.getValue().getKey()),
|
||||
ItemFluidIcon.make(recipe.getValue().getValue())
|
||||
};
|
||||
|
||||
|
||||
recipes.put(ItemFluidIcon.make(recipe.getKey(), 100), out);
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmFractions.json";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "Inputs are always 100mB, set output quantities accordingly.";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return fractions;
|
||||
@ -82,7 +83,7 @@ public class FractionRecipes extends SerializableRecipe {
|
||||
public void deleteRecipes() {
|
||||
fractions.clear();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
@ -90,14 +91,14 @@ public class FractionRecipes extends SerializableRecipe {
|
||||
FluidType input = Fluids.fromName(obj.get("input").getAsString());
|
||||
FluidStack output1 = this.readFluidStack(obj.get("output1").getAsJsonArray());
|
||||
FluidStack output2 = this.readFluidStack(obj.get("output2").getAsJsonArray());
|
||||
|
||||
|
||||
fractions.put(input, new Pair(output1, output2));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, Pair<FluidStack, FluidStack>> rec = (Entry<FluidType, Pair<FluidStack, FluidStack>>) recipe;
|
||||
|
||||
|
||||
writer.name("input").value(rec.getKey().getName());
|
||||
writer.name("output1"); this.writeFluidStack(rec.getValue().getKey(), writer);
|
||||
writer.name("output2"); this.writeFluidStack(rec.getValue().getValue(), writer);
|
||||
|
||||
@ -12,6 +12,8 @@ import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.BlockEnums;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.RecipesCommon.AStack;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
@ -19,6 +21,7 @@ import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemEnums.EnumAshType;
|
||||
import com.hbm.items.machine.ItemFluidIcon;
|
||||
@ -30,7 +33,7 @@ import net.minecraftforge.oredict.OreDictionary;
|
||||
public class MixerRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<FluidType, MixerRecipe[]> recipes = new HashMap();
|
||||
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
register(Fluids.COOLANT, new MixerRecipe(2_000, 50).setStack1(new FluidStack(Fluids.WATER, 1_800)).setSolid(new OreDictStack(KNO.dust())));
|
||||
@ -59,7 +62,7 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
register(Fluids.NITRIC_ACID, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.SULFURIC_ACID, 500)).setSolid(new OreDictStack(KNO.dust())));
|
||||
register(Fluids.RADIOSOLVENT, new MixerRecipe(1000, 50).setStack1(new FluidStack(Fluids.REFORMGAS, 750)).setStack2(new FluidStack(Fluids.CHLORINE, 250)));
|
||||
register(Fluids.SCHRABIDIC, new MixerRecipe(16_000, 100).setStack1(new FluidStack(Fluids.SAS3, 8_000)).setStack2(new FluidStack(Fluids.PEROXIDE, 6_000)).setSolid(new ComparableStack(ModItems.pellet_charged)));
|
||||
|
||||
|
||||
register(Fluids.PETROIL, new MixerRecipe(1_000, 30).setStack1(new FluidStack(Fluids.RECLAIMED, 800)).setStack2(new FluidStack(Fluids.LUBRICANT, 200)));
|
||||
register(Fluids.LUBRICANT,
|
||||
new MixerRecipe(1_000, 20).setStack1(new FluidStack(Fluids.HEATINGOIL, 500)).setStack2(new FluidStack(Fluids.UNSATURATEDS, 500)),
|
||||
@ -71,7 +74,7 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
register(Fluids.NITROGLYCERIN,
|
||||
new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.PETROLEUM, 1_000)).setStack2(new FluidStack(Fluids.NITRIC_ACID, 1_000)),
|
||||
new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.FISHOIL, 500)).setStack2(new FluidStack(Fluids.NITRIC_ACID, 500)));
|
||||
|
||||
|
||||
register(Fluids.THORIUM_SALT, new MixerRecipe(1_000, 30).setStack1(new FluidStack(Fluids.CHLORINE, 1000)).setSolid(new OreDictStack(TH232.dust())));
|
||||
|
||||
register(Fluids.SYNGAS, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.COALOIL, 500)).setStack2(new FluidStack(Fluids.STEAM, 500)));
|
||||
@ -86,34 +89,41 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
register(Fluids.DIESEL_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.DIESEL, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));
|
||||
register(Fluids.DIESEL_CRACK_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.DIESEL_CRACK, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));
|
||||
register(Fluids.KEROSENE_REFORM, new MixerRecipe(1_000, 50).setStack1(new FluidStack(Fluids.KEROSENE, 900)).setStack2(new FluidStack(Fluids.REFORMATE, 100)));
|
||||
|
||||
|
||||
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)).setSolid(new ComparableStack(ModItems.powder_flux)));
|
||||
register(Fluids.PHEROMONE_M, new MixerRecipe(2000, 10).setStack1(new FluidStack(Fluids.PHEROMONE, 1500)).setStack2(new FluidStack(Fluids.BLOOD, 500)).setSolid(new ComparableStack(ModItems.pill_herbal)));
|
||||
|
||||
register(Fluids.BAUXITE_SOLUTION, new MixerRecipe(300, 80).setStack1(new FluidStack(Fluids.LYE, 50)).setSolid(new ComparableStack(ModBlocks.stone_resource, 1, BlockEnums.EnumStoneType.BAUXITE.ordinal())));
|
||||
register(Fluids.LYE, new MixerRecipe(50, 100).setStack1(new FluidStack(Fluids.WATER, 500)).setSolid(new ComparableStack(ModItems.powder_ash, 2, EnumAshType.WOOD)));
|
||||
register(Fluids.ALUMINA, new MixerRecipe(200, 40).setStack1(new FluidStack(Fluids.SODIUM_ALUMINATE, 150)).setSolid(new OreDictStack(F.dust(), 3)),
|
||||
new MixerRecipe(300, 40).setStack1(new FluidStack(Fluids.SODIUM_ALUMINATE, 150)).setSolid(new ComparableStack(DictFrame.fromOne(ModItems.chunk_ore, ItemEnums.EnumChunkType.CRYOLITE))));
|
||||
|
||||
register(Fluids.PERFLUOROMETHYL, new MixerRecipe(1000, 20).setStack1(new FluidStack(Fluids.PETROLEUM, 1000)).setStack2(new FluidStack(Fluids.UNSATURATEDS, 500)).setSolid(new OreDictStack(F.dust())));
|
||||
|
||||
}
|
||||
|
||||
|
||||
public static void register(FluidType type, MixerRecipe... rec) {
|
||||
recipes.put(type, rec);
|
||||
}
|
||||
|
||||
|
||||
public static MixerRecipe[] getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
|
||||
public static MixerRecipe getOutput(FluidType type, int index) {
|
||||
MixerRecipe[] recs = recipes.get(type);
|
||||
|
||||
|
||||
if(recs == null) return null;
|
||||
|
||||
|
||||
return recs[index % recs.length];
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmMixer.json";
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
@ -123,43 +133,43 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
|
||||
FluidType outputType = Fluids.fromName(obj.get("outputType").getAsString());
|
||||
JsonArray recipeArray = obj.get("recipes").getAsJsonArray();
|
||||
MixerRecipe[] array = new MixerRecipe[recipeArray.size()];
|
||||
|
||||
|
||||
for(int i = 0; i < recipeArray.size(); i++) {
|
||||
JsonObject sub = recipeArray.get(i).getAsJsonObject();
|
||||
MixerRecipe mix = new MixerRecipe(sub.get("outputAmount").getAsInt(), sub.get("duration").getAsInt());
|
||||
|
||||
|
||||
if(sub.has("input1")) mix.setStack1(this.readFluidStack(sub.get("input1").getAsJsonArray()));
|
||||
if(sub.has("input2")) mix.setStack2(this.readFluidStack(sub.get("input2").getAsJsonArray()));
|
||||
if(sub.has("solidInput")) mix.setSolid(this.readAStack(sub.get("solidInput").getAsJsonArray()));
|
||||
|
||||
|
||||
array[i] = mix;
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
recipes.put(outputType, array);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
Entry<FluidType, MixerRecipe[]> rec = (Entry<FluidType, MixerRecipe[]>) recipe;
|
||||
MixerRecipe[] recipes = rec.getValue();
|
||||
|
||||
|
||||
writer.name("outputType").value(rec.getKey().getName());
|
||||
writer.name("recipes").beginArray();
|
||||
|
||||
|
||||
for(MixerRecipe mix : recipes) {
|
||||
writer.beginObject();
|
||||
writer.name("duration").value(mix.processTime);
|
||||
writer.name("outputAmount").value(mix.output);
|
||||
|
||||
|
||||
if(mix.input1 != null) { writer.name("input1"); this.writeFluidStack(mix.input1, writer); }
|
||||
if(mix.input2 != null) { writer.name("input2"); this.writeFluidStack(mix.input2, writer); }
|
||||
if(mix.solidInput != null) { writer.name("solidInput"); this.writeAStack(mix.solidInput, writer); }
|
||||
@ -169,36 +179,36 @@ public class MixerRecipes extends SerializableRecipe {
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
|
||||
HashMap<Object[], Object> recipes = new HashMap<Object[], Object>();
|
||||
|
||||
|
||||
for(Entry<FluidType, MixerRecipe[]> entry : MixerRecipes.recipes.entrySet()) {
|
||||
|
||||
|
||||
FluidType type = entry.getKey();
|
||||
MixerRecipe[] recs = entry.getValue();
|
||||
|
||||
|
||||
for(MixerRecipe recipe : recs) {
|
||||
FluidStack output = new FluidStack(type, recipe.output);
|
||||
|
||||
|
||||
List<Object> objects = new ArrayList();
|
||||
if(recipe.input1 != null) objects.add(ItemFluidIcon.make(recipe.input1));
|
||||
if(recipe.input2 != null) objects.add(ItemFluidIcon.make(recipe.input2));
|
||||
if(recipe.solidInput != null) objects.add(recipe.solidInput);
|
||||
|
||||
|
||||
recipes.put(objects.toArray(), ItemFluidIcon.make(output));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
public static class MixerRecipe {
|
||||
public FluidStack input1;
|
||||
public FluidStack input2;
|
||||
public AStack solidInput;
|
||||
public int processTime;
|
||||
public int output;
|
||||
|
||||
|
||||
protected MixerRecipe(int output, int processTime) {
|
||||
this.output = output;
|
||||
this.processTime = processTime;
|
||||
|
||||
@ -0,0 +1,194 @@
|
||||
package com.hbm.inventory.recipes;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
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.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ParticleAcceleratorRecipes extends SerializableRecipe {
|
||||
|
||||
public static final List<ParticleAcceleratorRecipe> recipes = new ArrayList();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_hydrogen),
|
||||
new ComparableStack(ModItems.particle_copper),
|
||||
300,
|
||||
new ItemStack(ModItems.particle_amat),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_amat),
|
||||
new ComparableStack(ModItems.particle_amat),
|
||||
400,
|
||||
new ItemStack(ModItems.particle_aschrab),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_aschrab),
|
||||
new ComparableStack(ModItems.particle_aschrab),
|
||||
10_000,
|
||||
new ItemStack(ModItems.particle_dark),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_hydrogen),
|
||||
new ComparableStack(ModItems.particle_amat),
|
||||
2_500,
|
||||
new ItemStack(ModItems.particle_muon),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_hydrogen),
|
||||
new ComparableStack(ModItems.particle_lead),
|
||||
6_500,
|
||||
new ItemStack(ModItems.particle_higgs),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_muon),
|
||||
new ComparableStack(ModItems.particle_higgs),
|
||||
5_000,
|
||||
new ItemStack(ModItems.particle_tachyon),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_muon),
|
||||
new ComparableStack(ModItems.particle_dark),
|
||||
12_500,
|
||||
new ItemStack(ModItems.particle_strange),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_strange),
|
||||
new ComparableStack(ModItems.powder_magic),
|
||||
12_500,
|
||||
new ItemStack(ModItems.particle_sparkticle),
|
||||
new ItemStack(ModItems.dust)
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(ModItems.particle_sparkticle),
|
||||
new ComparableStack(ModItems.particle_higgs),
|
||||
70_000,
|
||||
new ItemStack(ModItems.particle_digamma),
|
||||
null
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(Items.chicken),
|
||||
new ComparableStack(Items.chicken),
|
||||
100,
|
||||
new ItemStack(ModItems.nugget),
|
||||
new ItemStack(ModItems.nugget)
|
||||
));
|
||||
}
|
||||
|
||||
public static ParticleAcceleratorRecipe getOutput(ItemStack input1, ItemStack input2) {
|
||||
|
||||
for(ParticleAcceleratorRecipe recipe : recipes) {
|
||||
|
||||
if(((recipe.input1.matchesRecipe(input1, true) && recipe.input2.matchesRecipe(input2, true)) ||
|
||||
(recipe.input1.matchesRecipe(input2, true) && recipe.input2.matchesRecipe(input1, true)))) {
|
||||
return recipe;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
HashMap<Object[], Object> recipes = new HashMap<Object[], Object>();
|
||||
|
||||
for(ParticleAcceleratorRecipe entry : ParticleAcceleratorRecipes.recipes) {
|
||||
List<ItemStack> outputs = new ArrayList();
|
||||
if(entry.output1 != null) outputs.add(entry.output1);
|
||||
if(entry.output2 != null) outputs.add(entry.output2);
|
||||
recipes.put(new Object[] {entry.input1, entry.input2}, outputs.toArray(new ItemStack[0]));
|
||||
}
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
public static class ParticleAcceleratorRecipe {
|
||||
public AStack input1;
|
||||
public AStack input2;
|
||||
public int momentum;
|
||||
public ItemStack output1;
|
||||
public ItemStack output2;
|
||||
|
||||
public ParticleAcceleratorRecipe(AStack in1, AStack in2, int momentum, ItemStack out1, ItemStack out2) {
|
||||
this.input1 = in1;
|
||||
this.input2 = in2;
|
||||
this.momentum = momentum;
|
||||
this.output1 = out1;
|
||||
this.output2 = out2;
|
||||
}
|
||||
|
||||
// it makes more sense to have this logic here
|
||||
public boolean matchesRecipe(ItemStack in1, ItemStack in2) {
|
||||
return this.input1.matchesRecipe(in1, true) && this.input2.matchesRecipe(in2, true)
|
||||
|| this.input1.matchesRecipe(in2, true) && this.input2.matchesRecipe(in1, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getFileName() {
|
||||
return "hbmParticleAccelerator.json";
|
||||
}
|
||||
|
||||
@Override
|
||||
public Object getRecipeObject() {
|
||||
return recipes;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
recipes.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
int momentum = obj.get("momentum").getAsInt();
|
||||
AStack[] in = this.readAStackArray(obj.get("inputs").getAsJsonArray());
|
||||
ItemStack[] out = this.readItemStackArray(obj.get("outputs").getAsJsonArray());
|
||||
|
||||
this.recipes.add(new ParticleAcceleratorRecipe(
|
||||
in[0],
|
||||
in[1],
|
||||
momentum,
|
||||
out[0],
|
||||
out[1]
|
||||
));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
ParticleAcceleratorRecipe rec = (ParticleAcceleratorRecipe) recipe;
|
||||
|
||||
writer.name("momentum").value(rec.momentum);
|
||||
|
||||
writer.name("inputs").beginArray();
|
||||
this.writeAStack(rec.input1, writer);
|
||||
this.writeAStack(rec.input2, writer);
|
||||
writer.endArray();
|
||||
|
||||
writer.name("outputs").beginArray();
|
||||
this.writeItemStack(rec.output1, writer);
|
||||
if(rec.output2 != null) this.writeItemStack(rec.output2, writer);
|
||||
writer.endArray();
|
||||
}
|
||||
}
|
||||
@ -18,6 +18,8 @@ import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumSecretType;
|
||||
import com.hbm.items.food.ItemConserve.EnumFoodType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmoSecret;
|
||||
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -71,6 +73,17 @@ public class PedestalRecipes extends SerializableRecipe {
|
||||
new OreDictStack(BSCCO.ingot(), 16), new OreDictStack(STAR.block(), 64), new OreDictStack(BSCCO.ingot(), 16),
|
||||
new ComparableStack(ModItems.item_secret, 4, EnumSecretType.SELENIUM_STEEL), new ComparableStack(ModItems.item_secret, 2, EnumSecretType.CONTROLLER), new ComparableStack(ModItems.item_secret, 4, EnumSecretType.SELENIUM_STEEL))
|
||||
.extra(PedestalExtraCondition.FULL_MOON));
|
||||
|
||||
recipes.add(new PedestalRecipe(new ItemStack(ModItems.ammo_secret, 1, EnumAmmoSecret.FOLLY_SM.ordinal()),
|
||||
new OreDictStack(STAR.ingot(), 1), new ComparableStack(ModItems.powder_magic), new OreDictStack(STAR.ingot(), 1),
|
||||
new ComparableStack(ModItems.powder_magic), new ComparableStack(ModBlocks.moon_turf), new ComparableStack(ModItems.powder_magic),
|
||||
new OreDictStack(STAR.ingot(), 1), new ComparableStack(ModItems.powder_magic), new OreDictStack(STAR.ingot(), 1))
|
||||
.extra(PedestalExtraCondition.FULL_MOON));
|
||||
recipes.add(new PedestalRecipe(new ItemStack(ModItems.ammo_secret, 1, EnumAmmoSecret.FOLLY_NUKE.ordinal()),
|
||||
new OreDictStack(STAR.ingot(), 1), new ComparableStack(ModItems.powder_magic), new OreDictStack(STAR.ingot(), 1),
|
||||
new ComparableStack(ModItems.powder_magic), new ComparableStack(ModItems.ammo_standard, 4, EnumAmmo.NUKE_HIGH), new ComparableStack(ModItems.powder_magic),
|
||||
new OreDictStack(STAR.ingot(), 1), new ComparableStack(ModItems.powder_magic), new OreDictStack(STAR.ingot(), 1))
|
||||
.extra(PedestalExtraCondition.FULL_MOON));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -29,7 +29,7 @@ import com.hbm.items.machine.ItemScraps;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
|
||||
|
||||
public static List<RotaryFurnaceRecipe> recipes = new ArrayList();
|
||||
|
||||
@Override
|
||||
@ -37,53 +37,55 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(1)), 100, 100, new OreDictStack(IRON.ingot()), new OreDictStack(COAL.gem())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(1)), 100, 100, new OreDictStack(IRON.ingot()), new OreDictStack(ANY_COKE.gem())));
|
||||
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(2)), 100, 100, new OreDictStack(IRON.fragment(), 9), new OreDictStack(COAL.gem())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(3)), 100, 100, new OreDictStack(IRON.fragment(), 9), new OreDictStack(ANY_COKE.gem())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(4)), 200, 100, new OreDictStack(IRON.fragment(), 9), new OreDictStack(ANY_COKE.gem()), new ComparableStack(ModItems.powder_flux)));
|
||||
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(2)), 200, 25, new OreDictStack(IRON.fragment(), 9), new OreDictStack(COAL.gem())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(3)), 200, 25, new OreDictStack(IRON.fragment(), 9), new OreDictStack(ANY_COKE.gem())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_STEEL, INGOT.q(4)), 400, 25, new OreDictStack(IRON.fragment(), 9), new OreDictStack(ANY_COKE.gem()), new ComparableStack(ModItems.powder_flux)));
|
||||
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_DESH, INGOT.q(1)), 100, 200, new FluidStack(Fluids.LIGHTOIL, 100), new ComparableStack(ModItems.powder_desh_ready)));
|
||||
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_GUNMETAL, INGOT.q(4)), 200, 100, new OreDictStack(CU.ingot(), 3), new OreDictStack(AL.ingot(), 1)));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_WEAPONSTEEL, INGOT.q(1)), 200, 400, new FluidStack(Fluids.GAS_COKER, 100), new OreDictStack(STEEL.ingot(), 1), new ComparableStack(ModItems.powder_flux, 2)));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_SATURN, INGOT.q(2)), 200, 400, new FluidStack(Fluids.REFORMGAS, 250), new OreDictStack(DURA.dust(), 4), new OreDictStack(CU.dust())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_ALUMINIUM, INGOT.q(2)), 100, 400, new FluidStack(Fluids.SODIUM_ALUMINATE, 150)));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_ALUMINIUM, INGOT.q(3)), 40, 200, new FluidStack(Fluids.SODIUM_ALUMINATE, 150), new ComparableStack(ModItems.powder_flux, 2)));
|
||||
}
|
||||
|
||||
|
||||
public static HashMap getRecipes() {
|
||||
|
||||
HashMap<Object, Object> recipes = new HashMap<Object, Object>();
|
||||
|
||||
|
||||
for(RotaryFurnaceRecipe recipe : RotaryFurnaceRecipes.recipes) {
|
||||
|
||||
|
||||
int size = recipe.ingredients.length + (recipe.fluid != null ? 1 : 0);
|
||||
Object[] array = new Object[size];
|
||||
|
||||
|
||||
for(int i = 0; i < recipe.ingredients.length; i++) {
|
||||
array[i] = recipe.ingredients[i];
|
||||
}
|
||||
|
||||
|
||||
if(recipe.fluid != null) array[size - 1] = ItemFluidIcon.make(recipe.fluid);
|
||||
|
||||
|
||||
recipes.put(array, ItemScraps.create(recipe.output, true));
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
public static RotaryFurnaceRecipe getRecipe(ItemStack... inputs) {
|
||||
|
||||
|
||||
outer:
|
||||
for(RotaryFurnaceRecipe recipe : recipes) {
|
||||
|
||||
List<AStack> recipeList = new ArrayList();
|
||||
for(AStack ingredient : recipe.ingredients) recipeList.add(ingredient);
|
||||
|
||||
|
||||
for(int i = 0; i < inputs.length; i++) {
|
||||
|
||||
|
||||
ItemStack inputStack = inputs[i];
|
||||
|
||||
if(inputStack != null) {
|
||||
|
||||
|
||||
boolean hasMatch = false;
|
||||
Iterator<AStack> iterator = recipeList.iterator();
|
||||
|
||||
@ -102,10 +104,10 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(recipeList.isEmpty()) return recipe;
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -127,34 +129,34 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
|
||||
AStack[] inputs = this.readAStackArray(obj.get("inputs").getAsJsonArray());
|
||||
FluidStack fluid = obj.has("fluid") ? this.readFluidStack(obj.get("fluid").getAsJsonArray()) : null;
|
||||
|
||||
|
||||
JsonArray array = obj.get("output").getAsJsonArray();
|
||||
MaterialStack stack = new MaterialStack(Mats.matByName.get(array.get(0).getAsString()), array.get(1).getAsInt());
|
||||
|
||||
|
||||
int duration = obj.get("duration").getAsInt();
|
||||
int steam = obj.get("steam").getAsInt();
|
||||
|
||||
|
||||
recipes.add(new RotaryFurnaceRecipe(stack, duration, steam, fluid, inputs));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object obj, JsonWriter writer) throws IOException {
|
||||
RotaryFurnaceRecipe recipe = (RotaryFurnaceRecipe) obj;
|
||||
|
||||
|
||||
writer.name("inputs").beginArray();
|
||||
for(AStack aStack : recipe.ingredients) {
|
||||
this.writeAStack(aStack, writer);
|
||||
}
|
||||
writer.endArray();
|
||||
|
||||
|
||||
if(recipe.fluid != null) {
|
||||
writer.name("fluid");
|
||||
this.writeFluidStack(recipe.fluid, writer);
|
||||
}
|
||||
|
||||
|
||||
writer.name("output").beginArray();
|
||||
writer.setIndent("");
|
||||
writer.value(recipe.output.material.names[0]).value(recipe.output.amount);
|
||||
@ -164,15 +166,15 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
writer.name("duration").value(recipe.duration);
|
||||
writer.name("steam").value(recipe.steam);
|
||||
}
|
||||
|
||||
|
||||
public static class RotaryFurnaceRecipe {
|
||||
|
||||
|
||||
public AStack[] ingredients;
|
||||
public FluidStack fluid;
|
||||
public MaterialStack output;
|
||||
public int duration;
|
||||
public int steam;
|
||||
|
||||
|
||||
public RotaryFurnaceRecipe(MaterialStack output, int duration, int steam, FluidStack fluid, AStack... ingredients) {
|
||||
this.ingredients = ingredients;
|
||||
this.fluid = fluid;
|
||||
@ -180,7 +182,7 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
this.duration = duration;
|
||||
this.steam = steam;
|
||||
}
|
||||
|
||||
|
||||
public RotaryFurnaceRecipe(MaterialStack output, int duration, int steam, AStack... ingredients) {
|
||||
this(output, duration, steam, null, ingredients);
|
||||
}
|
||||
|
||||
@ -28,7 +28,7 @@ public class SILEXRecipes {
|
||||
private static HashMap<Object, SILEXRecipe> recipes = new HashMap();
|
||||
private static HashMap<ComparableStack, ComparableStack> itemTranslation = new HashMap();
|
||||
private static HashMap<String, String> dictTranslation = new HashMap();
|
||||
|
||||
|
||||
public static void register() {
|
||||
|
||||
itemTranslation.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.UF6.getID()), new ComparableStack(ModItems.ingot_uranium));
|
||||
@ -37,12 +37,12 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_u235), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_u238), 11)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ingot_pu_mix), new SILEXRecipe(900, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu239), 6)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu240), 3)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.ingot_am_mix), new SILEXRecipe(900, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_am241), 3)
|
||||
.addOut(new ItemStack(ModItems.nugget_am242), 6)
|
||||
@ -67,20 +67,20 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_australium_lesser), 5)
|
||||
.addOut(new ItemStack(ModItems.nugget_australium_greater), 1)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_schraranium), new SILEXRecipe(900, 100, 3)
|
||||
.addOut(new ItemStack(ModItems.nugget_schrabidium), 5)
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium), 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_neptunium), 2)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModBlocks.ore_tikite), new SILEXRecipe(900, 100, EnumWavelengths.UV)
|
||||
.addOut(new ItemStack(ModItems.powder_plutonium), 2)
|
||||
.addOut(new ItemStack(ModItems.powder_cobalt), 3)
|
||||
.addOut(new ItemStack(ModItems.powder_niobium), 3)
|
||||
.addOut(new ItemStack(ModItems.powder_nitan_mix), 2)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.crystal_trixite), new SILEXRecipe(1200, 100, EnumWavelengths.UV)
|
||||
.addOut(new ItemStack(ModItems.powder_plutonium), 2)
|
||||
.addOut(new ItemStack(ModItems.powder_cobalt), 3)
|
||||
@ -100,151 +100,161 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.powder_impure_osmiridium), 1)
|
||||
);
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.VITRIOL.getID()), new SILEXRecipe(1000, 1000, EnumWavelengths.IR)
|
||||
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.VITRIOL.getID()), new SILEXRecipe(1000, 300, EnumWavelengths.IR)
|
||||
.addOut(new ItemStack(ModItems.powder_bromine), 5)
|
||||
.addOut(new ItemStack(ModItems.powder_iodine), 5)
|
||||
.addOut(new ItemStack(ModItems.powder_iron), 5)
|
||||
.addOut(new ItemStack(ModItems.sulfur), 15)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.REDMUD.getID()), new SILEXRecipe(300, 50, EnumWavelengths.VISIBLE)
|
||||
.addOut(new ItemStack(ModItems.powder_aluminium), 10)
|
||||
.addOut(new ItemStack(ModItems.powder_neodymium_tiny, 3), 5)
|
||||
.addOut(new ItemStack(ModItems.powder_boron_tiny, 3), 5)
|
||||
.addOut(new ItemStack(ModItems.nugget_zirconium), 5)
|
||||
.addOut(new ItemStack(ModItems.powder_iron), 20)
|
||||
.addOut(new ItemStack(ModItems.powder_titanium), 15)
|
||||
.addOut(new ItemStack(ModItems.powder_sodium), 10)
|
||||
);
|
||||
|
||||
for(int i = 0; i < 5; i++) {
|
||||
|
||||
|
||||
// UEU //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i), new SILEXRecipe(600, 100, 1) //NU and MEU will breed more plutonium due to their higher concentrations of U-238
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium), 86 - i * 11) //NU is unenriched to the point where it'll always be lower burnup; so more Pu239 for longer
|
||||
.addOut(i < 2 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 10 + i * 3)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 2 + 5 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ueu, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium), 86 - i * 11)
|
||||
.addOut(i < 2 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 10 + i * 3)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 2 + 3 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 1 + 5 * i) );
|
||||
|
||||
|
||||
// MEU //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium_fuel), 84 - i * 16)
|
||||
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 4)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 7 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_meu, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium_fuel), 83 - i * 16)
|
||||
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 4)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 7 * i) );
|
||||
|
||||
|
||||
// HEU233 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_u233), 90 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), 4 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), 6 + 12 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu233, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_u233), 89 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM233.ordinal()), 4 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM233.ordinal()), 6 + 12 * i) );
|
||||
|
||||
|
||||
// HEU235 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_u235), 90 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 12 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heu235, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_u235), 89 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.URANIUM235.ordinal()), 4 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 6 + 12 * i) );
|
||||
|
||||
|
||||
// TH232 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_thorium_fuel), 84 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_u233), 6 + i * 4)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), 10 + 16 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_thmeu, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_thorium_fuel), 83 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_u233), 6 + i * 4)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.THORIUM.ordinal()), 10 + 16 * i) );
|
||||
|
||||
|
||||
// LEP //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_plutonium_fuel), 84 - i * 14)
|
||||
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 2)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 7 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 3 + 4 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_lep, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_plutonium_fuel), 83 - i * 14)
|
||||
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 2)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 7 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 3 + 4 * i) );
|
||||
|
||||
|
||||
// MEP //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu_mix), 85 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 10 + 10 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 5 + 5 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mep, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu_mix), 84 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 10 + 10 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 5 + 5 * i) );
|
||||
|
||||
|
||||
// HEP239 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu239), 85 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 15 + 20 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep239, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu239), 84 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 15 + 20 * i) );
|
||||
|
||||
|
||||
// HEP241 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 85 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), 15 + 20 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hep241, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 84 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), 15 + 20 * i) );
|
||||
|
||||
|
||||
// MEN //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_neptunium_fuel), 84 - i * 14)
|
||||
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 2)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 7 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_men, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_neptunium_fuel), 83 - i * 14)
|
||||
.addOut(i < 1 ? new ItemStack(ModItems.nugget_pu239) : new ItemStack(ModItems.nugget_pu_mix), 6 + i * 2)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 7 * i) );
|
||||
|
||||
|
||||
// HEN //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hen, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_neptunium), 90 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 12 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hen, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_neptunium), 89 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.NEPTUNIUM.ordinal()), 4 + 8 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 6 + 12 * i) );
|
||||
|
||||
|
||||
// MOX //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_mox_fuel), 84 - i * 20)
|
||||
@ -253,7 +263,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i) );
|
||||
|
||||
|
||||
//TODO: Readd xenon processing if/when the NEI handler can display more than 6 outputs properly
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mox, 1, i + 5), new SILEXRecipe(600, 100, 1) //Plutonium processing isn't possible w/o fucking up the NEI handler or removing xenon
|
||||
.addOut(new ItemStack(ModItems.nugget_mox_fuel), 84 - i * 20) //To prevent people from taking advantage of differing waste types, conform to the latter
|
||||
@ -262,33 +272,33 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.URANIUM235.ordinal()), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), 2 + 3 * i) );
|
||||
|
||||
|
||||
// LEAUS //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_australium_lesser), 90 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 6 + 12 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_pb209), 4 + 8 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_leaus, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_australium_lesser), 89 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 6 + 12 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_pb209), 4 + 8 * i) );
|
||||
|
||||
|
||||
// HEAUS //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_australium_greater), 90 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_au198), 5 + 10 * i)
|
||||
.addOut(new ItemStack(Items.gold_nugget), 3 + 6 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_pb209), 2 + 4 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_heaus, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_australium_greater), 89 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_au198), 5 + 10 * i)
|
||||
.addOut(new ItemStack(Items.gold_nugget), 3 + 6 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_pb209), 2 + 4 * i) );
|
||||
|
||||
|
||||
// LES //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_les, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_les), 90 - i * 20)
|
||||
@ -297,7 +307,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), 1 + 2 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.SCHRABIDIUM.ordinal()), 1 + 2 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 4 + 8 * i) );
|
||||
|
||||
|
||||
//TODO: Readd xenon processing if/when the NEI handler can display more than 6 outputs properly
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_les, 1, i + 5), new SILEXRecipe(600, 100, 2) //I'd rather not fuck up the NEI handler, so six items it is
|
||||
.addOut(new ItemStack(ModItems.nugget_les), 90 - i * 20) //Just bullshit something about "not enough np237 for extractable amounts of xe135"
|
||||
@ -305,8 +315,8 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.NEPTUNIUM.ordinal()), 2 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), 1 + 2 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.SCHRABIDIUM.ordinal()), 1 + 2 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 4 + 8 * i) );
|
||||
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 4 + 8 * i) );
|
||||
|
||||
// MES //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mes, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_schrabidium_fuel), 90 - i * 20)
|
||||
@ -315,7 +325,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), 1 + 3 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.SCHRABIDIUM.ordinal()), 2 + 4 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 4 + 6 * i) );
|
||||
|
||||
|
||||
//TODO: Readd xenon processing if/when the NEI handler can display more than 6 outputs properly
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_mes, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_schrabidium_fuel), 90 - i * 20) //ditto
|
||||
@ -324,7 +334,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), 1 + 3 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.SCHRABIDIUM.ordinal()), 2 + 4 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 4 + 6 * i) );
|
||||
|
||||
|
||||
// HES //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hes, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_hes), 90 - i * 20)
|
||||
@ -333,7 +343,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), 2 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.SCHRABIDIUM.ordinal()), 4 + 6 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 2 + 4 * i) );
|
||||
|
||||
|
||||
//TODO: Readd xenon processing if/when the NEI handler can display more than 6 outputs properly
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_hes, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_hes), 90 - i * 20) //ditto
|
||||
@ -342,17 +352,17 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_long_tiny, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), 2 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_short_tiny, 1, ItemWasteShort.WasteClass.SCHRABIDIUM.ordinal()), 4 + 6 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 2 + 4 * i) );
|
||||
|
||||
|
||||
// BALEFIRE //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire, 1, i), new SILEXRecipe(400, 100, 3)
|
||||
.addOut(new ItemStack(ModItems.powder_balefire), 90 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 10 + 20 * i) );
|
||||
|
||||
|
||||
// FLASHGOLD //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_balefire_gold, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_au198), 90 - 20 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_balefire), 10 + 20 * i) );
|
||||
|
||||
|
||||
// FLASHLEAD //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_flashlead, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_au198), 44 - 10 * i)
|
||||
@ -360,14 +370,14 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_bismuth), 1 + 6 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_mercury), 1 + 6 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_gh336), 10 + 8 * i) ); //Reimumunch
|
||||
|
||||
|
||||
// POBE //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_po210be, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_polonium), 45 - 10 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_beryllium), 45 - 10 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 5 + 10 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i) );
|
||||
|
||||
|
||||
// PUBE //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu238), 45 - 10 * i)
|
||||
@ -375,7 +385,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 2 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_pu238be, 1, i + 5), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu238), 44 - 10 * i)
|
||||
@ -383,7 +393,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 2 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i) );
|
||||
|
||||
|
||||
// RABE //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_ra226be, 1, i), new SILEXRecipe(600, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_ra226), 45 - 10 * i)
|
||||
@ -391,7 +401,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 3 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.nugget_polonium), 2 + 5 * i)
|
||||
.addOut(new ItemStack(ModItems.powder_coal_tiny), 5 + 10 * i) );
|
||||
|
||||
|
||||
// DRX //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i), new SILEXRecipe(600, 100, 4)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
@ -400,7 +410,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_drx, 1, i + 5), new SILEXRecipe(600, 100, 4)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
@ -408,41 +418,41 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1)
|
||||
.addOut(new ItemStack(ModItems.undefined), 1) );
|
||||
|
||||
|
||||
// ZFB BI //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_bismuth), 50 + i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_zirconium), 150) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_bismuth, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 3)
|
||||
.addOut(new ItemStack(ModItems.nugget_uranium), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_bismuth), 50 + i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_zirconium), 147) );
|
||||
|
||||
|
||||
// ZFB PU-241 //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_u235), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu240), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 50 + i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_zirconium), 150) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_pu241, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 3)
|
||||
.addOut(new ItemStack(ModItems.nugget_u235), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu240), 50 - i * 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 50 + i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_zirconium), 147) );
|
||||
|
||||
|
||||
// ZFB RG-AM //
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 100 - i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_am_mix), 50 + i * 20)
|
||||
.addOut(new ItemStack(ModItems.nugget_zirconium), 150) );
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.rbmk_pellet_zfb_am_mix, 1, i + 5), new SILEXRecipe(600, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.powder_xe135_tiny), 3)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 100 - i * 20)
|
||||
@ -503,7 +513,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_bismuth), 10)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 29)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM239.ordinal()), new SILEXRecipe(900, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu240), 10)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 25)
|
||||
@ -519,7 +529,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_u238), 3)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 39)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM240.ordinal()), new SILEXRecipe(900, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_pu241), 15)
|
||||
.addOut(new ItemStack(ModItems.nugget_neptunium), 5)
|
||||
@ -536,7 +546,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_u238), 3)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 36)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.nuclear_waste_short, 1, ItemWasteShort.WasteClass.PLUTONIUM241.ordinal()), new SILEXRecipe(900, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.nugget_am241), 25)
|
||||
.addOut(new ItemStack(ModItems.nugget_am242), 35)
|
||||
@ -591,7 +601,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.nugget_lead), 45)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 17)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.nuclear_waste_long, 1, ItemWasteLong.WasteClass.SCHRABIDIUM.ordinal()), new SILEXRecipe(900, 100, 1)
|
||||
.addOut(new ItemStack(ModItems.nugget_solinium), 25)
|
||||
.addOut(new ItemStack(ModItems.nugget_euphemium), 18)
|
||||
@ -623,7 +633,7 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.dust_tiny), 20)
|
||||
.addOut(new ItemStack(ModItems.nuclear_waste_tiny), 32)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.fallout, 1), new SILEXRecipe(900, 100, 2)
|
||||
.addOut(new ItemStack(ModItems.dust_tiny), 90)
|
||||
.addOut(new ItemStack(ModItems.nugget_co60), 2)
|
||||
@ -632,14 +642,14 @@ public class SILEXRecipes {
|
||||
.addOut(new ItemStack(ModItems.powder_cs137_tiny), 3)
|
||||
.addOut(new ItemStack(ModItems.nugget_au198), 1)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(Blocks.gravel, 1), new SILEXRecipe(1000, 250, EnumWavelengths.VISIBLE)
|
||||
.addOut(new ItemStack(Items.flint), 80)
|
||||
.addOut(new ItemStack(ModItems.powder_boron), 5)
|
||||
.addOut(new ItemStack(ModItems.powder_lithium), 10)
|
||||
.addOut(new ItemStack(ModItems.fluorite), 5)
|
||||
);
|
||||
|
||||
|
||||
recipes.put(new ComparableStack(ModItems.fluid_icon, 1, Fluids.FULLERENE.getID()),
|
||||
new SILEXRecipe(1_000, 1_000, EnumWavelengths.VISIBLE).addOut(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.FULLERENE), 1));
|
||||
}
|
||||
@ -652,19 +662,19 @@ public class SILEXRecipes {
|
||||
tinyWasteTranslation.put(ModItems.nuclear_waste_short_depleted_tiny, ModItems.nuclear_waste_short_depleted);
|
||||
tinyWasteTranslation.put(ModItems.nuclear_waste_long_depleted_tiny, ModItems.nuclear_waste_long_depleted);
|
||||
}
|
||||
|
||||
|
||||
public static SILEXRecipe getOutput(ItemStack stack) {
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return null;
|
||||
|
||||
|
||||
ComparableStack comp = translateItem(stack);
|
||||
|
||||
|
||||
if(recipes.containsKey(comp))
|
||||
return recipes.get(comp);
|
||||
|
||||
|
||||
String[] dictKeys = comp.getDictKeys();
|
||||
|
||||
|
||||
for(String key : dictKeys) {
|
||||
String translation = translateDict(key);
|
||||
if(recipes.containsKey(translation))
|
||||
@ -680,54 +690,54 @@ public class SILEXRecipes {
|
||||
SILEXRecipe tinyVersion = new SILEXRecipe(fluidProduced, result.fluidConsumed, result.laserStrength);
|
||||
// Shared ownership shouldn't be an issue since the resulting recipe isn't modified by the caller
|
||||
tinyVersion.outputs = result.outputs;
|
||||
|
||||
|
||||
// TODO: Cache? Might break saving recipes, IDK
|
||||
// recipes.put(comp, tinyVersion);
|
||||
|
||||
return tinyVersion;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static ComparableStack translateItem(ItemStack stack) {
|
||||
ComparableStack orig = new ComparableStack(stack.getItem(), 1, stack.getItemDamage());
|
||||
ComparableStack translation = itemTranslation.get(orig);
|
||||
|
||||
|
||||
if(translation != null)
|
||||
return translation;
|
||||
|
||||
|
||||
return orig;
|
||||
}
|
||||
|
||||
|
||||
public static String translateDict(String key) {
|
||||
|
||||
|
||||
String translation = dictTranslation.get(key);
|
||||
|
||||
|
||||
if(translation != null)
|
||||
return translation;
|
||||
|
||||
|
||||
return key;
|
||||
}
|
||||
|
||||
|
||||
public static List<Object> getAllIngredients() {
|
||||
List<Object> ing = new ArrayList();
|
||||
|
||||
|
||||
for(Entry<Object, SILEXRecipe> entry : SILEXRecipes.recipes.entrySet()) ing.add(entry.getKey());
|
||||
for(Entry<ComparableStack, ComparableStack> entry : SILEXRecipes.itemTranslation.entrySet()) ing.add(entry.getKey());
|
||||
for(Entry<String, String> entry : SILEXRecipes.dictTranslation.entrySet()) ing.add(entry.getKey());
|
||||
|
||||
|
||||
return ing;
|
||||
}
|
||||
|
||||
public static Map<Object, SILEXRecipe> getRecipes() {
|
||||
|
||||
|
||||
Map<Object, SILEXRecipe> recipes = new HashMap<Object, SILEXRecipe>();
|
||||
List<Object> ing = getAllIngredients();
|
||||
|
||||
|
||||
for(Object ingredient : ing) {
|
||||
|
||||
|
||||
if(ingredient instanceof String) {
|
||||
List<ItemStack> ingredients = OreDictionary.getOres((String)ingredient);
|
||||
if(ingredients.size() > 0) {
|
||||
@ -735,41 +745,41 @@ public class SILEXRecipes {
|
||||
if(output != null)
|
||||
recipes.put(ingredients, output);
|
||||
}
|
||||
|
||||
|
||||
} else if(ingredient instanceof ComparableStack) {
|
||||
SILEXRecipe output = getOutput(((ComparableStack) ingredient).toStack());
|
||||
if(output != null)
|
||||
recipes.put(((ComparableStack)ingredient).toStack(), output);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
public static class SILEXRecipe {
|
||||
|
||||
|
||||
public int fluidProduced;
|
||||
public int fluidConsumed;
|
||||
public EnumWavelengths laserStrength;
|
||||
public List<WeightedRandomObject> outputs = new ArrayList();
|
||||
|
||||
|
||||
public SILEXRecipe(int fluidProduced, int fluidConsumed, EnumWavelengths laserStrength) {
|
||||
this.fluidProduced = fluidProduced;
|
||||
this.fluidConsumed = fluidConsumed;
|
||||
this.laserStrength = laserStrength;
|
||||
}
|
||||
|
||||
|
||||
public SILEXRecipe(int fluidProduced, int fluidConsumed, int laserStrength) {
|
||||
this(fluidProduced, fluidConsumed, EnumWavelengths.values()[laserStrength]);
|
||||
}
|
||||
|
||||
|
||||
public SILEXRecipe addOut(ItemStack stack, int weight) {
|
||||
return addOut(new WeightedRandomObject(stack, weight));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public SILEXRecipe addOut(WeightedRandomObject entry) {
|
||||
outputs.add(entry);
|
||||
return this;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -33,24 +33,24 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
|
||||
public static HashMap<ComparableStack, ItemStack> shredderRecipes = new HashMap();
|
||||
public static HashMap<Object, Object> neiShredderRecipes;
|
||||
|
||||
|
||||
@Override
|
||||
public void registerPost() {
|
||||
|
||||
|
||||
String[] names = OreDictionary.getOreNames();
|
||||
|
||||
|
||||
for(int i = 0; i < names.length; i++) {
|
||||
|
||||
|
||||
String name = names[i];
|
||||
|
||||
|
||||
//if the dict contains invalid names, skip
|
||||
if(name == null || name.isEmpty())
|
||||
continue;
|
||||
|
||||
|
||||
if(name.contains("Any")) continue;
|
||||
|
||||
|
||||
List<ItemStack> matches = OreDictionary.getOres(name);
|
||||
|
||||
|
||||
//if the name isn't assigned to an ore, also skip
|
||||
if(matches == null || matches.isEmpty())
|
||||
continue;
|
||||
@ -63,23 +63,23 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
generateRecipes("crystal", name, matches, 1);
|
||||
//2 ingot units, any
|
||||
generateRecipes("ore", name, matches, 2);
|
||||
|
||||
|
||||
if(name.length() > 5 && name.substring(0, 5).equals("block")) {
|
||||
ItemStack dust = getDustByName(name.substring(5));
|
||||
|
||||
|
||||
if(dust != null && dust.getItem() != ModItems.scrap) {
|
||||
|
||||
|
||||
dust.stackSize = 9;
|
||||
|
||||
|
||||
if(getIngotOrGemByName(name.substring(5)) == null)
|
||||
dust.stackSize = 4;
|
||||
|
||||
|
||||
for(ItemStack stack : matches) {
|
||||
putIfValid(stack, dust, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(name.length() > 7 && name.substring(0, 8).equals("dustTiny")) {
|
||||
for(ItemStack stack : matches) {
|
||||
putIfValid(stack, new ItemStack(ModItems.dust_tiny), name);
|
||||
@ -91,40 +91,40 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Untested
|
||||
private static void generateRecipes(String prefix, String name, List<ItemStack> matches, int outCount) {
|
||||
|
||||
|
||||
int len = prefix.length();
|
||||
|
||||
|
||||
if(name.length() > len && name.substring(0, len).equals(prefix)) {
|
||||
|
||||
|
||||
String matName = name.substring(len);
|
||||
|
||||
|
||||
ItemStack dust = getDustByName(matName);
|
||||
|
||||
|
||||
if(dust != null && dust.getItem() != ModItems.scrap) {
|
||||
|
||||
|
||||
dust.stackSize = outCount;
|
||||
|
||||
|
||||
for(ItemStack stack : matches) {
|
||||
putIfValid(stack, dust, name);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
private static void putIfValid(ItemStack in, ItemStack dust, String name) {
|
||||
|
||||
if(in != null) {
|
||||
|
||||
|
||||
if(in.getItem() != null) {
|
||||
setRecipe(new ComparableStack(in), dust);
|
||||
} else {
|
||||
MainRegistry.logger.error("Ore dict entry '" + name + "' has a null item in its stack! How does that even happen?");
|
||||
Thread.currentThread().dumpStack();
|
||||
}
|
||||
|
||||
|
||||
} else {
|
||||
MainRegistry.logger.error("Ore dict entry '" + name + "' has a null stack!");
|
||||
Thread.currentThread().dumpStack();
|
||||
@ -209,15 +209,16 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
ShredderRecipes.setRecipe(DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.RARE), new ItemStack(ModItems.powder_desh_mix));
|
||||
ShredderRecipes.setRecipe(Blocks.sand, new ItemStack(ModItems.dust, 2));
|
||||
ShredderRecipes.setRecipe(ModBlocks.block_slag, new ItemStack(ModItems.powder_cement, 4));
|
||||
|
||||
ShredderRecipes.setRecipe(ModBlocks.ore_aluminium, DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.CRYOLITE, 2));
|
||||
|
||||
List<ItemStack> logs = OreDictionary.getOres("logWood");
|
||||
List<ItemStack> planks = OreDictionary.getOres("plankWood");
|
||||
List<ItemStack> saplings = OreDictionary.getOres("treeSapling");
|
||||
|
||||
|
||||
for(ItemStack log : logs) ShredderRecipes.setRecipe(log, new ItemStack(ModItems.powder_sawdust, 4));
|
||||
for(ItemStack plank : planks) ShredderRecipes.setRecipe(plank, new ItemStack(ModItems.powder_sawdust, 1));
|
||||
for(ItemStack sapling : saplings) ShredderRecipes.setRecipe(sapling, new ItemStack(Items.stick, 1));
|
||||
|
||||
|
||||
for(EnumBedrockOre ore : EnumBedrockOre.values()) {
|
||||
int i = ore.ordinal();
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModItems.ore_bedrock, 1, i), new ItemStack(ModItems.ore_enriched, 1, i));
|
||||
@ -230,7 +231,7 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModItems.ore_deepcleaned, 1, i), new ItemStack(ModItems.ore_enriched, 1, i));
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModItems.ore_seared, 1, i), new ItemStack(ModItems.ore_enriched, 1, i));
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < 5; i++) ShredderRecipes.setRecipe(new ItemStack(Items.skull, 1, i), new ItemStack(ModItems.biomass, 4));
|
||||
|
||||
/* Crystal processing */
|
||||
@ -295,7 +296,7 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModBlocks.sellafield, 1, 3), new ItemStack(ModItems.scrap_nuclear, 5));
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModBlocks.sellafield, 1, 4), new ItemStack(ModItems.scrap_nuclear, 7));
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModBlocks.sellafield, 1, 5), new ItemStack(ModItems.scrap_nuclear, 15));
|
||||
|
||||
|
||||
/* Fracking debris scrapping */
|
||||
ShredderRecipes.setRecipe(ModBlocks.dirt_dead, new ItemStack(ModItems.scrap_oil, 1));
|
||||
ShredderRecipes.setRecipe(ModBlocks.dirt_oily, new ItemStack(ModItems.scrap_oil, 1));
|
||||
@ -335,13 +336,13 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
ShredderRecipes.setRecipe(new ItemStack(Blocks.stained_hardened_clay, 1, i), new ItemStack(Items.clay_ball, 4));
|
||||
ShredderRecipes.setRecipe(new ItemStack(Blocks.wool, 1, i), new ItemStack(Items.string, 4));
|
||||
}
|
||||
|
||||
|
||||
/* Shredding bobbleheads */
|
||||
for(int i = 0; i < BobbleType.values().length; i++) {
|
||||
BobbleType type = BobbleType.values()[i];
|
||||
ShredderRecipes.setRecipe(new ItemStack(ModBlocks.bobblehead, 1, i), new ItemStack(ModItems.scrap_plastic, 1, type.scrap.ordinal()));
|
||||
}
|
||||
|
||||
|
||||
/* Debris shredding */
|
||||
ShredderRecipes.setRecipe(ModItems.debris_concrete, new ItemStack(ModItems.scrap_nuclear, 2));
|
||||
ShredderRecipes.setRecipe(ModItems.debris_shrapnel, new ItemStack(ModItems.powder_steel_tiny, 5));
|
||||
@ -349,96 +350,96 @@ public class ShredderRecipes extends SerializableRecipe {
|
||||
ShredderRecipes.setRecipe(ModItems.debris_element, new ItemStack(ModItems.scrap_nuclear, 4));
|
||||
ShredderRecipes.setRecipe(ModItems.debris_metal, new ItemStack(ModItems.powder_steel_tiny, 3));
|
||||
ShredderRecipes.setRecipe(ModItems.debris_graphite, new ItemStack(ModItems.powder_coal, 1));
|
||||
|
||||
|
||||
/* GC COMPAT */
|
||||
Block gcMoonBlock = Compat.tryLoadBlock(Compat.MOD_GCC, "moonBlock");
|
||||
if(gcMoonBlock != null && gcMoonBlock != Blocks.air) {
|
||||
ShredderRecipes.setRecipe(new ItemStack(gcMoonBlock, 1, 3), new ItemStack(ModBlocks.moon_turf)); //Moon dirt
|
||||
ShredderRecipes.setRecipe(new ItemStack(gcMoonBlock, 1, 5), new ItemStack(ModBlocks.moon_turf)); //Moon topsoil
|
||||
}
|
||||
|
||||
|
||||
/* AR COMPAT */
|
||||
Block arMoonTurf = Compat.tryLoadBlock(Compat.MOD_AR, "turf");
|
||||
if(arMoonTurf != null && gcMoonBlock != Blocks.air) ShredderRecipes.setRecipe(arMoonTurf, new ItemStack(ModBlocks.moon_turf)); //i assume it's moon turf
|
||||
Block arMoonTurfDark = Compat.tryLoadBlock(Compat.MOD_AR, "turfDark");
|
||||
if(arMoonTurfDark != null && gcMoonBlock != Blocks.air) ShredderRecipes.setRecipe(arMoonTurfDark, new ItemStack(ModBlocks.moon_turf)); //probably moon dirt? would have helped if i had ever played AR for more than 5 seconds
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns scrap when no dust is found, for quickly adding recipes
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack getDustByName(String name) {
|
||||
|
||||
|
||||
List<ItemStack> matches = OreDictionary.getOres("dust" + name);
|
||||
|
||||
|
||||
if(matches != null && !matches.isEmpty())
|
||||
return matches.get(0).copy();
|
||||
|
||||
|
||||
return new ItemStack(ModItems.scrap);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns null when no ingot or gem is found, for deciding whether the block shredding output should be 9 or 4 dusts
|
||||
* @param name
|
||||
* @return
|
||||
*/
|
||||
public static ItemStack getIngotOrGemByName(String name) {
|
||||
|
||||
|
||||
List<ItemStack> matches = OreDictionary.getOres("ingot" + name);
|
||||
|
||||
|
||||
if(matches != null && !matches.isEmpty())
|
||||
return matches.get(0).copy();
|
||||
|
||||
|
||||
matches = OreDictionary.getOres("gem" + name);
|
||||
|
||||
|
||||
if(matches != null && !matches.isEmpty())
|
||||
return matches.get(0).copy();
|
||||
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static void setRecipe(Item in, ItemStack out) {
|
||||
setRecipe(new ComparableStack(in), out);
|
||||
}
|
||||
|
||||
|
||||
public static void setRecipe(Block in, ItemStack out) {
|
||||
setRecipe(new ComparableStack(in), out);
|
||||
}
|
||||
|
||||
|
||||
public static void setRecipe(ItemStack in, ItemStack out) {
|
||||
setRecipe(new ComparableStack(in), out);
|
||||
}
|
||||
|
||||
|
||||
public static void setRecipe(ComparableStack in, ItemStack out) {
|
||||
if(!shredderRecipes.containsKey(in)) {
|
||||
shredderRecipes.put(in, out);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static Map<Object, Object> getShredderRecipes() {
|
||||
|
||||
|
||||
//convert the map only once to save on processing power (might be more ram intensive but that can't be THAT bad, right?)
|
||||
if(neiShredderRecipes == null)
|
||||
neiShredderRecipes = new HashMap(shredderRecipes);
|
||||
|
||||
|
||||
return neiShredderRecipes;
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack getShredderResult(ItemStack stack) {
|
||||
|
||||
|
||||
if(stack == null || stack.getItem() == null)
|
||||
return new ItemStack(ModItems.scrap);
|
||||
|
||||
|
||||
ComparableStack comp = new ComparableStack(stack).makeSingular();
|
||||
ItemStack sta = shredderRecipes.get(comp);
|
||||
|
||||
|
||||
if(sta == null) {
|
||||
comp.meta = OreDictionary.WILDCARD_VALUE;
|
||||
sta = shredderRecipes.get(comp);
|
||||
}
|
||||
|
||||
|
||||
return sta == null ? new ItemStack(ModItems.scrap) : sta;
|
||||
}
|
||||
|
||||
|
||||
@ -110,6 +110,7 @@ public class SolderingRecipes extends SerializableRecipe {
|
||||
|
||||
// a very, very vague guess on what the recipes should be. testing still needed, upgrade requirements are likely to change. maybe inclusion of caesium?
|
||||
recipes.add(new SolderingRecipe(new ItemStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER.ordinal()), 400, 15_000,
|
||||
new FluidStack(Fluids.PERFLUOROMETHYL, 1_000),
|
||||
new AStack[] {
|
||||
new ComparableStack(ModItems.circuit, lbsm ? 8 : 32, EnumCircuitType.CHIP),
|
||||
new ComparableStack(ModItems.circuit, lbsm ? 8 : 32, EnumCircuitType.CAPACITOR),
|
||||
@ -121,6 +122,7 @@ public class SolderingRecipes extends SerializableRecipe {
|
||||
new OreDictStack(PB.wireFine(), 16)}
|
||||
));
|
||||
recipes.add(new SolderingRecipe(new ItemStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER_ADVANCED.ordinal()), 600, 25_000,
|
||||
new FluidStack(Fluids.PERFLUOROMETHYL, 4_000),
|
||||
new AStack[] {
|
||||
new ComparableStack(ModItems.circuit, lbsm ? 8 : 16, EnumCircuitType.CHIP_BISMOID),
|
||||
new ComparableStack(ModItems.circuit, lbsm ? 16 : 48, EnumCircuitType.CAPACITOR_TANTALIUM),
|
||||
@ -132,6 +134,7 @@ public class SolderingRecipes extends SerializableRecipe {
|
||||
new OreDictStack(PB.wireFine(), 24)}
|
||||
));
|
||||
recipes.add(new SolderingRecipe(new ItemStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER_QUANTUM.ordinal()), 600, 250_000,
|
||||
new FluidStack(Fluids.PERFLUOROMETHYL_COLD, 6_000),
|
||||
new AStack[] {
|
||||
new ComparableStack(ModItems.circuit, lbsm ? 8 : 16, EnumCircuitType.CHIP_QUANTUM),
|
||||
new ComparableStack(ModItems.circuit, lbsm ? 16 : 48, EnumCircuitType.CHIP_BISMOID),
|
||||
|
||||
@ -55,12 +55,12 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
//in the event that these compounds are STILL too useless, add unsat + gas -> kerosene recipe for all those missile junkies
|
||||
//aromatics can be idfk wax or soap or sth, perhaps artificial lubricant?
|
||||
//on that note, add more leaded variants
|
||||
|
||||
|
||||
private static HashMap<FluidType, Pair<Integer, ItemStack>> recipes = new HashMap();
|
||||
|
||||
@Override
|
||||
public void registerDefaults() {
|
||||
|
||||
|
||||
registerRecipe(WATER, 1000, Blocks.ice);
|
||||
registerRecipe(LAVA, 1000, Blocks.obsidian);
|
||||
registerRecipe(MERCURY, 125, ModItems.ingot_mercury);
|
||||
@ -68,7 +68,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerRecipe(SALIENT, 1280, new ItemStack(ModItems.bio_wafer, 8)); //4 (food val) * 2 (sat mod) * 2 (constant) * 10 (quanta) * 8 (batch size)
|
||||
registerRecipe(ENDERJUICE, 100, Items.ender_pearl);
|
||||
registerRecipe(WATZ, 1000, ModItems.ingot_mud);
|
||||
registerRecipe(REDMUD, 1000, Items.iron_ingot);
|
||||
registerRecipe(REDMUD, 450, Items.iron_ingot);
|
||||
registerRecipe(SODIUM, 100, ModItems.powder_sodium);
|
||||
registerRecipe(LEAD, 100, ModItems.ingot_lead);
|
||||
registerRecipe(SLOP, 250, ModBlocks.ore_oil_sand);
|
||||
@ -84,7 +84,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerRecipe(LUBRICANT, SF_LUBE, DictFrame.fromOne(ModItems.oil_tar, EnumTarType.PARAFFIN));
|
||||
|
||||
registerRecipe(BALEFIRE, 250, ModItems.solid_fuel_bf);
|
||||
|
||||
|
||||
registerSFAuto(SMEAR);
|
||||
registerSFAuto(HEATINGOIL);
|
||||
registerSFAuto(HEATINGOIL_VACUUM);
|
||||
@ -114,7 +114,7 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
registerSFAuto(REFORMATE);
|
||||
registerSFAuto(XYLENE);
|
||||
registerSFAuto(BALEFIRE, 24_000_000L, ModItems.solid_fuel_bf); //holy shit this is energy dense*/
|
||||
|
||||
|
||||
}
|
||||
|
||||
private static void registerSFAuto(FluidType fluid) {
|
||||
@ -123,13 +123,13 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
private static void registerSFAuto(FluidType fluid, long tuPerSF, Item fuel) {
|
||||
long tuPerBucket = fluid.getTrait(FT_Flammable.class).getHeatEnergy();
|
||||
double penalty = 1.25D;
|
||||
|
||||
|
||||
int mB = (int) (tuPerSF * 1000L * penalty / tuPerBucket);
|
||||
|
||||
if(mB > 10_000) mB -= (mB % 1000);
|
||||
else if(mB > 1_000) mB -= (mB % 100);
|
||||
else if(mB > 100) mB -= (mB % 10);
|
||||
|
||||
|
||||
mB = Math.max(mB, 1);
|
||||
|
||||
registerRecipe(fluid, mB, fuel);
|
||||
@ -140,24 +140,24 @@ public class SolidificationRecipes extends SerializableRecipe {
|
||||
private static void registerRecipe(FluidType type, int quantity, ItemStack output) {
|
||||
recipes.put(type, new Pair<Integer, ItemStack>(quantity, output));
|
||||
}
|
||||
|
||||
|
||||
public static Pair<Integer, ItemStack> getOutput(FluidType type) {
|
||||
return recipes.get(type);
|
||||
}
|
||||
|
||||
public static HashMap<ItemStack, ItemStack> getRecipes() {
|
||||
|
||||
|
||||
HashMap<ItemStack, ItemStack> recipes = new HashMap<ItemStack, ItemStack>();
|
||||
|
||||
|
||||
for(Entry<FluidType, Pair<Integer, ItemStack>> entry : SolidificationRecipes.recipes.entrySet()) {
|
||||
|
||||
|
||||
FluidType type = entry.getKey();
|
||||
int amount = entry.getValue().getKey();
|
||||
ItemStack out = entry.getValue().getValue().copy();
|
||||
|
||||
|
||||
recipes.put(ItemFluidIcon.make(type, amount), out);
|
||||
}
|
||||
|
||||
|
||||
return recipes;
|
||||
}
|
||||
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
package com.hbm.inventory.recipes.anvil;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.inventory.OreDictManager;
|
||||
@ -18,10 +22,12 @@ import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
import com.hbm.inventory.recipes.AssemblerRecipes;
|
||||
import com.hbm.inventory.recipes.AssemblerRecipes.AssemblerRecipe;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ItemEnums.EnumChunkType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.food.ItemFlask.EnumInfusion;
|
||||
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
@ -30,15 +36,19 @@ import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
|
||||
public class AnvilRecipes {
|
||||
public class AnvilRecipes extends SerializableRecipe {
|
||||
|
||||
private static List<AnvilSmithingRecipe> smithingRecipes = new ArrayList();
|
||||
private static List<AnvilConstructionRecipe> constructionRecipes = new ArrayList();
|
||||
|
||||
public static void register() {
|
||||
registerSmithing();
|
||||
registerConstruction();
|
||||
}
|
||||
|
||||
@Override public String getFileName() { return "hbmAnvil.json"; }
|
||||
@Override public Object getRecipeObject() { return constructionRecipes; }
|
||||
@Override public void deleteRecipes() { constructionRecipes.clear(); }
|
||||
@Override public void registerDefaults() { registerConstruction(); }
|
||||
|
||||
/*
|
||||
* ////// // // // ////// // // // // // //////
|
||||
@ -587,7 +597,6 @@ public class AnvilRecipes {
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(new AStack[]{new ComparableStack(ModItems.mold_base), new OreDictStack(STEEL.ingot(), 4)}, new AnvilOutput(new ItemStack(ModItems.mold, 1, 28))).setTier(2));
|
||||
|
||||
pullFromAssembler(new ComparableStack(ModItems.pellet_buckshot), 1);
|
||||
pullFromAssembler(new ComparableStack(ModItems.pellet_canister), 1);
|
||||
}
|
||||
|
||||
public static void registerConstructionUpgrades() {
|
||||
@ -1064,6 +1073,12 @@ public class AnvilRecipes {
|
||||
this.setOverlay(OverlayType.NONE); //no preferred overlay for many:many conversions
|
||||
}
|
||||
|
||||
public AnvilConstructionRecipe(AStack[] input, Pair<ItemStack, Float>[] output) {
|
||||
for(AStack stack : input) this.input.add(stack);
|
||||
for(Pair<ItemStack, Float> out : output) this.output.add(new AnvilOutput(out.getKey(), out.getValue()));
|
||||
this.setOverlay(OverlayType.NONE); //no preferred overlay for many:many conversions
|
||||
}
|
||||
|
||||
public AnvilConstructionRecipe setTier(int tier) {
|
||||
this.tierLower = tier;
|
||||
if(GeneralConfig.enableLBSM && GeneralConfig.enableLBSMUnlockAnvil) this.tierLower = 1;
|
||||
@ -1130,4 +1145,42 @@ public class AnvilRecipes {
|
||||
RECYCLING,
|
||||
SMITHING;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
|
||||
AStack[] inputs = this.readAStackArray(obj.get("inputs").getAsJsonArray());
|
||||
Pair<ItemStack, Float>[] outputs = this.readItemStackArrayChance(obj.get("outputs").getAsJsonArray());
|
||||
|
||||
int tierLower = obj.get("tierLower").getAsInt();
|
||||
int tierUpper = obj.has("tierUpper") ? obj.get("tierUpper").getAsInt() : -1;
|
||||
|
||||
OverlayType overlay = OverlayType.NONE;
|
||||
if(obj.has("overlay")) {
|
||||
String overlayName = obj.get("overlay").getAsString();
|
||||
overlay = OverlayType.valueOf(overlayName);
|
||||
if(overlay == null) overlay = OverlayType.NONE;
|
||||
}
|
||||
|
||||
this.constructionRecipes.add(new AnvilConstructionRecipe(inputs, outputs).setTierRange(tierLower, tierUpper).setOverlay(overlay));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
AnvilConstructionRecipe rec = (AnvilConstructionRecipe) recipe;
|
||||
|
||||
writer.name("inputs").beginArray();
|
||||
for(AStack stack : rec.input) this.writeAStack(stack, writer);
|
||||
writer.endArray();
|
||||
|
||||
writer.name("outputs").beginArray();
|
||||
for(AnvilOutput stack : rec.output) this.writeItemStackChance(new Pair(stack.stack, stack.chance), writer);
|
||||
writer.endArray();
|
||||
|
||||
writer.name("tierLower").value(rec.tierLower);
|
||||
writer.name("tierUpper").value(rec.tierUpper);
|
||||
|
||||
writer.name("overlay").value(rec.overlay.name());
|
||||
}
|
||||
}
|
||||
|
||||
@ -24,6 +24,7 @@ import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.material.MatDistribution;
|
||||
import com.hbm.inventory.recipes.*;
|
||||
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
@ -73,8 +74,11 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new ArcWelderRecipes());
|
||||
recipeHandlers.add(new RotaryFurnaceRecipes());
|
||||
recipeHandlers.add(new ExposureChamberRecipes());
|
||||
recipeHandlers.add(new ParticleAcceleratorRecipes());
|
||||
recipeHandlers.add(new AmmoPressRecipes());
|
||||
recipeHandlers.add(new AssemblerRecipes());
|
||||
//AFTER Assembler
|
||||
recipeHandlers.add(new AnvilRecipes());
|
||||
recipeHandlers.add(new PedestalRecipes());
|
||||
|
||||
recipeHandlers.add(new MatDistribution());
|
||||
|
||||
@ -81,13 +81,11 @@ public class ItemPoolsSingle {
|
||||
weighted(ModItems.powder_power, 0, 1, 5, 1),
|
||||
weighted(ModItems.sat_chip, 0, 1, 1, 1),
|
||||
weighted(Items.diamond, 0, 5, 9, 1),
|
||||
weighted(ModItems.warhead_nuclear, 0, 1, 1, 1),
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_STANDARD.ordinal(), 1, 3, 1),
|
||||
weighted(ModItems.ammo_container, 0, 1, 4, 1),
|
||||
weighted(ModItems.grenade_nuclear, 0, 1, 2, 1),
|
||||
weighted(ModItems.grenade_mirv, 0, 1, 1, 1),
|
||||
weighted(ModItems.powder_yellowcake, 0, 26, 42, 1),
|
||||
weighted(ModItems.ingot_u235, 0, 3, 6, 1),
|
||||
weighted(ModItems.gun_heavy_revolver, 0, 1, 1, 1),
|
||||
weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 18, 32, 1),
|
||||
weighted(ModItems.circuit, EnumCircuitType.BASIC.ordinal(), 6, 12, 1)
|
||||
@ -99,16 +97,10 @@ public class ItemPoolsSingle {
|
||||
weighted(ModItems.ammo_container, 0, 3, 6, 1),
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO.ordinal(), 2, 3, 1),
|
||||
weighted(ModItems.gun_carbine, 0, 1, 1, 1),
|
||||
weighted(ModItems.ammo_standard, EnumAmmo.R762_DU.ordinal(), 16, 32, 1),
|
||||
weighted(ModItems.gun_congolake, 0, 1, 1, 1),
|
||||
weighted(ModItems.gun_b92, 0, 1, 1, 1),
|
||||
weighted(ModItems.ingot_combine_steel, 0, 16, 28, 1),
|
||||
weighted(ModItems.man_core, 0, 1, 1, 1),
|
||||
weighted(ModItems.boy_kit, 0, 1, 1, 1),
|
||||
weighted(ModItems.nuke_starter_kit, 0, 1, 1, 1),
|
||||
weighted(ModItems.weaponized_starblaster_cell, 0, 1, 1, 1),
|
||||
weighted(ModItems.warhead_mirv, 0, 1, 1, 1),
|
||||
weighted(ModItems.battery_schrabidium_cell, 0, 1, 1, 1),
|
||||
weighted(ModItems.powder_nitan_mix, 0, 16, 32, 1)
|
||||
weighted(ModItems.circuit, EnumCircuitType.ADVANCED.ordinal(), 6, 12, 1)
|
||||
};
|
||||
}};
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
package com.hbm.items;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
@ -14,6 +15,7 @@ import net.minecraft.item.EnumRarity;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemCustomLore extends Item {
|
||||
|
||||
@ -104,4 +106,121 @@ public class ItemCustomLore extends Item {
|
||||
setTextureName(RefStrings.MODID + ':' + uloc);
|
||||
return super.setUnlocalizedName(uloc);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
if(stack.getItem() != ModItems.undefined || stack.getItemDamage() != 99) return ("" + StatCollector.translateToLocal(this.getUnlocalizedNameInefficiently(stack) + ".name")).trim();
|
||||
|
||||
return name.getResult();
|
||||
}
|
||||
|
||||
public static String[] names = new String[] {
|
||||
"THE DEFAULT", "NEXT ONE", "ANOTHER ONE", "NON-STANDARD NAME", "AMBIGUOUS TITLE", "SHORT"
|
||||
};
|
||||
|
||||
public static Random rand = new Random();
|
||||
public static int currentIndex = 0;
|
||||
public static ScramblingName name = new ScramblingName(names[0]);
|
||||
|
||||
public static void updateSystem() {
|
||||
name.updateTick(names);
|
||||
}
|
||||
|
||||
/**
|
||||
* A surprise tool we need for later
|
||||
* @author hbm
|
||||
*/
|
||||
public static class ScramblingName {
|
||||
|
||||
public String previous;
|
||||
public String next;
|
||||
public String[] previousFrags;
|
||||
public String[] nextFrags;
|
||||
public String[] frags;
|
||||
public int[] mask;
|
||||
public int age = 0;
|
||||
|
||||
public ScramblingName(String init) {
|
||||
previous = next = init;
|
||||
frags = init.split("");
|
||||
mask = new int[frags.length];
|
||||
previousFrags = chop(previous, frags.length);
|
||||
nextFrags = chop(next, frags.length);
|
||||
}
|
||||
|
||||
public String getResult() {
|
||||
return String.join("", frags);
|
||||
}
|
||||
|
||||
public void updateTick(String[] nextNames) {
|
||||
age++;
|
||||
try {
|
||||
//pick new name
|
||||
if(age % 200 == 0) nextName(nextNames);
|
||||
//run substitution
|
||||
if(age % 5 == 0) scramble();
|
||||
} catch(Exception ex) { }
|
||||
}
|
||||
|
||||
public void nextName(String[] nextNames) {
|
||||
if(nextNames.length < 2) return;
|
||||
|
||||
this.previous = this.next;
|
||||
|
||||
String initial = next;
|
||||
//keep choosing new names until it's different
|
||||
while(initial.equals(next)) {
|
||||
next = nextNames[rand.nextInt(nextNames.length)];
|
||||
}
|
||||
|
||||
//frag setup
|
||||
int length = Math.min(previous.length(), next.length());
|
||||
this.previousFrags = chop(previous, length);
|
||||
this.frags = chop(previous, length);
|
||||
this.nextFrags = chop(next, length);
|
||||
mask = new int[length];
|
||||
}
|
||||
|
||||
public void scramble() {
|
||||
|
||||
//all fragments that haven't been substituted
|
||||
List<Integer> indices = new ArrayList();
|
||||
|
||||
for(int i = 0; i < mask.length; i++) {
|
||||
int m = mask[i];
|
||||
//mask 0 means not yet processed
|
||||
if(m == 0) indices.add(i);
|
||||
//mask 1-5 means obfuscated
|
||||
if(m > 0 && m <= 5) mask[i]++;
|
||||
//mask >5 means replaced
|
||||
if(m > 5) frags[i] = nextFrags[i];
|
||||
}
|
||||
|
||||
//if there's at least one index listed, start processing
|
||||
if(!indices.isEmpty()) {
|
||||
int toSwitch = indices.get(rand.nextInt(indices.size()));
|
||||
mask[toSwitch] = 1;
|
||||
frags[toSwitch] = EnumChatFormatting.OBFUSCATED + previousFrags[toSwitch] + EnumChatFormatting.RESET;
|
||||
}
|
||||
}
|
||||
|
||||
public String[] chop(String name, int parts) {
|
||||
if(parts == name.length()) return name.split("");
|
||||
|
||||
double index = 0;
|
||||
double incrementPerStep = (double) name.length() / (double) parts;
|
||||
List<String> slices = new ArrayList();
|
||||
|
||||
for(int i = 0; i < parts; i++) {
|
||||
int end = (i == parts - 1) ? name.length() : (int) (index + incrementPerStep);
|
||||
slices.add(name.substring((int) index, end));
|
||||
index += incrementPerStep;
|
||||
}
|
||||
|
||||
String[] chop = slices.toArray(new String[parts]);
|
||||
//System.out.println("Chopped " + name + " into " + parts + " pieces: " + chop);
|
||||
|
||||
return chop;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -51,7 +51,9 @@ public class ItemEnums {
|
||||
}
|
||||
|
||||
public static enum EnumChunkType {
|
||||
RARE
|
||||
RARE,
|
||||
MALACHITE,
|
||||
CRYOLITE
|
||||
}
|
||||
|
||||
public static enum EnumAchievementType {
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -27,6 +27,6 @@ public class ItemModCladding extends ItemArmorMod {
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
list.add(EnumChatFormatting.YELLOW + " " + stack.getDisplayName() + " (+" + rad + " radiation resistence)");
|
||||
list.add(EnumChatFormatting.YELLOW + " " + stack.getDisplayName() + " (+" + rad + " radiation resistance)");
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.inventory.FluidStack;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -40,7 +41,10 @@ public class ItemFluidIcon extends Item {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
if(stack.hasTagCompound()) {
|
||||
if(getQuantity(stack) > 0) list.add(getQuantity(stack) + "mB");
|
||||
if(getPressure(stack) > 0) list.add(EnumChatFormatting.RED + "" + getPressure(stack) + "PU");
|
||||
if(getPressure(stack) > 0) {
|
||||
list.add(EnumChatFormatting.RED + "" + getPressure(stack) + "PU");
|
||||
list.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_RED) + "Pressurized, use compressor!");
|
||||
}
|
||||
}
|
||||
|
||||
Fluids.fromID(stack.getItemDamage()).addInfo(list);
|
||||
|
||||
51
src/main/java/com/hbm/items/machine/ItemPACoil.java
Normal file
51
src/main/java/com/hbm/items/machine/ItemPACoil.java
Normal file
@ -0,0 +1,51 @@
|
||||
package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.items.ItemEnumMulti;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemPACoil extends ItemEnumMulti {
|
||||
|
||||
public ItemPACoil() {
|
||||
super(EnumCoilType.class, true, true);
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
public static enum EnumCoilType {
|
||||
GOLD(0, 2_200, 0, 2_200, 15),
|
||||
NIOBIUM(1_500, 8_400, 1_500, 8_400, 21),
|
||||
BSCCO(7_500, 15_000, 7_500, 15_000, 27),
|
||||
CHLOROPHYTE(14_500, 75_000, 14_500, 75_000, 51);
|
||||
|
||||
public int quadMin;
|
||||
public int quadMax;
|
||||
public int diMin;
|
||||
public int diMax;
|
||||
public int diDistMin;
|
||||
|
||||
private EnumCoilType(int quadMin, int quadMax, int diMin, int diMax, int diDistMin) {
|
||||
this.quadMin = quadMin;
|
||||
this.quadMax = quadMax;
|
||||
this.diMin = diMin;
|
||||
this.diMax = diMax;
|
||||
this.diDistMin = diDistMin;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
EnumCoilType type = EnumUtil.grabEnumSafely(theEnum, stack.getItemDamage());
|
||||
list.add(EnumChatFormatting.BLUE + "Quadrupole operational range: " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", type.quadMin) + " - " + String.format(Locale.US, "%,d", type.quadMax));
|
||||
list.add(EnumChatFormatting.BLUE + "Dipole operational range: " + EnumChatFormatting.RESET + String.format(Locale.US, "%,d", type.diMin) + " - " + String.format(Locale.US, "%,d", type.diMax));
|
||||
list.add(EnumChatFormatting.BLUE + "Dipole minimum side length: " + EnumChatFormatting.RESET + type.diDistMin);
|
||||
list.add(EnumChatFormatting.RED + "Minimums not met result in a power draw penalty!");
|
||||
list.add(EnumChatFormatting.RED + "Maximums exceeded result in the particle crashing!");
|
||||
list.add(EnumChatFormatting.RED + "Particles will crash in dipoles if both penalties take effect!");
|
||||
}
|
||||
}
|
||||
@ -134,26 +134,32 @@ public class ItemRBMKRod extends Item {
|
||||
|
||||
inFlux += selfRate;
|
||||
|
||||
double xenon = getPoison(stack);
|
||||
xenon -= xenonBurnFunc(inFlux);
|
||||
|
||||
inFlux *= (1D - getPoisonLevel(stack));
|
||||
|
||||
xenon += xenonGenFunc(inFlux);
|
||||
|
||||
if(xenon < 0D) xenon = 0D;
|
||||
if(xenon > 100D) xenon = 100D;
|
||||
|
||||
setPoison(stack, xenon);
|
||||
//if xenon poison is enabled
|
||||
if(RBMKDials.getXenon(world)) {
|
||||
double xenon = getPoison(stack);
|
||||
xenon -= xenonBurnFunc(inFlux);
|
||||
|
||||
inFlux *= (1D - getPoisonLevel(stack));
|
||||
|
||||
xenon += xenonGenFunc(inFlux);
|
||||
|
||||
if(xenon < 0D) xenon = 0D;
|
||||
if(xenon > 100D) xenon = 100D;
|
||||
|
||||
setPoison(stack, xenon);
|
||||
}
|
||||
|
||||
double outFlux = reactivityFunc(inFlux, getEnrichment(stack)) * RBMKDials.getReactivityMod(world);
|
||||
|
||||
double y = getYield(stack);
|
||||
y -= inFlux;
|
||||
|
||||
if(y < 0D) y = 0D;
|
||||
|
||||
setYield(stack, y);
|
||||
|
||||
//if depletion is enabled
|
||||
if(RBMKDials.getDepletion(world)) {
|
||||
double y = getYield(stack);
|
||||
y -= inFlux;
|
||||
|
||||
if(y < 0D) y = 0D;
|
||||
|
||||
setYield(stack, y);
|
||||
}
|
||||
|
||||
double coreHeat = this.getCoreHeat(stack);
|
||||
coreHeat += outFlux * heat;
|
||||
|
||||
@ -34,7 +34,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
|
||||
public IIcon[] icons = new IIcon[BedrockOreType.values().length * BedrockOreGrade.values().length];
|
||||
public IIcon[] overlays = new IIcon[ProcessingTrait.values().length];
|
||||
|
||||
|
||||
public ItemBedrockOreNew() {
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
@ -44,10 +44,10 @@ public class ItemBedrockOreNew extends Item {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerIcons(IIconRegister reg) {
|
||||
|
||||
|
||||
|
||||
if(reg instanceof TextureMap) {
|
||||
TextureMap map = (TextureMap) reg;
|
||||
|
||||
|
||||
for(int i = 0; i < BedrockOreGrade.values().length; i++) { BedrockOreGrade grade = BedrockOreGrade.values()[i];
|
||||
for(int j = 0; j < BedrockOreType.values().length; j++) { BedrockOreType type = BedrockOreType.values()[j];
|
||||
String placeholderName = RefStrings.MODID + ":bedrock_ore_" + grade.prefix + "_" + type.suffix + "-" + (i * BedrockOreType.values().length + j);
|
||||
@ -57,7 +57,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
for(int i = 0; i < overlays.length; i++) {
|
||||
ProcessingTrait trait = ProcessingTrait.values()[i];
|
||||
overlays[i] = reg.registerIcon(RefStrings.MODID + ":bedrock_ore_overlay." + trait.name().toLowerCase(Locale.US));
|
||||
@ -67,7 +67,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubItems(Item item, CreativeTabs tab, List list) {
|
||||
|
||||
|
||||
for(int j = 0; j < BedrockOreType.values().length; j++) { BedrockOreType type = BedrockOreType.values()[j];
|
||||
for(int i = 0; i < BedrockOreGrade.values().length; i++) { BedrockOreGrade grade = BedrockOreGrade.values()[i];
|
||||
list.add(this.make(grade, type));
|
||||
@ -80,7 +80,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
public boolean requiresMultipleRenderPasses() {
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public int getRenderPasses(int metadata) {
|
||||
return 1 + this.getGrade(metadata).traits.length;
|
||||
@ -105,15 +105,15 @@ public class ItemBedrockOreNew extends Item {
|
||||
String type = StatCollector.translateToLocalFormatted(this.getUnlocalizedNameInefficiently(stack) + ".type." + this.getType(meta).suffix + ".name");
|
||||
return StatCollector.translateToLocalFormatted(this.getUnlocalizedNameInefficiently(stack) + ".grade." + this.getGrade(meta).name().toLowerCase(Locale.US) + ".name", type);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
|
||||
for(ProcessingTrait trait : this.getGrade(stack.getItemDamage()).traits) {
|
||||
list.add(I18nUtil.resolveKey(this.getUnlocalizedNameInefficiently(stack) + ".trait." + trait.name().toLowerCase(Locale.US)));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static class BedrockOreOutput {
|
||||
public NTMMaterial mat;
|
||||
public int amount;
|
||||
@ -122,21 +122,21 @@ public class ItemBedrockOreNew extends Item {
|
||||
this.amount = amount;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static BedrockOreOutput o(NTMMaterial mat, int amount) {
|
||||
return new BedrockOreOutput(mat, amount);
|
||||
}
|
||||
|
||||
public static enum BedrockOreType {
|
||||
// primary sulfuric solvent radsolvent
|
||||
LIGHT_METAL( 0xFFFFFF, 0x353535, "light", o(MAT_IRON, 9), o(MAT_COPPER, 9), o(MAT_TITANIUM, 9), o(MAT_ALUMINIUM, 5), o(MAT_ALUMINIUM, 4), o(MAT_CHLOROCALCITE, 5), o(MAT_LITHIUM, 5), o(MAT_SODIUM, 3), o(MAT_CHLOROCALCITE, 6), o(MAT_LITHIUM, 6), o(MAT_SODIUM, 6)),
|
||||
LIGHT_METAL( 0xFFFFFF, 0x353535, "light", o(MAT_IRON, 9), o(MAT_COPPER, 9), o(MAT_TITANIUM, 6), o(MAT_BAUXITE, 9), o(MAT_CRYOLITE, 3), o(MAT_CHLOROCALCITE, 5), o(MAT_LITHIUM, 5), o(MAT_SODIUM, 3), o(MAT_CHLOROCALCITE, 6), o(MAT_LITHIUM, 6), o(MAT_SODIUM, 6)),
|
||||
HEAVY_METAL( 0x868686, 0x000000, "heavy", o(MAT_TUNGSTEN, 9), o(MAT_LEAD, 9), o(MAT_GOLD, 2), o(MAT_GOLD, 2), o(MAT_BERYLLIUM, 3), o(MAT_TUNGSTEN, 9), o(MAT_LEAD, 9), o(MAT_GOLD, 5), o(MAT_BISMUTH, 1), o(MAT_BISMUTH, 1), o(MAT_GOLD, 6)),
|
||||
RARE_EARTH( 0xE6E6B6, 0x1C1C00, "rare", o(MAT_COBALT, 5), o(MAT_RAREEARTH, 5),o(MAT_BORON, 5), o(MAT_LANTHANIUM, 3), o(MAT_NIOBIUM, 4), o(MAT_NEODYMIUM, 3), o(MAT_STRONTIUM, 3), o(MAT_ZIRCONIUM, 3), o(MAT_NIOBIUM, 5), o(MAT_NEODYMIUM, 5), o(MAT_STRONTIUM, 3)),
|
||||
ACTINIDE( 0xC1C7BD, 0x2B3227, "actinide", o(MAT_URANIUM, 4), o(MAT_THORIUM, 4), o(MAT_RADIUM, 2), o(MAT_RADIUM, 2), o(MAT_POLONIUM, 2), o(MAT_RADIUM, 2), o(MAT_RADIUM, 2), o(MAT_POLONIUM, 2), o(MAT_TECHNETIUM, 1), o(MAT_TECHNETIUM, 1), o(MAT_U238, 1)),
|
||||
NON_METAL( 0xAFAFAF, 0x0F0F0F, "nonmetal", o(MAT_COAL, 9), o(MAT_SULFUR, 9), o(MAT_LIGNITE, 9), o(MAT_KNO, 6), o(MAT_FLUORITE, 6), o(MAT_PHOSPHORUS, 5), o(MAT_FLUORITE, 6), o(MAT_SULFUR, 6), o(MAT_CHLOROCALCITE, 6), o(MAT_SILICON, 2), o(MAT_SILICON, 2)),
|
||||
CRYSTALLINE( 0xE2FFFA, 0x1E8A77, "crystal", o(MAT_REDSTONE, 9), o(MAT_CINNABAR, 4), o(MAT_SODALITE, 9), o(MAT_ASBESTOS, 6), o(MAT_DIAMOND, 3), o(MAT_CINNABAR, 3), o(MAT_ASBESTOS, 5), o(MAT_EMERALD, 3), o(MAT_BORAX, 3), o(MAT_MOLYSITE, 3), o(MAT_SODALITE, 9));
|
||||
//sediment
|
||||
|
||||
|
||||
public int light;
|
||||
public int dark;
|
||||
public String suffix;
|
||||
@ -144,7 +144,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
public BedrockOreOutput byproductAcid1, byproductAcid2, byproductAcid3;
|
||||
public BedrockOreOutput byproductSolvent1, byproductSolvent2, byproductSolvent3;
|
||||
public BedrockOreOutput byproductRad1, byproductRad2, byproductRad3;
|
||||
|
||||
|
||||
private BedrockOreType(int light, int dark, String suffix, BedrockOreOutput p1, BedrockOreOutput p2, BedrockOreOutput bA1, BedrockOreOutput bA2, BedrockOreOutput bA3, BedrockOreOutput bS1, BedrockOreOutput bS2, BedrockOreOutput bS3, BedrockOreOutput bR1, BedrockOreOutput bR2, BedrockOreOutput bR3) {
|
||||
this.light = light;
|
||||
this.dark = dark;
|
||||
@ -155,14 +155,14 @@ public class ItemBedrockOreNew extends Item {
|
||||
this.byproductRad1 = bR1; this.byproductRad2 = bR2; this.byproductRad3 = bR3;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static MaterialStack toFluid(BedrockOreOutput o, double amount) {
|
||||
if(o.mat != null && o.mat.smeltable == SmeltingBehavior.SMELTABLE) {
|
||||
return new MaterialStack(o.mat, (int) Math.ceil(MaterialShapes.FRAGMENT.q(o.amount) * amount));
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack extract(BedrockOreOutput o, double amount) {
|
||||
return new ItemStack(ModItems.bedrock_ore_fragment, Math.min((int) Math.ceil(o.amount * amount), 64), o.mat.id);
|
||||
}
|
||||
@ -179,7 +179,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
public static final int roasted = 0xCFCFCF;
|
||||
public static final int arc = 0xC3A2A2;
|
||||
public static final int washed = 0xDBE2CB;
|
||||
|
||||
|
||||
public static enum ProcessingTrait {
|
||||
ROASTED,
|
||||
ARC,
|
||||
@ -189,7 +189,7 @@ public class ItemBedrockOreNew extends Item {
|
||||
SOLVENT,
|
||||
RAD
|
||||
}
|
||||
|
||||
|
||||
public static enum BedrockOreGrade {
|
||||
BASE(none, "base"), //from the slopper
|
||||
BASE_ROASTED(roasted, "base", ROASTED), //optional combination oven step, yields vitriol
|
||||
@ -205,45 +205,45 @@ public class ItemBedrockOreNew extends Item {
|
||||
PRIMARY_FIRST(0xFFD3D4, "primary", CENTRIFUGED), //higher first material yield
|
||||
PRIMARY_SECOND(0xD3FFEB, "primary", CENTRIFUGED), //higher second material yield
|
||||
CRUMBS(none, "crumbs", CENTRIFUGED), //endpoint for primary, recycling
|
||||
|
||||
|
||||
SULFURIC_BYPRODUCT(none, "sulfuric", CENTRIFUGED, SULFURIC), //from centrifuging
|
||||
SULFURIC_ROASTED(roasted, "sulfuric", ROASTED, SULFURIC), //comboven again
|
||||
SULFURIC_ARC(arc, "sulfuric", ARC, SULFURIC), //alternate step
|
||||
SULFURIC_WASHED(washed, "sulfuric", WASHED, SULFURIC), //sulfuric endpoint
|
||||
|
||||
|
||||
SOLVENT_BYPRODUCT(none, "solvent", CENTRIFUGED, SOLVENT), //from centrifuging
|
||||
SOLVENT_ROASTED(roasted, "solvent", ROASTED, SOLVENT), //comboven again
|
||||
SOLVENT_ARC(arc, "solvent", ARC, SOLVENT), //alternate step
|
||||
SOLVENT_WASHED(washed, "solvent", WASHED, SOLVENT), //solvent endpoint
|
||||
|
||||
|
||||
RAD_BYPRODUCT(none, "rad", CENTRIFUGED, RAD), //from centrifuging
|
||||
RAD_ROASTED(roasted, "rad", ROASTED, RAD), //comboven again
|
||||
RAD_ARC(arc, "rad", ARC, RAD), //alternate step
|
||||
RAD_WASHED(washed, "rad", WASHED, RAD); //rad endpoint
|
||||
|
||||
|
||||
public int tint;
|
||||
public String prefix;
|
||||
public ProcessingTrait[] traits;
|
||||
|
||||
|
||||
private BedrockOreGrade(int tint, String prefix, ProcessingTrait... traits) {
|
||||
this.tint = tint;
|
||||
this.prefix = prefix;
|
||||
this.traits = traits;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack make(BedrockOreGrade grade, BedrockOreType type) {
|
||||
return make(grade, type, 1);
|
||||
}
|
||||
|
||||
|
||||
public static ItemStack make(BedrockOreGrade grade, BedrockOreType type, int amount) {
|
||||
return new ItemStack(ModItems.bedrock_ore, amount, grade.ordinal() << 4 | type.ordinal());
|
||||
}
|
||||
|
||||
|
||||
public BedrockOreGrade getGrade(int meta) {
|
||||
return EnumUtil.grabEnumSafely(BedrockOreGrade.class, meta >> 4);
|
||||
}
|
||||
|
||||
|
||||
public BedrockOreType getType(int meta) {
|
||||
return EnumUtil.grabEnumSafely(BedrockOreType.class, meta & 15);
|
||||
}
|
||||
|
||||
@ -111,7 +111,6 @@ public class ItemStarterKit extends Item {
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_uf6_tank, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_puf6_tank, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_reactor_breeding, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_rtg_furnace_off, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.reactor_research, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_turbine, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_radgen, 1));
|
||||
@ -174,29 +173,6 @@ public class ItemStarterKit extends Item {
|
||||
|
||||
if(this == ModItems.nuke_electric_kit)
|
||||
{
|
||||
/*player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_coal_off), 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_diesel), 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 64));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 64));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.red_wire_coated), 64));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_battery), 6));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_electric_furnace_off), 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(Item.getItemFromBlock(ModBlocks.machine_chemplant), 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_red_cell_24, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_advanced_cell_4, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_advanced_cell_4, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.battery_lithium, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.fusion_core, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.energy_core, 1));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.plate_aluminium, 32));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.plate_titanium, 32));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.plate_steel, 32));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.circuit_aluminium, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.circuit_copper, 8));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.circuit_red_copper, 4));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.circuit_gold, 2));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.motor, 4));*/
|
||||
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_copper, 16));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_gold, 8));
|
||||
player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_tungsten, 8));
|
||||
|
||||
180
src/main/java/com/hbm/items/tool/ItemCasingBag.java
Normal file
180
src/main/java/com/hbm/items/tool/ItemCasingBag.java
Normal file
@ -0,0 +1,180 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import com.hbm.inventory.container.ContainerCasingBag;
|
||||
import com.hbm.inventory.gui.GUICasingBag;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.ItemStackUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemCasingBag extends Item implements IGUIProvider {
|
||||
|
||||
public ItemCasingBag() {
|
||||
this.setMaxStackSize(1);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMaxItemUseDuration(ItemStack stack) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||
if(!world.isRemote) player.openGui(MainRegistry.instance, 0, world, 0, 0, 0);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new ContainerCasingBag(player.inventory, new InventoryCasingBag(player.getHeldItem()));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||
return new GUICasingBag(player.inventory, new InventoryCasingBag(player.getHeldItem()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if ammo was able to be added
|
||||
* @param bag
|
||||
* @param casing
|
||||
* @param amount
|
||||
* @return
|
||||
*/
|
||||
public static boolean pushCasing(ItemStack bag, ItemStack casing, float amount) {
|
||||
if(!bag.hasTagCompound()) bag.stackTagCompound = new NBTTagCompound();
|
||||
String name = casing.getUnlocalizedName() + "@" + casing.getItemDamage();
|
||||
boolean ret = false;
|
||||
//only add if the previous number did not exceed 1 (i.e. the bag ran full, and may have been emptied, we don't know)
|
||||
//this may also cause minor loss, which evens out the dupe mentioned below. not that it matters, casings only have a 50% recovery rate!
|
||||
if(bag.stackTagCompound.getFloat(name) < 1) {
|
||||
ret = true;
|
||||
bag.stackTagCompound.setFloat(name, bag.stackTagCompound.getFloat(name) + amount);
|
||||
}
|
||||
if(bag.stackTagCompound.getFloat(name) >= 1) {
|
||||
InventoryCasingBag inv = new InventoryCasingBag(bag);
|
||||
ItemStack toAdd = casing.copy();
|
||||
while(bag.stackTagCompound.getFloat(name) >= 1) {
|
||||
|
||||
boolean didSomething = false;
|
||||
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if(toAdd.stackSize <= 0) break;
|
||||
ItemStack slot = inv.getStackInSlot(i);
|
||||
if(slot != null && slot.getItem() == toAdd.getItem() && slot.getItemDamage() == toAdd.getItemDamage()) {
|
||||
int am = Math.min(toAdd.stackSize, slot.getMaxStackSize() - slot.stackSize);
|
||||
toAdd.stackSize -= am;
|
||||
slot.stackSize += am;
|
||||
if(am > 0) didSomething = true;
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < inv.getSizeInventory(); i++) {
|
||||
if(toAdd.stackSize <= 0) break;
|
||||
ItemStack slot = inv.getStackInSlot(i);
|
||||
if(slot == null) {
|
||||
inv.setInventorySlotContents(i, toAdd);
|
||||
didSomething = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if(didSomething) {
|
||||
bag.stackTagCompound.setFloat(name, bag.stackTagCompound.getFloat(name) - 1F);
|
||||
ret = true;
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
inv.markDirty();
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
public static class InventoryCasingBag implements IInventory {
|
||||
|
||||
public final ItemStack box;
|
||||
public ItemStack[] slots;
|
||||
|
||||
public InventoryCasingBag(ItemStack box) {
|
||||
this.box = box;
|
||||
slots = new ItemStack[this.getSizeInventory()];
|
||||
|
||||
if(!box.hasTagCompound())
|
||||
box.setTagCompound(new NBTTagCompound());
|
||||
|
||||
ItemStack[] fromNBT = ItemStackUtil.readStacksFromNBT(box, slots.length);
|
||||
|
||||
if(fromNBT != null) {
|
||||
for(int i = 0; i < slots.length; i++) {
|
||||
slots[i] = fromNBT[i];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override public int getSizeInventory() { return 15; }
|
||||
@Override public ItemStack getStackInSlot(int slot) { return slots[slot]; }
|
||||
|
||||
@Override
|
||||
public ItemStack decrStackSize(int slot, int amount) {
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
if (stack != null) {
|
||||
if (stack.stackSize > amount) {
|
||||
stack = stack.splitStack(amount);
|
||||
markDirty();
|
||||
} else {
|
||||
setInventorySlotContents(slot, null);
|
||||
}
|
||||
}
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getStackInSlotOnClosing(int slot) {
|
||||
ItemStack stack = getStackInSlot(slot);
|
||||
setInventorySlotContents(slot, null);
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setInventorySlotContents(int slot, ItemStack stack) {
|
||||
|
||||
if(stack != null) {
|
||||
stack.stackSize = Math.min(stack.stackSize, this.getInventoryStackLimit());
|
||||
}
|
||||
|
||||
slots[slot] = stack;
|
||||
markDirty();
|
||||
}
|
||||
|
||||
@Override public String getInventoryName() { return "container.casingBag"; }
|
||||
@Override public boolean hasCustomInventoryName() { return box.hasDisplayName(); }
|
||||
@Override public int getInventoryStackLimit() { return 64; }
|
||||
|
||||
@Override
|
||||
public void markDirty() {
|
||||
for(int i = 0; i < getSizeInventory(); ++i) {
|
||||
if(getStackInSlot(i) != null && getStackInSlot(i).stackSize == 0) {
|
||||
slots[i] = null;
|
||||
}
|
||||
}
|
||||
|
||||
ItemStackUtil.addStacksToNBT(box, slots);
|
||||
}
|
||||
|
||||
@Override public boolean isUseableByPlayer(EntityPlayer player) { return true; }
|
||||
@Override public void openInventory() { }
|
||||
@Override public void closeInventory() { }
|
||||
@Override public boolean isItemValidForSlot(int slot, ItemStack stack) { return false; }
|
||||
}
|
||||
}
|
||||
@ -31,7 +31,7 @@ public class ItemColtanCompass extends Item {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
list.add("Points towards the coltan deposit.");
|
||||
list.add("The deposit is a large area where coltan ore spawns like standard ore,");
|
||||
list.add("it's not one large blob of ore on that exact location, dipshit.");
|
||||
list.add("it's not one large blob of ore on that exact location.");
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -10,7 +10,9 @@ import com.hbm.blocks.bomb.BlockDetonatable;
|
||||
import com.hbm.entity.projectile.EntityBulletBaseMK4;
|
||||
import com.hbm.entity.projectile.EntityBulletBeamBase;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ItemEnums.EnumCasingType;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
|
||||
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
|
||||
@ -42,6 +44,8 @@ public class BulletConfig implements Cloneable {
|
||||
public int id;
|
||||
|
||||
public ComparableStack ammo;
|
||||
public ItemStack casingItem;
|
||||
public int casingAmount;
|
||||
/** How much ammo is added to a standard mag when loading one item */
|
||||
public int ammoReloadCount = 1;
|
||||
public float velocity = 10F;
|
||||
@ -103,6 +107,8 @@ public class BulletConfig implements Cloneable {
|
||||
public BulletConfig setItem(ComparableStack ammo) { this.ammo = ammo; return this; }
|
||||
public BulletConfig setItem(EnumAmmo ammo) { this.ammo = new ComparableStack(ModItems.ammo_standard, 1, ammo.ordinal()); return this; }
|
||||
public BulletConfig setItem(EnumAmmoSecret ammo) { this.ammo = new ComparableStack(ModItems.ammo_secret, 1, ammo.ordinal()); return this; }
|
||||
public BulletConfig setCasing(ItemStack item, int amount) { this.casingItem = item; this.casingAmount = amount; return this; }
|
||||
public BulletConfig setCasing(EnumCasingType item, int amount) { this.casingItem = DictFrame.fromOne(ModItems.casing, item); this.casingAmount = amount; return this; }
|
||||
public BulletConfig setReloadCount(int ammoReloadCount) { this.ammoReloadCount = ammoReloadCount; return this; }
|
||||
public BulletConfig setVel(float velocity) { this.velocity = velocity; return this; }
|
||||
public BulletConfig setSpread(float spread) { this.spread = spread; return this; }
|
||||
|
||||
@ -22,7 +22,10 @@ public class Receiver {
|
||||
public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE";
|
||||
public static final String I_DELAYAFTERDRYFIRE = "I_DELAYAFTERDRYFIRE";
|
||||
public static final String I_ROUNDSPERCYCLE = "I_ROUNDSPERCYCLE";
|
||||
public static final String F_SPREADMOD = "F_SPREADMOD";
|
||||
public static final String F_SPRADINNATE = "F_SPRADINNATE";
|
||||
public static final String F_SPREADAMMO = "F_SPREADAMMO";
|
||||
public static final String F_SPREADHIPFIRE = "F_SPREADHIPFIRE";
|
||||
public static final String F_SPREADDURABILITY = "F_SPREADDURABILITY";
|
||||
public static final String B_REFIREONHOLD = "B_REFIREONHOLD";
|
||||
public static final String B_REFIREAFTERDRY = "B_REFIREAFTERDRY";
|
||||
public static final String B_DOESDRYFIRE = "B_DOESDRYFIRE";
|
||||
@ -54,7 +57,10 @@ public class Receiver {
|
||||
protected int delayAfterFire_DNA;
|
||||
protected int delayAfterDryFire_DNA;
|
||||
protected int roundsPerCycle_DNA = 1;
|
||||
protected float spreadModExtra_DNA = 0F;
|
||||
protected float spreadInnate_DNA = 0F;
|
||||
protected float spreadMultAmmo_DNA = 1F;
|
||||
protected float spreadPenaltyHipfire_DNA = 0.025F;
|
||||
protected float spreadDurability_DNA = 0.125F;
|
||||
protected boolean refireOnHold_DNA = false;
|
||||
protected boolean refireAfterDry_DNA = false;
|
||||
protected boolean doesDryFire_DNA = true;
|
||||
@ -82,7 +88,10 @@ public class Receiver {
|
||||
public int getDelayAfterFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.delayAfterFire_DNA, stack, I_DELAYAFTERFIRE, this); }
|
||||
public int getDelayAfterDryFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.delayAfterDryFire_DNA, stack, I_DELAYAFTERDRYFIRE, this); }
|
||||
public int getRoundsPerCycle(ItemStack stack) { return WeaponUpgradeManager.eval(this.roundsPerCycle_DNA, stack, I_ROUNDSPERCYCLE, this); }
|
||||
public float getGunSpread(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadModExtra_DNA, stack, F_SPREADMOD, this); }
|
||||
public float getInnateSpread(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadInnate_DNA, stack, F_SPRADINNATE, this); }
|
||||
public float getAmmoSpread(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadMultAmmo_DNA, stack, F_SPREADAMMO, this); }
|
||||
public float getHipfireSpread(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadPenaltyHipfire_DNA, stack, F_SPREADHIPFIRE, this); }
|
||||
public float getDurabilitySpread(ItemStack stack) { return WeaponUpgradeManager.eval(this.spreadDurability_DNA, stack, F_SPREADDURABILITY, this); }
|
||||
public boolean getRefireOnHold(ItemStack stack) { return WeaponUpgradeManager.eval(this.refireOnHold_DNA, stack, B_REFIREONHOLD, this); }
|
||||
public boolean getRefireAfterDry(ItemStack stack) { return WeaponUpgradeManager.eval(this.refireAfterDry_DNA, stack, B_REFIREAFTERDRY, this); }
|
||||
public boolean getDoesDryFire(ItemStack stack) { return WeaponUpgradeManager.eval(this.doesDryFire_DNA, stack, B_DOESDRYFIRE, this); }
|
||||
@ -111,7 +120,10 @@ public class Receiver {
|
||||
public Receiver delay(int delay) { this.delayAfterFire_DNA = this.delayAfterDryFire_DNA = delay; return this; }
|
||||
public Receiver dry(int delay) { this.delayAfterDryFire_DNA = delay; return this; }
|
||||
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; return this; }
|
||||
public Receiver spread(float spread) { this.spreadModExtra_DNA = spread; return this; }
|
||||
public Receiver spread(float spread) { this.spreadInnate_DNA = spread; return this; }
|
||||
public Receiver spreadAmmo(float spread) { this.spreadMultAmmo_DNA = spread; return this; }
|
||||
public Receiver spreadHipfire(float spread) { this.spreadPenaltyHipfire_DNA = spread; return this; }
|
||||
public Receiver spreadDurability(float spread) { this.spreadDurability_DNA = spread; return this; }
|
||||
public Receiver auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
|
||||
public Receiver autoAfterDry(boolean auto) { this.refireAfterDry_DNA = auto; return this; }
|
||||
public Receiver dryfire(boolean dryfire) { this.doesDryFire_DNA = dryfire; return this; }
|
||||
|
||||
@ -65,6 +65,7 @@ public class GunFactory {
|
||||
XFactoryFolly.init();
|
||||
XFactoryTurret.init();
|
||||
XFactory10ga.init();
|
||||
XFactory35800.init();
|
||||
|
||||
/// PROXY BULLSHIT ///
|
||||
MainRegistry.proxy.registerGunCfg();
|
||||
@ -124,6 +125,7 @@ public class GunFactory {
|
||||
|
||||
public static enum EnumAmmoSecret {
|
||||
FOLLY_SM, FOLLY_NUKE,
|
||||
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN
|
||||
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN,
|
||||
P35_800
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import static com.hbm.items.weapon.sedna.factory.XFactory10ga.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory12ga.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory22lr.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory357.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory35800.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory40mm.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory44.*;
|
||||
import static com.hbm.items.weapon.sedna.factory.XFactory50.*;
|
||||
@ -82,6 +83,8 @@ public class GunFactoryClient {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_hangman, new ItemRenderHangman());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter, new ItemRenderBolter());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_folly, new ItemRenderFolly());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_aberrator, new ItemRenderAberrator());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_aberrator_eott, new ItemRenderEOTT());
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_double_barrel, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_tex));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.gun_double_barrel_sacred_dragon, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_sacred_dragon_tex));
|
||||
//PROJECTILES
|
||||
@ -189,6 +192,8 @@ public class GunFactoryClient {
|
||||
|
||||
folly_sm.setRendererBeam(LegoClient.RENDER_FOLLY);
|
||||
folly_nuke.setRenderer(LegoClient.RENDER_BIG_NUKE);
|
||||
|
||||
p35800.setRendererBeam(LegoClient.RENDER_LASER_WHITE);
|
||||
|
||||
setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
|
||||
|
||||
@ -236,6 +241,7 @@ public class GunFactoryClient {
|
||||
((ItemGunBaseNT) ModItems.gun_hangman) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_bolter) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_folly) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_aberrator) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_double_barrel) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_double_barrel_sacred_dragon) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
|
||||
@ -245,6 +251,8 @@ public class GunFactoryClient {
|
||||
((ItemGunBaseNT) ModItems.gun_maresleg_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_DURABILITY_MIRROR, LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_uzi_akimbo) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_DURABILITY, LegoClient.HUD_COMPONENT_AMMO);
|
||||
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 0).hud(LegoClient.HUD_COMPONENT_AMMO_MIRROR);
|
||||
((ItemGunBaseNT) ModItems.gun_aberrator_eott) .getConfig(null, 1).hud(LegoClient.HUD_COMPONENT_AMMO);
|
||||
}
|
||||
|
||||
public static void setRendererBulk(BiConsumer<EntityBulletBaseMK4, Float> renderer, BulletConfig... configs) { for(BulletConfig config : configs) config.setRenderer(renderer); }
|
||||
|
||||
@ -201,7 +201,7 @@ public class Lego {
|
||||
int index = ctx.configIndex;
|
||||
if(anim != null) ItemGunBaseNT.playAnimation(player, stack, anim, ctx.configIndex);
|
||||
|
||||
float aim = ItemGunBaseNT.getIsAiming(stack) ? 0.25F : 1F;
|
||||
boolean aim = ItemGunBaseNT.getIsAiming(stack);
|
||||
Receiver primary = ctx.config.getReceivers(stack)[0];
|
||||
IMagazine mag = primary.getMagazine(stack);
|
||||
BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory);
|
||||
@ -220,7 +220,7 @@ public class Lego {
|
||||
|
||||
for(int i = 0; i < projectiles; i++) {
|
||||
float damage = calcDamage(ctx, stack, primary, calcWear, index);
|
||||
float spread = calcSpread(ctx, stack, primary, calcWear, index, aim);
|
||||
float spread = calcSpread(ctx, stack, primary, config, calcWear, index, aim);
|
||||
|
||||
if(config.pType == ProjectileType.BULLET) {
|
||||
EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset);
|
||||
@ -260,14 +260,17 @@ public class Lego {
|
||||
return primary.getBaseDamage(stack) * (calcWear ? getStandardWearDamage(stack, ctx.config, index) : 1);
|
||||
}
|
||||
|
||||
public static float calcSpread(LambdaContext ctx, ItemStack stack, Receiver primary, boolean calcWear, int index, float aim) {
|
||||
return primary.getGunSpread(stack) * aim + (calcWear ? getStandardWearSpread(stack, ctx.config, index) * 0.125F : 0F); //TODO: redo all this spread shit
|
||||
/*
|
||||
* spread should have multiple additive parts:
|
||||
* - hipfire penalty (mitigated by aiming)
|
||||
* - innate gun inaccuracy (usually 0, increases with wear)
|
||||
* - bullet inaccuray (usually 0, higher with buckshot)
|
||||
*/
|
||||
public static float calcSpread(LambdaContext ctx, ItemStack stack, Receiver primary, BulletConfig config, boolean calcWear, int index, boolean aim) {
|
||||
// the gun's innate spread, SMGs will have poor accuracy no matter what
|
||||
float spreadInnate = primary.getInnateSpread(stack);
|
||||
// the ammo's spread (for example for buckshot) multiplied with the gun's ammo modifier (choke or sawed off barrel)
|
||||
float spreadAmmo = config.spread * primary.getAmmoSpread(stack);
|
||||
// hipfire penalty, i.e. extra spread when not aiming
|
||||
float spreadHipfire = aim ? 0F : primary.getHipfireSpread(stack);
|
||||
// extra spread caused by weapon durability, [0;0.125] by default
|
||||
float spreadWear = !calcWear ? 0F : (getStandardWearSpread(stack, ctx.config, index) * primary.getDurabilitySpread(stack));
|
||||
|
||||
return spreadInnate + spreadAmmo + spreadHipfire + spreadWear;
|
||||
}
|
||||
|
||||
public static void standardExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range) { standardExplode(bullet, mop, range, 1F); }
|
||||
|
||||
@ -328,6 +328,9 @@ public class LegoClient {
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_PURPLE = (bullet, interp) -> {
|
||||
renderStandardLaser(bullet, interp, 0x60, 0x15, 0x80);
|
||||
};
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_WHITE = (bullet, interp) -> {
|
||||
renderStandardLaser(bullet, interp, 0x15, 0x15, 0x15);
|
||||
};
|
||||
|
||||
public static void renderStandardLaser(EntityBulletBeamBase bullet, float interp, int r, int g, int b) {
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.items.weapon.sedna.factory;
|
||||
import java.util.function.BiConsumer;
|
||||
|
||||
import com.hbm.config.ClientConfig;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.handler.threading.PacketThreading;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT;
|
||||
import com.hbm.items.weapon.sedna.Receiver;
|
||||
@ -771,26 +772,27 @@ public class Orchestras {
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STINGER = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
|
||||
AudioWrapper runningAudio = ItemGunBaseNT.loopedSounds.get(entity);
|
||||
if(ItemGunStinger.getLockonProgress(stack) > 0 && !ItemGunStinger.getIsLockedOn(stack)) {
|
||||
//start sound
|
||||
if(runningAudio == null || !runningAudio.isPlaying()) {
|
||||
AudioWrapper audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.fire.lockon", (float) entity.posX, (float) entity.posY, (float) entity.posZ, 1F, 15F, 1F, 10);
|
||||
ItemGunBaseNT.loopedSounds.put(entity, audio);
|
||||
audio.startSound();
|
||||
if(entity.worldObj.isRemote) {
|
||||
AudioWrapper runningAudio = ItemGunBaseNT.loopedSounds.get(entity);
|
||||
if(ItemGunStinger.getLockonProgress(stack) > 0 && !ItemGunStinger.getIsLockedOn(stack)) {
|
||||
//start sound
|
||||
if(runningAudio == null || !runningAudio.isPlaying()) {
|
||||
AudioWrapper audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.fire.lockon", (float) entity.posX, (float) entity.posY, (float) entity.posZ, 1F, 15F, 1F, 10);
|
||||
ItemGunBaseNT.loopedSounds.put(entity, audio);
|
||||
audio.startSound();
|
||||
}
|
||||
//keepalive
|
||||
if(runningAudio != null && runningAudio.isPlaying()) {
|
||||
runningAudio.keepAlive();
|
||||
runningAudio.updatePosition((float) entity.posX, (float) entity.posY, (float) entity.posZ);
|
||||
}
|
||||
} else {
|
||||
//stop sound due to timeout
|
||||
if(runningAudio != null && runningAudio.isPlaying()) runningAudio.stopSound();
|
||||
}
|
||||
//keepalive
|
||||
if(runningAudio != null && runningAudio.isPlaying()) {
|
||||
runningAudio.keepAlive();
|
||||
runningAudio.updatePosition((float) entity.posX, (float) entity.posY, (float) entity.posZ);
|
||||
}
|
||||
} else {
|
||||
//stop sound due to timeout
|
||||
if(runningAudio != null && runningAudio.isPlaying()) runningAudio.stopSound();
|
||||
}
|
||||
|
||||
if(type == AnimType.RELOAD) {
|
||||
@ -1277,4 +1279,31 @@ public class Orchestras {
|
||||
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F);
|
||||
}
|
||||
};
|
||||
|
||||
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_ABERRATOR = (stack, ctx) -> {
|
||||
EntityLivingBase entity = ctx.entity;
|
||||
if(entity.worldObj.isRemote) return;
|
||||
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
|
||||
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
|
||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||
|
||||
if(type == AnimType.RELOAD) {
|
||||
if(timer == 5) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallRemove", 1F, 0.75F);
|
||||
if(timer == 32) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallInsert", 1F, 0.75F);
|
||||
if(timer == 42) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 0.75F);
|
||||
}
|
||||
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 1) {
|
||||
int cba = (stack.getItem() == ModItems.gun_aberrator_eott && ctx.configIndex == 0) ? -1 : 1;
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D * cba, -0.075, 0.25, 0, 0.01, casing.getName());
|
||||
}
|
||||
}
|
||||
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
if(timer == 1) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 0.75F);
|
||||
if(timer == 9) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.pistolCock", 1F, 0.75F);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.function.BiConsumer;
|
||||
import java.util.function.BiFunction;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.ItemEnums.EnumCasingType;
|
||||
import com.hbm.items.weapon.sedna.BulletConfig;
|
||||
import com.hbm.items.weapon.sedna.Crosshair;
|
||||
import com.hbm.items.weapon.sedna.GunConfig;
|
||||
@ -31,10 +32,10 @@ public class XFactory10ga {
|
||||
|
||||
public static void init() {
|
||||
|
||||
g10 = new BulletConfig().setItem(EnumAmmo.G10).setProjectiles(10).setDamage(1F/10F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GA"));
|
||||
g10_shrapnel = new BulletConfig().setItem(EnumAmmo.G10_SHRAPNEL).setProjectiles(10).setDamage(1F/10F).setSpread(0.05F).setRicochetAngle(90).setRicochetCount(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xE5DD00, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GAShrapnel"));
|
||||
g10_du = new BulletConfig().setItem(EnumAmmo.G10_DU).setProjectiles(10).setDamage(1F/4F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.2F).setDoesPenetrate(true).setDamageFalloutByPen(false).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x538D53, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GADU"));
|
||||
g10_slug = new BulletConfig().setItem(EnumAmmo.G10_SLUG).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.1F).setDoesPenetrate(true).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x808080, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GASlug"));
|
||||
g10 = new BulletConfig().setItem(EnumAmmo.G10).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/10F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GA"));
|
||||
g10_shrapnel = new BulletConfig().setItem(EnumAmmo.G10_SHRAPNEL).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/10F).setSpread(0.05F).setRicochetAngle(90).setRicochetCount(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xE5DD00, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GAShrapnel"));
|
||||
g10_du = new BulletConfig().setItem(EnumAmmo.G10_DU).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/4F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.2F).setDoesPenetrate(true).setDamageFalloutByPen(false).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x538D53, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GADU"));
|
||||
g10_slug = new BulletConfig().setItem(EnumAmmo.G10_SLUG).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.1F).setDoesPenetrate(true).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x808080, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GASlug"));
|
||||
|
||||
ModItems.gun_double_barrel = new ItemGunBaseNT(WeaponQuality.SPECIAL, new GunConfig()
|
||||
.dura(1000).draw(10).inspect(39).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
@ -49,7 +50,7 @@ public class XFactory10ga {
|
||||
ModItems.gun_double_barrel_sacred_dragon = new ItemGunBaseNT(WeaponQuality.B_SIDE, new GunConfig()
|
||||
.dura(6000).draw(10).inspect(39).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(45F).rounds(2).delay(10).reload(41).reloadOnEmpty(true).sound("hbm:weapon.fire.shotgun", 1.0F, 0.9F)
|
||||
.dmg(45F).spreadAmmo(1.35F).rounds(2).delay(10).reload(41).reloadOnEmpty(true).sound("hbm:weapon.fire.shotgun", 1.0F, 0.9F)
|
||||
.mag(new MagazineFullReload(0, 2).addConfigs(g10, g10_shrapnel, g10_du, g10_slug))
|
||||
.offset(0.75, -0.0625, -0.1875)
|
||||
.setupStandardFire().recoil(LAMBDA_RECOIL_DOUBLE_BARREL))
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user