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:
BallOfEnergy 2025-02-09 18:02:29 -06:00
commit aceb313fec
379 changed files with 21379 additions and 11185 deletions

47
.github/workflows/build.yml vendored Normal file
View 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

View File

@ -1,15 +1,12 @@
## Added
* Phosphor vines
## Changed ## 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 * Particle detectors now print an error for when the recipe could not be completed
* U233's color coded isotope indicator is now yellow instead of orange, making yellow standard code for "secondary fissile isotope" and orange for "radioisotope" * Removed "no ore dict data" line from tooltips with extended view enabled
* NITAN powders can now be found in the creative tab * 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
* Fixed raw bedrock ore tooltip not showing the density's color correctly * Fixed items being annihilated when shift clicking them into the particle source
* Fixed T45 helmet not protecting against carbon monoxide * Fixed packet optimization not allowing packets to be sent when the day night cycle is halted
* Fixed general issues regarding the rotary furnace * Fixed particle detectors not always using power when they should
* Fixed corrupted broadcaster noise having infinite range * Fixed rotary furnace voiding low pressure steam when dealing with input numbers not divisible by 100
* Fixed packet issues for explosive charges and custom machines * Fixed state leak causing smoke from the right akimbo weapon to glow when the first one is fired
* Fixed one of the rotary furnace's visual connections now properly showing up

View File

@ -1,6 +1,6 @@
mod_version=1.0.27 mod_version=1.0.27
# Empty build number makes a release type # Empty build number makes a release type
mod_build_number=5202 mod_build_number=5230
credits=HbMinecraft,\ credits=HbMinecraft,\
\ rodolphito (explosion algorithms),\ \ rodolphito (explosion algorithms),\
@ -38,7 +38,8 @@ credits=HbMinecraft,\
\ VT-6/24 (models, textures),\ \ VT-6/24 (models, textures),\
\ Nos (models),\ \ Nos (models),\
\ Minecreep (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),\ \ haru315 (spiral point algorithm),\
\ Sten89 (models),\ \ Sten89 (models),\
\ Pixelguru26 (textures),\ \ Pixelguru26 (textures),\

View File

@ -32,7 +32,7 @@ INDEX includes:
optionally returning a value optionally returning a value
On the implementation side we can expect: 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 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 - 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 then send the return value on the return frequency

View File

@ -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_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_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_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_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"); machine_industrial_generator = new MachineIGenerator(Material.iron).setBlockName("machine_industrial_generator").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName("gold_block");

View File

@ -134,12 +134,12 @@ public class BlockPedestal extends BlockContainer {
if(recipe.extra == recipe.extra.FULL_MOON) { if(recipe.extra == recipe.extra.FULL_MOON) {
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue; 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(recipe.extra == recipe.extra.NEW_MOON) {
if(world.getCelestialAngle(0) < 0.35 || world.getCelestialAngle(0) > 0.65) continue; 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) { if(recipe.extra == recipe.extra.SUN) {

View File

@ -1,10 +1,16 @@
package com.hbm.blocks.generic; package com.hbm.blocks.generic;
import java.util.ArrayList;
import com.hbm.blocks.BlockEnumMulti; import com.hbm.blocks.BlockEnumMulti;
import com.hbm.blocks.BlockEnums; import com.hbm.blocks.BlockEnums;
import com.hbm.blocks.ModBlocks; 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.block.material.Material;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockResourceStone extends BlockEnumMulti { public class BlockResourceStone extends BlockEnumMulti {
@ -22,4 +28,16 @@ public class BlockResourceStone extends BlockEnumMulti {
super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune); 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);
}
} }

View File

@ -176,6 +176,7 @@ public class FoundryChannel extends BlockContainer implements ICrucibleAcceptor
} }
cast.amount = 0; cast.amount = 0;
cast.type = null; cast.type = null;
cast.propagateMaterial(null);
cast.markDirty(); cast.markDirty();
world.markBlockForUpdate(x, y, z); world.markBlockForUpdate(x, y, z);
} }

View File

@ -1,15 +1,20 @@
package com.hbm.blocks.machine.albion; package com.hbm.blocks.machine.albion;
import java.util.List;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.machine.albion.TileEntityPABeamline; import com.hbm.tileentity.machine.albion.TileEntityPABeamline;
import net.minecraft.block.material.Material; 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.tileentity.TileEntity;
import net.minecraft.world.World; import net.minecraft.world.World;
public class BlockPABeamline extends BlockDummyable { public class BlockPABeamline extends BlockDummyable implements ITooltipProvider {
public BlockPABeamline() { public BlockPABeamline() {
super(Material.iron); 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[] getDimensions() { return new int[] {0, 0, 0, 0, 1, 1}; }
@Override public int getOffset() { return 0; } @Override public int getOffset() { return 0; }
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
addStandardInfo(stack, player, list, ext);
}
} }

View File

@ -1,15 +1,22 @@
package com.hbm.blocks.machine.albion; package com.hbm.blocks.machine.albion;
import java.util.List;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.albion.TileEntityPADetector; import com.hbm.tileentity.machine.albion.TileEntityPADetector;
import net.minecraft.block.material.Material; 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.tileentity.TileEntity;
import net.minecraft.world.World; 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() { public BlockPADetector() {
super(Material.iron); super(Material.iron);
@ -20,10 +27,34 @@ public class BlockPADetector extends BlockDummyable {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityPADetector(); if(meta >= 12) return new TileEntityPADetector();
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
return null; 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[] getDimensions() { return new int[] {2, 2, 2, 2, 4, 4}; }
@Override public int getOffset() { return 0; } @Override public int getOffset() { return 0; }
@Override public int getHeightOffset() { return 2; } @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);
}
} }

View File

@ -1,15 +1,22 @@
package com.hbm.blocks.machine.albion; package com.hbm.blocks.machine.albion;
import java.util.List;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.albion.TileEntityPADipole; import com.hbm.tileentity.machine.albion.TileEntityPADipole;
import net.minecraft.block.material.Material; 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.tileentity.TileEntity;
import net.minecraft.world.World; 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() { public BlockPADipole() {
super(Material.iron); super(Material.iron);
@ -20,10 +27,35 @@ public class BlockPADipole extends BlockDummyable {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityPADipole(); if(meta >= 12) return new TileEntityPADipole();
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
return null; 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[] getDimensions() { return new int[] {1, 1, 1, 1, 1, 1}; }
@Override public int getOffset() { return 0; } @Override public int getOffset() { return 0; }
@Override public int getHeightOffset() { return 1; } @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);
}
} }

View File

@ -1,15 +1,22 @@
package com.hbm.blocks.machine.albion; package com.hbm.blocks.machine.albion;
import java.util.List;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.albion.TileEntityPAQuadrupole; import com.hbm.tileentity.machine.albion.TileEntityPAQuadrupole;
import net.minecraft.block.material.Material; 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.tileentity.TileEntity;
import net.minecraft.world.World; 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() { public BlockPAQuadrupole() {
super(Material.iron); super(Material.iron);
@ -20,10 +27,31 @@ public class BlockPAQuadrupole extends BlockDummyable {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityPAQuadrupole(); if(meta >= 12) return new TileEntityPAQuadrupole();
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
return null; 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[] getDimensions() { return new int[] {1, 1, 1, 1, 1, 1}; }
@Override public int getOffset() { return 0; } @Override public int getOffset() { return 0; }
@Override public int getHeightOffset() { return 1; } @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);
}
} }

View File

@ -1,15 +1,22 @@
package com.hbm.blocks.machine.albion; package com.hbm.blocks.machine.albion;
import java.util.List;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.albion.TileEntityPARFC; import com.hbm.tileentity.machine.albion.TileEntityPARFC;
import net.minecraft.block.material.Material; 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.tileentity.TileEntity;
import net.minecraft.world.World; 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() { public BlockPARFC() {
super(Material.iron); super(Material.iron);
@ -20,10 +27,34 @@ public class BlockPARFC extends BlockDummyable {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityPARFC(); if(meta >= 12) return new TileEntityPARFC();
if(meta >= 6) return new TileEntityProxyCombo().power().fluid();
return null; 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[] getDimensions() { return new int[] {1, 1, 1, 1, 4, 4}; }
@Override public int getOffset() { return 0; } @Override public int getOffset() { return 0; }
@Override public int getHeightOffset() { return 1; } @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);
}
} }

View File

@ -1,15 +1,22 @@
package com.hbm.blocks.machine.albion; package com.hbm.blocks.machine.albion;
import java.util.List;
import com.hbm.blocks.BlockDummyable; import com.hbm.blocks.BlockDummyable;
import com.hbm.blocks.ITooltipProvider;
import com.hbm.lib.RefStrings; import com.hbm.lib.RefStrings;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.tileentity.TileEntityProxyCombo;
import com.hbm.tileentity.machine.albion.TileEntityPASource; import com.hbm.tileentity.machine.albion.TileEntityPASource;
import net.minecraft.block.material.Material; 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.tileentity.TileEntity;
import net.minecraft.world.World; 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() { public BlockPASource() {
super(Material.iron); super(Material.iron);
@ -20,10 +27,36 @@ public class BlockPASource extends BlockDummyable {
@Override @Override
public TileEntity createNewTileEntity(World world, int meta) { public TileEntity createNewTileEntity(World world, int meta) {
if(meta >= 12) return new TileEntityPASource(); if(meta >= 12) return new TileEntityPASource();
if(meta >= 6) return new TileEntityProxyCombo().inventory().power().fluid();
return null; 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[] getDimensions() { return new int[] {1, 1, 1, 1, 4, 4}; }
@Override public int getOffset() { return 0; } @Override public int getOffset() { return 0; }
@Override public int getHeightOffset() { return 1; } @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);
}
} }

View File

@ -32,6 +32,7 @@ public class ClientConfig {
public static ConfigWrapper<Boolean> GUN_ANIMS_LEGACY = new ConfigWrapper(false); 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_MODEL_FOV = new ConfigWrapper(false);
public static ConfigWrapper<Boolean> GUN_VISUAL_RECOIL = new ConfigWrapper(true); 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_OREDICT = new ConfigWrapper(true);
public static ConfigWrapper<Boolean> ITEM_TOOLTIP_SHOW_CUSTOM_NUKE = 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); 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_ANIMS_LEGACY", GUN_ANIMS_LEGACY);
configMap.put("GUN_MODEL_FOV", GUN_MODEL_FOV); configMap.put("GUN_MODEL_FOV", GUN_MODEL_FOV);
configMap.put("GUN_VISUAL_RECOIL", GUN_VISUAL_RECOIL); 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_OREDICT", ITEM_TOOLTIP_SHOW_OREDICT);
configMap.put("ITEM_TOOLTIP_SHOW_CUSTOM_NUKE", ITEM_TOOLTIP_SHOW_CUSTOM_NUKE); configMap.put("ITEM_TOOLTIP_SHOW_CUSTOM_NUKE", ITEM_TOOLTIP_SHOW_CUSTOM_NUKE);
configMap.put("MAIN_MENU_WACKY_SPLASHES", MAIN_MENU_WACKY_SPLASHES); configMap.put("MAIN_MENU_WACKY_SPLASHES", MAIN_MENU_WACKY_SPLASHES);

View File

@ -62,7 +62,6 @@ public class WorldConfig {
public static int copperClusterSpawn = 4; public static int copperClusterSpawn = 4;
public static int alexandriteSpawn = 100; public static int alexandriteSpawn = 100;
public static int malachiteSpawn = 1;
public static int limestoneSpawn = 1; public static int limestoneSpawn = 1;
public static int netherUraniumuSpawn = 8; 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); 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); 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); 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); netherUraniumuSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.N00_uraniumSpawnrate", "Amount of nether uranium per chunk", 8);

View File

@ -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_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_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.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_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_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 }); 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 });

View File

@ -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_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_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_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_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_beryllium), new ItemStack(ModItems.ingot_beryllium), 2.0F);
GameRegistry.addSmelting(Item.getItemFromBlock(ModBlocks.ore_schrabidium), new ItemStack(ModItems.ingot_schrabidium), 128.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.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.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.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); GameRegistry.addSmelting(DictFrame.fromOne(ModBlocks.ore_meteor, EnumMeteorType.COBALT), new ItemStack(ModItems.ingot_cobalt, 4), 10.0F);

View File

@ -158,8 +158,6 @@ public class WeaponRecipes {
//Ammo assemblies //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 }); 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 //240mm Shells

View File

@ -201,7 +201,7 @@ public class EntityDeliveryDrone extends EntityDroneBase implements IInventory,
if(!worldObj.isRemote && loaderTicket != null) { if(!worldObj.isRemote && loaderTicket != null) {
clearChunkLoader(); clearChunkLoader();
ForgeChunkManager.forceChunk(loaderTicket, new ChunkCoordIntPair(newChunkX, newChunkZ)); 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)));
} }
} }

View File

@ -4,6 +4,7 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
import api.hbm.conveyor.IConveyorItem; import api.hbm.conveyor.IConveyorItem;
import api.hbm.conveyor.IEnterableBlock; import api.hbm.conveyor.IEnterableBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -15,6 +16,8 @@ import net.minecraftforge.common.util.ForgeDirection;
public class EntityMovingItem extends EntityMovingConveyorObject implements IConveyorItem { public class EntityMovingItem extends EntityMovingConveyorObject implements IConveyorItem {
public EntityItem cacheForRender = null;
public EntityMovingItem(World p_i1582_1_) { public EntityMovingItem(World p_i1582_1_) {
super(p_i1582_1_); super(p_i1582_1_);
this.setSize(0.375F, 0.375F); this.setSize(0.375F, 0.375F);
@ -31,10 +34,11 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
return stack == null ? new ItemStack(Blocks.stone) : stack; return stack == null ? new ItemStack(Blocks.stone) : stack;
} }
/** Adds the item to the player's inventory */
@Override @Override
public boolean interactFirst(EntityPlayer player) { 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(); player.inventoryContainer.detectAndSendChanges();
this.setDead(); this.setDead();
} }
@ -42,13 +46,21 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
return false; return false;
} }
/** Knocks the item off the belt */
@Override @Override
public boolean attackEntityFrom(DamageSource source, float amount) { public boolean hitByEntity(Entity attacker) {
if(!worldObj.isRemote) { if(!worldObj.isRemote && !this.isDead) {
this.setDead(); this.setDead();
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY, posZ, this.getItemStack())); 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; return true;
} }
@ -57,6 +69,23 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
this.getDataWatcher().addObjectByDataType(10, 5); 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 @Override
protected void readEntityFromNBT(NBTTagCompound nbt) { protected void readEntityFromNBT(NBTTagCompound nbt) {
@ -78,6 +107,7 @@ public class EntityMovingItem extends EntityMovingConveyorObject implements ICon
@Override @Override
public void enterBlock(IEnterableBlock enterable, BlockPos pos, ForgeDirection dir) { 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)) { if(enterable.canItemEnter(worldObj, pos.getX(), pos.getY(), pos.getZ(), dir, this)) {
enterable.onItemEnter(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 @Override
public boolean onLeaveConveyor() { public boolean onLeaveConveyor() {
if(this.isDead) return true;
this.setDead(); this.setDead();
EntityItem item = new EntityItem(worldObj, posX + motionX * 2, posY + motionY * 2, posZ + motionZ * 2, this.getItemStack()); EntityItem item = new EntityItem(worldObj, posX + motionX * 2, posY + motionY * 2, posZ + motionZ * 2, this.getItemStack());
item.motionX = this.motionX * 2; item.motionX = this.motionX * 2;

View File

@ -5,6 +5,7 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
import api.hbm.conveyor.IConveyorPackage; import api.hbm.conveyor.IConveyorPackage;
import api.hbm.conveyor.IEnterableBlock; import api.hbm.conveyor.IEnterableBlock;
import net.minecraft.entity.Entity;
import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.item.EntityItem;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -38,7 +39,7 @@ public class EntityMovingPackage extends EntityMovingConveyorObject implements I
@Override @Override
public boolean interactFirst(EntityPlayer player) { public boolean interactFirst(EntityPlayer player) {
if(!worldObj.isRemote) { if(!worldObj.isRemote && !this.isDead) {
for(ItemStack stack : contents) { for(ItemStack stack : contents) {
if(!player.inventory.addItemStackToInventory(stack.copy())) { if(!player.inventory.addItemStackToInventory(stack.copy())) {
@ -53,15 +54,21 @@ public class EntityMovingPackage extends EntityMovingConveyorObject implements I
} }
@Override @Override
public boolean attackEntityFrom(DamageSource source, float amount) { public boolean hitByEntity(Entity attacker) {
if(!worldObj.isRemote) { if(!worldObj.isRemote && !this.isDead) {
this.setDead(); this.setDead();
for(ItemStack stack : contents) { for(ItemStack stack : contents) {
worldObj.spawnEntityInWorld(new EntityItem(worldObj, posX, posY + 0.125, posZ, stack)); 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; return true;
} }

View File

@ -8,7 +8,6 @@ import com.hbm.blocks.ModBlocks;
import com.hbm.config.MobConfig; import com.hbm.config.MobConfig;
import com.hbm.entity.mob.ai.EntityAIBreaking; import com.hbm.entity.mob.ai.EntityAIBreaking;
import com.hbm.entity.pathfinder.PathFinderUtils; import com.hbm.entity.pathfinder.PathFinderUtils;
import com.hbm.entity.projectile.EntityBullet;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import net.minecraft.block.Block; import net.minecraft.block.Block;
@ -141,24 +140,6 @@ public class EntityFBI extends EntityMob implements IRangedAttackMob {
@Override @Override
public void attackEntityWithRangedAttack(EntityLivingBase entity, float f) { 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(); private static final Set<Block> canDestroy = new HashSet();

View File

@ -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.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.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! */ /** 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.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.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.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 @Override

View File

@ -42,7 +42,7 @@ import net.minecraft.util.MathHelper;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.util.ForgeDirection; import net.minecraftforge.common.util.ForgeDirection;
@Spaghetti("no") @Spaghetti("my eyes are bleeding")
public class ExplosionChaos { public class ExplosionChaos {
private final static Random random = new Random(); private final static Random random = new Random();

View File

@ -28,6 +28,7 @@ import net.minecraft.world.ChunkPosition;
import net.minecraft.world.Explosion; import net.minecraft.world.Explosion;
import net.minecraft.world.World; import net.minecraft.world.World;
@Deprecated
public class ExplosionNT extends Explosion { public class ExplosionNT extends Explosion {
public Set<ExAttrib> atttributes = new HashSet(); public Set<ExAttrib> atttributes = new HashSet();

View File

@ -25,8 +25,8 @@ public class HbmKeybinds {
public static KeyBinding hudKey = new KeyBinding(category + ".toggleHUD", Keyboard.KEY_V, category); 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 dashKey = new KeyBinding(category + ".dash", Keyboard.KEY_LSHIFT, category);
public static KeyBinding trainKey = new KeyBinding(category + ".trainInv", Keyboard.KEY_R, 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 copyToolAlt = new KeyBinding(category + ".copyToolAlt", Keyboard.KEY_LMENU, category);
public static KeyBinding copyToolCtrl = new KeyBinding(category + ".copyToolCtrl", Keyboard.KEY_LCONTROL, 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); public static KeyBinding reloadKey = new KeyBinding(category + ".reload", Keyboard.KEY_R, category);

View File

@ -82,7 +82,7 @@ public abstract class WeaponAbility {
if(victim instanceof EntityLivingBase) { if(victim instanceof EntityLivingBase) {
EntityLivingBase living = (EntityLivingBase) victim; EntityLivingBase living = (EntityLivingBase) victim;
if(living.getHealth() <= 0) return;
living.setHealth(living.getHealth() - amount); living.setHealth(living.getHealth() - amount);
if(living.getHealth() <= 0) living.onDeath(DamageSource.magic); if(living.getHealth() <= 0) living.onDeath(DamageSource.magic);
player.heal(amount); player.heal(amount);

View File

@ -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.inventory.fluid.trait.FT_Heatable.HeatingType;
import com.hbm.items.machine.ItemFluidIcon; import com.hbm.items.machine.ItemFluidIcon;
import net.minecraft.item.ItemStack;
public class BoilingHandler extends NEIUniversalHandler { public class BoilingHandler extends NEIUniversalHandler {
public BoilingHandler() { 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 @Override

View 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";
}
}

View 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;
}
}

View File

@ -242,19 +242,19 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler implemen
case 6: return new int[][] { case 6: return new int[][] {
{102, 6}, {120, 6}, {102, 6}, {120, 6},
{102, 24}, {120, 24}, {102, 24}, {120, 24},
{102, 32}, {120, 32}, {102, 42}, {120, 42},
}; };
case 7: return new int[][] { case 7: return new int[][] {
{102, 6}, {120, 6}, {102, 6}, {120, 6},
{102, 24}, {120, 24}, {102, 24}, {120, 24},
{102, 32}, {120, 32}, {102, 42}, {120, 42},
{138, 24}, {138, 24},
}; };
case 8: return new int[][] { case 8: return new int[][] {
{102, 6}, {120, 6}, {102, 6}, {120, 6},
{102, 24}, {120, 24}, {102, 24}, {120, 24},
{102, 32}, {120, 32}, {102, 42}, {120, 42},
{138, 24}, {138, 32}, {138, 24}, {138, 42},
}; };
} }

View 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;
}
}

View File

@ -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);
}
}
}

View File

@ -10,8 +10,7 @@ public class RTGRecipeHandler extends NEIUniversalHandler {
public RTGRecipeHandler() { public RTGRecipeHandler() {
super("RTG", new ItemStack[] { super("RTG", new ItemStack[] {
new ItemStack(ModBlocks.machine_rtg_grey), new ItemStack(ModBlocks.machine_rtg_grey),
new ItemStack(ModBlocks.machine_difurnace_rtg_off), new ItemStack(ModBlocks.machine_difurnace_rtg_off)
new ItemStack(ModBlocks.machine_rtg_furnace_off)
}, ItemRTGPellet.getRecipeMap()); }, ItemRTGPellet.getRecipeMap());
} }

View File

@ -241,6 +241,8 @@ public class OreDictManager {
public static final DictFrame MALACHITE = new DictFrame("Malachite"); public static final DictFrame MALACHITE = new DictFrame("Malachite");
public static final DictFrame LIMESTONE = new DictFrame("Limestone"); public static final DictFrame LIMESTONE = new DictFrame("Limestone");
public static final DictFrame SLAG = new DictFrame("Slag"); 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 * HAZARDS, MISC
*/ */
@ -442,8 +444,10 @@ public class OreDictManager {
SODALITE .gem(gem_sodalite); SODALITE .gem(gem_sodalite);
VOLCANIC .gem(gem_volcanic) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM)); VOLCANIC .gem(gem_volcanic) .ore(DictFrame.fromOne(ore_basalt, EnumBasaltOreType.GEM));
HEMATITE .ore(fromOne(stone_resource, EnumStoneType.HEMATITE)); 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)); 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); SLAG .block(block_slag);
/* /*

View File

@ -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();
}
}

View File

@ -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 @Override
public ItemStack transferStackInSlot(EntityPlayer player, int index) { public ItemStack transferStackInSlot(EntityPlayer player, int index) {
ItemStack stack = null; ItemStack stack = null;

View File

@ -42,8 +42,8 @@ public class ContainerFEL extends Container {
ItemStack stack = slot.getStack(); ItemStack stack = slot.getStack();
rStack = stack.copy(); rStack = stack.copy();
if(index == 0) { if(index <= 1) {
if(!this.mergeItemStack(stack, 1, this.inventorySlots.size(), false)) { if(!this.mergeItemStack(stack, 2, this.inventorySlots.size(), false)) {
return null; return null;
} }
} else { } else {

View 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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -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;
}
}

View File

@ -44,6 +44,9 @@ public class Fluids {
public static FluidType ULTRAHOTSTEAM; public static FluidType ULTRAHOTSTEAM;
public static FluidType COOLANT; public static FluidType COOLANT;
public static FluidType COOLANT_HOT; 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 LAVA;
public static FluidType DEUTERIUM; public static FluidType DEUTERIUM;
public static FluidType TRITIUM; public static FluidType TRITIUM;
@ -180,6 +183,10 @@ public class Fluids {
public static FluidType STELLAR_FLUX; public static FluidType STELLAR_FLUX;
public static FluidType VITRIOL; public static FluidType VITRIOL;
public static FluidType SLOP; 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 */ /* Lagacy names for compatibility purposes */
@Deprecated public static FluidType ACID; //JAOPCA uses this, apparently @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); 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); 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 = 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 //ADD NEW FLUIDS HERE
@ -414,6 +428,9 @@ public class Fluids {
metaOrder.add(CARBONDIOXIDE); metaOrder.add(CARBONDIOXIDE);
metaOrder.add(COOLANT); metaOrder.add(COOLANT);
metaOrder.add(COOLANT_HOT); metaOrder.add(COOLANT_HOT);
metaOrder.add(PERFLUOROMETHYL);
metaOrder.add(PERFLUOROMETHYL_COLD);
metaOrder.add(PERFLUOROMETHYL_HOT);
metaOrder.add(CRYOGEL); metaOrder.add(CRYOGEL);
metaOrder.add(MUG); metaOrder.add(MUG);
metaOrder.add(MUG_HOT); metaOrder.add(MUG_HOT);
@ -525,8 +542,12 @@ public class Fluids {
metaOrder.add(POTASSIUM_CHLORIDE); metaOrder.add(POTASSIUM_CHLORIDE);
metaOrder.add(CALCIUM_CHLORIDE); metaOrder.add(CALCIUM_CHLORIDE);
metaOrder.add(CALCIUM_SOLUTION); metaOrder.add(CALCIUM_SOLUTION);
metaOrder.add(SODIUM_ALUMINATE);
metaOrder.add(BAUXITE_SOLUTION);
metaOrder.add(ALUMINA);
//solutions and working fluids //solutions and working fluids
metaOrder.add(FRACKSOL); metaOrder.add(FRACKSOL);
metaOrder.add(LYE);
//the fun guys //the fun guys
metaOrder.add(PHOSGENE); metaOrder.add(PHOSGENE);
metaOrder.add(MUSTARDGAS); 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.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)); 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.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)); MUG_HOT.addTraits(new FT_Coolable(MUG, 1, 1, 400).setEff(CoolingType.HEATEXCHANGER, 1.0D));

View File

@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.gui.GuiInfoContainer; import com.hbm.inventory.gui.GuiInfoContainer;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.IItemFluidIdentifier; import com.hbm.items.machine.IItemFluidIdentifier;
import com.hbm.util.BobMathUtil;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; import cpw.mods.fml.relauncher.SideOnly;
@ -253,6 +254,7 @@ public class FluidTank {
if(this.pressure != 0) { if(this.pressure != 0) {
list.add(EnumChatFormatting.RED + "Pressure: " + this.pressure + " PU"); list.add(EnumChatFormatting.RED + "Pressure: " + this.pressure + " PU");
list.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_RED) + "Pressurized, use compressor!");
} }
type.addInfo(list); type.addInfo(list);

View File

@ -71,7 +71,8 @@ public class FT_Heatable extends FluidTrait {
BOILER("Boilable"), BOILER("Boilable"),
HEATEXCHANGER("Heatable"), HEATEXCHANGER("Heatable"),
PWR("PWR Coolant"), PWR("PWR Coolant"),
ICF("ICF Coolant"); ICF("ICF Coolant"),
PA("Particle Accelerator Coolant");
public String name; public String name;

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View 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);
}
}

View File

@ -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 + 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 + 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 + 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 + 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" } ); this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 28, guiTop + 70, 30, 10, mouseX, mouseY, new String[]{ "Save parameters" } );

View File

@ -21,6 +21,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack; import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.material.Mats.MaterialStack; import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumAshType;
import com.hbm.items.ItemEnums.EnumCasingType; import com.hbm.items.ItemEnums.EnumCasingType;
@ -62,13 +63,13 @@ 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.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), MAT_GUNMETAL, PLATE.q(1, 2));
registerEntry(DictFrame.fromOne(ModItems.casing, EnumCasingType.LARGE_STEEL), MAT_WEAPONSTEEL, 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 //actual ores
if(!Compat.isModLoaded(Compat.MOD_GT6)) { 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.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.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.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.COAL.ore(), MAT_CARBON, GEM.q(3), MAT_STONE, QUART.q(1));
@ -82,7 +83,7 @@ public class MatDistribution extends SerializableRecipe {
registerOre(OreDictManager.REDSTONE.ore(), MAT_REDSTONE, INGOT.q(4), MAT_STONE, QUART.q(1)); 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.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(DictFrame.fromOne(ModBlocks.stone_resource, EnumStoneType.LIMESTONE), MAT_FLUX, DUST.q(10));
registerEntry(ModItems.powder_flux, MAT_FLUX, DUST.q(1)); registerEntry(ModItems.powder_flux, MAT_FLUX, DUST.q(1));

View File

@ -10,6 +10,7 @@ public class MaterialShapes {
public static final List<MaterialShapes> allShapes = new ArrayList(); public static final List<MaterialShapes> allShapes = new ArrayList();
public static final MaterialShapes ANY = new MaterialShapes(0).noAutogen(); 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 ORE = new MaterialShapes(0, "ore", "oreNether").noAutogen();
public static final MaterialShapes ORENETHER = new MaterialShapes(0, "oreNether").noAutogen(); public static final MaterialShapes ORENETHER = new MaterialShapes(0, "oreNether").noAutogen();

View File

@ -67,6 +67,8 @@ public class Mats {
public static final NTMMaterial MAT_PIGIRON = makeSmeltable(2603, df("PigIron"), 0xFF8B59).m(); 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_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_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 //Radioactive
public static final NTMMaterial MAT_URANIUM = makeSmeltable(9200, U, 0xC1C7BD, 0x2B3227, 0x9AA196).setAutogen(FRAGMENT, NUGGET, BILLET, DUST, BLOCK).m(); 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(); public static final NTMMaterial MAT_GHIORSIUM = makeSmeltable(12836, GH336, 0xF4EFE1, 0x2A3306, 0xC6C6A1).setAutogen(NUGGET, BILLET, BLOCK).m();
//Base metals //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_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, CASTPLATE, WELDEDPLATE, SHELL, PIPE, 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_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_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(); 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_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_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_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_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_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(); public static final NTMMaterial MAT_COBALT = makeSmeltable(2700, CO, 0xC2D1EE, 0x353554, 0x8F72AE).setAutogen(FRAGMENT, NUGGET, DUSTTINY, BILLET, DUST, BLOCK).m();

View File

@ -41,6 +41,7 @@ public class AmmoPressRecipes extends SerializableRecipe {
OreDictStack uranium = new OreDictStack(U238.ingot()); OreDictStack uranium = new OreDictStack(U238.ingot());
ComparableStack smokeful = new ComparableStack(Items.gunpowder); ComparableStack smokeful = new ComparableStack(Items.gunpowder);
OreDictStack smokeless = new OreDictStack(ANY_SMOKELESS.dust()); OreDictStack smokeless = new OreDictStack(ANY_SMOKELESS.dust());
ComparableStack rocket = new ComparableStack(ModItems.rocket_fuel);
OreDictStack he = new OreDictStack(ANY_HIGHEXPLOSIVE.ingot()); OreDictStack he = new OreDictStack(ANY_HIGHEXPLOSIVE.ingot());
OreDictStack wp = new OreDictStack(P_WHITE.ingot()); OreDictStack wp = new OreDictStack(P_WHITE.ingot());
OreDictStack rp = new OreDictStack(P_RED.dust()); 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), recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HE, 2),
null, dyn, null, null, dyn, null,
null, cBig, 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), recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_HEAT, 2),
coplate, he, null, coplate, he, null,
null, cBig, 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), recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_DEMO, 2),
null, he.copy(2), null, null, he.copy(2), null,
null, cBig, 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), recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_INC, 2),
diesel, dyn, null, diesel, dyn, null,
null, cBig, 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), recipes.add(new AmmoPressRecipe(DictFrame.fromOne(ModItems.ammo_standard, EnumAmmo.ROCKET_PHOSPHORUS, 2),
wp, he, null, wp, he, null,
null, cBig, 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()); OreDictStack sPlate = new OreDictStack(STEEL.plate());
ComparableStack napalm = new ComparableStack(ModItems.canister_napalm); ComparableStack napalm = new ComparableStack(ModItems.canister_napalm);

View File

@ -3,6 +3,7 @@ package com.hbm.inventory.recipes;
import java.io.IOException; import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap; import java.util.HashMap;
import java.util.HashSet;
import java.util.List; import java.util.List;
import java.util.Map.Entry; 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;
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade; import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType; import com.hbm.items.special.ItemBedrockOreNew.BedrockOreType;
import com.hbm.util.Tuple.Pair;
import net.minecraft.init.Items; import net.minecraft.init.Items;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -36,43 +38,47 @@ import net.minecraftforge.oredict.OreDictionary;
public class ArcFurnaceRecipes extends SerializableRecipe { 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> fastCacheSolid = new HashMap();
public static HashMap<ComparableStack, ArcFurnaceRecipe> fastCacheLiquid = 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 @Override
public void registerDefaults() { 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)))); register(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)))); 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))));
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)))); register(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)))); register(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)))); register(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)))); 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))));
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)))); 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))));
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)))); 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))));
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)))); 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))));
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(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))); register(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 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()) { 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))); register(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))); register(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))); register(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))); register(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))); register(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.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))); register(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))); register(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.CRUMBS, type)), new ArcFurnaceRecipe().fluidNull(ItemBedrockOreNew.toFluid(type.primary1, 1), ItemBedrockOreNew.toFluid(type.primary2, 1)));
int i3 = 3; 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))); 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)));
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))); 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)));
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.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 // Autogen for simple single type items
@ -86,12 +92,9 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
String name = shape.name() + material.names[0]; String name = shape.name() + material.names[0];
if(!OreDictionary.getOres(name).isEmpty()) { if(!OreDictionary.getOres(name).isEmpty()) {
OreDictStack dict = new OreDictStack(name); OreDictStack dict = new OreDictStack(name);
ArcFurnaceRecipe recipe = recipes.get(dict); ArcFurnaceRecipe recipe = new ArcFurnaceRecipe();
if(recipe == null) recipe = new ArcFurnaceRecipe(); recipe.fluid(new MaterialStack(convert, (int) (shape.q(1) * out / in)));
if(recipe.fluidOutput == null) { register(dict, recipe);
recipe.fluid(new MaterialStack(convert, (int) (shape.q(1) * out / in)));
recipes.put(dict, recipe);
}
} }
} }
} }
@ -116,17 +119,31 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
if(input != null && output != null) { if(input != null && output != null) {
ComparableStack comp = new ComparableStack(input); ComparableStack comp = new ComparableStack(input);
if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) { if(OreDictManager.arcSmeltable.contains(comp) || OreDictManager.arcSmeltable.contains(new ComparableStack(output))) {
ArcFurnaceRecipe recipe = recipes.get(comp); ArcFurnaceRecipe recipe = new ArcFurnaceRecipe();
if(recipe == null) recipe = new ArcFurnaceRecipe(); recipe.solid(output.copy());
if(recipe.solidOutput == null) { register(comp, recipe);
recipe.solid(output.copy());
recipes.put(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) { private static void addCustomSmeltable(AStack astack, List<MaterialStack> mats) {
List<MaterialStack> smeltables = new ArrayList(); List<MaterialStack> smeltables = new ArrayList();
for(MaterialStack mat : mats) { for(MaterialStack mat : mats) {
@ -135,12 +152,9 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
} }
} }
if(smeltables.isEmpty()) return; if(smeltables.isEmpty()) return;
ArcFurnaceRecipe recipe = recipes.get(astack); ArcFurnaceRecipe recipe = new ArcFurnaceRecipe();
if(recipe == null) recipe = new ArcFurnaceRecipe(); recipe.fluid(smeltables.toArray(new MaterialStack[0]));
if(recipe.fluidOutput == null) { register(astack, recipe);
recipe.fluid(smeltables.toArray(new MaterialStack[0]));
recipes.put(astack, recipe);
}
} }
public static ArcFurnaceRecipe getOutput(ItemStack stack, boolean liquid) { 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 && fastCacheSolid.containsKey(cacheKey)) return fastCacheSolid.get(cacheKey);
if(liquid && fastCacheLiquid.containsKey(cacheKey)) return fastCacheLiquid.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)) { if(entry.getKey().matchesRecipe(stack, true)) {
ArcFurnaceRecipe rec = entry.getValue(); ArcFurnaceRecipe rec = entry.getValue();
if((liquid && rec.fluidOutput != null) || (!liquid && rec.solidOutput != null)) { if((liquid && rec.fluidOutput != null) || (!liquid && rec.solidOutput != null)) {
@ -179,7 +193,7 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
public static HashMap getSolidRecipes() { public static HashMap getSolidRecipes() {
HashMap<Object, Object> recipes = new HashMap<Object, Object>(); 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()); if(recipe.getValue().solidOutput != null) recipes.put(recipe.getKey().copy(), recipe.getValue().solidOutput.copy());
} }
return recipes; return recipes;
@ -187,7 +201,7 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
public static HashMap getFluidRecipes() { public static HashMap getFluidRecipes() {
HashMap<Object, Object> recipes = new HashMap<Object, Object>(); 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) { if(recipe.getValue().fluidOutput != null && recipe.getValue().fluidOutput.length > 0) {
Object[] out = new Object[recipe.getValue().fluidOutput.length]; 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); 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 @Override
public Object getRecipeObject() { public Object getRecipeObject() {
return recipes; return recipeList;
} }
@Override @Override
public void deleteRecipes() { public void deleteRecipes() {
recipes.clear(); occupiedSolid.clear();
occupiedLiquid.clear();
recipeList.clear();
fastCacheSolid.clear(); fastCacheSolid.clear();
fastCacheLiquid.clear(); fastCacheLiquid.clear();
} }
@ -245,12 +261,12 @@ public class ArcFurnaceRecipes extends SerializableRecipe {
} }
} }
this.recipes.put(input, arc); register(input, arc);
} }
@Override @Override
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException { 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"); writer.name("input");
this.writeAStack(rec.getKey(), writer); this.writeAStack(rec.getKey(), writer);

View File

@ -32,6 +32,7 @@ import com.hbm.items.ItemGenericPart.EnumPartType;
import com.hbm.items.machine.ItemAssemblyTemplate; import com.hbm.items.machine.ItemAssemblyTemplate;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType; import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.items.machine.ItemDrillbit.EnumDrillType; 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.machine.ItemPistons.EnumPistonType;
import com.hbm.items.weapon.ItemAmmoHIMARS; import com.hbm.items.weapon.ItemAmmoHIMARS;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo; 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.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_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.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.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_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); 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.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_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_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_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_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); 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);
@ -550,14 +550,6 @@ public class AssemblerRecipes extends SerializableRecipe {
new OreDictStack(Fluids.LUBRICANT.getDict(1_000), 4) new OreDictStack(Fluids.LUBRICANT.getDict(1_000), 4)
}, 600); }, 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[] { makeRecipe(new ComparableStack(ModBlocks.machine_cyclotron, 1), new AStack[] {
new ComparableStack(ModBlocks.machine_lithium_battery, 3), new ComparableStack(ModBlocks.machine_lithium_battery, 3),
new ComparableStack(ModBlocks.hadron_coil_neodymium, 8), new ComparableStack(ModBlocks.hadron_coil_neodymium, 8),
@ -947,6 +939,50 @@ public class AssemblerRecipes extends SerializableRecipe {
new ComparableStack(ModItems.circuit, 8, EnumCircuitType.BASIC) new ComparableStack(ModItems.circuit, 8, EnumCircuitType.BASIC)
}, 200); }, 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[] { makeRecipe(new ComparableStack(ModBlocks.machine_exposure_chamber, 1), new AStack[] {
!exp ? new OreDictStack(AL.plateCast(), 12) : new OreDictStack(AL.heavyComp(), 1), !exp ? new OreDictStack(AL.plateCast(), 12) : new OreDictStack(AL.heavyComp(), 1),
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4), new OreDictStack(ANY_RESISTANTALLOY.ingot(), 4),

View File

@ -22,6 +22,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.inventory.RecipesCommon.OreDictStack; import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.material.MaterialShapes; import com.hbm.inventory.material.MaterialShapes;
import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums;
import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumAshType;
import com.hbm.items.ItemEnums.EnumChunkType; import com.hbm.items.ItemEnums.EnumChunkType;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
@ -362,8 +363,8 @@ public class CentrifugeRecipes extends SerializableRecipe {
new ItemStack(Blocks.gravel, 1) }); new ItemStack(Blocks.gravel, 1) });
recipes.put(new OreDictStack(AL.ore()), new ItemStack[] { recipes.put(new OreDictStack(AL.ore()), new ItemStack[] {
new ItemStack(ModItems.powder_aluminium, 1), new ItemStack(ModItems.chunk_ore, 2, ItemEnums.EnumChunkType.CRYOLITE.ordinal()),
new ItemStack(ModItems.powder_aluminium, 1), new ItemStack(ModItems.powder_titanium, 1),
new ItemStack(ModItems.powder_iron, 1), new ItemStack(ModItems.powder_iron, 1),
new ItemStack(Blocks.gravel, 1) }); new ItemStack(Blocks.gravel, 1) });
@ -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_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_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_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_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_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) }); 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) });

View File

@ -58,7 +58,7 @@ public class CokerRecipes extends SerializableRecipe {
registerSFAuto(WOODOIL, 340_000L, new ItemStack(Items.coal, 1, 1), GAS_COKER); registerSFAuto(WOODOIL, 340_000L, new ItemStack(Items.coal, 1, 1), GAS_COKER);
registerRecipe(WATZ, 4_000, new ItemStack(ModItems.ingot_mud, 4), null); 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(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(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)); registerRecipe(CALCIUM_SOLUTION, 125, new ItemStack(ModItems.powder_calcium), new FluidStack(SPENTSTEAM, 100));

View File

@ -9,8 +9,6 @@ import static com.hbm.inventory.OreDictManager.*;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter; 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.FluidStack;
import com.hbm.inventory.OreDictManager.DictFrame; import com.hbm.inventory.OreDictManager.DictFrame;
import com.hbm.inventory.RecipesCommon.AStack; 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.RecipesCommon.OreDictStack;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums;
import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumAshType;
import com.hbm.items.ItemEnums.EnumBriquetteType; import com.hbm.items.ItemEnums.EnumBriquetteType;
import com.hbm.items.ItemEnums.EnumCokeType; import com.hbm.items.ItemEnums.EnumCokeType;
@ -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(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(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(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(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))); recipes.put(LIMESTONE.dust(), new Pair(new ItemStack(ModItems.powder_calcium), new FluidStack(Fluids.CARBONDIOXIDE, 50)));

View File

@ -11,22 +11,38 @@ import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.util.Tuple.Pair; import com.hbm.util.Tuple.Pair;
import net.minecraft.item.ItemStack;
public class CompressorRecipes extends SerializableRecipe { public class CompressorRecipes extends SerializableRecipe {
public static HashMap<Pair<FluidType, Integer>, CompressorRecipe> recipes = new HashMap(); public static HashMap<Pair<FluidType, Integer>, CompressorRecipe> recipes = new HashMap();
@Override @Override
public void registerDefaults() { 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, 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.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.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 { public static class CompressorRecipe {

View File

@ -20,6 +20,8 @@ import com.hbm.inventory.RecipesCommon.OreDictStack;
import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.material.MaterialShapes; 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.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumAshType;
import com.hbm.items.ItemEnums.EnumPlantType; 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.ModItems;
import com.hbm.items.machine.ItemChemicalDye.EnumChemDye; import com.hbm.items.machine.ItemChemicalDye.EnumChemDye;
import com.hbm.items.machine.ItemFluidIcon; import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.items.machine.ItemScraps;
import com.hbm.items.special.ItemBedrockOreNew; import com.hbm.items.special.ItemBedrockOreNew;
import com.hbm.items.special.ItemBedrockOre.EnumBedrockOre; import com.hbm.items.special.ItemBedrockOre.EnumBedrockOre;
import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade; import com.hbm.items.special.ItemBedrockOreNew.BedrockOreGrade;
@ -65,7 +68,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime)); registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime));
registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime)); registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime));
registerRecipe(U.ore(), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime), sulfur); 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(PU.ore(), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime), sulfur);
registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime), sulfur); registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime), sulfur);
registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime)); registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime));
@ -81,6 +84,9 @@ public class CrystallizerRecipes extends SerializableRecipe {
//registerRecipe(STAR.ore(), new CrystallizerRecipe(ModItems.crystal_starmetal, baseTime), sulfur); //registerRecipe(STAR.ore(), new CrystallizerRecipe(ModItems.crystal_starmetal, baseTime), sulfur);
registerRecipe(CO.ore(), new CrystallizerRecipe(ModItems.crystal_cobalt, 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("oreRareEarth", new CrystallizerRecipe(ModItems.crystal_rare, baseTime), sulfur);
registerRecipe("oreCinnabar", new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime)); registerRecipe("oreCinnabar", new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime));

View File

@ -28,6 +28,8 @@ 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.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.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.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.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))); recipes.put(Fluids.CALCIUM_CHLORIDE, new ElectrolysisRecipe(250, new FluidStack(Fluids.CHLORINE, 125), new FluidStack(Fluids.CALCIUM_SOLUTION, 125)));

View File

@ -16,6 +16,7 @@ import com.hbm.inventory.material.MaterialShapes;
import com.hbm.inventory.material.Mats; import com.hbm.inventory.material.Mats;
import com.hbm.inventory.material.Mats.MaterialStack; import com.hbm.inventory.material.Mats.MaterialStack;
import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.machine.ItemFluidIcon; import com.hbm.items.machine.ItemFluidIcon;
import com.hbm.items.machine.ItemScraps; import com.hbm.items.machine.ItemScraps;
@ -78,10 +79,12 @@ public class ElectrolyserMetalRecipes extends SerializableRecipe {
new ItemStack(ModItems.powder_lithium_tiny, 3))); new ItemStack(ModItems.powder_lithium_tiny, 3)));
recipes.put(new ComparableStack(ModItems.crystal_aluminium), new ElectrolysisMetalRecipe( 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 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))); new ItemStack(ModItems.powder_lithium_tiny, 3)));
recipes.put(new ComparableStack(ModItems.crystal_beryllium), new ElectrolysisMetalRecipe( recipes.put(new ComparableStack(ModItems.crystal_beryllium), new ElectrolysisMetalRecipe(
new MaterialStack(Mats.MAT_BERYLLIUM, MaterialShapes.INGOT.q(6)), new MaterialStack(Mats.MAT_BERYLLIUM, MaterialShapes.INGOT.q(6)),
new MaterialStack(Mats.MAT_LEAD, MaterialShapes.NUGGET.q(4)), new MaterialStack(Mats.MAT_LEAD, MaterialShapes.NUGGET.q(4)),

View File

@ -41,6 +41,7 @@ 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.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.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.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) { public static Pair<FluidStack, FluidStack> getFractions(FluidType oil) {

View File

@ -12,6 +12,8 @@ import com.google.gson.JsonArray;
import com.google.gson.JsonElement; import com.google.gson.JsonElement;
import com.google.gson.JsonObject; import com.google.gson.JsonObject;
import com.google.gson.stream.JsonWriter; 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.FluidStack;
import com.hbm.inventory.RecipesCommon.AStack; import com.hbm.inventory.RecipesCommon.AStack;
import com.hbm.inventory.RecipesCommon.ComparableStack; 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.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.recipes.loader.SerializableRecipe; import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.ItemEnums.EnumAshType; import com.hbm.items.ItemEnums.EnumAshType;
import com.hbm.items.machine.ItemFluidIcon; import com.hbm.items.machine.ItemFluidIcon;
@ -91,6 +94,13 @@ public class MixerRecipes extends SerializableRecipe {
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.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.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) { public static void register(FluidType type, MixerRecipe... rec) {

View File

@ -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();
}
}

View File

@ -18,6 +18,8 @@ import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums.EnumSecretType; import com.hbm.items.ItemEnums.EnumSecretType;
import com.hbm.items.food.ItemConserve.EnumFoodType; import com.hbm.items.food.ItemConserve.EnumFoodType;
import com.hbm.items.ModItems; 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.init.Items;
import net.minecraft.item.ItemStack; 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 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)) 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)); .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 @Override

View File

@ -38,15 +38,17 @@ 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(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(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(2)), 200, 25, 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(3)), 200, 25, 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(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_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_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_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_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() { public static HashMap getRecipes() {

View File

@ -100,13 +100,23 @@ public class SILEXRecipes {
.addOut(new ItemStack(ModItems.powder_impure_osmiridium), 1) .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_bromine), 5)
.addOut(new ItemStack(ModItems.powder_iodine), 5) .addOut(new ItemStack(ModItems.powder_iodine), 5)
.addOut(new ItemStack(ModItems.powder_iron), 5) .addOut(new ItemStack(ModItems.powder_iron), 5)
.addOut(new ItemStack(ModItems.sulfur), 15) .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++) { for(int i = 0; i < 5; i++) {
// UEU // // UEU //

View File

@ -209,6 +209,7 @@ public class ShredderRecipes extends SerializableRecipe {
ShredderRecipes.setRecipe(DictFrame.fromOne(ModItems.chunk_ore, EnumChunkType.RARE), new ItemStack(ModItems.powder_desh_mix)); 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(Blocks.sand, new ItemStack(ModItems.dust, 2));
ShredderRecipes.setRecipe(ModBlocks.block_slag, new ItemStack(ModItems.powder_cement, 4)); 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> logs = OreDictionary.getOres("logWood");
List<ItemStack> planks = OreDictionary.getOres("plankWood"); List<ItemStack> planks = OreDictionary.getOres("plankWood");

View File

@ -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? // 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, recipes.add(new SolderingRecipe(new ItemStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER.ordinal()), 400, 15_000,
new FluidStack(Fluids.PERFLUOROMETHYL, 1_000),
new AStack[] { new AStack[] {
new ComparableStack(ModItems.circuit, lbsm ? 8 : 32, EnumCircuitType.CHIP), new ComparableStack(ModItems.circuit, lbsm ? 8 : 32, EnumCircuitType.CHIP),
new ComparableStack(ModItems.circuit, lbsm ? 8 : 32, EnumCircuitType.CAPACITOR), new ComparableStack(ModItems.circuit, lbsm ? 8 : 32, EnumCircuitType.CAPACITOR),
@ -121,6 +122,7 @@ public class SolderingRecipes extends SerializableRecipe {
new OreDictStack(PB.wireFine(), 16)} new OreDictStack(PB.wireFine(), 16)}
)); ));
recipes.add(new SolderingRecipe(new ItemStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER_ADVANCED.ordinal()), 600, 25_000, 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 AStack[] {
new ComparableStack(ModItems.circuit, lbsm ? 8 : 16, EnumCircuitType.CHIP_BISMOID), new ComparableStack(ModItems.circuit, lbsm ? 8 : 16, EnumCircuitType.CHIP_BISMOID),
new ComparableStack(ModItems.circuit, lbsm ? 16 : 48, EnumCircuitType.CAPACITOR_TANTALIUM), new ComparableStack(ModItems.circuit, lbsm ? 16 : 48, EnumCircuitType.CAPACITOR_TANTALIUM),
@ -132,6 +134,7 @@ public class SolderingRecipes extends SerializableRecipe {
new OreDictStack(PB.wireFine(), 24)} new OreDictStack(PB.wireFine(), 24)}
)); ));
recipes.add(new SolderingRecipe(new ItemStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER_QUANTUM.ordinal()), 600, 250_000, 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 AStack[] {
new ComparableStack(ModItems.circuit, lbsm ? 8 : 16, EnumCircuitType.CHIP_QUANTUM), new ComparableStack(ModItems.circuit, lbsm ? 8 : 16, EnumCircuitType.CHIP_QUANTUM),
new ComparableStack(ModItems.circuit, lbsm ? 16 : 48, EnumCircuitType.CHIP_BISMOID), new ComparableStack(ModItems.circuit, lbsm ? 16 : 48, EnumCircuitType.CHIP_BISMOID),

View File

@ -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(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(ENDERJUICE, 100, Items.ender_pearl);
registerRecipe(WATZ, 1000, ModItems.ingot_mud); 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(SODIUM, 100, ModItems.powder_sodium);
registerRecipe(LEAD, 100, ModItems.ingot_lead); registerRecipe(LEAD, 100, ModItems.ingot_lead);
registerRecipe(SLOP, 250, ModBlocks.ore_oil_sand); registerRecipe(SLOP, 250, ModBlocks.ore_oil_sand);

View File

@ -1,8 +1,12 @@
package com.hbm.inventory.recipes.anvil; package com.hbm.inventory.recipes.anvil;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; 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.blocks.ModBlocks;
import com.hbm.config.GeneralConfig; import com.hbm.config.GeneralConfig;
import com.hbm.inventory.OreDictManager; 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.material.NTMMaterial;
import com.hbm.inventory.recipes.AssemblerRecipes; import com.hbm.inventory.recipes.AssemblerRecipes;
import com.hbm.inventory.recipes.AssemblerRecipes.AssemblerRecipe; import com.hbm.inventory.recipes.AssemblerRecipes.AssemblerRecipe;
import com.hbm.inventory.recipes.loader.SerializableRecipe;
import com.hbm.items.ItemEnums.EnumChunkType; import com.hbm.items.ItemEnums.EnumChunkType;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.food.ItemFlask.EnumInfusion; import com.hbm.items.food.ItemFlask.EnumInfusion;
import com.hbm.items.machine.ItemCircuit.EnumCircuitType; import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
import com.hbm.util.Tuple.Pair;
import net.minecraft.block.Block; import net.minecraft.block.Block;
import net.minecraft.init.Blocks; import net.minecraft.init.Blocks;
@ -30,16 +36,20 @@ import net.minecraft.item.ItemStack;
import net.minecraftforge.oredict.OreDictionary; import net.minecraftforge.oredict.OreDictionary;
public class AnvilRecipes { public class AnvilRecipes extends SerializableRecipe {
private static List<AnvilSmithingRecipe> smithingRecipes = new ArrayList(); private static List<AnvilSmithingRecipe> smithingRecipes = new ArrayList();
private static List<AnvilConstructionRecipe> constructionRecipes = new ArrayList(); private static List<AnvilConstructionRecipe> constructionRecipes = new ArrayList();
public static void register() { public static void register() {
registerSmithing(); 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)); 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_buckshot), 1);
pullFromAssembler(new ComparableStack(ModItems.pellet_canister), 1);
} }
public static void registerConstructionUpgrades() { public static void registerConstructionUpgrades() {
@ -1064,6 +1073,12 @@ public class AnvilRecipes {
this.setOverlay(OverlayType.NONE); //no preferred overlay for many:many conversions 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) { public AnvilConstructionRecipe setTier(int tier) {
this.tierLower = tier; this.tierLower = tier;
if(GeneralConfig.enableLBSM && GeneralConfig.enableLBSMUnlockAnvil) this.tierLower = 1; if(GeneralConfig.enableLBSM && GeneralConfig.enableLBSMUnlockAnvil) this.tierLower = 1;
@ -1130,4 +1145,42 @@ public class AnvilRecipes {
RECYCLING, RECYCLING,
SMITHING; 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());
}
} }

View File

@ -24,6 +24,7 @@ import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.inventory.material.MatDistribution; import com.hbm.inventory.material.MatDistribution;
import com.hbm.inventory.recipes.*; import com.hbm.inventory.recipes.*;
import com.hbm.inventory.recipes.anvil.AnvilRecipes;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.main.MainRegistry; import com.hbm.main.MainRegistry;
import com.hbm.util.Tuple.Pair; import com.hbm.util.Tuple.Pair;
@ -73,8 +74,11 @@ public abstract class SerializableRecipe {
recipeHandlers.add(new ArcWelderRecipes()); recipeHandlers.add(new ArcWelderRecipes());
recipeHandlers.add(new RotaryFurnaceRecipes()); recipeHandlers.add(new RotaryFurnaceRecipes());
recipeHandlers.add(new ExposureChamberRecipes()); recipeHandlers.add(new ExposureChamberRecipes());
recipeHandlers.add(new ParticleAcceleratorRecipes());
recipeHandlers.add(new AmmoPressRecipes()); recipeHandlers.add(new AmmoPressRecipes());
recipeHandlers.add(new AssemblerRecipes()); recipeHandlers.add(new AssemblerRecipes());
//AFTER Assembler
recipeHandlers.add(new AnvilRecipes());
recipeHandlers.add(new PedestalRecipes()); recipeHandlers.add(new PedestalRecipes());
recipeHandlers.add(new MatDistribution()); recipeHandlers.add(new MatDistribution());

View File

@ -81,13 +81,11 @@ public class ItemPoolsSingle {
weighted(ModItems.powder_power, 0, 1, 5, 1), weighted(ModItems.powder_power, 0, 1, 5, 1),
weighted(ModItems.sat_chip, 0, 1, 1, 1), weighted(ModItems.sat_chip, 0, 1, 1, 1),
weighted(Items.diamond, 0, 5, 9, 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_standard, EnumAmmo.NUKE_STANDARD.ordinal(), 1, 3, 1),
weighted(ModItems.ammo_container, 0, 1, 4, 1), weighted(ModItems.ammo_container, 0, 1, 4, 1),
weighted(ModItems.grenade_nuclear, 0, 1, 2, 1), weighted(ModItems.grenade_nuclear, 0, 1, 2, 1),
weighted(ModItems.grenade_mirv, 0, 1, 1, 1), weighted(ModItems.grenade_mirv, 0, 1, 1, 1),
weighted(ModItems.powder_yellowcake, 0, 26, 42, 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.gun_heavy_revolver, 0, 1, 1, 1),
weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 18, 32, 1), weighted(ModItems.circuit, EnumCircuitType.CHIP.ordinal(), 18, 32, 1),
weighted(ModItems.circuit, EnumCircuitType.BASIC.ordinal(), 6, 12, 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_container, 0, 3, 6, 1),
weighted(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO.ordinal(), 2, 3, 1), weighted(ModItems.ammo_standard, EnumAmmo.NUKE_DEMO.ordinal(), 2, 3, 1),
weighted(ModItems.gun_carbine, 0, 1, 1, 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_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.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)
}; };
}}; }};

View File

@ -1,5 +1,6 @@
package com.hbm.items; package com.hbm.items;
import java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Random; import java.util.Random;
@ -14,6 +15,7 @@ import net.minecraft.item.EnumRarity;
import net.minecraft.item.Item; import net.minecraft.item.Item;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
import net.minecraft.util.EnumChatFormatting; import net.minecraft.util.EnumChatFormatting;
import net.minecraft.util.StatCollector;
public class ItemCustomLore extends Item { public class ItemCustomLore extends Item {
@ -104,4 +106,121 @@ public class ItemCustomLore extends Item {
setTextureName(RefStrings.MODID + ':' + uloc); setTextureName(RefStrings.MODID + ':' + uloc);
return super.setUnlocalizedName(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;
}
}
} }

View File

@ -51,7 +51,9 @@ public class ItemEnums {
} }
public static enum EnumChunkType { public static enum EnumChunkType {
RARE RARE,
MALACHITE,
CRYOLITE
} }
public static enum EnumAchievementType { public static enum EnumAchievementType {

View File

@ -593,25 +593,7 @@ public class ModItems {
public static Item mechanism_launcher_2; public static Item mechanism_launcher_2;
public static Item mechanism_special; public static Item mechanism_special;
public static Item assembly_iron;
public static Item assembly_steel;
public static Item assembly_lead;
public static Item assembly_gold;
public static Item assembly_schrabidium;
public static Item assembly_nightmare;
public static Item assembly_desh;
//public static Item assembly_pip;
public static Item assembly_nopip;
public static Item assembly_smg;
public static Item assembly_556;
public static Item assembly_762;
public static Item assembly_45;
public static Item assembly_uzi;
public static Item assembly_actionexpress;
public static Item assembly_calamity;
public static Item assembly_lacunae;
public static Item assembly_nuke; public static Item assembly_nuke;
public static Item assembly_luna;
public static Item casing; public static Item casing;
@ -841,6 +823,8 @@ public class ModItems {
public static Item demon_core_open; public static Item demon_core_open;
public static Item demon_core_closed; public static Item demon_core_closed;
public static Item pa_coil;
public static Item particle_empty; public static Item particle_empty;
public static Item particle_hydrogen; public static Item particle_hydrogen;
public static Item particle_copper; public static Item particle_copper;
@ -1177,6 +1161,8 @@ public class ModItems {
public static Item containment_box; public static Item containment_box;
public static Item plastic_bag; public static Item plastic_bag;
public static Item casing_bag;
public static Item test_nuke_igniter; public static Item test_nuke_igniter;
public static Item test_nuke_propellant; public static Item test_nuke_propellant;
public static Item test_nuke_tier1_shielding; public static Item test_nuke_tier1_shielding;
@ -1201,10 +1187,6 @@ public class ModItems {
public static Item pellet_gas; public static Item pellet_gas;
public static Item magnetron; public static Item magnetron;
public static Item pellet_buckshot; public static Item pellet_buckshot;
public static Item pellet_flechette;
public static Item pellet_chlorophyte;
public static Item pellet_canister;
public static Item pellet_claws;
public static Item pellet_charged; public static Item pellet_charged;
public static Item designator; public static Item designator;
@ -1518,6 +1500,8 @@ public class ModItems {
public static Item gun_hangman; public static Item gun_hangman;
public static Item gun_bolter; public static Item gun_bolter;
public static Item gun_folly; public static Item gun_folly;
public static Item gun_aberrator;
public static Item gun_aberrator_eott;
public static Item gun_double_barrel; public static Item gun_double_barrel;
public static Item gun_double_barrel_sacred_dragon; public static Item gun_double_barrel_sacred_dragon;
@ -2851,24 +2835,7 @@ public class ModItems {
mechanism_launcher_1 = new Item().setUnlocalizedName("mechanism_launcher_1").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_5"); mechanism_launcher_1 = new Item().setUnlocalizedName("mechanism_launcher_1").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_5");
mechanism_launcher_2 = new Item().setUnlocalizedName("mechanism_launcher_2").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_6"); mechanism_launcher_2 = new Item().setUnlocalizedName("mechanism_launcher_2").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_6");
mechanism_special = new Item().setUnlocalizedName("mechanism_special").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_7"); mechanism_special = new Item().setUnlocalizedName("mechanism_special").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":mechanism_7");
assembly_iron = new Item().setUnlocalizedName("assembly_iron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_iron");
assembly_steel = new Item().setUnlocalizedName("assembly_steel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_steel");
assembly_lead = new Item().setUnlocalizedName("assembly_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_lead");
assembly_gold = new Item().setUnlocalizedName("assembly_gold").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_gold");
assembly_schrabidium = new Item().setUnlocalizedName("assembly_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_schrabidium");
assembly_nightmare = new Item().setUnlocalizedName("assembly_nightmare").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nightmare");
assembly_desh = new Item().setUnlocalizedName("assembly_desh").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_desh");
assembly_nopip = new Item().setUnlocalizedName("assembly_nopip").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nopip");
assembly_smg = new Item().setUnlocalizedName("assembly_smg").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_smg");
assembly_556 = new Item().setUnlocalizedName("assembly_556").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_556");
assembly_762 = new Item().setUnlocalizedName("assembly_762").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_762");
assembly_45 = new Item().setUnlocalizedName("assembly_45").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_45");
assembly_uzi = new Item().setUnlocalizedName("assembly_uzi").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_uzi");
assembly_actionexpress = new Item().setUnlocalizedName("assembly_actionexpress").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_actionexpress");
assembly_calamity = new Item().setUnlocalizedName("assembly_calamity").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_calamity");
assembly_lacunae = new Item().setUnlocalizedName("assembly_lacunae").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_lacunae");
assembly_nuke = new Item().setUnlocalizedName("assembly_nuke").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nuke"); assembly_nuke = new Item().setUnlocalizedName("assembly_nuke").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_nuke");
assembly_luna = new Item().setUnlocalizedName("assembly_luna").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":assembly_luna");
casing = new ItemEnumMulti(ItemEnums.EnumCasingType.class, true, true).setUnlocalizedName("casing").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":casing"); casing = new ItemEnumMulti(ItemEnums.EnumCasingType.class, true, true).setUnlocalizedName("casing").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":casing");
wiring_red_copper = new ItemWiring().setUnlocalizedName("wiring_red_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wiring_red_copper"); wiring_red_copper = new ItemWiring().setUnlocalizedName("wiring_red_copper").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":wiring_red_copper");
@ -2929,6 +2896,8 @@ public class ModItems {
demon_core_open = new ItemDemonCore().setUnlocalizedName("demon_core_open").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":demon_core_open"); demon_core_open = new ItemDemonCore().setUnlocalizedName("demon_core_open").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":demon_core_open");
demon_core_closed = new Item().setUnlocalizedName("demon_core_closed").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":demon_core_closed"); demon_core_closed = new Item().setUnlocalizedName("demon_core_closed").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":demon_core_closed");
pa_coil = new ItemPACoil().setUnlocalizedName("pa_coil").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":pa_coil");
particle_empty = new Item().setUnlocalizedName("particle_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":particle_empty"); particle_empty = new Item().setUnlocalizedName("particle_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":particle_empty");
particle_hydrogen = new Item().setUnlocalizedName("particle_hydrogen").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_hydrogen"); particle_hydrogen = new Item().setUnlocalizedName("particle_hydrogen").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_hydrogen");
particle_copper = new Item().setUnlocalizedName("particle_copper").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_copper"); particle_copper = new Item().setUnlocalizedName("particle_copper").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_copper");
@ -3488,9 +3457,9 @@ public class ModItems {
rbmk_fuel_heaus = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_heaus) rbmk_fuel_heaus = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_heaus)
.setYield(100000000D) .setYield(100000000D)
.setStats(35) .setStats(35)
.setFunction(EnumBurnFunc.SQUARE_ROOT) .setFunction(EnumBurnFunc.LINEAR)
.setXenon(0.05D, 50D) .setXenon(0.05D, 50D)
.setHeat(2D) .setHeat(1.5D)
.setMeltingPoint(5211).setUnlocalizedName("rbmk_fuel_heaus").setTextureName(RefStrings.MODID + ":rbmk_fuel_heaus"); .setMeltingPoint(5211).setUnlocalizedName("rbmk_fuel_heaus").setTextureName(RefStrings.MODID + ":rbmk_fuel_heaus");
rbmk_fuel_po210be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_po210be) rbmk_fuel_po210be = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_po210be)
.setYield(25000000D) .setYield(25000000D)
@ -3568,7 +3537,7 @@ public class ModItems {
.setMeltingPoint(2744) .setMeltingPoint(2744)
.setUnlocalizedName("rbmk_fuel_zfb_am_mix").setTextureName(RefStrings.MODID + ":rbmk_fuel_zfb_am_mix"); .setUnlocalizedName("rbmk_fuel_zfb_am_mix").setTextureName(RefStrings.MODID + ":rbmk_fuel_zfb_am_mix");
rbmk_fuel_drx = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_drx) rbmk_fuel_drx = (ItemRBMKRod) new ItemRBMKRod(rbmk_pellet_drx)
.setYield(1000000D) .setYield(10000000D)
.setStats(1000, 10) .setStats(1000, 10)
.setFunction(EnumBurnFunc.QUADRATIC) .setFunction(EnumBurnFunc.QUADRATIC)
.setHeat(0.1D) .setHeat(0.1D)
@ -3621,6 +3590,8 @@ public class ModItems {
containment_box = new ItemLeadBox().setUnlocalizedName("containment_box").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":containment_box"); containment_box = new ItemLeadBox().setUnlocalizedName("containment_box").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":containment_box");
plastic_bag = new ItemPlasticBag().setUnlocalizedName("plastic_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plastic_bag"); plastic_bag = new ItemPlasticBag().setUnlocalizedName("plastic_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":plastic_bag");
casing_bag = new ItemCasingBag().setUnlocalizedName("casing_bag").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":casing_bag");
debris_graphite = new Item().setUnlocalizedName("debris_graphite").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_graphite"); debris_graphite = new Item().setUnlocalizedName("debris_graphite").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_graphite");
debris_metal = new Item().setUnlocalizedName("debris_metal").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_metal"); debris_metal = new Item().setUnlocalizedName("debris_metal").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_metal");
debris_fuel = new Item().setUnlocalizedName("debris_fuel").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_fuel"); debris_fuel = new Item().setUnlocalizedName("debris_fuel").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":debris_fuel");
@ -3643,10 +3614,6 @@ public class ModItems {
pellet_gas = new ItemCustomLore().setUnlocalizedName("pellet_gas").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellet_gas"); pellet_gas = new ItemCustomLore().setUnlocalizedName("pellet_gas").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellet_gas");
magnetron = new ItemCustomLore().setUnlocalizedName("magnetron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":magnetron_alt"); magnetron = new ItemCustomLore().setUnlocalizedName("magnetron").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":magnetron_alt");
pellet_buckshot = new Item().setUnlocalizedName("pellet_buckshot").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_lead"); pellet_buckshot = new Item().setUnlocalizedName("pellet_buckshot").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_lead");
pellet_flechette = new Item().setUnlocalizedName("pellet_flechette").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_flechette");
pellet_chlorophyte = new Item().setUnlocalizedName("pellet_chlorophyte").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_chlorophyte");
pellet_canister = new Item().setUnlocalizedName("pellet_canister").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_canister");
pellet_claws = new Item().setUnlocalizedName("pellet_claws").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_claws");
pellet_charged = new Item().setUnlocalizedName("pellet_charged").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_charged"); pellet_charged = new Item().setUnlocalizedName("pellet_charged").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":pellets_charged");
designator = new ItemDesingator().setUnlocalizedName("designator").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator"); designator = new ItemDesingator().setUnlocalizedName("designator").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":designator");
@ -5714,24 +5681,7 @@ public class ModItems {
GameRegistry.registerItem(casing, casing.getUnlocalizedName()); GameRegistry.registerItem(casing, casing.getUnlocalizedName());
//Bullet Assemblies //Bullet Assemblies
GameRegistry.registerItem(assembly_iron, assembly_iron.getUnlocalizedName());
GameRegistry.registerItem(assembly_steel, assembly_steel.getUnlocalizedName());
GameRegistry.registerItem(assembly_lead, assembly_lead.getUnlocalizedName());
GameRegistry.registerItem(assembly_gold, assembly_gold.getUnlocalizedName());
GameRegistry.registerItem(assembly_schrabidium, assembly_schrabidium.getUnlocalizedName());
GameRegistry.registerItem(assembly_nightmare, assembly_nightmare.getUnlocalizedName());
GameRegistry.registerItem(assembly_desh, assembly_desh.getUnlocalizedName());
GameRegistry.registerItem(assembly_nopip, assembly_nopip.getUnlocalizedName());
GameRegistry.registerItem(assembly_smg, assembly_smg.getUnlocalizedName());
GameRegistry.registerItem(assembly_556, assembly_556.getUnlocalizedName());
GameRegistry.registerItem(assembly_762, assembly_762.getUnlocalizedName());
GameRegistry.registerItem(assembly_45, assembly_45.getUnlocalizedName());
GameRegistry.registerItem(assembly_uzi, assembly_uzi.getUnlocalizedName());
GameRegistry.registerItem(assembly_lacunae, assembly_lacunae.getUnlocalizedName());
GameRegistry.registerItem(assembly_actionexpress, assembly_actionexpress.getUnlocalizedName());
GameRegistry.registerItem(assembly_calamity, assembly_calamity.getUnlocalizedName());
GameRegistry.registerItem(assembly_nuke, assembly_nuke.getUnlocalizedName()); GameRegistry.registerItem(assembly_nuke, assembly_nuke.getUnlocalizedName());
GameRegistry.registerItem(assembly_luna, assembly_luna.getUnlocalizedName());
//Wiring //Wiring
GameRegistry.registerItem(wiring_red_copper, wiring_red_copper.getUnlocalizedName()); GameRegistry.registerItem(wiring_red_copper, wiring_red_copper.getUnlocalizedName());
@ -5757,10 +5707,6 @@ public class ModItems {
GameRegistry.registerItem(tritium_deuterium_cake, tritium_deuterium_cake.getUnlocalizedName()); GameRegistry.registerItem(tritium_deuterium_cake, tritium_deuterium_cake.getUnlocalizedName());
GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName()); GameRegistry.registerItem(pellet_cluster, pellet_cluster.getUnlocalizedName());
GameRegistry.registerItem(pellet_buckshot, pellet_buckshot.getUnlocalizedName()); GameRegistry.registerItem(pellet_buckshot, pellet_buckshot.getUnlocalizedName());
GameRegistry.registerItem(pellet_flechette, pellet_flechette.getUnlocalizedName());
GameRegistry.registerItem(pellet_chlorophyte, pellet_chlorophyte.getUnlocalizedName());
GameRegistry.registerItem(pellet_canister, pellet_canister.getUnlocalizedName());
GameRegistry.registerItem(pellet_claws, pellet_claws.getUnlocalizedName());
GameRegistry.registerItem(pellet_charged, pellet_charged.getUnlocalizedName()); GameRegistry.registerItem(pellet_charged, pellet_charged.getUnlocalizedName());
GameRegistry.registerItem(pellet_gas, pellet_gas.getUnlocalizedName()); GameRegistry.registerItem(pellet_gas, pellet_gas.getUnlocalizedName());
GameRegistry.registerItem(magnetron, magnetron.getUnlocalizedName()); GameRegistry.registerItem(magnetron, magnetron.getUnlocalizedName());
@ -5785,6 +5731,9 @@ public class ModItems {
GameRegistry.registerItem(demon_core_open, demon_core_open.getUnlocalizedName()); GameRegistry.registerItem(demon_core_open, demon_core_open.getUnlocalizedName());
GameRegistry.registerItem(demon_core_closed, demon_core_closed.getUnlocalizedName()); GameRegistry.registerItem(demon_core_closed, demon_core_closed.getUnlocalizedName());
//PA
GameRegistry.registerItem(pa_coil, pa_coil.getUnlocalizedName());
//Particle Containers //Particle Containers
GameRegistry.registerItem(particle_empty, particle_empty.getUnlocalizedName()); GameRegistry.registerItem(particle_empty, particle_empty.getUnlocalizedName());
GameRegistry.registerItem(particle_hydrogen, particle_hydrogen.getUnlocalizedName()); GameRegistry.registerItem(particle_hydrogen, particle_hydrogen.getUnlocalizedName());
@ -6280,6 +6229,8 @@ public class ModItems {
GameRegistry.registerItem(containment_box, containment_box.getUnlocalizedName()); GameRegistry.registerItem(containment_box, containment_box.getUnlocalizedName());
GameRegistry.registerItem(plastic_bag, plastic_bag.getUnlocalizedName()); GameRegistry.registerItem(plastic_bag, plastic_bag.getUnlocalizedName());
GameRegistry.registerItem(casing_bag, casing_bag.getUnlocalizedName());
//Keys and Locks //Keys and Locks
GameRegistry.registerItem(key, key.getUnlocalizedName()); GameRegistry.registerItem(key, key.getUnlocalizedName());
GameRegistry.registerItem(key_red, key_red.getUnlocalizedName()); GameRegistry.registerItem(key_red, key_red.getUnlocalizedName());
@ -6544,6 +6495,8 @@ public class ModItems {
GameRegistry.registerItem(gun_hangman, gun_hangman.getUnlocalizedName()); GameRegistry.registerItem(gun_hangman, gun_hangman.getUnlocalizedName());
GameRegistry.registerItem(gun_bolter, gun_bolter.getUnlocalizedName()); GameRegistry.registerItem(gun_bolter, gun_bolter.getUnlocalizedName());
GameRegistry.registerItem(gun_folly, gun_folly.getUnlocalizedName()); GameRegistry.registerItem(gun_folly, gun_folly.getUnlocalizedName());
GameRegistry.registerItem(gun_aberrator, gun_aberrator.getUnlocalizedName());
GameRegistry.registerItem(gun_aberrator_eott, gun_aberrator_eott.getUnlocalizedName());
GameRegistry.registerItem(gun_double_barrel, gun_double_barrel.getUnlocalizedName()); GameRegistry.registerItem(gun_double_barrel, gun_double_barrel.getUnlocalizedName());
GameRegistry.registerItem(gun_double_barrel_sacred_dragon, gun_double_barrel_sacred_dragon.getUnlocalizedName()); GameRegistry.registerItem(gun_double_barrel_sacred_dragon, gun_double_barrel_sacred_dragon.getUnlocalizedName());

View File

@ -27,6 +27,6 @@ public class ItemModCladding extends ItemArmorMod {
@Override @Override
public void addDesc(List list, ItemStack stack, ItemStack armor) { 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)");
} }
} }

View File

@ -6,6 +6,7 @@ import com.hbm.inventory.FluidStack;
import com.hbm.inventory.fluid.FluidType; import com.hbm.inventory.fluid.FluidType;
import com.hbm.inventory.fluid.Fluids; import com.hbm.inventory.fluid.Fluids;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.util.BobMathUtil;
import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly; 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) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
if(stack.hasTagCompound()) { if(stack.hasTagCompound()) {
if(getQuantity(stack) > 0) list.add(getQuantity(stack) + "mB"); 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); Fluids.fromID(stack.getItemDamage()).addInfo(list);

View 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!");
}
}

View File

@ -134,26 +134,32 @@ public class ItemRBMKRod extends Item {
inFlux += selfRate; inFlux += selfRate;
double xenon = getPoison(stack); //if xenon poison is enabled
xenon -= xenonBurnFunc(inFlux); if(RBMKDials.getXenon(world)) {
double xenon = getPoison(stack);
xenon -= xenonBurnFunc(inFlux);
inFlux *= (1D - getPoisonLevel(stack)); inFlux *= (1D - getPoisonLevel(stack));
xenon += xenonGenFunc(inFlux); xenon += xenonGenFunc(inFlux);
if(xenon < 0D) xenon = 0D; if(xenon < 0D) xenon = 0D;
if(xenon > 100D) xenon = 100D; if(xenon > 100D) xenon = 100D;
setPoison(stack, xenon); setPoison(stack, xenon);
}
double outFlux = reactivityFunc(inFlux, getEnrichment(stack)) * RBMKDials.getReactivityMod(world); double outFlux = reactivityFunc(inFlux, getEnrichment(stack)) * RBMKDials.getReactivityMod(world);
double y = getYield(stack); //if depletion is enabled
y -= inFlux; if(RBMKDials.getDepletion(world)) {
double y = getYield(stack);
y -= inFlux;
if(y < 0D) y = 0D; if(y < 0D) y = 0D;
setYield(stack, y); setYield(stack, y);
}
double coreHeat = this.getCoreHeat(stack); double coreHeat = this.getCoreHeat(stack);
coreHeat += outFlux * heat; coreHeat += outFlux * heat;

View File

@ -129,7 +129,7 @@ public class ItemBedrockOreNew extends Item {
public static enum BedrockOreType { public static enum BedrockOreType {
// primary sulfuric solvent radsolvent // 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)), 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)), 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)), 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)),

View File

@ -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_uf6_tank, 2));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_puf6_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_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.reactor_research, 4));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_turbine, 4)); player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_turbine, 4));
player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_radgen, 1)); player.inventory.addItemStackToInventory(new ItemStack(ModBlocks.machine_radgen, 1));
@ -174,29 +173,6 @@ public class ItemStarterKit extends Item {
if(this == ModItems.nuke_electric_kit) 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_copper, 16));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_gold, 8)); player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_gold, 8));
player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_tungsten, 8)); player.inventory.addItemStackToInventory(new ItemStack(ModItems.coil_tungsten, 8));

View 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; }
}
}

View File

@ -31,7 +31,7 @@ public class ItemColtanCompass extends Item {
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
list.add("Points towards the coltan deposit."); list.add("Points towards the coltan deposit.");
list.add("The deposit is a large area where coltan ore spawns like standard ore,"); 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 @Override

View File

@ -10,7 +10,9 @@ import com.hbm.blocks.bomb.BlockDetonatable;
import com.hbm.entity.projectile.EntityBulletBaseMK4; import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.entity.projectile.EntityBulletBeamBase; import com.hbm.entity.projectile.EntityBulletBeamBase;
import com.hbm.interfaces.NotableComments; import com.hbm.interfaces.NotableComments;
import com.hbm.inventory.OreDictManager.DictFrame;
import com.hbm.inventory.RecipesCommon.ComparableStack; import com.hbm.inventory.RecipesCommon.ComparableStack;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.weapon.sedna.factory.ConfettiUtil; import com.hbm.items.weapon.sedna.factory.ConfettiUtil;
import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo; import com.hbm.items.weapon.sedna.factory.GunFactory.EnumAmmo;
@ -42,6 +44,8 @@ public class BulletConfig implements Cloneable {
public int id; public int id;
public ComparableStack ammo; public ComparableStack ammo;
public ItemStack casingItem;
public int casingAmount;
/** How much ammo is added to a standard mag when loading one item */ /** How much ammo is added to a standard mag when loading one item */
public int ammoReloadCount = 1; public int ammoReloadCount = 1;
public float velocity = 10F; 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(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(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 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 setReloadCount(int ammoReloadCount) { this.ammoReloadCount = ammoReloadCount; return this; }
public BulletConfig setVel(float velocity) { this.velocity = velocity; return this; } public BulletConfig setVel(float velocity) { this.velocity = velocity; return this; }
public BulletConfig setSpread(float spread) { this.spread = spread; return this; } public BulletConfig setSpread(float spread) { this.spread = spread; return this; }

View File

@ -22,7 +22,10 @@ public class Receiver {
public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE"; public static final String I_DELAYAFTERFIRE = "I_DELAYAFTERFIRE";
public static final String I_DELAYAFTERDRYFIRE = "I_DELAYAFTERDRYFIRE"; public static final String I_DELAYAFTERDRYFIRE = "I_DELAYAFTERDRYFIRE";
public static final String I_ROUNDSPERCYCLE = "I_ROUNDSPERCYCLE"; 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_REFIREONHOLD = "B_REFIREONHOLD";
public static final String B_REFIREAFTERDRY = "B_REFIREAFTERDRY"; public static final String B_REFIREAFTERDRY = "B_REFIREAFTERDRY";
public static final String B_DOESDRYFIRE = "B_DOESDRYFIRE"; public static final String B_DOESDRYFIRE = "B_DOESDRYFIRE";
@ -54,7 +57,10 @@ public class Receiver {
protected int delayAfterFire_DNA; protected int delayAfterFire_DNA;
protected int delayAfterDryFire_DNA; protected int delayAfterDryFire_DNA;
protected int roundsPerCycle_DNA = 1; 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 refireOnHold_DNA = false;
protected boolean refireAfterDry_DNA = false; protected boolean refireAfterDry_DNA = false;
protected boolean doesDryFire_DNA = true; 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 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 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 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 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 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); } 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 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 dry(int delay) { this.delayAfterDryFire_DNA = delay; return this; }
public Receiver rounds(int rounds) { this.roundsPerCycle_DNA = rounds; 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 auto(boolean auto) { this.refireOnHold_DNA = auto; return this; }
public Receiver autoAfterDry(boolean auto) { this.refireAfterDry_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; } public Receiver dryfire(boolean dryfire) { this.doesDryFire_DNA = dryfire; return this; }

View File

@ -65,6 +65,7 @@ public class GunFactory {
XFactoryFolly.init(); XFactoryFolly.init();
XFactoryTurret.init(); XFactoryTurret.init();
XFactory10ga.init(); XFactory10ga.init();
XFactory35800.init();
/// PROXY BULLSHIT /// /// PROXY BULLSHIT ///
MainRegistry.proxy.registerGunCfg(); MainRegistry.proxy.registerGunCfg();
@ -124,6 +125,7 @@ public class GunFactory {
public static enum EnumAmmoSecret { public static enum EnumAmmoSecret {
FOLLY_SM, FOLLY_NUKE, FOLLY_SM, FOLLY_NUKE,
M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN M44_EQUESTRIAN, G12_EQUESTRIAN, BMG50_EQUESTRIAN,
P35_800
} }
} }

View File

@ -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.XFactory12ga.*;
import static com.hbm.items.weapon.sedna.factory.XFactory22lr.*; 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.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.XFactory40mm.*;
import static com.hbm.items.weapon.sedna.factory.XFactory44.*; import static com.hbm.items.weapon.sedna.factory.XFactory44.*;
import static com.hbm.items.weapon.sedna.factory.XFactory50.*; 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_hangman, new ItemRenderHangman());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter, new ItemRenderBolter()); MinecraftForgeClient.registerItemRenderer(ModItems.gun_bolter, new ItemRenderBolter());
MinecraftForgeClient.registerItemRenderer(ModItems.gun_folly, new ItemRenderFolly()); 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, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_tex));
MinecraftForgeClient.registerItemRenderer(ModItems.gun_double_barrel_sacred_dragon, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_sacred_dragon_tex)); MinecraftForgeClient.registerItemRenderer(ModItems.gun_double_barrel_sacred_dragon, new ItemRenderDoubleBarrel(ResourceManager.double_barrel_sacred_dragon_tex));
//PROJECTILES //PROJECTILES
@ -190,6 +193,8 @@ public class GunFactoryClient {
folly_sm.setRendererBeam(LegoClient.RENDER_FOLLY); folly_sm.setRendererBeam(LegoClient.RENDER_FOLLY);
folly_nuke.setRenderer(LegoClient.RENDER_BIG_NUKE); 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 setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
//HUDS //HUDS
@ -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_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_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_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) .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); ((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_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, 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_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); } public static void setRendererBulk(BiConsumer<EntityBulletBaseMK4, Float> renderer, BulletConfig... configs) { for(BulletConfig config : configs) config.setRenderer(renderer); }

View File

@ -201,7 +201,7 @@ public class Lego {
int index = ctx.configIndex; int index = ctx.configIndex;
if(anim != null) ItemGunBaseNT.playAnimation(player, stack, anim, 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]; Receiver primary = ctx.config.getReceivers(stack)[0];
IMagazine mag = primary.getMagazine(stack); IMagazine mag = primary.getMagazine(stack);
BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory); BulletConfig config = (BulletConfig) mag.getType(stack, ctx.inventory);
@ -220,7 +220,7 @@ public class Lego {
for(int i = 0; i < projectiles; i++) { for(int i = 0; i < projectiles; i++) {
float damage = calcDamage(ctx, stack, primary, calcWear, index); 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) { if(config.pType == ProjectileType.BULLET) {
EntityBulletBaseMK4 mk4 = new EntityBulletBaseMK4(entity, config, damage, spread, sideOffset, heightOffset, forwardOffset); 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); 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) { public static float calcSpread(LambdaContext ctx, ItemStack stack, Receiver primary, BulletConfig config, boolean calcWear, int index, boolean aim) {
return primary.getGunSpread(stack) * aim + (calcWear ? getStandardWearSpread(stack, ctx.config, index) * 0.125F : 0F); //TODO: redo all this spread shit // the gun's innate spread, SMGs will have poor accuracy no matter what
/* float spreadInnate = primary.getInnateSpread(stack);
* spread should have multiple additive parts: // the ammo's spread (for example for buckshot) multiplied with the gun's ammo modifier (choke or sawed off barrel)
* - hipfire penalty (mitigated by aiming) float spreadAmmo = config.spread * primary.getAmmoSpread(stack);
* - innate gun inaccuracy (usually 0, increases with wear) // hipfire penalty, i.e. extra spread when not aiming
* - bullet inaccuray (usually 0, higher with buckshot) 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); } public static void standardExplode(EntityBulletBaseMK4 bullet, MovingObjectPosition mop, float range) { standardExplode(bullet, mop, range, 1F); }

View File

@ -328,6 +328,9 @@ public class LegoClient {
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_PURPLE = (bullet, interp) -> { public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_PURPLE = (bullet, interp) -> {
renderStandardLaser(bullet, interp, 0x60, 0x15, 0x80); 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) { public static void renderStandardLaser(EntityBulletBeamBase bullet, float interp, int r, int g, int b) {

View File

@ -3,6 +3,7 @@ package com.hbm.items.weapon.sedna.factory;
import java.util.function.BiConsumer; import java.util.function.BiConsumer;
import com.hbm.config.ClientConfig; import com.hbm.config.ClientConfig;
import com.hbm.items.ModItems;
import com.hbm.handler.threading.PacketThreading; import com.hbm.handler.threading.PacketThreading;
import com.hbm.items.weapon.sedna.ItemGunBaseNT; import com.hbm.items.weapon.sedna.ItemGunBaseNT;
import com.hbm.items.weapon.sedna.Receiver; import com.hbm.items.weapon.sedna.Receiver;
@ -771,26 +772,27 @@ public class Orchestras {
public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STINGER = (stack, ctx) -> { public static BiConsumer<ItemStack, LambdaContext> ORCHESTRA_STINGER = (stack, ctx) -> {
EntityLivingBase entity = ctx.entity; EntityLivingBase entity = ctx.entity;
if(entity.worldObj.isRemote) return;
AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex); AnimType type = ItemGunBaseNT.getLastAnim(stack, ctx.configIndex);
int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex); int timer = ItemGunBaseNT.getAnimTimer(stack, ctx.configIndex);
AudioWrapper runningAudio = ItemGunBaseNT.loopedSounds.get(entity); if(entity.worldObj.isRemote) {
if(ItemGunStinger.getLockonProgress(stack) > 0 && !ItemGunStinger.getIsLockedOn(stack)) { AudioWrapper runningAudio = ItemGunBaseNT.loopedSounds.get(entity);
//start sound if(ItemGunStinger.getLockonProgress(stack) > 0 && !ItemGunStinger.getIsLockedOn(stack)) {
if(runningAudio == null || !runningAudio.isPlaying()) { //start sound
AudioWrapper audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.fire.lockon", (float) entity.posX, (float) entity.posY, (float) entity.posZ, 1F, 15F, 1F, 10); if(runningAudio == null || !runningAudio.isPlaying()) {
ItemGunBaseNT.loopedSounds.put(entity, audio); AudioWrapper audio = MainRegistry.proxy.getLoopedSound("hbm:weapon.fire.lockon", (float) entity.posX, (float) entity.posY, (float) entity.posZ, 1F, 15F, 1F, 10);
audio.startSound(); 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) { if(type == AnimType.RELOAD) {
@ -1277,4 +1279,31 @@ public class Orchestras {
if(timer == 2) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 1F, 1F); 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);
}
};
} }

View File

@ -4,6 +4,7 @@ import java.util.function.BiConsumer;
import java.util.function.BiFunction; import java.util.function.BiFunction;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair; import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.items.weapon.sedna.GunConfig; import com.hbm.items.weapon.sedna.GunConfig;
@ -31,10 +32,10 @@ public class XFactory10ga {
public static void init() { 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 = 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).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_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).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_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).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_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() 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) .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() 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) .dura(6000).draw(10).inspect(39).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .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)) .mag(new MagazineFullReload(0, 2).addConfigs(g10, g10_shrapnel, g10_du, g10_slug))
.offset(0.75, -0.0625, -0.1875) .offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(LAMBDA_RECOIL_DOUBLE_BARREL)) .setupStandardFire().recoil(LAMBDA_RECOIL_DOUBLE_BARREL))

View File

@ -10,6 +10,7 @@ import com.hbm.entity.projectile.EntityBulletBaseMK4;
import com.hbm.entity.projectile.EntityDuchessGambit; import com.hbm.entity.projectile.EntityDuchessGambit;
import com.hbm.extprop.HbmLivingProps; import com.hbm.extprop.HbmLivingProps;
import com.hbm.items.ModItems; import com.hbm.items.ModItems;
import com.hbm.items.ItemEnums.EnumCasingType;
import com.hbm.items.weapon.sedna.BulletConfig; import com.hbm.items.weapon.sedna.BulletConfig;
import com.hbm.items.weapon.sedna.Crosshair; import com.hbm.items.weapon.sedna.Crosshair;
import com.hbm.items.weapon.sedna.GunConfig; import com.hbm.items.weapon.sedna.GunConfig;
@ -255,15 +256,15 @@ public class XFactory12ga {
public static void init() { public static void init() {
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setBlackPowder(true).setProjectiles(8).setDamage(0.75F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP")); g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setProjectiles(8).setDamage(0.75F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setBlackPowder(true).setProjectiles(4).setDamage(0.75F/4F).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM")); g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setProjectiles(4).setDamage(0.75F/4F).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setBlackPowder(true).setDamage(0.75F).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG")); g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setDamage(0.75F).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG"));
g12 = new BulletConfig().setItem(EnumAmmo.G12).setProjectiles(8).setDamage(1F/8F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(2F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA")); g12 = new BulletConfig().setItem(EnumAmmo.G12).setCasing(EnumCasingType.BUCKSHOT, 6).setProjectiles(8).setDamage(1F/8F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(2F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
g12_slug = new BulletConfig().setItem(EnumAmmo.G12_SLUG).setHeadshot(1.5F).setSpread(0.0F).setRicochetAngle(25).setThresholdNegation(4F).setArmorPiercing(0.15F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x393939, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_SLUG")); g12_slug = new BulletConfig().setItem(EnumAmmo.G12_SLUG).setCasing(EnumCasingType.BUCKSHOT, 6).setHeadshot(1.5F).setSpread(0.0F).setRicochetAngle(25).setThresholdNegation(4F).setArmorPiercing(0.15F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x393939, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_SLUG"));
g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setProjectiles(8).setDamage(1F/8F).setThresholdNegation(5F).setThresholdNegation(3F).setArmorPiercing(0.2F).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE")); g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setCasing(EnumCasingType.BUCKSHOT, 6).setProjectiles(8).setDamage(1F/8F).setThresholdNegation(5F).setThresholdNegation(3F).setArmorPiercing(0.2F).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE"));
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setProjectiles(4).setDamage(2F/4F).setSpread(0.015F).setRicochetAngle(15).setThresholdNegation(4F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM")); g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setProjectiles(4).setDamage(2F/4F).setSpread(0.015F).setRicochetAngle(15).setThresholdNegation(4F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setDamage(2.5F).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE")); g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setDamage(2.5F).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE"));
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS")) g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"))
.setOnImpact((bullet, mop) -> { if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase) { HbmLivingProps data = HbmLivingProps.getData((EntityLivingBase) mop.entityHit); if(data.phosphorus < 300) data.phosphorus = 300; } }); .setOnImpact((bullet, mop) -> { if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase) { HbmLivingProps data = HbmLivingProps.getData((EntityLivingBase) mop.entityHit); if(data.phosphorus < 300) data.phosphorus = 300; } });
//g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX")); //g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX"));
g12_equestrian_bj = new BulletConfig().setItem(EnumAmmoSecret.G12_EQUESTRIAN).setDamage(0F).setOnImpact(LAMBDA_BOAT).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_EQUESTRIAN, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12gaEquestrianBJ")); g12_equestrian_bj = new BulletConfig().setItem(EnumAmmoSecret.G12_EQUESTRIAN).setDamage(0F).setOnImpact(LAMBDA_BOAT).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_EQUESTRIAN, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12gaEquestrianBJ"));
@ -297,7 +298,7 @@ public class XFactory12ga {
ModItems.gun_maresleg_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE, ModItems.gun_maresleg_akimbo = new ItemGunBaseNT(WeaponQuality.B_SIDE,
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE) new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(16F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F) .dmg(16F).spreadHipfire(0F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(all)) .mag(new MagazineSingleReload(0, 6).addConfigs(all))
.offset(0.75, -0.0625, 0.1875D) .offset(0.75, -0.0625, 0.1875D)
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG)) .setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
@ -306,7 +307,7 @@ public class XFactory12ga {
.anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO), .anim(LAMBDA_MARESLEG_SHORT_ANIMS).orchestra(Orchestras.ORCHESTRA_MARESLEG_AKIMBO),
new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE) new GunConfig().dura(600).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(16F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F) .dmg(16F).spreadHipfire(0F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(1, 6).addConfigs(all)) .mag(new MagazineSingleReload(1, 6).addConfigs(all))
.offset(0.75, -0.0625, -0.1875) .offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG)) .setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))
@ -317,7 +318,7 @@ public class XFactory12ga {
ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig() ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
.dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE) .dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(32F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F) .dmg(32F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_equestrian_tkr, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus)) .mag(new MagazineSingleReload(0, 6).addConfigs(g12_equestrian_tkr, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus))
.offset(0.75, -0.0625, -0.1875) .offset(0.75, -0.0625, -0.1875)
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(LAMBDA_RECOIL_MARESLEG)) .canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(LAMBDA_RECOIL_MARESLEG))
@ -339,7 +340,7 @@ public class XFactory12ga {
ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig() ModItems.gun_spas12 = new ItemGunBaseNT(WeaponQuality.A_SIDE, new GunConfig()
.dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE) .dura(600).draw(20).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
.rec(new Receiver(0) .rec(new Receiver(0)
.dmg(32F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F) .dmg(32F).spreadHipfire(0F).delay(20).reload(5, 10, 10, 10, 0).jam(36).sound("hbm:weapon.shotgunShoot", 1.0F, 1.0F)
.mag(new MagazineSingleReload(0, 8).addConfigs(all)) .mag(new MagazineSingleReload(0, 8).addConfigs(all))
.offset(0.75, -0.0625, -0.1875) .offset(0.75, -0.0625, -0.1875)
.setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG)) .setupStandardFire().recoil(LAMBDA_RECOIL_MARESLEG))

Some files were not shown because too many files have changed in this diff Show More