mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-02-24 15:00:48 +00:00
Merge remote-tracking branch 'HbmMods/master'
This commit is contained in:
commit
b8132a2ac6
@ -20,7 +20,7 @@ archivesBaseName = "HBM-NTM"
|
|||||||
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
sourceCompatibility = targetCompatibility = compileJava.sourceCompatibility = compileJava.targetCompatibility = '1.8'
|
||||||
|
|
||||||
minecraft {
|
minecraft {
|
||||||
version = "1.7.10-10.13.4.1558-1.7.10"
|
version = "1.7.10-10.13.4.1614-1.7.10"
|
||||||
runDir = "eclipse"
|
runDir = "eclipse"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
package api.hbm.energy;
|
package api.hbm.energy;
|
||||||
|
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* For compatible cables with no buffer, using the IPowertNet. You can make your own cables with IEnergyConnector as well, but they won't join their power network.
|
* For compatible cables with no buffer, using the IPowertNet. You can make your own cables with IEnergyConnector as well, but they won't join their power network.
|
||||||
* @author hbm
|
* @author hbm
|
||||||
@ -9,4 +11,20 @@ public interface IEnergyConductor extends IEnergyConnector {
|
|||||||
public IPowerNet getPowerNet();
|
public IPowerNet getPowerNet();
|
||||||
|
|
||||||
public void setPowerNet(IPowerNet network);
|
public void setPowerNet(IPowerNet network);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* A unique identifier for every conductor tile. Used to prevent duplicates when loading previously persistent unloaded tiles.
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public default int getIdentity() {
|
||||||
|
|
||||||
|
TileEntity te = (TileEntity) this;
|
||||||
|
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + te.xCoord;
|
||||||
|
result = prime * result + te.yCoord;
|
||||||
|
result = prime * result + te.zCoord;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -17,7 +17,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
|||||||
public interface IEnergyConnector {
|
public interface IEnergyConnector {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the amount of power that was added
|
* Returns the amount of power that remains in the source after transfer
|
||||||
* @param power
|
* @param power
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -20,6 +20,14 @@ public interface IPowerNet {
|
|||||||
|
|
||||||
public void destroy();
|
public void destroy();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* When a link is removed, instead of destroying the network, causing it to be recreated from currently loaded conductors,
|
||||||
|
* we re-evaluate it, creating new nets based on the previous links.
|
||||||
|
*
|
||||||
|
* NYI
|
||||||
|
*/
|
||||||
|
public void reevaluate();
|
||||||
|
|
||||||
public boolean isValid();
|
public boolean isValid();
|
||||||
|
|
||||||
public List<IEnergyConductor> getLinks();
|
public List<IEnergyConductor> getLinks();
|
||||||
|
|||||||
@ -105,19 +105,24 @@ public class PowerNet implements IPowerNet {
|
|||||||
if(this.subscribers.isEmpty())
|
if(this.subscribers.isEmpty())
|
||||||
return power;
|
return power;
|
||||||
|
|
||||||
|
List<IEnergyConnector> subList = new ArrayList(subscribers);
|
||||||
|
|
||||||
List<Long> weight = new ArrayList();
|
List<Long> weight = new ArrayList();
|
||||||
long totalReq = 0;
|
long totalReq = 0;
|
||||||
|
|
||||||
for(IEnergyConnector con : this.subscribers) {
|
for(IEnergyConnector con : subList) {
|
||||||
long req = con.getTransferWeight();
|
long req = con.getTransferWeight();
|
||||||
weight.add(req);
|
weight.add(req);
|
||||||
totalReq += req;
|
totalReq += req;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(totalReq == 0)
|
||||||
|
return power;
|
||||||
|
|
||||||
long totalGiven = 0;
|
long totalGiven = 0;
|
||||||
|
|
||||||
for(int i = 0; i < this.subscribers.size(); i++) {
|
for(int i = 0; i < subList.size(); i++) {
|
||||||
IEnergyConnector con = this.subscribers.get(i);
|
IEnergyConnector con = subList.get(i);
|
||||||
long req = weight.get(i);
|
long req = weight.get(i);
|
||||||
double fraction = (double)req / (double)totalReq;
|
double fraction = (double)req / (double)totalReq;
|
||||||
|
|
||||||
@ -128,4 +133,7 @@ public class PowerNet implements IPowerNet {
|
|||||||
|
|
||||||
return power - totalGiven;
|
return power - totalGiven;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reevaluate() { }
|
||||||
}
|
}
|
||||||
|
|||||||
10
src/main/java/api/hbm/fluid/IFluidConductor.java
Normal file
10
src/main/java/api/hbm/fluid/IFluidConductor.java
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
package api.hbm.fluid;
|
||||||
|
|
||||||
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
|
|
||||||
|
public interface IFluidConductor {
|
||||||
|
|
||||||
|
public IPipeNet getPipeNet(FluidType type);
|
||||||
|
|
||||||
|
public void setPipeNet(FluidType type, FluidType network);
|
||||||
|
}
|
||||||
31
src/main/java/api/hbm/fluid/IFluidConnector.java
Normal file
31
src/main/java/api/hbm/fluid/IFluidConnector.java
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
package api.hbm.fluid;
|
||||||
|
|
||||||
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
|
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public interface IFluidConnector {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the amount of fluid that remains
|
||||||
|
* @param power
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int transferFluid(FluidType type, int fluid);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Whether the given side can be connected to
|
||||||
|
* @param dir
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public default boolean canConnect(ForgeDirection dir) {
|
||||||
|
return dir != ForgeDirection.UNKNOWN;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns the amount of fluid that this machine is able to receive
|
||||||
|
* @param type
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int getDemand(FluidType type);
|
||||||
|
}
|
||||||
8
src/main/java/api/hbm/fluid/IPipeNet.java
Normal file
8
src/main/java/api/hbm/fluid/IPipeNet.java
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
package api.hbm.fluid;
|
||||||
|
|
||||||
|
import api.hbm.energy.IPowerNet;
|
||||||
|
|
||||||
|
public interface IPipeNet {
|
||||||
|
|
||||||
|
public void joinNetworks(IPowerNet network);
|
||||||
|
}
|
||||||
@ -1,7 +1,15 @@
|
|||||||
package com.hbm.blocks;
|
package com.hbm.blocks;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.gui.Gui;
|
||||||
|
import net.minecraft.client.gui.ScaledResolution;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent;
|
||||||
|
|
||||||
@ -9,4 +17,40 @@ public interface ILookOverlay {
|
|||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z);
|
public void printHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z);
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public static void printGeneric(RenderGameOverlayEvent.Pre event, String title, int titleCol, int bgCol, List<String> text) {
|
||||||
|
|
||||||
|
Minecraft mc = Minecraft.getMinecraft();
|
||||||
|
ScaledResolution resolution = event.resolution;
|
||||||
|
|
||||||
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
|
int pX = resolution.getScaledWidth() / 2 + 8;
|
||||||
|
int pZ = resolution.getScaledHeight() / 2;
|
||||||
|
|
||||||
|
List<String> exceptions = new ArrayList();
|
||||||
|
exceptions.add("x");
|
||||||
|
exceptions.add("y");
|
||||||
|
exceptions.add("z");
|
||||||
|
exceptions.add("items");
|
||||||
|
exceptions.add("id");
|
||||||
|
|
||||||
|
mc.fontRenderer.drawString(title, pX + 1, pZ - 9, bgCol);
|
||||||
|
mc.fontRenderer.drawString(title, pX, pZ - 10, titleCol);
|
||||||
|
|
||||||
|
for(String line : text) {
|
||||||
|
|
||||||
|
if(exceptions.contains(line))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
mc.fontRenderer.drawStringWithShadow(line, pX, pZ, 0xFFFFFF);
|
||||||
|
pZ += 10;
|
||||||
|
}
|
||||||
|
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
|
||||||
|
GL11.glPopMatrix();
|
||||||
|
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,6 +52,8 @@ public class ModBlocks {
|
|||||||
public static Block test_conductor;
|
public static Block test_conductor;
|
||||||
public static Block test_ct;
|
public static Block test_ct;
|
||||||
public static Block test_rail;
|
public static Block test_rail;
|
||||||
|
public static Block test_bb_bork;
|
||||||
|
public static Block test_bb_inf;
|
||||||
|
|
||||||
public static Block ore_uranium;
|
public static Block ore_uranium;
|
||||||
public static Block ore_uranium_scorched;
|
public static Block ore_uranium_scorched;
|
||||||
@ -493,6 +495,8 @@ public class ModBlocks {
|
|||||||
public static Block fireworks;
|
public static Block fireworks;
|
||||||
public static Block dynamite;
|
public static Block dynamite;
|
||||||
public static Block tnt;
|
public static Block tnt;
|
||||||
|
public static Block semtex;
|
||||||
|
public static Block c4;
|
||||||
|
|
||||||
public static Block charge_dynamite;
|
public static Block charge_dynamite;
|
||||||
public static Block charge_miner;
|
public static Block charge_miner;
|
||||||
@ -712,6 +716,7 @@ public class ModBlocks {
|
|||||||
public static Block substation;
|
public static Block substation;
|
||||||
public static Block cable_switch;
|
public static Block cable_switch;
|
||||||
public static Block cable_detector;
|
public static Block cable_detector;
|
||||||
|
public static Block cable_diode;
|
||||||
public static Block machine_detector;
|
public static Block machine_detector;
|
||||||
public static Block rf_cable;
|
public static Block rf_cable;
|
||||||
public static Block oil_duct_solid;
|
public static Block oil_duct_solid;
|
||||||
@ -940,6 +945,7 @@ public class ModBlocks {
|
|||||||
|
|
||||||
public static Block machine_chemplant;
|
public static Block machine_chemplant;
|
||||||
public static final int guiID_machine_chemplant = 49;
|
public static final int guiID_machine_chemplant = 49;
|
||||||
|
public static Block machine_chemfac;
|
||||||
|
|
||||||
public static Block machine_fluidtank;
|
public static Block machine_fluidtank;
|
||||||
public static final int guiID_machine_fluidtank = 50;
|
public static final int guiID_machine_fluidtank = 50;
|
||||||
@ -1248,6 +1254,8 @@ public class ModBlocks {
|
|||||||
test_conductor = new TestConductor(Material.iron).setBlockName("test_conductor").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cable_neo");
|
test_conductor = new TestConductor(Material.iron).setBlockName("test_conductor").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cable_neo");
|
||||||
test_ct = new TestCT(Material.iron).setBlockName("test_ct").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_ct");
|
test_ct = new TestCT(Material.iron).setBlockName("test_ct").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_ct");
|
||||||
test_rail = new TestRail(Material.iron).setBlockName("test_rail").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_rail");
|
test_rail = new TestRail(Material.iron).setBlockName("test_rail").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_rail");
|
||||||
|
test_bb_bork = new TestBB(Material.iron).setBlockName("test_bb_bork").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_bb_bork");
|
||||||
|
test_bb_inf = new TestBB(Material.iron).setBlockName("test_bb_inf").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_bb_inf");
|
||||||
|
|
||||||
ore_uranium = new BlockOutgas(Material.rock, true, 5, true).setBlockName("ore_uranium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_uranium");
|
ore_uranium = new BlockOutgas(Material.rock, true, 5, true).setBlockName("ore_uranium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_uranium");
|
||||||
ore_uranium_scorched = new BlockOutgas(Material.rock, true, 5, true).setBlockName("ore_uranium_scorched").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_uranium_scorched");
|
ore_uranium_scorched = new BlockOutgas(Material.rock, true, 5, true).setBlockName("ore_uranium_scorched").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":ore_uranium_scorched");
|
||||||
@ -1447,8 +1455,8 @@ public class ModBlocks {
|
|||||||
block_ra226 = new BlockHazard().makeBeaconable().setBlockName("block_ra226").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_ra226");
|
block_ra226 = new BlockHazard().makeBeaconable().setBlockName("block_ra226").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_ra226");
|
||||||
block_actinium = new BlockHazard().makeBeaconable().setBlockName("block_actinium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_actinium");
|
block_actinium = new BlockHazard().makeBeaconable().setBlockName("block_actinium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_actinium");
|
||||||
block_tritium = new BlockRotatablePillar(Material.glass, RefStrings.MODID + ":block_tritium_top").setBlockName("block_tritium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGlass).setHardness(3.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_tritium_side");
|
block_tritium = new BlockRotatablePillar(Material.glass, RefStrings.MODID + ":block_tritium_top").setBlockName("block_tritium").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeGlass).setHardness(3.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_tritium_side");
|
||||||
block_semtex = new BlockSemtex(Material.tnt).setBlockName("block_semtex").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_semtex");
|
block_semtex = new BlockPlasticExplosive(Material.tnt).setBlockName("block_semtex").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_semtex");
|
||||||
block_c4 = new BlockSemtex(Material.tnt).setBlockName("block_c4").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_c4");
|
block_c4 = new BlockPlasticExplosive(Material.tnt).setBlockName("block_c4").setCreativeTab(MainRegistry.blockTab).setStepSound(Block.soundTypeMetal).setHardness(2.0F).setResistance(2.0F).setBlockTextureName(RefStrings.MODID + ":block_c4");
|
||||||
block_smore = new BlockPillar(Material.rock, RefStrings.MODID + ":block_smore_top").setBlockName("block_smore").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_smore_side");
|
block_smore = new BlockPillar(Material.rock, RefStrings.MODID + ":block_smore_top").setBlockName("block_smore").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":block_smore_side");
|
||||||
|
|
||||||
block_australium = new BlockBeaconable(Material.iron).setBlockName("block_australium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_australium");
|
block_australium = new BlockBeaconable(Material.iron).setBlockName("block_australium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":block_australium");
|
||||||
@ -1718,6 +1726,8 @@ public class ModBlocks {
|
|||||||
mine_fat = new Landmine(Material.iron).setBlockName("mine_fat").setCreativeTab(MainRegistry.nukeTab).setHardness(1.0F).setBlockTextureName(RefStrings.MODID + ":mine_fat");
|
mine_fat = new Landmine(Material.iron).setBlockName("mine_fat").setCreativeTab(MainRegistry.nukeTab).setHardness(1.0F).setBlockTextureName(RefStrings.MODID + ":mine_fat");
|
||||||
dynamite = new BlockDynamite().setBlockName("dynamite").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":dynamite");
|
dynamite = new BlockDynamite().setBlockName("dynamite").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":dynamite");
|
||||||
tnt = new BlockTNT().setBlockName("tnt_ntm").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":tnt");
|
tnt = new BlockTNT().setBlockName("tnt_ntm").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":tnt");
|
||||||
|
semtex = new BlockSemtex().setBlockName("semtex").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":semtex");
|
||||||
|
c4 = new BlockC4().setBlockName("c4").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.nukeTab).setHardness(0.0F).setBlockTextureName(RefStrings.MODID + ":c4");
|
||||||
|
|
||||||
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
machine_difurnace_off = new MachineDiFurnace(false).setBlockName("machine_difurnace_off").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
machine_difurnace_on = new MachineDiFurnace(true).setBlockName("machine_difurnace_on").setHardness(5.0F).setLightLevel(1.0F).setResistance(10.0F);
|
||||||
@ -1824,6 +1834,7 @@ public class ModBlocks {
|
|||||||
substation = new Substation(Material.iron).setBlockName("substation").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":substation");
|
substation = new Substation(Material.iron).setBlockName("substation").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":substation");
|
||||||
cable_switch = new CableSwitch(Material.iron).setBlockName("cable_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
cable_switch = new CableSwitch(Material.iron).setBlockName("cable_switch").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
cable_detector = new CableDetector(Material.iron).setBlockName("cable_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
cable_detector = new CableDetector(Material.iron).setBlockName("cable_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab);
|
||||||
|
cable_diode = new CableDiode(Material.iron).setBlockName("cable_diode").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_diode");
|
||||||
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
|
machine_detector = new PowerDetector(Material.iron).setBlockName("machine_detector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_detector_off");
|
||||||
oil_duct_solid = new OilDuctSolid(Material.iron).setBlockName("oil_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":oil_duct_solid_alt");
|
oil_duct_solid = new OilDuctSolid(Material.iron).setBlockName("oil_duct_solid").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":oil_duct_solid_alt");
|
||||||
oil_duct = new BlockOilDuct(Material.iron).setBlockName("oil_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":oil_duct_icon_alt");
|
oil_duct = new BlockOilDuct(Material.iron).setBlockName("oil_duct").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":oil_duct_icon_alt");
|
||||||
@ -2060,9 +2071,10 @@ public class ModBlocks {
|
|||||||
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
|
drill_pipe = new BlockNoDrop(Material.iron).setBlockName("drill_pipe").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":drill_pipe");
|
||||||
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
|
machine_mining_laser = new MachineMiningLaser(Material.iron).setBlockName("machine_mining_laser").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_mining_laser");
|
||||||
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
|
barricade = new BlockNoDrop(Material.sand).setBlockName("barricade").setHardness(1.0F).setResistance(2.5F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":barricade");
|
||||||
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
|
machine_assembler = new MachineAssembler(Material.iron).setBlockName("machine_assembler").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_assembler");
|
||||||
machine_chemplant = new MachineChemplant(Material.iron).setBlockName("machine_chemplant").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chemplant");
|
machine_chemplant = new MachineChemplant(Material.iron).setBlockName("machine_chemplant").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_chemplant");
|
||||||
machine_fluidtank = new MachineFluidTank(Material.iron).setBlockName("machine_fluidtank").setHardness(5.0F).setResistance(100.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fluidtank");
|
machine_chemfac = new MachineChemfac(Material.iron).setBlockName("machine_chemfac").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||||
|
machine_fluidtank = new MachineFluidTank(Material.iron).setBlockName("machine_fluidtank").setHardness(5.0F).setResistance(30.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_fluidtank");
|
||||||
machine_bat9000 = new MachineBigAssTank9000(Material.iron).setBlockName("machine_bat9000").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
machine_bat9000 = new MachineBigAssTank9000(Material.iron).setBlockName("machine_bat9000").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||||
machine_orbus = new MachineOrbus(Material.iron).setBlockName("machine_orbus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
machine_orbus = new MachineOrbus(Material.iron).setBlockName("machine_orbus").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":block_steel");
|
||||||
machine_turbofan = new MachineTurbofan(Material.iron).setBlockName("machine_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbofan");
|
machine_turbofan = new MachineTurbofan(Material.iron).setBlockName("machine_turbofan").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":machine_turbofan");
|
||||||
@ -2250,6 +2262,8 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(test_conductor, test_conductor.getUnlocalizedName());
|
GameRegistry.registerBlock(test_conductor, test_conductor.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(test_ct, test_ct.getUnlocalizedName());
|
GameRegistry.registerBlock(test_ct, test_ct.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(test_rail, test_rail.getUnlocalizedName());
|
GameRegistry.registerBlock(test_rail, test_rail.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(test_bb_bork, test_bb_bork.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(test_bb_inf, test_bb_inf.getUnlocalizedName());
|
||||||
|
|
||||||
//Ores
|
//Ores
|
||||||
GameRegistry.registerBlock(ore_uranium, ore_uranium.getUnlocalizedName());
|
GameRegistry.registerBlock(ore_uranium, ore_uranium.getUnlocalizedName());
|
||||||
@ -2693,6 +2707,8 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(fireworks, fireworks.getUnlocalizedName());
|
GameRegistry.registerBlock(fireworks, fireworks.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(dynamite, dynamite.getUnlocalizedName());
|
GameRegistry.registerBlock(dynamite, dynamite.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(tnt, tnt.getUnlocalizedName());
|
GameRegistry.registerBlock(tnt, tnt.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(semtex, semtex.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(c4, c4.getUnlocalizedName());
|
||||||
|
|
||||||
//Turrets
|
//Turrets
|
||||||
GameRegistry.registerBlock(turret_light, turret_light.getUnlocalizedName());
|
GameRegistry.registerBlock(turret_light, turret_light.getUnlocalizedName());
|
||||||
@ -2921,6 +2937,7 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(substation, ItemBlockBase.class, substation.getUnlocalizedName());
|
GameRegistry.registerBlock(substation, ItemBlockBase.class, substation.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(cable_switch, cable_switch.getUnlocalizedName());
|
GameRegistry.registerBlock(cable_switch, cable_switch.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(cable_detector, cable_detector.getUnlocalizedName());
|
GameRegistry.registerBlock(cable_detector, cable_detector.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(cable_diode, cable_diode.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(rf_cable, rf_cable.getUnlocalizedName());
|
GameRegistry.registerBlock(rf_cable, rf_cable.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(oil_duct, oil_duct.getUnlocalizedName());
|
GameRegistry.registerBlock(oil_duct, oil_duct.getUnlocalizedName());
|
||||||
@ -2968,6 +2985,7 @@ public class ModBlocks {
|
|||||||
GameRegistry.registerBlock(machine_microwave, machine_microwave.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_microwave, machine_microwave.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_assembler, machine_assembler.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_assembler, machine_assembler.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_chemplant, machine_chemplant.getUnlocalizedName());
|
||||||
|
GameRegistry.registerBlock(machine_chemfac, machine_chemfac.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_fluidtank, machine_fluidtank.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_fluidtank, machine_fluidtank.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_bat9000, machine_bat9000.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_bat9000, machine_bat9000.getUnlocalizedName());
|
||||||
GameRegistry.registerBlock(machine_orbus, machine_orbus.getUnlocalizedName());
|
GameRegistry.registerBlock(machine_orbus, machine_orbus.getUnlocalizedName());
|
||||||
|
|||||||
13
src/main/java/com/hbm/blocks/bomb/BlockC4.java
Normal file
13
src/main/java/com/hbm/blocks/bomb/BlockC4.java
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package com.hbm.blocks.bomb;
|
||||||
|
|
||||||
|
import com.hbm.entity.item.EntityTNTPrimedBase;
|
||||||
|
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BlockC4 extends BlockTNTBase {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void explodeEntity(World world, double x, double y, double z, EntityTNTPrimedBase entity) {
|
||||||
|
world.createExplosion(entity, x, y, z, 26F, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -80,7 +80,7 @@ public abstract class BlockChargeBase extends BlockContainerBase implements IBom
|
|||||||
|
|
||||||
if(!world.isSideSolid(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir)) {
|
if(!world.isSideSolid(x - dir.offsetX, y - dir.offsetY, z - dir.offsetZ, dir)) {
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
this.explode(world, x, y, z);
|
//this.explode(world, x, y, z);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,15 @@
|
|||||||
package com.hbm.blocks.bomb;
|
package com.hbm.blocks.bomb;
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
import java.util.List;
|
||||||
import com.hbm.explosion.ExplosionNT;
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||||
|
|
||||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockChargeC4 extends BlockChargeBase {
|
public class BlockChargeC4 extends BlockChargeBase {
|
||||||
@ -15,9 +21,11 @@ public class BlockChargeC4 extends BlockChargeBase {
|
|||||||
safe = true;
|
safe = true;
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
safe = false;
|
safe = false;
|
||||||
ExplosionNT exp = new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 4F);
|
|
||||||
exp.explode();
|
ExplosionVNT xnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 15F).makeStandard();
|
||||||
ExplosionLarge.spawnParticles(world, x + 0.5, y + 0.5, z + 0.5, 20);
|
xnt.setBlockAllocator(new BlockAllocatorStandard(32));
|
||||||
|
xnt.setBlockProcessor(new BlockProcessorStandard().setNoDrop());
|
||||||
|
xnt.explode();
|
||||||
|
|
||||||
return BombReturnCode.DETONATED;
|
return BombReturnCode.DETONATED;
|
||||||
}
|
}
|
||||||
@ -31,4 +39,10 @@ public class BlockChargeC4 extends BlockChargeBase {
|
|||||||
public int getRenderType() {
|
public int getRenderType() {
|
||||||
return renderID;
|
return renderID;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
super.addInformation(stack, player, list, ext);
|
||||||
|
list.add(EnumChatFormatting.BLUE + "Does not drop blocks.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,15 @@
|
|||||||
package com.hbm.blocks.bomb;
|
package com.hbm.blocks.bomb;
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
import java.util.List;
|
||||||
import com.hbm.explosion.ExplosionNT;
|
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockChargeSemtex extends BlockChargeBase {
|
public class BlockChargeSemtex extends BlockChargeBase {
|
||||||
@ -14,9 +21,14 @@ public class BlockChargeSemtex extends BlockChargeBase {
|
|||||||
safe = true;
|
safe = true;
|
||||||
world.setBlockToAir(x, y, z);
|
world.setBlockToAir(x, y, z);
|
||||||
safe = false;
|
safe = false;
|
||||||
ExplosionNT exp = new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 4F);
|
|
||||||
exp.explode();
|
ExplosionVNT xnt = new ExplosionVNT(world, x + 0.5, y + 0.5, z + 0.5, 10F);
|
||||||
ExplosionLarge.spawnParticles(world, x + 0.5, y + 0.5, z + 0.5, 20);
|
xnt.setBlockAllocator(new BlockAllocatorStandard(32));
|
||||||
|
xnt.setBlockProcessor(new BlockProcessorStandard()
|
||||||
|
.setAllDrop()
|
||||||
|
.setFortune(3));
|
||||||
|
xnt.setSFX(new ExplosionEffectStandard());
|
||||||
|
xnt.explode();
|
||||||
|
|
||||||
return BombReturnCode.DETONATED;
|
return BombReturnCode.DETONATED;
|
||||||
}
|
}
|
||||||
@ -26,6 +38,15 @@ public class BlockChargeSemtex extends BlockChargeBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getRenderType() {
|
public int getRenderType() {
|
||||||
return BlockChargeDynamite.renderID;
|
return BlockChargeC4.renderID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
super.addInformation(stack, player, list, ext);
|
||||||
|
list.add(EnumChatFormatting.BLUE + "Will drop all blocks.");
|
||||||
|
list.add(EnumChatFormatting.BLUE + "Does not do damage.");
|
||||||
|
list.add(EnumChatFormatting.BLUE + "");
|
||||||
|
list.add(EnumChatFormatting.LIGHT_PURPLE + "Fortune III");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
92
src/main/java/com/hbm/blocks/bomb/BlockPlasticExplosive.java
Normal file
92
src/main/java/com/hbm/blocks/bomb/BlockPlasticExplosive.java
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
package com.hbm.blocks.bomb;
|
||||||
|
|
||||||
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
|
import com.hbm.explosion.ExplosionNT;
|
||||||
|
import com.hbm.interfaces.IBomb;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.IIcon;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.Explosion;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public class BlockPlasticExplosive extends Block implements IBomb {
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
private IIcon topIcon;
|
||||||
|
|
||||||
|
public BlockPlasticExplosive(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
||||||
|
this.blockIcon = p_149651_1_.registerIcon(this.getTextureName());
|
||||||
|
this.topIcon = p_149651_1_.registerIcon(this.getTextureName() + "_front");
|
||||||
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public IIcon getIcon(int side, int meta) {
|
||||||
|
int k = getPistonOrientation(meta);
|
||||||
|
return ForgeDirection.getOrientation(k).getOpposite().ordinal() == side ? this.topIcon : this.blockIcon;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int getPistonOrientation(int meta) {
|
||||||
|
return meta & 7;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
||||||
|
int l = determineOrientation(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_);
|
||||||
|
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, l, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int determineOrientation(World world, int x, int y, int z, EntityLivingBase player) {
|
||||||
|
|
||||||
|
if(MathHelper.abs((float) player.posX - (float) x) < 2.0F && MathHelper.abs((float) player.posZ - (float) z) < 2.0F) {
|
||||||
|
double d0 = player.posY + 1.82D - (double) player.yOffset;
|
||||||
|
|
||||||
|
if(d0 - (double) y > 2.0D) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if((double) y - d0 > 0.0D) {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
||||||
|
|
||||||
|
return l == 0 ? 3 : (l == 1 ? 4 : (l == 2 ? 2 : (l == 3 ? 5 : 1)));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) {
|
||||||
|
this.explode(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) {
|
||||||
|
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
||||||
|
this.explode(world, x, y, z);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BombReturnCode explode(World world, int x, int y, int z) {
|
||||||
|
|
||||||
|
if(!world.isRemote) {
|
||||||
|
new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 50).overrideResolution(64).explode();
|
||||||
|
ExplosionLarge.spawnParticles(world, x, y, z, ExplosionLarge.cloudFunction(15));
|
||||||
|
}
|
||||||
|
|
||||||
|
return BombReturnCode.DETONATED;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,92 +1,13 @@
|
|||||||
package com.hbm.blocks.bomb;
|
package com.hbm.blocks.bomb;
|
||||||
|
|
||||||
import com.hbm.explosion.ExplosionLarge;
|
import com.hbm.entity.item.EntityTNTPrimedBase;
|
||||||
import com.hbm.explosion.ExplosionNT;
|
|
||||||
import com.hbm.interfaces.IBomb;
|
|
||||||
|
|
||||||
import cpw.mods.fml.relauncher.Side;
|
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.item.ItemStack;
|
|
||||||
import net.minecraft.util.IIcon;
|
|
||||||
import net.minecraft.util.MathHelper;
|
|
||||||
import net.minecraft.world.Explosion;
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
|
||||||
|
|
||||||
public class BlockSemtex extends Block implements IBomb {
|
public class BlockSemtex extends BlockTNTBase {
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
private IIcon topIcon;
|
|
||||||
|
|
||||||
public BlockSemtex(Material mat) {
|
|
||||||
super(mat);
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void registerBlockIcons(IIconRegister p_149651_1_) {
|
|
||||||
this.blockIcon = p_149651_1_.registerIcon(this.getTextureName());
|
|
||||||
this.topIcon = p_149651_1_.registerIcon(this.getTextureName() + "_front");
|
|
||||||
}
|
|
||||||
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public IIcon getIcon(int side, int meta) {
|
|
||||||
int k = getPistonOrientation(meta);
|
|
||||||
return ForgeDirection.getOrientation(k).getOpposite().ordinal() == side ? this.topIcon : this.blockIcon;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getPistonOrientation(int meta) {
|
|
||||||
return meta & 7;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockPlacedBy(World p_149689_1_, int p_149689_2_, int p_149689_3_, int p_149689_4_, EntityLivingBase p_149689_5_, ItemStack p_149689_6_) {
|
public void explodeEntity(World world, double x, double y, double z, EntityTNTPrimedBase entity) {
|
||||||
int l = determineOrientation(p_149689_1_, p_149689_2_, p_149689_3_, p_149689_4_, p_149689_5_);
|
world.createExplosion(entity, x, y, z, 20F, true);
|
||||||
p_149689_1_.setBlockMetadataWithNotify(p_149689_2_, p_149689_3_, p_149689_4_, l, 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int determineOrientation(World world, int x, int y, int z, EntityLivingBase player) {
|
|
||||||
|
|
||||||
if(MathHelper.abs((float) player.posX - (float) x) < 2.0F && MathHelper.abs((float) player.posZ - (float) z) < 2.0F) {
|
|
||||||
double d0 = player.posY + 1.82D - (double) player.yOffset;
|
|
||||||
|
|
||||||
if(d0 - (double) y > 2.0D) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
if((double) y - d0 > 0.0D) {
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int l = MathHelper.floor_double((double) (player.rotationYaw * 4.0F / 360.0F) + 0.5D) & 3;
|
|
||||||
|
|
||||||
return l == 0 ? 3 : (l == 1 ? 4 : (l == 2 ? 2 : (l == 3 ? 5 : 1)));
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onBlockDestroyedByExplosion(World world, int x, int y, int z, Explosion explosion) {
|
|
||||||
this.explode(world, x, y, z);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block p_149695_5_) {
|
|
||||||
if(world.isBlockIndirectlyGettingPowered(x, y, z)) {
|
|
||||||
this.explode(world, x, y, z);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public BombReturnCode explode(World world, int x, int y, int z) {
|
|
||||||
|
|
||||||
if(!world.isRemote) {
|
|
||||||
new ExplosionNT(world, null, x + 0.5, y + 0.5, z + 0.5, 50).overrideResolution(64).explode();
|
|
||||||
ExplosionLarge.spawnParticles(world, x, y, z, ExplosionLarge.cloudFunction(15));
|
|
||||||
}
|
|
||||||
|
|
||||||
return BombReturnCode.DETONATED;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -155,7 +155,8 @@ public class Landmine extends BlockContainer implements IBomb {
|
|||||||
world.newExplosion(null, x + 0.5, y + 0.5, z + 0.5, 2.5F, false, false);
|
world.newExplosion(null, x + 0.5, y + 0.5, z + 0.5, 2.5F, false, false);
|
||||||
}
|
}
|
||||||
if(this == ModBlocks.mine_he) {
|
if(this == ModBlocks.mine_he) {
|
||||||
ExplosionLarge.explode(world, x + 0.5, y + 0.5, z + 0.5, 10F, true, false, false);
|
ExplosionLarge.explode(world, x + 0.5, y + 0.5, z + 0.5, 3F, true, false, false);
|
||||||
|
world.newExplosion(null, x + 0.5, y + 2, z + 0.5, 15F, false, false);
|
||||||
}
|
}
|
||||||
if(this == ModBlocks.mine_shrap) {
|
if(this == ModBlocks.mine_shrap) {
|
||||||
ExplosionLarge.explode(world, x + 0.5, y + 0.5, z + 0.5, 1, true, false, false);
|
ExplosionLarge.explode(world, x + 0.5, y + 0.5, z + 0.5, 1, true, false, false);
|
||||||
|
|||||||
@ -55,4 +55,16 @@ public class BlockDepthOre extends BlockDepth {
|
|||||||
|
|
||||||
return super.quantityDropped(rand);
|
return super.quantityDropped(rand);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int quantityDroppedWithBonus(int fortune, Random rand) {
|
||||||
|
|
||||||
|
int mult = rand.nextInt(fortune + 2) - 1;
|
||||||
|
|
||||||
|
if(mult < 0) {
|
||||||
|
mult = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.quantityDropped(rand) * (mult + 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -241,6 +241,22 @@ public class BlockOre extends Block {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int quantityDroppedWithBonus(int fortune, Random rand) {
|
||||||
|
|
||||||
|
if(fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, rand, fortune)) {
|
||||||
|
int mult = rand.nextInt(fortune + 2) - 1;
|
||||||
|
|
||||||
|
if(mult < 0) {
|
||||||
|
mult = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return this.quantityDropped(rand) * (mult + 1);
|
||||||
|
} else {
|
||||||
|
return this.quantityDropped(rand);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageDropped(int p_149692_1_) {
|
public int damageDropped(int p_149692_1_) {
|
||||||
return this == ModBlocks.waste_planks ? 1 : 0;
|
return this == ModBlocks.waste_planks ? 1 : 0;
|
||||||
|
|||||||
@ -5,12 +5,12 @@ import java.util.List;
|
|||||||
import com.hbm.blocks.IStepTickReceiver;
|
import com.hbm.blocks.IStepTickReceiver;
|
||||||
import com.hbm.blocks.ITooltipProvider;
|
import com.hbm.blocks.ITooltipProvider;
|
||||||
|
|
||||||
import codechicken.lib.math.MathHelper;
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class BlockSpeedy extends Block implements IStepTickReceiver, ITooltipProvider {
|
public class BlockSpeedy extends Block implements IStepTickReceiver, ITooltipProvider {
|
||||||
|
|||||||
@ -1,12 +1,17 @@
|
|||||||
package com.hbm.blocks.machine;
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ILookOverlay;
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
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.TileEntityDiFurnace;
|
import com.hbm.tileentity.machine.TileEntityDiFurnace;
|
||||||
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
@ -25,10 +30,11 @@ import net.minecraft.tileentity.TileEntity;
|
|||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||||
|
|
||||||
public class MachineBattery extends BlockContainer {
|
public class MachineBattery extends BlockContainer implements ILookOverlay {
|
||||||
|
|
||||||
private final Random field_149933_a = new Random();
|
private final Random field_149933_a = new Random();
|
||||||
private static boolean keepInventory;
|
private static boolean keepInventory;
|
||||||
public long maxPower;
|
public long maxPower;
|
||||||
|
|
||||||
@ -83,10 +89,9 @@ public class MachineBattery extends BlockContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_)
|
public Item getItemDropped(int p_149650_1_, Random p_149650_2_, int p_149650_3_) {
|
||||||
{
|
return Item.getItemFromBlock(this);
|
||||||
return Item.getItemFromBlock(this);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onBlockAdded(World world, int x, int y, int z) {
|
public void onBlockAdded(World world, int x, int y, int z) {
|
||||||
@ -95,8 +100,7 @@ public class MachineBattery extends BlockContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private void setDefaultDirection(World world, int x, int y, int z) {
|
private void setDefaultDirection(World world, int x, int y, int z) {
|
||||||
if(!world.isRemote)
|
if(!world.isRemote) {
|
||||||
{
|
|
||||||
Block block1 = world.getBlock(x, y, z - 1);
|
Block block1 = world.getBlock(x, y, z - 1);
|
||||||
Block block2 = world.getBlock(x, y, z + 1);
|
Block block2 = world.getBlock(x, y, z + 1);
|
||||||
Block block3 = world.getBlock(x - 1, y, z);
|
Block block3 = world.getBlock(x - 1, y, z);
|
||||||
@ -104,20 +108,16 @@ public class MachineBattery extends BlockContainer {
|
|||||||
|
|
||||||
byte b0 = 3;
|
byte b0 = 3;
|
||||||
|
|
||||||
if(block1.func_149730_j() && !block2.func_149730_j())
|
if(block1.func_149730_j() && !block2.func_149730_j()) {
|
||||||
{
|
|
||||||
b0 = 3;
|
b0 = 3;
|
||||||
}
|
}
|
||||||
if(block2.func_149730_j() && !block1.func_149730_j())
|
if(block2.func_149730_j() && !block1.func_149730_j()) {
|
||||||
{
|
|
||||||
b0 = 2;
|
b0 = 2;
|
||||||
}
|
}
|
||||||
if(block3.func_149730_j() && !block4.func_149730_j())
|
if(block3.func_149730_j() && !block4.func_149730_j()) {
|
||||||
{
|
|
||||||
b0 = 5;
|
b0 = 5;
|
||||||
}
|
}
|
||||||
if(block4.func_149730_j() && !block3.func_149730_j())
|
if(block4.func_149730_j() && !block3.func_149730_j()) {
|
||||||
{
|
|
||||||
b0 = 4;
|
b0 = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,26 +129,21 @@ public class MachineBattery extends BlockContainer {
|
|||||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack itemStack) {
|
||||||
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
int i = MathHelper.floor_double(player.rotationYaw * 4.0F / 360.0F + 0.5D) & 3;
|
||||||
|
|
||||||
if(i == 0)
|
if(i == 0) {
|
||||||
{
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 2, 2);
|
||||||
}
|
}
|
||||||
if(i == 1)
|
if(i == 1) {
|
||||||
{
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 5, 2);
|
||||||
}
|
}
|
||||||
if(i == 2)
|
if(i == 2) {
|
||||||
{
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 3, 2);
|
||||||
}
|
}
|
||||||
if(i == 3)
|
if(i == 3) {
|
||||||
{
|
|
||||||
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
world.setBlockMetadataWithNotify(x, y, z, 4, 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(itemStack.hasDisplayName())
|
if(itemStack.hasDisplayName()) {
|
||||||
{
|
((TileEntityDiFurnace) world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
|
||||||
((TileEntityDiFurnace)world.getTileEntity(x, y, z)).setCustomName(itemStack.getDisplayName());
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -159,14 +154,11 @@ public class MachineBattery extends BlockContainer {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
if(world.isRemote)
|
if(world.isRemote) {
|
||||||
{
|
|
||||||
return true;
|
return true;
|
||||||
} else if(!player.isSneaking())
|
} else if(!player.isSneaking()) {
|
||||||
{
|
|
||||||
TileEntityMachineBattery entity = (TileEntityMachineBattery) world.getTileEntity(x, y, z);
|
TileEntityMachineBattery entity = (TileEntityMachineBattery) world.getTileEntity(x, y, z);
|
||||||
if(entity != null)
|
if(entity != null) {
|
||||||
{
|
|
||||||
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_battery, world, x, y, z);
|
FMLNetworkHandler.openGui(player, MainRegistry.instance, ModBlocks.guiID_machine_battery, world, x, y, z);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
@ -176,55 +168,62 @@ public class MachineBattery extends BlockContainer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_)
|
public void breakBlock(World p_149749_1_, int p_149749_2_, int p_149749_3_, int p_149749_4_, Block p_149749_5_, int p_149749_6_) {
|
||||||
{
|
if(!keepInventory) {
|
||||||
if (!keepInventory)
|
TileEntityMachineBattery tileentityfurnace = (TileEntityMachineBattery) p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
||||||
{
|
|
||||||
TileEntityMachineBattery tileentityfurnace = (TileEntityMachineBattery)p_149749_1_.getTileEntity(p_149749_2_, p_149749_3_, p_149749_4_);
|
|
||||||
|
|
||||||
if (tileentityfurnace != null)
|
if(tileentityfurnace != null) {
|
||||||
{
|
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
|
||||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||||
{
|
|
||||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
|
||||||
|
|
||||||
if (itemstack != null)
|
if(itemstack != null) {
|
||||||
{
|
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||||
float f = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||||
float f1 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
||||||
float f2 = this.field_149933_a.nextFloat() * 0.8F + 0.1F;
|
|
||||||
|
|
||||||
while (itemstack.stackSize > 0)
|
while(itemstack.stackSize > 0) {
|
||||||
{
|
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
|
||||||
|
|
||||||
if (j1 > itemstack.stackSize)
|
if(j1 > itemstack.stackSize) {
|
||||||
{
|
j1 = itemstack.stackSize;
|
||||||
j1 = itemstack.stackSize;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
itemstack.stackSize -= j1;
|
itemstack.stackSize -= j1;
|
||||||
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
EntityItem entityitem = new EntityItem(p_149749_1_, p_149749_2_ + f, p_149749_3_ + f1, p_149749_4_ + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||||
|
|
||||||
if (itemstack.hasTagCompound())
|
if(itemstack.hasTagCompound()) {
|
||||||
{
|
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
}
|
||||||
}
|
|
||||||
|
|
||||||
float f3 = 0.05F;
|
float f3 = 0.05F;
|
||||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
entityitem.motionX = (float) this.field_149933_a.nextGaussian() * f3;
|
||||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
entityitem.motionY = (float) this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
entityitem.motionZ = (float) this.field_149933_a.nextGaussian() * f3;
|
||||||
p_149749_1_.spawnEntityInWorld(entityitem);
|
p_149749_1_.spawnEntityInWorld(entityitem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
p_149749_1_.func_147453_f(p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
super.breakBlock(p_149749_1_, p_149749_2_, p_149749_3_, p_149749_4_, p_149749_5_, p_149749_6_);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if(!(te instanceof TileEntityMachineBattery))
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntityMachineBattery battery = (TileEntityMachineBattery) te;
|
||||||
|
|
||||||
|
List<String> text = new ArrayList();
|
||||||
|
text.add(BobMathUtil.getShortNumber(battery.getPower()) + " / " + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE");
|
||||||
|
|
||||||
|
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,23 +1,30 @@
|
|||||||
package com.hbm.blocks.machine;
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.blocks.ILookOverlay;
|
||||||
import com.hbm.handler.MultiblockHandlerXR;
|
import com.hbm.handler.MultiblockHandlerXR;
|
||||||
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.tileentity.TileEntityProxyCombo;
|
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||||
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticCracker;
|
import com.hbm.tileentity.machine.oil.TileEntityMachineCatalyticCracker;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.util.ChatComponentText;
|
import net.minecraft.util.ChatComponentText;
|
||||||
import net.minecraft.util.ChatComponentTranslation;
|
import net.minecraft.util.ChatComponentTranslation;
|
||||||
|
import net.minecraft.util.ChatStyle;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class MachineCatalyticCracker extends BlockDummyable {
|
public class MachineCatalyticCracker extends BlockDummyable implements ILookOverlay {
|
||||||
|
|
||||||
public MachineCatalyticCracker(Material mat) {
|
public MachineCatalyticCracker(Material mat) {
|
||||||
super(mat);
|
super(mat);
|
||||||
@ -49,7 +56,7 @@ public class MachineCatalyticCracker extends BlockDummyable {
|
|||||||
|
|
||||||
if(!world.isRemote && !player.isSneaking()) {
|
if(!world.isRemote && !player.isSneaking()) {
|
||||||
|
|
||||||
if(player.getHeldItem() == null || player.getHeldItem().getItem() == ModItems.fluid_identifier) {
|
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.fluid_identifier) {
|
||||||
int[] pos = this.findCore(world, x, y, z);
|
int[] pos = this.findCore(world, x, y, z);
|
||||||
|
|
||||||
if(pos == null)
|
if(pos == null)
|
||||||
@ -61,20 +68,10 @@ public class MachineCatalyticCracker extends BlockDummyable {
|
|||||||
return false;
|
return false;
|
||||||
|
|
||||||
TileEntityMachineCatalyticCracker cracker = (TileEntityMachineCatalyticCracker) te;
|
TileEntityMachineCatalyticCracker cracker = (TileEntityMachineCatalyticCracker) te;
|
||||||
|
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
|
||||||
if(player.getHeldItem() == null) {
|
cracker.tanks[0].setTankType(type);
|
||||||
|
cracker.markDirty();
|
||||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "=== CATALYTIC CRACKING TOWER ==="));
|
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
|
||||||
|
|
||||||
for(int i = 0; i < cracker.tanks.length; i++)
|
|
||||||
player.addChatComponentMessage(new ChatComponentTranslation("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase()).appendSibling(new ChatComponentText(": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB")));
|
|
||||||
} else {
|
|
||||||
|
|
||||||
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
|
|
||||||
cracker.tanks[0].setTankType(type);
|
|
||||||
cracker.markDirty();
|
|
||||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Changed type to " + type + "!"));
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -115,4 +112,26 @@ public class MachineCatalyticCracker extends BlockDummyable {
|
|||||||
this.makeExtra(world, x + dir.offsetX * o - dir.offsetX * 2 + rot.offsetX * 2, y + dir.offsetY * o, z + dir.offsetZ * o - dir.offsetZ * 2 + rot.offsetZ * 2);
|
this.makeExtra(world, x + dir.offsetX * o - dir.offsetX * 2 + rot.offsetX * 2, y + dir.offsetY * o, z + dir.offsetZ * o - dir.offsetZ * 2 + rot.offsetZ * 2);
|
||||||
this.makeExtra(world, x + dir.offsetX * o - dir.offsetX * 2 - rot.offsetX * 3, y + dir.offsetY * o, z + dir.offsetZ * o - dir.offsetZ * 2 - rot.offsetZ * 3);
|
this.makeExtra(world, x + dir.offsetX * o - dir.offsetX * 2 - rot.offsetX * 3, y + dir.offsetY * o, z + dir.offsetZ * o - dir.offsetZ * 2 - rot.offsetZ * 3);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||||
|
int[] pos = this.findCore(world, x, y, z);
|
||||||
|
|
||||||
|
if(pos == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||||
|
|
||||||
|
if(!(te instanceof TileEntityMachineCatalyticCracker))
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntityMachineCatalyticCracker cracker = (TileEntityMachineCatalyticCracker) te;
|
||||||
|
|
||||||
|
List<String> text = new ArrayList();
|
||||||
|
|
||||||
|
for(int i = 0; i < cracker.tanks.length; i++)
|
||||||
|
text.add((i < 2 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase()) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||||
|
|
||||||
|
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
64
src/main/java/com/hbm/blocks/machine/MachineChemfac.java
Normal file
64
src/main/java/com/hbm/blocks/machine/MachineChemfac.java
Normal file
@ -0,0 +1,64 @@
|
|||||||
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
|
||||||
|
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public class MachineChemfac extends BlockDummyable {
|
||||||
|
|
||||||
|
public MachineChemfac(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
|
if(meta >= 12) return new TileEntityMachineChemfac();
|
||||||
|
if(meta >= 6) return new TileEntityProxyCombo(false, true, true);
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int[] getDimensions() {
|
||||||
|
return new int[] {3, 0, 4, 3, 4, 3};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) {
|
||||||
|
return this.standardOpenBehavior(world, x, y, z, player, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getOffset() {
|
||||||
|
return 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void fillSpace(World world, int x, int y, int z, ForgeDirection dir, int o) {
|
||||||
|
super.fillSpace(world, x, y, z, dir, o);
|
||||||
|
|
||||||
|
x += dir.offsetX * o;
|
||||||
|
z += dir.offsetZ * o;
|
||||||
|
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||||
|
|
||||||
|
this.safeRem = true;
|
||||||
|
|
||||||
|
for(int i = -3; i < 3; i++) {
|
||||||
|
this.makeExtra(world, x + rot.offsetX * 2 + dir.offsetX * i, y + 3, z + rot.offsetZ * 2 + dir.offsetZ * i);
|
||||||
|
this.makeExtra(world, x - rot.offsetX * 3 + dir.offsetX * i, y + 3, z - rot.offsetZ * 3 + dir.offsetZ * i);
|
||||||
|
|
||||||
|
this.makeExtra(world, x + rot.offsetX * 3 + dir.offsetX * i, y + 1, z + rot.offsetZ * 3 + dir.offsetZ * i);
|
||||||
|
this.makeExtra(world, x + rot.offsetX * 3 + dir.offsetX * i, y + 2, z + rot.offsetZ * 3 + dir.offsetZ * i);
|
||||||
|
|
||||||
|
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX * i, y + 1, z - rot.offsetZ * 4 + dir.offsetZ * i);
|
||||||
|
this.makeExtra(world, x - rot.offsetX * 4 + dir.offsetX * i, y + 2, z - rot.offsetZ * 4 + dir.offsetZ * i);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.safeRem = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,17 +1,25 @@
|
|||||||
package com.hbm.blocks.machine;
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.blocks.ILookOverlay;
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.tileentity.machine.storage.TileEntityMachineBattery;
|
||||||
import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU;
|
import com.hbm.tileentity.machine.storage.TileEntityMachineFENSU;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||||
|
|
||||||
public class MachineFENSU extends BlockDummyable {
|
public class MachineFENSU extends BlockDummyable implements ILookOverlay {
|
||||||
|
|
||||||
public MachineFENSU(Material mat) {
|
public MachineFENSU(Material mat) {
|
||||||
super(mat);
|
super(mat);
|
||||||
@ -58,4 +66,23 @@ public class MachineFENSU extends BlockDummyable {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||||
|
int[] pos = this.findCore(world, x, y, z);
|
||||||
|
|
||||||
|
if(pos == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||||
|
|
||||||
|
if(!(te instanceof TileEntityMachineBattery))
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntityMachineBattery battery = (TileEntityMachineBattery) te;
|
||||||
|
|
||||||
|
List<String> text = new ArrayList();
|
||||||
|
text.add(BobMathUtil.getShortNumber(battery.getPower()) + " / " + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE");
|
||||||
|
|
||||||
|
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,11 +1,16 @@
|
|||||||
package com.hbm.blocks.machine;
|
package com.hbm.blocks.machine;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.blocks.ILookOverlay;
|
||||||
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.tileentity.TileEntityProxyCombo;
|
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||||
import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower;
|
import com.hbm.tileentity.machine.oil.TileEntityMachineFractionTower;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -15,9 +20,10 @@ import net.minecraft.util.ChatComponentTranslation;
|
|||||||
import net.minecraft.util.ChatStyle;
|
import net.minecraft.util.ChatStyle;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class MachineFractionTower extends BlockDummyable {
|
public class MachineFractionTower extends BlockDummyable implements ILookOverlay {
|
||||||
|
|
||||||
public MachineFractionTower(Material mat) {
|
public MachineFractionTower(Material mat) {
|
||||||
super(mat);
|
super(mat);
|
||||||
@ -49,7 +55,7 @@ public class MachineFractionTower extends BlockDummyable {
|
|||||||
|
|
||||||
if(!world.isRemote && !player.isSneaking()) {
|
if(!world.isRemote && !player.isSneaking()) {
|
||||||
|
|
||||||
if(player.getHeldItem() == null || player.getHeldItem().getItem() == ModItems.fluid_identifier) {
|
if(player.getHeldItem() != null && player.getHeldItem().getItem() == ModItems.fluid_identifier) {
|
||||||
int[] pos = this.findCore(world, x, y, z);
|
int[] pos = this.findCore(world, x, y, z);
|
||||||
|
|
||||||
if(pos == null)
|
if(pos == null)
|
||||||
@ -62,22 +68,13 @@ public class MachineFractionTower extends BlockDummyable {
|
|||||||
|
|
||||||
TileEntityMachineFractionTower frac = (TileEntityMachineFractionTower) te;
|
TileEntityMachineFractionTower frac = (TileEntityMachineFractionTower) te;
|
||||||
|
|
||||||
if(player.getHeldItem() == null) {
|
if(world.getTileEntity(pos[0], pos[1] - 3, pos[2]) instanceof TileEntityMachineFractionTower) {
|
||||||
|
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You can only change the type in the bottom segment!"));
|
||||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "=== FRACTIONING TOWER Y:" + pos[1] + " ==="));
|
|
||||||
|
|
||||||
for(int i = 0; i < frac.tanks.length; i++)
|
|
||||||
player.addChatComponentMessage(new ChatComponentTranslation("hbmfluid." + frac.tanks[i].getTankType().getName().toLowerCase()).appendSibling(new ChatComponentText(": " + frac.tanks[i].getFill() + "/" + frac.tanks[i].getMaxFill() + "mB")));
|
|
||||||
} else {
|
} else {
|
||||||
|
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
|
||||||
if(world.getTileEntity(pos[0], pos[1] - 3, pos[2]) instanceof TileEntityMachineFractionTower) {
|
frac.tanks[0].setTankType(type);
|
||||||
player.addChatComponentMessage(new ChatComponentText(EnumChatFormatting.RED + "You can only change the type in the bottom segment!"));
|
frac.markDirty();
|
||||||
} else {
|
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
|
||||||
FluidType type = Fluids.fromID(player.getHeldItem().getItemDamage());
|
|
||||||
frac.tanks[0].setTankType(type);
|
|
||||||
frac.markDirty();
|
|
||||||
player.addChatComponentMessage(new ChatComponentText("Changed type to ").setChatStyle(new ChatStyle().setColor(EnumChatFormatting.YELLOW)).appendSibling(new ChatComponentTranslation("hbmfluid." + type.getName().toLowerCase())).appendSibling(new ChatComponentText("!")));
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -101,4 +98,26 @@ public class MachineFractionTower extends BlockDummyable {
|
|||||||
this.makeExtra(world, x, y, z + 1);
|
this.makeExtra(world, x, y, z + 1);
|
||||||
this.makeExtra(world, x, y, z - 1);
|
this.makeExtra(world, x, y, z - 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||||
|
int[] pos = this.findCore(world, x, y, z);
|
||||||
|
|
||||||
|
if(pos == null)
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(pos[0], pos[1], pos[2]);
|
||||||
|
|
||||||
|
if(!(te instanceof TileEntityMachineFractionTower))
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntityMachineFractionTower cracker = (TileEntityMachineFractionTower) te;
|
||||||
|
|
||||||
|
List<String> text = new ArrayList();
|
||||||
|
|
||||||
|
for(int i = 0; i < cracker.tanks.length; i++)
|
||||||
|
text.add((i == 0 ? (EnumChatFormatting.GREEN + "-> ") : (EnumChatFormatting.RED + "<- ")) + EnumChatFormatting.RESET + I18nUtil.resolveKey("hbmfluid." + cracker.tanks[i].getTankType().getName().toLowerCase()) + ": " + cracker.tanks[i].getFill() + "/" + cracker.tanks[i].getMaxFill() + "mB");
|
||||||
|
|
||||||
|
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
202
src/main/java/com/hbm/blocks/network/CableDiode.java
Normal file
202
src/main/java/com/hbm/blocks/network/CableDiode.java
Normal file
@ -0,0 +1,202 @@
|
|||||||
|
package com.hbm.blocks.network;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ILookOverlay;
|
||||||
|
import com.hbm.blocks.ITooltipProvider;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
|
import api.hbm.block.IToolable;
|
||||||
|
import api.hbm.energy.IEnergyUser;
|
||||||
|
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||||
|
import net.minecraft.block.BlockContainer;
|
||||||
|
import net.minecraft.block.BlockPistonBase;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.nbt.NBTTagList;
|
||||||
|
import net.minecraft.network.NetworkManager;
|
||||||
|
import net.minecraft.network.Packet;
|
||||||
|
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||||
|
import net.minecraft.tileentity.TileEntity;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||||
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
|
public class CableDiode extends BlockContainer implements ILookOverlay, IToolable, ITooltipProvider {
|
||||||
|
|
||||||
|
public CableDiode(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getRenderType() {
|
||||||
|
return renderID;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isOpaqueCube() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean renderAsNormalBlock() {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase player, ItemStack stack) {
|
||||||
|
int l = BlockPistonBase.determineOrientation(world, x, y, z, player);
|
||||||
|
world.setBlockMetadataWithNotify(x, y, z, l, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean onScrew(World world, EntityPlayer player, int x, int y, int z, int side, float fX, float fY, float fZ, ToolType tool) {
|
||||||
|
|
||||||
|
TileEntityDiode te = (TileEntityDiode)world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if(world.isRemote)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if(tool == ToolType.SCREWDRIVER) {
|
||||||
|
if(te.level < 11)
|
||||||
|
te.level++;
|
||||||
|
te.markDirty();
|
||||||
|
world.markBlockForUpdate(x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if(tool == ToolType.HAND_DRILL) {
|
||||||
|
if(te.level > 1)
|
||||||
|
te.level--;
|
||||||
|
te.markDirty();
|
||||||
|
world.markBlockForUpdate(x, y, z);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
list.add(EnumChatFormatting.GOLD + "Limits throughput and restricts flow direction");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + "Use screwdriver to increase throughput");
|
||||||
|
list.add(EnumChatFormatting.YELLOW + "Use hand drill to decrease throughput");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||||
|
|
||||||
|
TileEntity te = world.getTileEntity(x, y, z);
|
||||||
|
|
||||||
|
if(!(te instanceof TileEntityDiode))
|
||||||
|
return;
|
||||||
|
|
||||||
|
TileEntityDiode diode = (TileEntityDiode) te;
|
||||||
|
|
||||||
|
List<String> text = new ArrayList();
|
||||||
|
text.add("Max.: " + BobMathUtil.getShortNumber(diode.getMaxPower()) + "HE/pulse");
|
||||||
|
|
||||||
|
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public TileEntity createNewTileEntity(World world, int meta) {
|
||||||
|
return new TileEntityDiode();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class TileEntityDiode extends TileEntity implements IEnergyUser {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readFromNBT(nbt);
|
||||||
|
level = nbt.getInteger("level");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeToNBT(nbt);
|
||||||
|
nbt.setInteger("level", level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Packet getDescriptionPacket() {
|
||||||
|
NBTTagCompound nbt = new NBTTagCompound();
|
||||||
|
this.writeToNBT(nbt);
|
||||||
|
return new S35PacketUpdateTileEntity(this.xCoord, this.yCoord, this.zCoord, 0, nbt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onDataPacket(NetworkManager net, S35PacketUpdateTileEntity pkt) {
|
||||||
|
this.readFromNBT(pkt.func_148857_g());
|
||||||
|
}
|
||||||
|
|
||||||
|
int level = 1;
|
||||||
|
|
||||||
|
private ForgeDirection getDir() {
|
||||||
|
return ForgeDirection.getOrientation(this.getBlockMetadata()).getOpposite();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void updateEntity() {
|
||||||
|
|
||||||
|
if(!worldObj.isRemote) {
|
||||||
|
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||||
|
|
||||||
|
if(dir == getDir())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
this.trySubscribe(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean recursionBrake = false;
|
||||||
|
private long subBuffer;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long transferPower(long power) {
|
||||||
|
|
||||||
|
if(recursionBrake)
|
||||||
|
return power;
|
||||||
|
|
||||||
|
//this part turns "maxPower" from a glorified transfer weight into an actual transfer cap
|
||||||
|
long overShoot = Math.max(0, power - getMaxPower());
|
||||||
|
power = Math.min(power, getMaxPower());
|
||||||
|
|
||||||
|
recursionBrake = true;
|
||||||
|
this.subBuffer = power;
|
||||||
|
|
||||||
|
ForgeDirection dir = getDir();
|
||||||
|
this.sendPower(worldObj, xCoord + dir.offsetX, yCoord + dir.offsetY, zCoord + dir.offsetZ, dir);
|
||||||
|
long ret = this.subBuffer;
|
||||||
|
|
||||||
|
this.subBuffer = 0;
|
||||||
|
recursionBrake = false;
|
||||||
|
|
||||||
|
return ret + overShoot;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getMaxPower() {
|
||||||
|
return (long) Math.pow(10, level);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getPower() {
|
||||||
|
return subBuffer;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void setPower(long power) {
|
||||||
|
this.subBuffer = power;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
18
src/main/java/com/hbm/blocks/test/TestBB.java
Normal file
18
src/main/java/com/hbm/blocks/test/TestBB.java
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package com.hbm.blocks.test;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
|
||||||
|
public class TestBB extends Block {
|
||||||
|
|
||||||
|
public TestBB(Material mat) {
|
||||||
|
super(mat);
|
||||||
|
|
||||||
|
if(this == ModBlocks.test_bb_bork)
|
||||||
|
this.setBlockBounds(-1000F, -1000F, -1000F, 1001F, 1001F, 1001F);
|
||||||
|
else
|
||||||
|
this.setBlockBounds(Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.NEGATIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY, Float.POSITIVE_INFINITY);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -23,7 +23,7 @@ public class BombConfig {
|
|||||||
public static int mk4 = 1024;
|
public static int mk4 = 1024;
|
||||||
public static int blastSpeed = 1024;
|
public static int blastSpeed = 1024;
|
||||||
public static int falloutRange = 100;
|
public static int falloutRange = 100;
|
||||||
public static int fSpeed = 256;
|
public static int fDelay = 4;
|
||||||
public static int limitExplosionLifespan = 0;
|
public static int limitExplosionLifespan = 0;
|
||||||
|
|
||||||
public static void loadFromConfig(Configuration config) {
|
public static void loadFromConfig(Configuration config) {
|
||||||
@ -80,17 +80,16 @@ public class BombConfig {
|
|||||||
Property propBlastSpeed = config.get(CATEGORY_NUKE, "6.01_blastSpeed", 1024);
|
Property propBlastSpeed = config.get(CATEGORY_NUKE, "6.01_blastSpeed", 1024);
|
||||||
propBlastSpeed.comment = "Base speed of MK3 system (old and schrabidium) detonations (Blocks / tick)";
|
propBlastSpeed.comment = "Base speed of MK3 system (old and schrabidium) detonations (Blocks / tick)";
|
||||||
blastSpeed = propBlastSpeed.getInt();
|
blastSpeed = propBlastSpeed.getInt();
|
||||||
// fallout range
|
// new explosion speed
|
||||||
Property propFalloutRange = config.get(CATEGORY_NUKE, "6.02_blastSpeedNew", 1024);
|
Property propFalloutRange = config.get(CATEGORY_NUKE, "6.02_blastSpeedNew", 1024);
|
||||||
propFalloutRange.comment = "Base speed of MK4 system (new) detonations (Blocks / tick)";
|
propFalloutRange.comment = "Base speed of MK4 system (new) detonations (Blocks / tick)";
|
||||||
mk4 = propFalloutRange.getInt();
|
mk4 = propFalloutRange.getInt();
|
||||||
// fallout speed
|
// fallout range
|
||||||
Property falloutRangeProp = config.get(CATEGORY_NUKE, "6.03_falloutRange", 100);
|
Property falloutRangeProp = config.get(CATEGORY_NUKE, "6.03_falloutRange", 100);
|
||||||
falloutRangeProp.comment = "Radius of fallout area (base radius * value in percent)";
|
falloutRangeProp.comment = "Radius of fallout area (base radius * value in percent)";
|
||||||
falloutRange = falloutRangeProp.getInt();
|
falloutRange = falloutRangeProp.getInt();
|
||||||
// new explosion speed
|
Property falloutDelayProp = config.get(CATEGORY_NUKE, "6.04_falloutDelay", 4);
|
||||||
Property falloutSpeed = config.get(CATEGORY_NUKE, "6.04_falloutSpeed", 256);
|
falloutDelayProp.comment = "How many ticks to wait for the next fallout chunk computation";
|
||||||
falloutSpeed.comment = "Blocks processed per tick by the fallout rain";
|
fDelay = falloutDelayProp.getInt();
|
||||||
fSpeed = falloutSpeed.getInt();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -78,7 +78,7 @@ public class ArmorRecipes {
|
|||||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ajro_boots, 1), new Object[] { ModItems.ajr_boots, KEY_RED, KEY_BLACK });
|
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ajro_boots, 1), new Object[] { ModItems.ajr_boots, KEY_RED, KEY_BLACK });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_helmet, 1), new Object[] { "SBS", " C ", " I ", 'S', Items.string, 'B', new ItemStack(Blocks.wool, 1, 15), 'C', ModItems.circuit_targeting_tier4, 'I', STAR.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_helmet, 1), new Object[] { "SBS", " C ", " I ", 'S', Items.string, 'B', new ItemStack(Blocks.wool, 1, 15), 'C', ModItems.circuit_targeting_tier4, 'I', STAR.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_plate, 1), new Object[] { "N N", "MSM", "NCN", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_plate, 'C', ModItems.circuit_targeting_tier5 });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_plate, 1), new Object[] { "N N", "MSM", "NCN", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_plate, 'C', ModItems.circuit_targeting_tier5 });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_plate_jetpack, 1), new Object[] { "NFN", "TPT", "ICI", 'N', ModItems.plate_armor_lunar, 'F', ModItems.fins_quad_titanium, 'T', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.XENON.ordinal()), 'P', ModItems.bj_plate, 'I', ModItems.mp_thruster_10_xenon, 'C', ModItems.crystal_phosphorus });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_plate_jetpack, 1), new Object[] { "NFN", "TPT", "ICI", 'N', ModItems.plate_armor_lunar, 'F', ModItems.fins_quad_titanium, 'T', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.XENON.getID()), 'P', ModItems.bj_plate, 'I', ModItems.mp_thruster_10_xenon, 'C', ModItems.crystal_phosphorus });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_legs, 1), new Object[] { "MBM", "NSN", "N N", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_legs, 'B', ModBlocks.block_starmetal });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_legs, 1), new Object[] { "MBM", "NSN", "N N", 'N', ModItems.plate_armor_lunar, 'M', ModItems.motor_desh, 'S', ModItems.starmetal_legs, 'B', ModBlocks.block_starmetal });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_boots, 1), new Object[] { "N N", "BSB", 'N', ModItems.plate_armor_lunar, 'S', ModItems.starmetal_boots, 'B', ModBlocks.block_starmetal });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bj_boots, 1), new Object[] { "N N", "BSB", 'N', ModItems.plate_armor_lunar, 'S', ModItems.starmetal_boots, 'B', ModBlocks.block_starmetal });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.hev_helmet, 1), new Object[] { "PPC", "PBP", "IFI", 'P', ModItems.plate_armor_hev, 'C', ModItems.circuit_targeting_tier4, 'B', ModItems.titanium_helmet, 'I', ModItems.plate_polymer, 'F', ModItems.gas_mask_filter });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.hev_helmet, 1), new Object[] { "PPC", "PBP", "IFI", 'P', ModItems.plate_armor_hev, 'C', ModItems.circuit_targeting_tier4, 'B', ModItems.titanium_helmet, 'I', ModItems.plate_polymer, 'F', ModItems.gas_mask_filter });
|
||||||
@ -97,6 +97,10 @@ public class ArmorRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rpa_plate, 1), new Object[] { "P P", "MLM", "PKP", 'L', DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2), 'K', ModItems.plate_kevlar, 'P', ModItems.plate_armor_ajr, 'M', ModItems.motor_desh });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rpa_plate, 1), new Object[] { "P P", "MLM", "PKP", 'L', DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2), 'K', ModItems.plate_kevlar, 'P', ModItems.plate_armor_ajr, 'M', ModItems.motor_desh });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rpa_legs, 1), new Object[] { "MPM", "KLK", "P P", 'L', DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2), 'K', ModItems.plate_kevlar, 'P', ModItems.plate_armor_ajr, 'M', ModItems.motor_desh });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rpa_legs, 1), new Object[] { "MPM", "KLK", "P P", 'L', DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2), 'K', ModItems.plate_kevlar, 'P', ModItems.plate_armor_ajr, 'M', ModItems.motor_desh });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rpa_boots, 1), new Object[] { "KLK", "P P", 'L', DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2), 'K', ModItems.plate_kevlar, 'P', ModItems.plate_armor_ajr });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rpa_boots, 1), new Object[] { "KLK", "P P", 'L', DictFrame.fromOne(ModItems.parts_legendary, EnumLegendaryType.TIER2), 'K', ModItems.plate_kevlar, 'P', ModItems.plate_armor_ajr });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.steamsuit_helmet, 1), new Object[] { "DCD", "CXC", " F ", 'D', DESH.ingot(), 'C', CU.plate(), 'X', ModItems.steel_helmet, 'F', ModItems.gas_mask_filter });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.steamsuit_plate, 1), new Object[] { "C C", "DXD", "CFC", 'D', DESH.ingot(), 'C', CU.plate(), 'X', ModItems.steel_plate, 'F', ModItems.tank_steel });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.steamsuit_legs, 1), new Object[] { "CCC", "DXD", "C C", 'D', DESH.ingot(), 'C', CU.plate(), 'X', ModItems.steel_legs });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.steamsuit_boots, 1), new Object[] { "C C", "DXD", 'D', DESH.ingot(), 'C', CU.plate(), 'X', ModItems.steel_boots });
|
||||||
|
|
||||||
//Euphemium armor
|
//Euphemium armor
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.euphemium_helmet, 1), new Object[] { "EEE", "E E", 'E', ModItems.plate_euphemium });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.euphemium_helmet, 1), new Object[] { "EEE", "E E", 'E', ModItems.plate_euphemium });
|
||||||
|
|||||||
@ -148,6 +148,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mymy, 1), new Object[] { "PP ", " WP", 'P', ModItems.plate_polymer, 'W', ModItems.wire_aluminium });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_mymy, 1), new Object[] { "PP ", " WP", 'P', ModItems.plate_polymer, 'W', ModItems.wire_aluminium });
|
||||||
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_darter, 1), new Object[] { "SST", " P", 'S', STEEL.plate(), 'T', ModItems.gas_empty, 'P', ANY_PLASTIC.ingot() });
|
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_darter, 1), new Object[] { "SST", " P", 'S', STEEL.plate(), 'T', ModItems.gas_empty, 'P', ANY_PLASTIC.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fireext, 1), new Object[] { "HB", " T", 'H', ModItems.hull_small_steel, 'B', ModItems.bolt_tungsten, 'T', ModItems.tank_steel });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_fireext, 1), new Object[] { "HB", " T", 'H', ModItems.hull_small_steel, 'B', ModItems.bolt_tungsten, 'T', ModItems.tank_steel });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_spas12, 1), new Object[] { "TPS", "HHR", " L", 'T', ModItems.bolt_tungsten, 'P', STEEL.plate(), 'S', STEEL.ingot(), 'H', ModItems.hull_small_steel, 'R', ModItems.mechanism_rifle_1, 'L', ANY_PLASTIC.ingot()});
|
||||||
|
|
||||||
//Legacy ammo recycling
|
//Legacy ammo recycling
|
||||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_44, 1), new Object[] { ModItems.gun_revolver_nopip_ammo });
|
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_44, 1), new Object[] { ModItems.gun_revolver_nopip_ammo });
|
||||||
@ -199,8 +200,8 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_flechette, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_flechette, 12), new Object[] { " I ", "GCL", " P ", 'I', ModItems.pellet_flechette, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 4), new Object[] { " I ", "GCL", " P ", 'I', Blocks.tnt, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 4), new Object[] { " I ", "GCL", " P ", 'I', Blocks.tnt, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 4), new Object[] { " I ", "GCL", " P ", 'I', Blocks.tnt, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 4), new Object[] { " I ", "GCL", " P ", 'I', Blocks.tnt, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 6), new Object[] { " I ", "GCL", " P ", 'I', ModItems.ingot_semtex, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 6), new Object[] { " I ", "GCL", " P ", 'I', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 6), new Object[] { " I ", "GCL", " P ", 'I', ModItems.ingot_semtex, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_explosive, 6), new Object[] { " I ", "GCL", " P ", 'I', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_semtex, 4), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_semtex, 4), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_semtex, 4), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_4gauge_semtex, 4), new Object[] { " I ", "GCL", " P ", 'I', ModBlocks.det_miner, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'L', ModItems.plate_polymer });
|
||||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_4gauge_titan, 1), new Object[] { ModItems.ammo_4gauge, ModItems.nugget_bismuth, ModItems.nugget_tantalium, ModItems.ball_dynamite });
|
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_4gauge_titan, 1), new Object[] { ModItems.ammo_4gauge, ModItems.nugget_bismuth, ModItems.nugget_tantalium, ModItems.ball_dynamite });
|
||||||
@ -215,7 +216,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 6), new Object[] { "I", "C", "P", 'I', ModItems.powder_power, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.gun_revolver_nightmare2_ammo, 6), new Object[] { "I", "C", "P", 'I', ModItems.powder_power, 'C', ModItems.casing_buckshot, 'P', ModItems.primer_buckshot });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_calamity, 12), new Object[] { " I ", "GCG", " P ", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_calamity, 12), new Object[] { " I ", "GCG", " P ", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_actionexpress, 12), new Object[] { " I", "GC", " P", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_actionexpress, 12), new Object[] { " I", "GC", " P", 'I', PB.ingot(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', ModItems.wire_aluminium, 'P', STEEL.plate(), 'S', ModItems.hull_small_steel, 'E', ModItems.ingot_semtex });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.assembly_nuke, 1), new Object[] { " WP", "SEP", " WP", 'W', ModItems.wire_aluminium, 'P', STEEL.plate(), 'S', ModItems.hull_small_steel, 'E', ANY_HIGHEXPLOSIVE.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dart, 16), new Object[] { "IPI", "ICI", "IPI", 'I', ModItems.plate_polymer, 'P', IRON.plate(), 'C', new ItemStack(ModItems.fluid_tank_lead_full, 1, Fluids.WATZ.ordinal()) });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dart, 16), new Object[] { "IPI", "ICI", "IPI", 'I', ModItems.plate_polymer, 'P', IRON.plate(), 'C', new ItemStack(ModItems.fluid_tank_lead_full, 1, Fluids.WATZ.ordinal()) });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dart_nerf, 16), new Object[] { "I", "I", 'I', ModItems.plate_polymer });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_dart_nerf, 16), new Object[] { "I", "I", 'I', ModItems.plate_polymer });
|
||||||
|
|
||||||
@ -230,11 +231,12 @@ public class WeaponRecipes {
|
|||||||
|
|
||||||
//Rockets
|
//Rockets
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 1), new Object[] { " T ", "GCG", " P ", 'T', Blocks.tnt, 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 1), new Object[] { " T ", "GCG", " P ", 'T', Blocks.tnt, 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { " T ", "GCG", " P ", 'T', ModItems.ingot_semtex, 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 2), new Object[] { " T ", "GCG", " P ", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_he, 1), new Object[] { "G", "R", 'G', ModItems.ingot_semtex, 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket, 3), new Object[] { " T ", "GCG", " P ", 'T', ANY_PLASTICEXPLOSIVE.ingot(), 'G', ModItems.rocket_fuel, 'C', ModItems.casing_50, 'P', ModItems.primer_50 });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_he, 1), new Object[] { "G", "R", 'G', ANY_HIGHEXPLOSIVE.ingot(), 'R', ModItems.ammo_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_incendiary, 1), new Object[] { "G", "R", 'G', P_RED.dust(), 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_incendiary, 1), new Object[] { "G", "R", 'G', P_RED.dust(), 'R', ModItems.ammo_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_phosphorus, 1), new Object[] { "G", "R", 'G', P_WHITE.ingot(), 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_phosphorus, 1), new Object[] { "G", "R", 'G', P_WHITE.ingot(), 'R', ModItems.ammo_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_emp, 1), new Object[] { "G", "R", 'G', "dustDiamond", 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_emp, 1), new Object[] { "G", "R", 'G', DIAMOND.dust(), 'R', ModItems.ammo_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_shrapnel, 1), new Object[] { "G", "R", 'G', ModItems.pellet_buckshot, 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_shrapnel, 1), new Object[] { "G", "R", 'G', ModItems.pellet_buckshot, 'R', ModItems.ammo_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_glare, 1), new Object[] { "GGG", "GRG", "GGG", 'G', REDSTONE.dust(), 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_glare, 1), new Object[] { "GGG", "GRG", "GGG", 'G', REDSTONE.dust(), 'R', ModItems.ammo_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_toxic, 1), new Object[] { "G", "R", 'G', ModItems.pellet_gas, 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_toxic, 1), new Object[] { "G", "R", 'G', ModItems.pellet_gas, 'R', ModItems.ammo_rocket });
|
||||||
@ -249,7 +251,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.BIOFUEL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_rocket_rpc, 2), new Object[] { "BP ", "CBH", " DR", 'B', ModItems.blades_steel, 'P', STEEL.plate(), 'C', Fluids.BIOFUEL.getDict(1000), 'H', ModItems.hull_small_steel, 'D', ModItems.piston_selenium, 'R', ModItems.ammo_rocket });
|
||||||
|
|
||||||
//Stinger Rockets
|
//Stinger Rockets
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_he, 1), new Object[] { "S", "R", 'S', ModItems.ingot_semtex, 'R', ModItems.ammo_stinger_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_he, 1), new Object[] { "S", "R", 'S', ANY_HIGHEXPLOSIVE.ingot(), 'R', ModItems.ammo_stinger_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_incendiary, 1), new Object[] { "S", "R", 'S', P_RED.dust(), 'R', ModItems.ammo_stinger_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_incendiary, 1), new Object[] { "S", "R", 'S', P_RED.dust(), 'R', ModItems.ammo_stinger_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_nuclear, 1), new Object[] { "RPR", "PSP", "RPR", 'R', ModItems.neutron_reflector, 'P', PU239.nugget(), 'S', ModItems.ammo_stinger_rocket });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_nuclear, 1), new Object[] { "RPR", "PSP", "RPR", 'R', ModItems.neutron_reflector, 'P', PU239.nugget(), 'S', ModItems.ammo_stinger_rocket });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_bones, 1), new Object[] { " C ", "SKR", " P ", 'C', ModItems.fallout, 'S', SR90.dust(), 'K', ModItems.ammo_stinger_rocket, 'R', RA226.dust(), 'P', PU.dust() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_stinger_rocket_bones, 1), new Object[] { " C ", "SKR", " P ", 'C', ModItems.fallout, 'S', SR90.dust(), 'K', ModItems.ammo_stinger_rocket, 'R', RA226.dust(), 'P', PU.dust() });
|
||||||
@ -259,7 +261,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', Items.gunpowder, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade, 2), new Object[] { " T ", "GCI", " P ", 'T', Items.gunpowder, 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_tracer, 2), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_tracer, 2), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ModItems.cordite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_tracer, 2), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_tracer, 2), new Object[] { " T ", "GCI", " P ", 'T', LAPIS.dust(), 'G', ModItems.ballistite, 'C', ModItems.casing_50, 'P', ModItems.primer_50, 'I', IRON.plate() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_he, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.ingot_semtex });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_he, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ANY_HIGHEXPLOSIVE.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_incendiary, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_RED.dust() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_incendiary, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_RED.dust() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_phosphorus, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_WHITE.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_phosphorus, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', P_WHITE.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_toxic, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.powder_poison });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_grenade_toxic, 2), new Object[] { "GIG", 'G', ModItems.ammo_grenade, 'I', ModItems.powder_poison });
|
||||||
@ -272,9 +274,9 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 4), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 6), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell, 6), new Object[] { " T ", "GHG", "CCC", 'T', Blocks.tnt, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModItems.ingot_semtex, 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', Items.gunpowder, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ModItems.ingot_semtex, 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 4), new Object[] { " T ", "GHG", "CCC", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.ballistite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 6), new Object[] { " T ", "GHG", "CCC", 'T', ModItems.ingot_semtex, 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_explosive, 6), new Object[] { " T ", "GHG", "CCC", 'T', ANY_HIGHEXPLOSIVE.ingot(), 'G', ModItems.cordite, 'H', ModItems.hull_small_steel, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', Items.gunpowder, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', Items.gunpowder, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.ballistite, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 4), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.ballistite, 'C', CU.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 6), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.cordite, 'C', CU.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_shell_apfsds_t, 6), new Object[] { " I ", "GIG", "CCC", 'I', W.ingot(), 'G', ModItems.cordite, 'C', CU.ingot() });
|
||||||
@ -294,6 +296,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_tots, 1), new Object[] { "PPP", "PIP", "PPP", 'P', ModItems.pellet_cluster, 'I', PU239.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_tots, 1), new Object[] { "PPP", "PIP", "PPP", 'P', ModItems.pellet_cluster, 'I', PU239.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_safe, 1), new Object[] { "G", "N", 'G', Items.glowstone_dust, 'N', ModItems.ammo_nuke_low });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_safe, 1), new Object[] { "G", "N", 'G', Items.glowstone_dust, 'N', ModItems.ammo_nuke_low });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_pumpkin, 1), new Object[] { " T ", "TST", " T ", 'T', Blocks.tnt, 'S', ModItems.assembly_nuke });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.ammo_nuke_pumpkin, 1), new Object[] { " T ", "TST", " T ", 'T', Blocks.tnt, 'S', ModItems.assembly_nuke });
|
||||||
|
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke_barrel, 1), new Object[] { ModItems.nuclear_waste_pearl, ModItems.tank_steel });
|
||||||
|
|
||||||
//MIRV recycling
|
//MIRV recycling
|
||||||
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke, 6), new Object[] { ModItems.ammo_mirv });
|
CraftingManager.addShapelessAuto(new ItemStack(ModItems.ammo_nuke, 6), new Object[] { ModItems.ammo_mirv });
|
||||||
@ -355,7 +358,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_cloud), new Object[] { "SPS", "CAC", "SPS", 'S', S.dust(), 'P', ModItems.powder_poison, 'C', CU.dust(), 'A', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.ACID.getID()) });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_cloud), new Object[] { "SPS", "CAC", "SPS", 'S', S.dust(), 'P', ModItems.powder_poison, 'C', CU.dust(), 'A', new ItemStack(ModItems.fluid_tank_full, 1, Fluids.ACID.getID()) });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_pink_cloud), new Object[] { " S ", "ECE", " E ", 'S', ModItems.powder_spark_mix, 'E', ModItems.powder_magic, 'C', ModItems.grenade_cloud });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_pink_cloud), new Object[] { " S ", "ECE", " E ", 'S', ModItems.powder_spark_mix, 'E', ModItems.powder_magic, 'C', ModItems.grenade_cloud });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.nuclear_waste_pearl), new Object[] { "WWW", "WFW", "WWW", 'W', ModItems.nuclear_waste_tiny, 'F', ModBlocks.block_fallout });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.nuclear_waste_pearl), new Object[] { "WWW", "WFW", "WWW", 'W', ModItems.nuclear_waste_tiny, 'F', ModBlocks.block_fallout });
|
||||||
//CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_nuke), new Object[] { "CGC", "CGC", "PAP", 'C', ModBlocks.det_charge, 'G', ModItems.grenade_mk2, 'P', ALLOY.plate(), 'A', Blocks.anvil });
|
CraftingManager.addShapelessAuto(new ItemStack(ModItems.grenade_kyiv), new Object[] { ModItems.canister_napalm, ModItems.bottle2_empty, ModItems.rag });
|
||||||
|
|
||||||
//Sticks of explosives
|
//Sticks of explosives
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.stick_dynamite, 4), new Object[] { " S ", "PDP", "PDP", 'S', ModItems.safety_fuse, 'P', Items.paper, 'D', ModItems.ball_dynamite });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.stick_dynamite, 4), new Object[] { " S ", "PDP", "PDP", 'S', ModItems.safety_fuse, 'P', Items.paper, 'D', ModItems.ball_dynamite });
|
||||||
@ -366,6 +369,8 @@ public class WeaponRecipes {
|
|||||||
//Blocks of explosives
|
//Blocks of explosives
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.dynamite, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_dynamite, 'S', ModItems.safety_fuse });
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.dynamite, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_dynamite, 'S', ModItems.safety_fuse });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.tnt, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_tnt, 'S', ModItems.safety_fuse });
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.tnt, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_tnt, 'S', ModItems.safety_fuse });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.semtex, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_semtex, 'S', ModItems.safety_fuse });
|
||||||
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.c4, 1), new Object[] { "DDD", "DSD", "DDD", 'D', ModItems.stick_c4, 'S', ModItems.safety_fuse });
|
||||||
|
|
||||||
|
|
||||||
//IF Grenades
|
//IF Grenades
|
||||||
@ -384,8 +389,8 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_null, 1), new Object[] { "BAB", "AGA", "BAB", 'G', ModItems.grenade_if_generic, 'A', Blocks.obsidian, 'B', BIGMT.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.grenade_if_null, 1), new Object[] { "BAB", "AGA", "BAB", 'G', ModItems.grenade_if_generic, 'A', Blocks.obsidian, 'B', BIGMT.ingot() });
|
||||||
|
|
||||||
//Mines
|
//Mines
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_ap, 4), new Object[] { "C", "P", "T", 'C', ModItems.circuit_targeting_tier2, 'P', IRON.plate(), 'T', ModItems.ingot_semtex });
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_ap, 4), new Object[] { "C", "P", "T", 'C', ModItems.circuit_targeting_tier2, 'P', IRON.plate(), 'T', ANY_PLASTICEXPLOSIVE.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_he, 1), new Object[] { " C ", "PTP", 'C', ModItems.circuit_targeting_tier2, 'P', STEEL.plate(), 'T', ModItems.ingot_semtex });
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_he, 1), new Object[] { " C ", "PTP", 'C', ModItems.circuit_targeting_tier2, 'P', STEEL.plate(), 'T', ANY_HIGHEXPLOSIVE.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_shrap, 2), new Object[] { "LLL", " C ", "PTP", 'C', ModItems.circuit_targeting_tier2, 'P', STEEL.plate(), 'T', ModBlocks.det_cord, 'L', ModItems.pellet_buckshot });
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_shrap, 2), new Object[] { "LLL", " C ", "PTP", 'C', ModItems.circuit_targeting_tier2, 'P', STEEL.plate(), 'T', ModBlocks.det_cord, 'L', ModItems.pellet_buckshot });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_fat, 1), new Object[] { "CDN", 'C', ModItems.circuit_targeting_tier2, 'D', ModItems.ducttape, 'N', ModItems.ammo_nuke });
|
CraftingManager.addRecipeAuto(new ItemStack(ModBlocks.mine_fat, 1), new Object[] { "CDN", 'C', ModItems.circuit_targeting_tier2, 'D', ModItems.ducttape, 'N', ModItems.ammo_nuke });
|
||||||
|
|
||||||
@ -395,7 +400,7 @@ public class WeaponRecipes {
|
|||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.n2_charge, 1), new Object[] { " D ", "ERE", " D ", 'D', ModItems.ducttape, 'E', ModBlocks.det_charge, 'R', REDSTONE.block() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.n2_charge, 1), new Object[] { " D ", "ERE", " D ", 'D', ModItems.ducttape, 'E', ModBlocks.det_charge, 'R', REDSTONE.block() });
|
||||||
|
|
||||||
//Custom nuke rods
|
//Custom nuke rods
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_tnt, 1), new Object[] { " C ", "TIT", "TIT", 'C', CU.plate(), 'I', IRON.plate(), 'T', Blocks.tnt });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_tnt, 1), new Object[] { " C ", "TIT", "TIT", 'C', CU.plate(), 'I', IRON.plate(), 'T', ANY_HIGHEXPLOSIVE.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_nuke, 1), new Object[] { " C ", "LUL", "LUL", 'C', CU.plate(), 'L', PB.plate(), 'U', U235.ingot() });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_nuke, 1), new Object[] { " C ", "LUL", "LUL", 'C', CU.plate(), 'L', PB.plate(), 'U', U235.ingot() });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_hydro, 1), new Object[] { " C ", "LTL", "LIL", 'C', CU.plate(), 'L', PB.plate(), 'I', IRON.plate(), 'T', ModItems.cell_tritium });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_hydro, 1), new Object[] { " C ", "LTL", "LIL", 'C', CU.plate(), 'L', PB.plate(), 'I', IRON.plate(), 'T', ModItems.cell_tritium });
|
||||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_amat, 1), new Object[] { " C ", "MMM", "AAA", 'C', CU.plate(), 'A', AL.plate(), 'M', ModItems.cell_antimatter });
|
CraftingManager.addRecipeAuto(new ItemStack(ModItems.custom_amat, 1), new Object[] { " C ", "MMM", "AAA", 'C', CU.plate(), 'A', AL.plate(), 'M', ModItems.cell_antimatter });
|
||||||
|
|||||||
@ -23,6 +23,10 @@ public class ToolboxCraftingHandler implements IRecipe {
|
|||||||
ItemStack stack = inventory.getStackInRowAndColumn(i % 3, i / 3);
|
ItemStack stack = inventory.getStackInRowAndColumn(i % 3, i / 3);
|
||||||
|
|
||||||
if(stack != null) {
|
if(stack != null) {
|
||||||
|
|
||||||
|
if(stack.getItem().hasContainerItem(stack) || !stack.getItem().doesContainerItemLeaveCraftingGrid(stack))
|
||||||
|
return false;
|
||||||
|
|
||||||
itemCount++;
|
itemCount++;
|
||||||
|
|
||||||
if(stack.getItem() == ModItems.kit_toolbox_empty) {
|
if(stack.getItem() == ModItems.kit_toolbox_empty) {
|
||||||
|
|||||||
@ -5,20 +5,20 @@ import com.hbm.config.BombConfig;
|
|||||||
import com.hbm.config.RadiationConfig;
|
import com.hbm.config.RadiationConfig;
|
||||||
import com.hbm.config.VersatileConfig;
|
import com.hbm.config.VersatileConfig;
|
||||||
import com.hbm.saveddata.AuxSavedData;
|
import com.hbm.saveddata.AuxSavedData;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
|
import net.minecraft.world.ChunkCoordIntPair;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class EntityFalloutRain extends Entity {
|
import java.util.*;
|
||||||
|
|
||||||
public int revProgress;
|
public class EntityFalloutRain extends Entity {
|
||||||
public int radProgress;
|
private boolean firstTick = true; // Of course Vanilla has it private in Entity...
|
||||||
|
|
||||||
public EntityFalloutRain(World p_i1582_1_) {
|
public EntityFalloutRain(World p_i1582_1_) {
|
||||||
super(p_i1582_1_);
|
super(p_i1582_1_);
|
||||||
@ -33,50 +33,38 @@ public class EntityFalloutRain extends Entity {
|
|||||||
this.isImmuneToFire = true;
|
this.isImmuneToFire = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int tickDelay = BombConfig.fDelay;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onUpdate() {
|
public void onUpdate() {
|
||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
if (firstTick) {
|
||||||
|
if (chunksToProcess.isEmpty() && outerChunksToProcess.isEmpty()) gatherChunks();
|
||||||
|
firstTick = false;
|
||||||
|
}
|
||||||
|
|
||||||
for(int i = 0; i < BombConfig.fSpeed; i++) {
|
if (tickDelay == 0) {
|
||||||
|
tickDelay = BombConfig.fDelay;
|
||||||
|
if (!chunksToProcess.isEmpty()) {
|
||||||
|
long chunkPos = chunksToProcess.remove(chunksToProcess.size() - 1); // Just so it doesn't shift the whole list every time
|
||||||
|
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
||||||
|
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
||||||
|
for (int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) for (int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++)
|
||||||
|
stomp(x, z, Math.hypot(x - posX, z - posZ) * 100 / getScale());
|
||||||
|
} else if (!outerChunksToProcess.isEmpty()) {
|
||||||
|
long chunkPos = outerChunksToProcess.remove(outerChunksToProcess.size() - 1);
|
||||||
|
int chunkPosX = (int) (chunkPos & Integer.MAX_VALUE);
|
||||||
|
int chunkPosZ = (int) (chunkPos >> 32 & Integer.MAX_VALUE);
|
||||||
|
for (int x = chunkPosX << 4; x <= (chunkPosX << 4) + 16; x++) for (int z = chunkPosZ << 4; z <= (chunkPosZ << 4) + 16; z++) {
|
||||||
|
double distance = Math.hypot(x - posX, z - posZ);
|
||||||
|
if (distance <= getScale()) stomp(x, z, distance * 100 / getScale());
|
||||||
|
}
|
||||||
|
} else setDead();
|
||||||
|
}
|
||||||
|
|
||||||
Vec3 vec = Vec3.createVectorHelper(radProgress * 0.5, 0, 0);
|
tickDelay--;
|
||||||
double circum = radProgress * 2 * Math.PI * 2;
|
|
||||||
|
|
||||||
///
|
if(this.isDead) {
|
||||||
if(circum == 0)
|
|
||||||
circum = 1;
|
|
||||||
///
|
|
||||||
|
|
||||||
double part = 360D / circum;
|
|
||||||
|
|
||||||
vec.rotateAroundY((float) (part * revProgress));
|
|
||||||
|
|
||||||
int x = (int) (posX + vec.xCoord);
|
|
||||||
int z = (int) (posZ + vec.zCoord);
|
|
||||||
|
|
||||||
//int y = worldObj.getHeightValue(x, z) - 1;
|
|
||||||
|
|
||||||
//if(worldObj.getBlock(x, y, z) == Blocks.grass)
|
|
||||||
// worldObj.setBlock(x, y, z, ModBlocks.waste_earth);
|
|
||||||
|
|
||||||
double dist = radProgress * 100 / getScale() * 0.5;
|
|
||||||
|
|
||||||
stomp(x, z, dist);
|
|
||||||
|
|
||||||
revProgress++;
|
|
||||||
|
|
||||||
if(revProgress > circum) {
|
|
||||||
revProgress = 0;
|
|
||||||
radProgress++;
|
|
||||||
}
|
|
||||||
|
|
||||||
if(radProgress > getScale() * 2D) {
|
|
||||||
this.setDead();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(this.isDead) {
|
|
||||||
if(RadiationConfig.rain > 0 && getScale() > 150) {
|
if(RadiationConfig.rain > 0 && getScale() > 150) {
|
||||||
worldObj.getWorldInfo().setRaining(true);
|
worldObj.getWorldInfo().setRaining(true);
|
||||||
worldObj.getWorldInfo().setThundering(true);
|
worldObj.getWorldInfo().setThundering(true);
|
||||||
@ -88,6 +76,36 @@ public class EntityFalloutRain extends Entity {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private final List<Long> chunksToProcess = new ArrayList<>();
|
||||||
|
private final List<Long> outerChunksToProcess = new ArrayList<>();
|
||||||
|
|
||||||
|
// Is it worth the effort to split this into a method that can be called over multiple ticks? I'd say it's fast enough anyway...
|
||||||
|
private void gatherChunks() {
|
||||||
|
Set<Long> chunks = new LinkedHashSet<>(); // LinkedHashSet preserves insertion order
|
||||||
|
Set<Long> outerChunks = new LinkedHashSet<>();
|
||||||
|
int outerRange = getScale();
|
||||||
|
// Basically defines something like the step size, but as indirect proportion. The actual angle used for rotation will always end up at 360° for angle == adjustedMaxAngle
|
||||||
|
// So yea, I mathematically worked out that 20 is a good value for this, with the minimum possible being 18 in order to reach all chunks
|
||||||
|
int adjustedMaxAngle = 20 * outerRange / 32; // step size = 20 * chunks / 2
|
||||||
|
for (int angle = 0; angle <= adjustedMaxAngle; angle++) {
|
||||||
|
Vec3 vector = Vec3.createVectorHelper(outerRange, 0, 0);
|
||||||
|
vector.rotateAroundY((float) (angle * Math.PI / 180.0 / (adjustedMaxAngle / 360.0))); // Ugh, mutable data classes (also, ugh, radians; it uses degrees in 1.18; took me two hours to debug)
|
||||||
|
outerChunks.add(ChunkCoordIntPair.chunkXZ2Int((int) (posX + vector.xCoord) >> 4, (int) (posZ + vector.zCoord) >> 4));
|
||||||
|
}
|
||||||
|
for (int distance = 0; distance <= outerRange; distance += 8) for (int angle = 0; angle <= adjustedMaxAngle; angle++) {
|
||||||
|
Vec3 vector = Vec3.createVectorHelper(distance, 0, 0);
|
||||||
|
vector.rotateAroundY((float) (angle * Math.PI / 180.0 / (adjustedMaxAngle / 360.0)));
|
||||||
|
long chunkCoord = ChunkCoordIntPair.chunkXZ2Int((int) (posX + vector.xCoord) >> 4, (int) (posZ + vector.zCoord) >> 4);
|
||||||
|
if (!outerChunks.contains(chunkCoord)) chunks.add(chunkCoord);
|
||||||
|
}
|
||||||
|
|
||||||
|
chunksToProcess.addAll(chunks);
|
||||||
|
outerChunksToProcess.addAll(outerChunks);
|
||||||
|
Collections.reverse(chunksToProcess); // So it starts nicely from the middle
|
||||||
|
Collections.reverse(outerChunksToProcess);
|
||||||
|
}
|
||||||
|
|
||||||
|
// TODO cache chunks?
|
||||||
private void stomp(int x, int z, double dist) {
|
private void stomp(int x, int z, double dist) {
|
||||||
|
|
||||||
int depth = 0;
|
int depth = 0;
|
||||||
@ -103,7 +121,7 @@ public class EntityFalloutRain extends Entity {
|
|||||||
|
|
||||||
if(b != ModBlocks.fallout && (ab == Blocks.air || (ab.isReplaceable(worldObj, x, y + 1, z) && !ab.getMaterial().isLiquid()))) {
|
if(b != ModBlocks.fallout && (ab == Blocks.air || (ab.isReplaceable(worldObj, x, y + 1, z) && !ab.getMaterial().isLiquid()))) {
|
||||||
|
|
||||||
double d = (double) radProgress / (double) getScale() * 0.5;
|
double d = dist / 100;
|
||||||
|
|
||||||
double chance = 0.05 - Math.pow((d - 0.6) * 0.5, 2);
|
double chance = 0.05 - Math.pow((d - 0.6) * 0.5, 2);
|
||||||
|
|
||||||
@ -145,7 +163,7 @@ public class EntityFalloutRain extends Entity {
|
|||||||
return;
|
return;
|
||||||
} else if(b == Blocks.sand) {
|
} else if(b == Blocks.sand) {
|
||||||
|
|
||||||
if(rand.nextInt(60) == 0)
|
if(rand.nextInt(20) == 0)
|
||||||
worldObj.setBlock(x, y, z, meta == 0 ? ModBlocks.waste_trinitite : ModBlocks.waste_trinitite_red);
|
worldObj.setBlock(x, y, z, meta == 0 ? ModBlocks.waste_trinitite : ModBlocks.waste_trinitite_red);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -162,9 +180,9 @@ public class EntityFalloutRain extends Entity {
|
|||||||
|
|
||||||
else if (b == Blocks.coal_ore) {
|
else if (b == Blocks.coal_ore) {
|
||||||
int ra = rand.nextInt(150);
|
int ra = rand.nextInt(150);
|
||||||
if (ra < 7) {
|
if (ra < 20) {
|
||||||
worldObj.setBlock(x, y, z, Blocks.diamond_ore);
|
worldObj.setBlock(x, y, z, Blocks.diamond_ore);
|
||||||
} else if (ra < 10) {
|
} else if (ra < 30) {
|
||||||
worldObj.setBlock(x, y, z, Blocks.emerald_ore);
|
worldObj.setBlock(x, y, z, Blocks.emerald_ore);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -219,33 +237,50 @@ public class EntityFalloutRain extends Entity {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void entityInit() {
|
protected void entityInit() {
|
||||||
this.dataWatcher.addObject(16, Integer.valueOf(0));
|
this.dataWatcher.addObject(16, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
protected void readEntityFromNBT(NBTTagCompound tag) {
|
||||||
setScale(p_70037_1_.getInteger("scale"));
|
setScale(tag.getInteger("scale"));
|
||||||
revProgress = p_70037_1_.getInteger("revProgress");
|
chunksToProcess.addAll(readChunksFromIntArray(tag.getIntArray("chunks")));
|
||||||
radProgress = p_70037_1_.getInteger("radProgress");
|
outerChunksToProcess.addAll(readChunksFromIntArray(tag.getIntArray("outerChunks")));
|
||||||
|
}
|
||||||
|
|
||||||
|
private Collection<Long> readChunksFromIntArray(int[] data) {
|
||||||
|
List<Long> coords = new ArrayList<>();
|
||||||
|
boolean firstPart = true;
|
||||||
|
int x = 0;
|
||||||
|
for (int coord : data) {
|
||||||
|
if (firstPart) x = coord;
|
||||||
|
else coords.add(ChunkCoordIntPair.chunkXZ2Int(x, coord));
|
||||||
|
firstPart = !firstPart;
|
||||||
|
}
|
||||||
|
return coords;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
protected void writeEntityToNBT(NBTTagCompound tag) {
|
||||||
p_70014_1_.setInteger("scale", getScale());
|
tag.setInteger("scale", getScale());
|
||||||
p_70014_1_.setInteger("revProgress", revProgress);
|
tag.setIntArray("chunks", writeChunksToIntArray(chunksToProcess));
|
||||||
p_70014_1_.setInteger("radProgress", radProgress);
|
tag.setIntArray("outerChunks", writeChunksToIntArray(outerChunksToProcess));
|
||||||
|
}
|
||||||
|
|
||||||
|
private int[] writeChunksToIntArray(List<Long> coords) {
|
||||||
|
int[] data = new int[coords.size() * 2];
|
||||||
|
for (int i = 0; i < coords.size(); i++) {
|
||||||
|
data[i * 2] = (int) (coords.get(i) & Integer.MAX_VALUE);
|
||||||
|
data[i * 2 + 1] = (int) (coords.get(i) >> 32 & Integer.MAX_VALUE);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setScale(int i) {
|
public void setScale(int i) {
|
||||||
|
this.dataWatcher.updateObject(16, i);
|
||||||
this.dataWatcher.updateObject(16, Integer.valueOf(i));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getScale() {
|
public int getScale() {
|
||||||
|
|
||||||
int scale = this.dataWatcher.getWatchableObjectInt(16);
|
int scale = this.dataWatcher.getWatchableObjectInt(16);
|
||||||
|
|
||||||
return scale == 0 ? 1 : scale;
|
return scale == 0 ? 1 : scale;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.hbm.entity.grenade;
|
||||||
|
|
||||||
|
import com.hbm.items.weapon.ItemGenericGrenade;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class EntityGrenadeBouncyGeneric extends EntityGrenadeBouncyBase implements IGenericGrenade {
|
||||||
|
|
||||||
|
public EntityGrenadeBouncyGeneric(World world) {
|
||||||
|
super(world);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityGrenadeBouncyGeneric(World world, EntityLivingBase living) {
|
||||||
|
super(world, living);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityGrenadeBouncyGeneric(World world, double x, double y, double z) {
|
||||||
|
super(world, x, y, z);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityGrenadeBouncyGeneric setType(ItemGenericGrenade grenade) {
|
||||||
|
this.dataWatcher.updateObject(12, Item.getIdFromItem(grenade));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemGenericGrenade getGrenade() {
|
||||||
|
return (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
this.dataWatcher.addObject(12, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void explode() {
|
||||||
|
getGrenade().explode(worldObj, posX, posY, posZ);
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeEntityToNBT(nbt);
|
||||||
|
nbt.setInteger("grenade", this.dataWatcher.getWatchableObjectInt(12));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readEntityFromNBT(nbt);
|
||||||
|
this.dataWatcher.updateObject(12, nbt.getInteger("grenade"));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected int getMaxTimer() {
|
||||||
|
return getGrenade().getMaxTimer();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected double getBounceMod() {
|
||||||
|
return getGrenade().getBounceMod();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -4,31 +4,26 @@ import net.minecraft.entity.Entity;
|
|||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
public class EntityGrenadeGascan extends EntityGrenadeBase
|
public class EntityGrenadeGascan extends EntityGrenadeBase {
|
||||||
{
|
|
||||||
|
|
||||||
public EntityGrenadeGascan(World p_i1773_1_)
|
public EntityGrenadeGascan(World p_i1773_1_) {
|
||||||
{
|
super(p_i1773_1_);
|
||||||
super(p_i1773_1_);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public EntityGrenadeGascan(World p_i1774_1_, EntityLivingBase p_i1774_2_)
|
public EntityGrenadeGascan(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||||
{
|
super(p_i1774_1_, p_i1774_2_);
|
||||||
super(p_i1774_1_, p_i1774_2_);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public EntityGrenadeGascan(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_)
|
public EntityGrenadeGascan(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||||
{
|
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||||
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void explode() {
|
public void explode() {
|
||||||
|
|
||||||
if (!this.worldObj.isRemote)
|
if(!this.worldObj.isRemote) {
|
||||||
{
|
this.setDead();
|
||||||
this.setDead();
|
this.worldObj.newExplosion((Entity) null, (float) this.posX, (float) this.posY, (float) this.posZ, 5.0F, true, false);
|
||||||
this.worldObj.newExplosion((Entity)null, (float)this.posX, (float)this.posY, (float)this.posZ, 5.0F, true, false);
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,59 @@
|
|||||||
|
package com.hbm.entity.grenade;
|
||||||
|
|
||||||
|
import com.hbm.items.weapon.ItemGenericGrenade;
|
||||||
|
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class EntityGrenadeImpactGeneric extends EntityGrenadeBase implements IGenericGrenade {
|
||||||
|
|
||||||
|
public EntityGrenadeImpactGeneric(World p_i1773_1_) {
|
||||||
|
super(p_i1773_1_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityGrenadeImpactGeneric(World p_i1774_1_, EntityLivingBase p_i1774_2_) {
|
||||||
|
super(p_i1774_1_, p_i1774_2_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityGrenadeImpactGeneric(World p_i1775_1_, double p_i1775_2_, double p_i1775_4_, double p_i1775_6_) {
|
||||||
|
super(p_i1775_1_, p_i1775_2_, p_i1775_4_, p_i1775_6_);
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityGrenadeImpactGeneric setType(ItemGenericGrenade grenade) {
|
||||||
|
this.dataWatcher.updateObject(12, Item.getIdFromItem(grenade));
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemGenericGrenade getGrenade() {
|
||||||
|
return (ItemGenericGrenade) Item.getItemById(this.dataWatcher.getWatchableObjectInt(12));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void entityInit() {
|
||||||
|
this.dataWatcher.addObject(12, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void explode() {
|
||||||
|
|
||||||
|
if(!this.worldObj.isRemote) {
|
||||||
|
getGrenade().explode(worldObj, posX, posY, posZ);
|
||||||
|
this.setDead();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeEntityToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeEntityToNBT(nbt);
|
||||||
|
nbt.setInteger("grenade", this.dataWatcher.getWatchableObjectInt(12));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readEntityFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readEntityFromNBT(nbt);
|
||||||
|
this.dataWatcher.updateObject(12, nbt.getInteger("grenade"));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package com.hbm.entity.grenade;
|
||||||
|
|
||||||
|
import com.hbm.items.weapon.ItemGenericGrenade;
|
||||||
|
|
||||||
|
public interface IGenericGrenade {
|
||||||
|
|
||||||
|
public ItemGenericGrenade getGrenade();
|
||||||
|
}
|
||||||
@ -56,7 +56,7 @@ public class EntityMinerRocket extends Entity {
|
|||||||
|
|
||||||
if(dataWatcher.getWatchableObjectInt(16) == 1) {
|
if(dataWatcher.getWatchableObjectInt(16) == 1) {
|
||||||
|
|
||||||
if(ticksExisted % 2 == 0)
|
if(!worldObj.isRemote && ticksExisted % 4 == 0)
|
||||||
ExplosionLarge.spawnShock(worldObj, posX, posY, posZ, 1 + rand.nextInt(3), 1 + rand.nextGaussian());
|
ExplosionLarge.spawnShock(worldObj, posX, posY, posZ, 1 + rand.nextInt(3), 1 + rand.nextGaussian());
|
||||||
|
|
||||||
timer++;
|
timer++;
|
||||||
|
|||||||
@ -6,10 +6,10 @@ import com.hbm.items.ModItems;
|
|||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.EntityAgeable;
|
import net.minecraft.entity.EntityAgeable;
|
||||||
import net.minecraft.entity.EntityLeashKnot;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.boss.IBossDisplayData;
|
import net.minecraft.entity.boss.IBossDisplayData;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@ -107,6 +107,8 @@ public class EntityQuackos extends EntityDuck implements IBossDisplayData {
|
|||||||
fx.setPositionAndRotation(posX + rand.nextDouble() * 20 - 10, posY + rand.nextDouble() * 25, posZ + rand.nextDouble() * 20 - 10, 0, 0);
|
fx.setPositionAndRotation(posX + rand.nextDouble() * 20 - 10, posY + rand.nextDouble() * 25, posZ + rand.nextDouble() * 20 - 10, 0, 0);
|
||||||
worldObj.spawnEntityInWorld(fx);
|
worldObj.spawnEntityInWorld(fx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
dropItem(ModItems.spawn_duck, 3);
|
||||||
}
|
}
|
||||||
this.isDead = true;
|
this.isDead = true;
|
||||||
}
|
}
|
||||||
@ -148,12 +150,14 @@ public class EntityQuackos extends EntityDuck implements IBossDisplayData {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* BOW
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void updateLeashedState() {
|
public void onDeath(DamageSource sourceOrRatherLackThereof) { }
|
||||||
|
|
||||||
if(this.getLeashedToEntity() instanceof EntityLeashKnot)
|
@Override
|
||||||
this.getLeashedToEntity().setDead();
|
public boolean allowLeashing() {
|
||||||
|
return false;
|
||||||
super.updateLeashedState();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -6,6 +6,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.projectile.EntityThrowable;
|
import net.minecraft.entity.projectile.EntityThrowable;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.MovingObjectPosition;
|
import net.minecraft.util.MovingObjectPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ public class EntityFallingNuke extends EntityThrowable {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void entityInit() {
|
protected void entityInit() {
|
||||||
this.dataWatcher.addObject(20, Byte.valueOf((byte)0));
|
this.dataWatcher.addObject(20, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -91,7 +92,31 @@ public class EntityFallingNuke extends EntityThrowable {
|
|||||||
protected void onImpact(MovingObjectPosition p_70184_1_) {
|
protected void onImpact(MovingObjectPosition p_70184_1_) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
public void writeEntityToNBT(NBTTagCompound tag) {
|
||||||
|
super.writeEntityToNBT(tag);
|
||||||
|
tag.setFloat("tnt", tnt);
|
||||||
|
tag.setFloat("nuke", nuke);
|
||||||
|
tag.setFloat("hydro", hydro);
|
||||||
|
tag.setFloat("amat", amat);
|
||||||
|
tag.setFloat("dirty", dirty);
|
||||||
|
tag.setFloat("schrab", schrab);
|
||||||
|
tag.setFloat("euph", euph);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readEntityFromNBT(NBTTagCompound tag) {
|
||||||
|
super.readEntityFromNBT(tag);
|
||||||
|
tnt = tag.getFloat("tnt");
|
||||||
|
nuke = tag.getFloat("nuke");
|
||||||
|
hydro = tag.getFloat("hydro");
|
||||||
|
amat = tag.getFloat("amat");
|
||||||
|
dirty = tag.getFloat("dirty");
|
||||||
|
schrab = tag.getFloat("schrab");
|
||||||
|
euph = tag.getFloat("euph");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean isInRangeToRenderDist(double distance)
|
public boolean isInRangeToRenderDist(double distance)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -1,57 +0,0 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
|
||||||
|
|
||||||
import java.util.HashSet;
|
|
||||||
import java.util.Iterator;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
import net.minecraft.block.material.Material;
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class BlockProcessorStandard implements IBlockProcessor {
|
|
||||||
|
|
||||||
protected IDropChanceMutator chance;
|
|
||||||
|
|
||||||
public BlockProcessorStandard() { }
|
|
||||||
|
|
||||||
public BlockProcessorStandard(IDropChanceMutator chance) {
|
|
||||||
this.chance = chance;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void process(ExplosionVNT explosion, World world, double x, double y, double z, HashSet<ChunkPosition> affectedBlocks) {
|
|
||||||
|
|
||||||
Iterator iterator = affectedBlocks.iterator();
|
|
||||||
float dropChance = 1.0F / explosion.size;
|
|
||||||
|
|
||||||
while(iterator.hasNext()) {
|
|
||||||
ChunkPosition chunkposition = (ChunkPosition) iterator.next();
|
|
||||||
int blockX = chunkposition.chunkPosX;
|
|
||||||
int blockY = chunkposition.chunkPosY;
|
|
||||||
int blockZ = chunkposition.chunkPosZ;
|
|
||||||
Block block = world.getBlock(blockX, blockY, blockZ);
|
|
||||||
|
|
||||||
if(block.getMaterial() != Material.air) {
|
|
||||||
if(block.canDropFromExplosion(null)) {
|
|
||||||
|
|
||||||
if(chance != null) {
|
|
||||||
dropChance = chance.mutateDropChance(explosion, block, blockX, blockY, blockZ, dropChance);
|
|
||||||
}
|
|
||||||
|
|
||||||
block.dropBlockAsItemWithChance(world, blockX, blockY, blockZ, world.getBlockMetadata(blockX, blockY, blockZ), dropChance, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
block.onBlockExploded(world, blockX, blockY, blockZ, null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public BlockProcessorStandard setNoDrop() {
|
|
||||||
this.chance = new DropChanceNever();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
public BlockProcessorStandard setAllDrop() {
|
|
||||||
this.chance = new DropChanceAlways();
|
|
||||||
return this;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,16 +0,0 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Now it's getting ridiculously over-engineered
|
|
||||||
* @author hbm
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class DropChanceAlways implements IDropChanceMutator {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float mutateDropChance(ExplosionVNT explosion, Block block, int x, int y, int z, float chance) {
|
|
||||||
return 1F;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,11 +0,0 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
|
||||||
|
|
||||||
public class DropChanceNever implements IDropChanceMutator {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public float mutateDropChance(ExplosionVNT explosion, Block block, int x, int y, int z, float chance) {
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -2,6 +2,20 @@ package com.hbm.explosion.vanillant;
|
|||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IBlockAllocator;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IBlockProcessor;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IEntityProcessor;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IExplosionSFX;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IPlayerProcessor;
|
||||||
|
import com.hbm.explosion.vanillant.standard.BlockAllocatorStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.BlockProcessorStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.CustomDamageHandlerAmat;
|
||||||
|
import com.hbm.explosion.vanillant.standard.EntityProcessorStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.ExplosionEffectAmat;
|
||||||
|
import com.hbm.explosion.vanillant.standard.ExplosionEffectStandard;
|
||||||
|
import com.hbm.explosion.vanillant.standard.PlayerProcessorStandard;
|
||||||
|
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -29,9 +43,10 @@ public class ExplosionVNT {
|
|||||||
protected double posX;
|
protected double posX;
|
||||||
protected double posY;
|
protected double posY;
|
||||||
protected double posZ;
|
protected double posZ;
|
||||||
protected float size;
|
public float size;
|
||||||
public Entity exploder;
|
public Entity exploder;
|
||||||
|
|
||||||
|
private Map compatPlayers = new HashMap();
|
||||||
public Explosion compat;
|
public Explosion compat;
|
||||||
|
|
||||||
public ExplosionVNT(World world, double x, double y, double z, float size) {
|
public ExplosionVNT(World world, double x, double y, double z, float size) {
|
||||||
@ -46,22 +61,37 @@ public class ExplosionVNT {
|
|||||||
this.size = size;
|
this.size = size;
|
||||||
this.exploder = exploder;
|
this.exploder = exploder;
|
||||||
|
|
||||||
this.compat = new Explosion(world, exploder, x, y, z, size);
|
this.compat = new Explosion(world, exploder, x, y, z, size) {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Map func_77277_b() {
|
||||||
|
return ExplosionVNT.this.compatPlayers;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public void explode() {
|
public void explode() {
|
||||||
|
|
||||||
|
this.compat.exploder = this.exploder;
|
||||||
|
this.compat.explosionSize = this.size;
|
||||||
|
|
||||||
boolean processBlocks = blockAllocator != null && blockProcessor != null;
|
boolean processBlocks = blockAllocator != null && blockProcessor != null;
|
||||||
boolean processEntities = entityProcessor != null && playerProcessor != null;
|
boolean processEntities = entityProcessor != null && playerProcessor != null;
|
||||||
|
|
||||||
HashSet<ChunkPosition> affectedBlocks = null;
|
HashSet<ChunkPosition> affectedBlocks = null;
|
||||||
HashMap<EntityPlayer, Vec3> affectedEntities = null;
|
HashMap<EntityPlayer, Vec3> affectedPlayers = null;
|
||||||
|
|
||||||
|
//allocation
|
||||||
if(processBlocks) affectedBlocks = blockAllocator.allocate(this, world, posX, posY, posZ, size);
|
if(processBlocks) affectedBlocks = blockAllocator.allocate(this, world, posX, posY, posZ, size);
|
||||||
if(processEntities) affectedEntities = entityProcessor.process(this, world, posX, posY, posZ, size);
|
if(processEntities) affectedPlayers = entityProcessor.process(this, world, posX, posY, posZ, size);
|
||||||
|
|
||||||
|
//serverside processing
|
||||||
if(processBlocks) blockProcessor.process(this, world, posX, posY, posZ, affectedBlocks);
|
if(processBlocks) blockProcessor.process(this, world, posX, posY, posZ, affectedBlocks);
|
||||||
if(processEntities) playerProcessor.process(this, world, posX, posY, posZ, affectedEntities);
|
if(processEntities) playerProcessor.process(this, world, posX, posY, posZ, affectedPlayers);
|
||||||
|
|
||||||
|
//compat
|
||||||
|
if(processBlocks) this.compat.affectedBlockPositions.addAll(affectedBlocks);
|
||||||
|
if(processEntities) this.compatPlayers.putAll(affectedPlayers);
|
||||||
|
|
||||||
if(sfx != null) {
|
if(sfx != null) {
|
||||||
for(IExplosionSFX fx : sfx) {
|
for(IExplosionSFX fx : sfx) {
|
||||||
@ -90,4 +120,25 @@ public class ExplosionVNT {
|
|||||||
this.sfx = sfx;
|
this.sfx = sfx;
|
||||||
return this;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public ExplosionVNT makeStandard() {
|
||||||
|
this.setBlockAllocator(new BlockAllocatorStandard());
|
||||||
|
this.setBlockProcessor(new BlockProcessorStandard());
|
||||||
|
this.setEntityProcessor(new EntityProcessorStandard());
|
||||||
|
this.setPlayerProcessor(new PlayerProcessorStandard());
|
||||||
|
this.setSFX(new ExplosionEffectStandard());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public ExplosionVNT makeAmat() {
|
||||||
|
this.setBlockAllocator(new BlockAllocatorStandard(this.size < 15 ? 16 : 32));
|
||||||
|
this.setBlockProcessor(new BlockProcessorStandard()
|
||||||
|
.setNoDrop());
|
||||||
|
this.setEntityProcessor(new EntityProcessorStandard()
|
||||||
|
.withRangeMod(2F)
|
||||||
|
.withDamageMod(new CustomDamageHandlerAmat(50F)));
|
||||||
|
this.setPlayerProcessor(new PlayerProcessorStandard());
|
||||||
|
this.setSFX(new ExplosionEffectAmat());
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,7 +1,9 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
import net.minecraft.world.ChunkPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
|
public interface IBlockMutator {
|
||||||
|
|
||||||
|
public int mutateAtPosition(ExplosionVNT explosion, int x, int y, int z);
|
||||||
|
}
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
import net.minecraft.world.ChunkPosition;
|
import net.minecraft.world.ChunkPosition;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
|
||||||
|
public interface ICustomDamageHandler {
|
||||||
|
|
||||||
|
public void handleAttack(ExplosionVNT explosion, Entity entity, double distanceScaled);
|
||||||
|
}
|
||||||
@ -1,4 +1,6 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@ -0,0 +1,8 @@
|
|||||||
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
|
public interface IEntityRangeMutator {
|
||||||
|
|
||||||
|
public float mutateRange(ExplosionVNT explosion, float range);
|
||||||
|
}
|
||||||
@ -1,4 +1,6 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
@ -0,0 +1,10 @@
|
|||||||
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
|
public interface IFortuneMutator {
|
||||||
|
|
||||||
|
public int mutateFortune(ExplosionVNT explosion, Block block, int x, int y, int z);
|
||||||
|
}
|
||||||
@ -1,7 +1,9 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.interfaces;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.util.Vec3;
|
import net.minecraft.util.Vec3;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
@ -1,7 +1,10 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IBlockAllocator;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
@ -0,0 +1,104 @@
|
|||||||
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Iterator;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IBlockMutator;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IBlockProcessor;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IDropChanceMutator;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IFortuneMutator;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.block.material.Material;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class BlockProcessorStandard implements IBlockProcessor {
|
||||||
|
|
||||||
|
protected IDropChanceMutator chance;
|
||||||
|
protected IFortuneMutator fortune;
|
||||||
|
protected IBlockMutator convert;
|
||||||
|
|
||||||
|
public BlockProcessorStandard() { }
|
||||||
|
|
||||||
|
public BlockProcessorStandard withChance(IDropChanceMutator chance) {
|
||||||
|
this.chance = chance;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockProcessorStandard withFortune(IFortuneMutator fortune) {
|
||||||
|
this.fortune = fortune;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockProcessorStandard withBlockEffect(IBlockMutator convert) {
|
||||||
|
this.convert = convert;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void process(ExplosionVNT explosion, World world, double x, double y, double z, HashSet<ChunkPosition> affectedBlocks) {
|
||||||
|
|
||||||
|
Iterator iterator = affectedBlocks.iterator();
|
||||||
|
float dropChance = 1.0F / explosion.size;
|
||||||
|
|
||||||
|
while(iterator.hasNext()) {
|
||||||
|
ChunkPosition chunkposition = (ChunkPosition) iterator.next();
|
||||||
|
int blockX = chunkposition.chunkPosX;
|
||||||
|
int blockY = chunkposition.chunkPosY;
|
||||||
|
int blockZ = chunkposition.chunkPosZ;
|
||||||
|
Block block = world.getBlock(blockX, blockY, blockZ);
|
||||||
|
|
||||||
|
if(block.getMaterial() != Material.air) {
|
||||||
|
if(block.canDropFromExplosion(null)) {
|
||||||
|
|
||||||
|
if(chance != null) {
|
||||||
|
dropChance = chance.mutateDropChance(explosion, block, blockX, blockY, blockZ, dropChance);
|
||||||
|
}
|
||||||
|
|
||||||
|
int dropFortune = fortune == null ? 0 : fortune.mutateFortune(explosion, block, blockX, blockY, blockZ);
|
||||||
|
|
||||||
|
block.dropBlockAsItemWithChance(world, blockX, blockY, blockZ, world.getBlockMetadata(blockX, blockY, blockZ), dropChance, dropFortune);
|
||||||
|
}
|
||||||
|
|
||||||
|
block.onBlockExploded(world, blockX, blockY, blockZ, explosion.compat);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if(this.convert != null) {
|
||||||
|
iterator = affectedBlocks.iterator();
|
||||||
|
|
||||||
|
while(iterator.hasNext()) {
|
||||||
|
ChunkPosition chunkposition = (ChunkPosition) iterator.next();
|
||||||
|
int blockX = chunkposition.chunkPosX;
|
||||||
|
int blockY = chunkposition.chunkPosY;
|
||||||
|
int blockZ = chunkposition.chunkPosZ;
|
||||||
|
Block block = world.getBlock(blockX, blockY, blockZ);
|
||||||
|
|
||||||
|
if(block.getMaterial() == Material.air) {
|
||||||
|
this.convert.mutateAtPosition(explosion, blockX, blockY, blockZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public BlockProcessorStandard setNoDrop() {
|
||||||
|
this.chance = new DropChanceMutatorStandard(0F);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public BlockProcessorStandard setAllDrop() {
|
||||||
|
this.chance = new DropChanceMutatorStandard(1F);
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
public BlockProcessorStandard setFortune(int fortune) {
|
||||||
|
this.fortune = new IFortuneMutator() { //no standard class because we only have one case thus far
|
||||||
|
@Override
|
||||||
|
public int mutateFortune(ExplosionVNT explosion, Block block, int x, int y, int z) {
|
||||||
|
return fortune;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,25 @@
|
|||||||
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
|
||||||
|
import com.hbm.util.ContaminationUtil;
|
||||||
|
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||||
|
import com.hbm.util.ContaminationUtil.HazardType;
|
||||||
|
|
||||||
|
import net.minecraft.entity.Entity;
|
||||||
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|
||||||
|
public class CustomDamageHandlerAmat implements ICustomDamageHandler {
|
||||||
|
|
||||||
|
protected float radiation;
|
||||||
|
|
||||||
|
public CustomDamageHandlerAmat(float radiation) {
|
||||||
|
this.radiation = radiation;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void handleAttack(ExplosionVNT explosion, Entity entity, double distanceScaled) {
|
||||||
|
if(entity instanceof EntityLivingBase)
|
||||||
|
ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.CREATIVE, (float) (radiation * (1D - distanceScaled) * explosion.size));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,20 @@
|
|||||||
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IDropChanceMutator;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
|
public class DropChanceMutatorStandard implements IDropChanceMutator {
|
||||||
|
|
||||||
|
private float chance;
|
||||||
|
|
||||||
|
public DropChanceMutatorStandard(float chance) {
|
||||||
|
this.chance = chance;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float mutateDropChance(ExplosionVNT explosion, Block block, int x, int y, int z, float chance) {
|
||||||
|
return this.chance;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,13 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.ICustomDamageHandler;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IEntityProcessor;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IEntityRangeMutator;
|
||||||
|
|
||||||
import net.minecraft.enchantment.EnchantmentProtection;
|
import net.minecraft.enchantment.EnchantmentProtection;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -14,6 +19,9 @@ import net.minecraftforge.event.ForgeEventFactory;
|
|||||||
|
|
||||||
public class EntityProcessorStandard implements IEntityProcessor {
|
public class EntityProcessorStandard implements IEntityProcessor {
|
||||||
|
|
||||||
|
protected IEntityRangeMutator range;
|
||||||
|
protected ICustomDamageHandler damage;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public HashMap<EntityPlayer, Vec3> process(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
|
public HashMap<EntityPlayer, Vec3> process(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
|
||||||
|
|
||||||
@ -21,6 +29,10 @@ public class EntityProcessorStandard implements IEntityProcessor {
|
|||||||
|
|
||||||
size *= 2.0F;
|
size *= 2.0F;
|
||||||
|
|
||||||
|
if(range != null) {
|
||||||
|
size = range.mutateRange(explosion, size);
|
||||||
|
}
|
||||||
|
|
||||||
double minX = x - (double) size - 1.0D;
|
double minX = x - (double) size - 1.0D;
|
||||||
double maxX = x + (double) size + 1.0D;
|
double maxX = x + (double) size + 1.0D;
|
||||||
double minY = y - (double) size - 1.0D;
|
double minY = y - (double) size - 1.0D;
|
||||||
@ -64,10 +76,29 @@ public class EntityProcessorStandard implements IEntityProcessor {
|
|||||||
if(entity instanceof EntityPlayer) {
|
if(entity instanceof EntityPlayer) {
|
||||||
affectedPlayers.put((EntityPlayer) entity, Vec3.createVectorHelper(deltaX * knockback, deltaY * knockback, deltaZ * knockback));
|
affectedPlayers.put((EntityPlayer) entity, Vec3.createVectorHelper(deltaX * knockback, deltaY * knockback, deltaZ * knockback));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(damage != null) {
|
||||||
|
damage.handleAttack(explosion, entity, distanceScaled);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return affectedPlayers;
|
return affectedPlayers;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public EntityProcessorStandard withRangeMod(float mod) {
|
||||||
|
range = new IEntityRangeMutator() {
|
||||||
|
@Override
|
||||||
|
public float mutateRange(ExplosionVNT explosion, float range) {
|
||||||
|
return range * mod;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return this;
|
||||||
|
}
|
||||||
|
|
||||||
|
public EntityProcessorStandard withDamageMod(ICustomDamageHandler damage) {
|
||||||
|
this.damage = damage;
|
||||||
|
return this;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -0,0 +1,27 @@
|
|||||||
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IExplosionSFX;
|
||||||
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ExplosionEffectAmat implements IExplosionSFX {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doEffect(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
|
||||||
|
|
||||||
|
if(size < 15)
|
||||||
|
world.playSoundEffect(x, y, z, "random.explode", 4.0F, (1.4F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||||
|
else
|
||||||
|
world.playSoundEffect(x, y, z, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
||||||
|
|
||||||
|
NBTTagCompound data = new NBTTagCompound();
|
||||||
|
data.setString("type", "amat");
|
||||||
|
data.setFloat("scale", size);
|
||||||
|
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x, y, z), new TargetPoint(world.provider.dimensionId, x, y, z, 200));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,64 @@
|
|||||||
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IExplosionSFX;
|
||||||
|
import com.hbm.packet.ExplosionVanillaNewTechnologyCompressedAffectedBlockPositionDataForClientEffectsAndParticleHandlingPacket;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.ChunkPosition;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ExplosionEffectStandard implements IExplosionSFX {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void doEffect(ExplosionVNT explosion, World world, double x, double y, double z, float size) {
|
||||||
|
|
||||||
|
if(world.isRemote)
|
||||||
|
return;
|
||||||
|
|
||||||
|
world.playSoundEffect(x, y, z, "random.explode", 4.0F, (1.0F + (world.rand.nextFloat() - world.rand.nextFloat()) * 0.2F) * 0.7F);
|
||||||
|
|
||||||
|
PacketDispatcher.wrapper.sendToAllAround(new ExplosionVanillaNewTechnologyCompressedAffectedBlockPositionDataForClientEffectsAndParticleHandlingPacket(x, y, z, explosion.size, explosion.compat.affectedBlockPositions), new TargetPoint(world.provider.dimensionId, x, y, z, 250));
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void performClient(World world, double x, double y, double z, float size, List affectedBlocks) {
|
||||||
|
|
||||||
|
if(size >= 2.0F) {
|
||||||
|
world.spawnParticle("hugeexplosion", x, y, z, 1.0D, 0.0D, 0.0D);
|
||||||
|
} else {
|
||||||
|
world.spawnParticle("largeexplode", x, z, z, 1.0D, 0.0D, 0.0D);
|
||||||
|
}
|
||||||
|
|
||||||
|
int count = affectedBlocks.size();
|
||||||
|
|
||||||
|
for(int i = 0; i < count; i++) {
|
||||||
|
|
||||||
|
ChunkPosition pos = (ChunkPosition) affectedBlocks.get(i);
|
||||||
|
int pX = pos.chunkPosX;
|
||||||
|
int pY = pos.chunkPosY;
|
||||||
|
int pZ = pos.chunkPosZ;
|
||||||
|
|
||||||
|
double oX = (double) ((float) pX + world.rand.nextFloat());
|
||||||
|
double oY = (double) ((float) pY + world.rand.nextFloat());
|
||||||
|
double oZ = (double) ((float) pZ + world.rand.nextFloat());
|
||||||
|
double dX = oX - x;
|
||||||
|
double dY = oY - y;
|
||||||
|
double dZ = oZ - z;
|
||||||
|
double delta = (double) MathHelper.sqrt_double(dX * dX + dY * dY + dZ * dZ) / 1D /* hehehe */;
|
||||||
|
dX /= delta;
|
||||||
|
dY /= delta;
|
||||||
|
dZ /= delta;
|
||||||
|
double mod = 0.5D / (delta / (double) size + 0.1D);
|
||||||
|
mod *= (double) (world.rand.nextFloat() * world.rand.nextFloat() + 0.3F);
|
||||||
|
dX *= mod;
|
||||||
|
dY *= mod;
|
||||||
|
dZ *= mod;
|
||||||
|
world.spawnParticle("explode", (oX + x * 1.0D) / 2.0D, (oY + y * 1.0D) / 2.0D, (oZ + z * 1.0D) / 2.0D, dX, dY, dZ);
|
||||||
|
world.spawnParticle("smoke", oX, oY, oZ, dX, dY, dZ);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,8 +1,10 @@
|
|||||||
package com.hbm.explosion.vanillant;
|
package com.hbm.explosion.vanillant.standard;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
|
import com.hbm.explosion.vanillant.interfaces.IPlayerProcessor;
|
||||||
import com.hbm.packet.ExplosionKnockbackPacket;
|
import com.hbm.packet.ExplosionKnockbackPacket;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
|
||||||
@ -289,6 +289,8 @@ public class BobmazonOfferFactory {
|
|||||||
new ItemStack(ModItems.ammo_5mm_star, 64),
|
new ItemStack(ModItems.ammo_5mm_star, 64),
|
||||||
new ItemStack(ModItems.ammo_5mm_star, 64)
|
new ItemStack(ModItems.ammo_5mm_star, 64)
|
||||||
).setStackDisplayName("Frenchman's Reward"), Requirement.HIDDEN, 32));
|
).setStackDisplayName("Frenchman's Reward"), Requirement.HIDDEN, 32));
|
||||||
|
|
||||||
|
special.add(new Offer(new ItemStack(ModItems.gun_detonator, 1), Requirement.HIDDEN, 32));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static List<Offer> getOffers(ItemStack stack) {
|
public static List<Offer> getOffers(ItemStack stack) {
|
||||||
|
|||||||
@ -226,6 +226,7 @@ public class BulletConfigSyncingUtil {
|
|||||||
public static int NUKE_AMAT = i++;
|
public static int NUKE_AMAT = i++;
|
||||||
|
|
||||||
public static int ZOMG_BOLT = i++;
|
public static int ZOMG_BOLT = i++;
|
||||||
|
public static int DET_BOLT = i++;
|
||||||
|
|
||||||
public static int TURBINE = i++;
|
public static int TURBINE = i++;
|
||||||
|
|
||||||
@ -468,6 +469,7 @@ public class BulletConfigSyncingUtil {
|
|||||||
configSet.put(NUKE_AMAT, GunFatmanFactory.getBalefireConfig());
|
configSet.put(NUKE_AMAT, GunFatmanFactory.getBalefireConfig());
|
||||||
|
|
||||||
configSet.put(ZOMG_BOLT, GunEnergyFactory.getZOMGBoltConfig());
|
configSet.put(ZOMG_BOLT, GunEnergyFactory.getZOMGBoltConfig());
|
||||||
|
configSet.put(DET_BOLT, GunDetonatorFactory.getLaserConfig());
|
||||||
|
|
||||||
configSet.put(TURBINE, GunEnergyFactory.getTurbineConfig());
|
configSet.put(TURBINE, GunEnergyFactory.getTurbineConfig());
|
||||||
|
|
||||||
|
|||||||
@ -30,6 +30,7 @@ public class GUIHandler implements IGuiHandler {
|
|||||||
if(entity instanceof TileEntityMachineLiquefactor) { return new ContainerLiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity); }
|
if(entity instanceof TileEntityMachineLiquefactor) { return new ContainerLiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity); }
|
||||||
if(entity instanceof TileEntityMachineSolidifier) { return new ContainerSolidifier(player.inventory, (TileEntityMachineSolidifier) entity); }
|
if(entity instanceof TileEntityMachineSolidifier) { return new ContainerSolidifier(player.inventory, (TileEntityMachineSolidifier) entity); }
|
||||||
if(entity instanceof TileEntityMachineRadiolysis) { return new ContainerRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity); }
|
if(entity instanceof TileEntityMachineRadiolysis) { return new ContainerRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity); }
|
||||||
|
if(entity instanceof TileEntityMachineChemfac) { return new ContainerChemfac(player.inventory, (TileEntityMachineChemfac) entity); }
|
||||||
|
|
||||||
switch(ID) {
|
switch(ID) {
|
||||||
case ModBlocks.guiID_test_difurnace: {
|
case ModBlocks.guiID_test_difurnace: {
|
||||||
@ -870,6 +871,7 @@ public class GUIHandler implements IGuiHandler {
|
|||||||
if(entity instanceof TileEntityMachineLiquefactor) { return new GUILiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity); }
|
if(entity instanceof TileEntityMachineLiquefactor) { return new GUILiquefactor(player.inventory, (TileEntityMachineLiquefactor) entity); }
|
||||||
if(entity instanceof TileEntityMachineSolidifier) { return new GUISolidifier(player.inventory, (TileEntityMachineSolidifier) entity); }
|
if(entity instanceof TileEntityMachineSolidifier) { return new GUISolidifier(player.inventory, (TileEntityMachineSolidifier) entity); }
|
||||||
if(entity instanceof TileEntityMachineRadiolysis) { return new GUIRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity); }
|
if(entity instanceof TileEntityMachineRadiolysis) { return new GUIRadiolysis(player.inventory, (TileEntityMachineRadiolysis) entity); }
|
||||||
|
if(entity instanceof TileEntityMachineChemfac) { return new GUIChemfac(player.inventory, (TileEntityMachineChemfac) entity); }
|
||||||
|
|
||||||
switch(ID) {
|
switch(ID) {
|
||||||
case ModBlocks.guiID_test_difurnace: {
|
case ModBlocks.guiID_test_difurnace: {
|
||||||
|
|||||||
@ -110,6 +110,11 @@ public class HazmatRegistry {
|
|||||||
HazmatRegistry.registerHazmat(ModItems.bj_legs, bj * legs);
|
HazmatRegistry.registerHazmat(ModItems.bj_legs, bj * legs);
|
||||||
HazmatRegistry.registerHazmat(ModItems.bj_boots, bj * boots);
|
HazmatRegistry.registerHazmat(ModItems.bj_boots, bj * boots);
|
||||||
|
|
||||||
|
HazmatRegistry.registerHazmat(ModItems.steamsuit_helmet, 1.3 * helmet);
|
||||||
|
HazmatRegistry.registerHazmat(ModItems.steamsuit_plate, 1.3 * chest);
|
||||||
|
HazmatRegistry.registerHazmat(ModItems.steamsuit_legs, 1.3 * legs);
|
||||||
|
HazmatRegistry.registerHazmat(ModItems.steamsuit_boots, 1.3 * boots);
|
||||||
|
|
||||||
HazmatRegistry.registerHazmat(ModItems.hev_helmet, hev * helmet);
|
HazmatRegistry.registerHazmat(ModItems.hev_helmet, hev * helmet);
|
||||||
HazmatRegistry.registerHazmat(ModItems.hev_plate, hev * chest);
|
HazmatRegistry.registerHazmat(ModItems.hev_plate, hev * chest);
|
||||||
HazmatRegistry.registerHazmat(ModItems.hev_legs, hev * legs);
|
HazmatRegistry.registerHazmat(ModItems.hev_legs, hev * legs);
|
||||||
|
|||||||
@ -21,6 +21,82 @@ import net.minecraft.potion.PotionEffect;
|
|||||||
|
|
||||||
public class Gun12GaugeFactory {
|
public class Gun12GaugeFactory {
|
||||||
|
|
||||||
|
public static GunConfiguration getSpas12Config() {
|
||||||
|
|
||||||
|
GunConfiguration config = new GunConfiguration();
|
||||||
|
|
||||||
|
config.rateOfFire = 25;
|
||||||
|
config.roundsPerCycle = 1;
|
||||||
|
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||||
|
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||||
|
config.reloadDuration = 10;
|
||||||
|
config.firingDuration = 5;
|
||||||
|
config.ammoCap = 8;
|
||||||
|
config.durability = 2500;
|
||||||
|
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
||||||
|
config.allowsInfinity = true;
|
||||||
|
config.crosshair = Crosshair.CIRCLE;
|
||||||
|
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||||
|
config.firingSound = "hbm:weapon.shotgunPump";
|
||||||
|
|
||||||
|
config.name = "Franchi SPAS-12";
|
||||||
|
config.manufacturer = "Black Mesa Armory";
|
||||||
|
config.comment.add("\"Here, I have a more suitable gun for you. You'll need it — Catch!\"");
|
||||||
|
config.comment.add("Alt-fire with Mouse 2 (Right-click) to fire 2 shells at once");
|
||||||
|
|
||||||
|
config.config = new ArrayList<Integer>();
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_DU);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_AM);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
|
||||||
|
|
||||||
|
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||||
|
.addBus("SPAS_RECOIL_TRANSLATE", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, -2, 100))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||||
|
)
|
||||||
|
.addBus("SPAS_RECOIL_ROT", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-1, 0, 1, 100))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||||
|
)
|
||||||
|
.addBus("SPAS_PUMP", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 450))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, -1.8, 200))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 200))
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static GunConfiguration getSpas12AltConfig() {
|
||||||
|
|
||||||
|
GunConfiguration config = new GunConfiguration();
|
||||||
|
|
||||||
|
config.rateOfFire = 35;
|
||||||
|
config.roundsPerCycle = 2;
|
||||||
|
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||||
|
config.firingMode = GunConfiguration.FIRE_MANUAL;
|
||||||
|
config.firingDuration = 10;
|
||||||
|
config.ammoCap = 8;
|
||||||
|
config.reloadSound = GunConfiguration.RSOUND_SHOTGUN;
|
||||||
|
config.firingSound = "hbm:weapon.shotgunPump";
|
||||||
|
config.reloadType = GunConfiguration.RELOAD_SINGLE;
|
||||||
|
|
||||||
|
|
||||||
|
config.config = new ArrayList<Integer>();
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_DU);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_AM);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
public static GunConfiguration getUboinikConfig() {
|
public static GunConfiguration getUboinikConfig() {
|
||||||
|
|
||||||
GunConfiguration config = new GunConfiguration();
|
GunConfiguration config = new GunConfiguration();
|
||||||
|
|||||||
@ -173,6 +173,24 @@ public class Gun20GaugeFactory {
|
|||||||
config.firingSound = "hbm:weapon.revolverShoot";
|
config.firingSound = "hbm:weapon.revolverShoot";
|
||||||
config.firingPitch = 0.75F;
|
config.firingPitch = 0.75F;
|
||||||
|
|
||||||
|
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||||
|
.addBus("RECOIL", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||||
|
)
|
||||||
|
.addBus("LEVER_PULL", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //wait out recoil and lever flick
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 375)) //pull back bolt
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //release bolt
|
||||||
|
)
|
||||||
|
.addBus("LEVER_ROTATE", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250)) //wait out recoil
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 125)) //flick up lever in 125ms
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 750)) //pull action
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 125)) //flick down lever again
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
config.name = "Winchester Model 20 Polymer";
|
config.name = "Winchester Model 20 Polymer";
|
||||||
config.manufacturer = "Winchester Repeating Arms Company";
|
config.manufacturer = "Winchester Repeating Arms Company";
|
||||||
|
|
||||||
@ -201,6 +219,24 @@ public class Gun20GaugeFactory {
|
|||||||
config.firingSound = "hbm:weapon.revolverShoot";
|
config.firingSound = "hbm:weapon.revolverShoot";
|
||||||
config.firingPitch = 0.75F;
|
config.firingPitch = 0.75F;
|
||||||
|
|
||||||
|
config.animations.put(AnimType.CYCLE, new BusAnimation()
|
||||||
|
.addBus("RECOIL", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 25))
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 75))
|
||||||
|
)
|
||||||
|
.addBus("LEVER_PULL", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //wait out recoil and lever flick
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(-1, 0, 0, 375)) //pull back bolt
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 375)) //release bolt
|
||||||
|
)
|
||||||
|
.addBus("LEVER_ROTATE", new BusAnimationSequence()
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 250)) //wait out recoil
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 125)) //flick up lever in 125ms
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(1, 0, 0, 750)) //pull action
|
||||||
|
.addKeyframe(new BusAnimationKeyframe(0, 0, 0, 125)) //flick down lever again
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
config.name = "Winchester Model 20 D-25A";
|
config.name = "Winchester Model 20 D-25A";
|
||||||
config.manufacturer = "Winchester Repeating Arms Company / Big MT";
|
config.manufacturer = "Winchester Repeating Arms Company / Big MT";
|
||||||
|
|
||||||
|
|||||||
113
src/main/java/com/hbm/handler/guncfg/GunDetonatorFactory.java
Normal file
113
src/main/java/com/hbm/handler/guncfg/GunDetonatorFactory.java
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
package com.hbm.handler.guncfg;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
|
||||||
|
import com.hbm.entity.projectile.EntityBulletBase;
|
||||||
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
|
import com.hbm.handler.BulletConfiguration;
|
||||||
|
import com.hbm.handler.GunConfiguration;
|
||||||
|
import com.hbm.interfaces.IBomb;
|
||||||
|
import com.hbm.interfaces.IBomb.BombReturnCode;
|
||||||
|
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.packet.PlayerInformPacket;
|
||||||
|
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||||
|
import com.hbm.util.ChatBuilder;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
|
import net.minecraft.init.Items;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class GunDetonatorFactory {
|
||||||
|
|
||||||
|
public static GunConfiguration getDetonatorConfig() {
|
||||||
|
|
||||||
|
GunConfiguration config = new GunConfiguration();
|
||||||
|
|
||||||
|
config.rateOfFire = 1;
|
||||||
|
config.roundsPerCycle = 1;
|
||||||
|
config.gunMode = GunConfiguration.MODE_NORMAL;
|
||||||
|
config.firingMode = GunConfiguration.FIRE_AUTO;
|
||||||
|
config.hasSights = false;
|
||||||
|
config.reloadDuration = 20;
|
||||||
|
config.firingDuration = 0;
|
||||||
|
config.ammoCap = 1;
|
||||||
|
config.reloadType = GunConfiguration.RELOAD_FULL;
|
||||||
|
config.allowsInfinity = true;
|
||||||
|
config.crosshair = Crosshair.DUAL;
|
||||||
|
config.durability = 1_000_000_000;
|
||||||
|
config.reloadSound = GunConfiguration.RSOUND_LAUNCHER;
|
||||||
|
config.firingSound = "hbm:weapon.dartShoot";
|
||||||
|
config.reloadSoundEnd = false;
|
||||||
|
config.showAmmo = true;
|
||||||
|
|
||||||
|
config.name = "Hopeville Laser Detonator";
|
||||||
|
config.manufacturer = "WestTek";
|
||||||
|
|
||||||
|
config.config = new ArrayList();
|
||||||
|
config.config.add(BulletConfigSyncingUtil.DET_BOLT);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.R5_NORMAL_BOLT);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.R5_EXPLOSIVE_BOLT);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.R5_DU_BOLT);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.R5_STAR_BOLT);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.CHL_R5_BOLT);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_NORMAL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_INCENDIARY);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_SHRAPNEL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_DU);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_SLEEK);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.G12_AM);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_NORMAL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_LOW);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_SAFE);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_HIGH);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_TOTS);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_PUMPKIN);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_BARREL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_NORMAL);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_LOW);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_SAFE);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_MIRV_HIGH);
|
||||||
|
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static BulletConfiguration getLaserConfig() {
|
||||||
|
|
||||||
|
BulletConfiguration bullet = BulletConfigFactory.standardBulletConfig();
|
||||||
|
|
||||||
|
bullet.ammo = Items.redstone;
|
||||||
|
bullet.spread = 0.0F;
|
||||||
|
bullet.maxAge = 100;
|
||||||
|
bullet.dmgMin = 0;
|
||||||
|
bullet.dmgMax = 0;
|
||||||
|
bullet.leadChance = 0;
|
||||||
|
bullet.doesRicochet = false;
|
||||||
|
bullet.setToBolt(BulletConfiguration.BOLT_LASER);
|
||||||
|
|
||||||
|
bullet.bImpact = new IBulletImpactBehavior() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void behaveBlockHit(EntityBulletBase bullet, int x, int y, int z) {
|
||||||
|
|
||||||
|
World world = bullet.worldObj;
|
||||||
|
if(!world.isRemote && y > 0) {
|
||||||
|
Block b = world.getBlock(x, y, z);
|
||||||
|
if(b instanceof IBomb) {
|
||||||
|
BombReturnCode ret = ((IBomb)b).explode(world, x, y, z);
|
||||||
|
|
||||||
|
if(ret.wasSuccessful() && bullet.shooter instanceof EntityPlayerMP) {
|
||||||
|
EntityPlayerMP player = (EntityPlayerMP) bullet.shooter;
|
||||||
|
world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
|
||||||
|
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start("").nextTranslation(ret.getUnlocalizedMessage()).color(EnumChatFormatting.YELLOW).flush()), (EntityPlayerMP) player);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
return bullet;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -53,6 +53,7 @@ public class GunFatmanFactory {
|
|||||||
config.config.add(BulletConfigSyncingUtil.NUKE_TOTS);
|
config.config.add(BulletConfigSyncingUtil.NUKE_TOTS);
|
||||||
config.config.add(BulletConfigSyncingUtil.NUKE_SAFE);
|
config.config.add(BulletConfigSyncingUtil.NUKE_SAFE);
|
||||||
config.config.add(BulletConfigSyncingUtil.NUKE_PUMPKIN);
|
config.config.add(BulletConfigSyncingUtil.NUKE_PUMPKIN);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_BARREL);
|
||||||
config.durability = 1000;
|
config.durability = 1000;
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
@ -117,6 +118,7 @@ public class GunFatmanFactory {
|
|||||||
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_TOTS);
|
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_TOTS);
|
||||||
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_SAFE);
|
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_SAFE);
|
||||||
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_PUMPKIN);
|
config.config.add(BulletConfigSyncingUtil.NUKE_PROTO_PUMPKIN);
|
||||||
|
config.config.add(BulletConfigSyncingUtil.NUKE_BARREL);
|
||||||
config.durability = 1000;
|
config.durability = 1000;
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
@ -240,7 +242,7 @@ public class GunFatmanFactory {
|
|||||||
public static BulletConfiguration getNukeBarrelConfig() {
|
public static BulletConfiguration getNukeBarrelConfig() {
|
||||||
|
|
||||||
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
|
BulletConfiguration bullet = BulletConfigFactory.standardNukeConfig();
|
||||||
bullet.ammo = ModItems.ammo_nuke_pumpkin;
|
bullet.ammo = ModItems.ammo_nuke_barrel;
|
||||||
bullet.explosive = 3F;
|
bullet.explosive = 3F;
|
||||||
bullet.style = bullet.STYLE_BARREL;
|
bullet.style = bullet.STYLE_BARREL;
|
||||||
|
|
||||||
|
|||||||
@ -160,8 +160,6 @@ public class HazardRegistry {
|
|||||||
HazardSystem.register(stick_tnt, makeData(EXPLOSIVE, 1.5F));
|
HazardSystem.register(stick_tnt, makeData(EXPLOSIVE, 1.5F));
|
||||||
HazardSystem.register(stick_semtex, makeData(EXPLOSIVE, 2.5F));
|
HazardSystem.register(stick_semtex, makeData(EXPLOSIVE, 2.5F));
|
||||||
HazardSystem.register(stick_c4, makeData(EXPLOSIVE, 2.5F));
|
HazardSystem.register(stick_c4, makeData(EXPLOSIVE, 2.5F));
|
||||||
HazardSystem.register(dynamite, makeData(EXPLOSIVE, 6F));
|
|
||||||
HazardSystem.register(tnt, makeData(EXPLOSIVE, 8F));
|
|
||||||
|
|
||||||
HazardSystem.register("dustCoal", makeData(COAL, powder));
|
HazardSystem.register("dustCoal", makeData(COAL, powder));
|
||||||
HazardSystem.register("dustTinyCoal", makeData(COAL, powder_tiny));
|
HazardSystem.register("dustTinyCoal", makeData(COAL, powder_tiny));
|
||||||
@ -528,7 +526,7 @@ public class HazardRegistry {
|
|||||||
HazardData data = new HazardData();
|
HazardData data = new HazardData();
|
||||||
data.addEntry(new HazardEntry(RADIATION, base).addMod(new HazardModifierRTGRadiation(target)));
|
data.addEntry(new HazardEntry(RADIATION, base).addMod(new HazardModifierRTGRadiation(target)));
|
||||||
if(hot > 0) data.addEntry(new HazardEntry(HOT, hot));
|
if(hot > 0) data.addEntry(new HazardEntry(HOT, hot));
|
||||||
if(blinding > 0) data.addEntry(new HazardEntry(BLINDING, hot));
|
if(blinding > 0) data.addEntry(new HazardEntry(BLINDING, blinding));
|
||||||
HazardSystem.register(pellet, data);
|
HazardSystem.register(pellet, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
package com.hbm.hazard.modifier;
|
package com.hbm.hazard.modifier;
|
||||||
|
|
||||||
import com.hbm.hazard.HazardRegistry;
|
|
||||||
import com.hbm.items.machine.ItemFuelRod;
|
import com.hbm.items.machine.ItemFuelRod;
|
||||||
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
|
|||||||
@ -27,7 +27,7 @@ public class HazardModifierRBMKRadiation extends HazardModifier {
|
|||||||
|
|
||||||
} else if(stack.getItem() instanceof ItemRBMKPellet) {
|
} else if(stack.getItem() instanceof ItemRBMKPellet) {
|
||||||
|
|
||||||
level = level + (target - level) * (ItemRBMKPellet.rectify(stack.getItemDamage()) / 4F);
|
level = level + (target - level) * ((ItemRBMKPellet.rectify(stack.getItemDamage()) % 5) / 4F);
|
||||||
|
|
||||||
if(ItemRBMKPellet.hasXenon(stack.getItemDamage()))
|
if(ItemRBMKPellet.hasXenon(stack.getItemDamage()))
|
||||||
level += HazardRegistry.xe135 * HazardRegistry.nugget;
|
level += HazardRegistry.xe135 * HazardRegistry.nugget;
|
||||||
|
|||||||
@ -5,4 +5,20 @@ import com.hbm.inventory.fluid.FluidType;
|
|||||||
public interface IFluidAcceptor extends IFluidContainer {
|
public interface IFluidAcceptor extends IFluidContainer {
|
||||||
|
|
||||||
int getMaxFluidFill(FluidType type);
|
int getMaxFluidFill(FluidType type);
|
||||||
|
|
||||||
|
public default void setFluidFillForReceive(int fill, FluidType type) {
|
||||||
|
this.setFluidFill(fill, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public default int getFluidFillForReceive(FluidType type) {
|
||||||
|
return this.getFluidFill(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public default int getMaxFluidFillForReceive(FluidType type) {
|
||||||
|
return this.getMaxFluidFill(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public default void receiveFluid(int amount, FluidType type) {
|
||||||
|
this.setFluidFill(this.getFluidFill(type) + amount, type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -13,4 +13,16 @@ public interface IFluidSource extends IFluidContainer {
|
|||||||
boolean getTact();
|
boolean getTact();
|
||||||
List<IFluidAcceptor> getFluidList(FluidType type);
|
List<IFluidAcceptor> getFluidList(FluidType type);
|
||||||
void clearFluidList(FluidType type);
|
void clearFluidList(FluidType type);
|
||||||
|
|
||||||
|
public default void setFluidFillForTransfer(int fill, FluidType type) {
|
||||||
|
this.setFluidFill(fill, type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public default int getFluidFillForTransfer(FluidType type) {
|
||||||
|
return this.getFluidFill(type);
|
||||||
|
}
|
||||||
|
|
||||||
|
public default void transferFluid(int amount, FluidType type) {
|
||||||
|
this.setFluidFillForTransfer(this.getFluidFillForTransfer(type) - amount, type);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,6 +12,7 @@ import com.hbm.inventory.fluid.FluidType.FluidTrait;
|
|||||||
import com.hbm.inventory.fluid.Fluids;
|
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.armor.ItemArmorMod;
|
||||||
import com.hbm.items.machine.ItemFluidIdentifier;
|
import com.hbm.items.machine.ItemFluidIdentifier;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
@ -161,7 +162,7 @@ public class FluidTank {
|
|||||||
partial = ArmorModHandler.pryMods(partial)[ArmorModHandler.plate_only];
|
partial = ArmorModHandler.pryMods(partial)[ArmorModHandler.plate_only];
|
||||||
|
|
||||||
if(partial == null)
|
if(partial == null)
|
||||||
return;
|
partial = slots[in];
|
||||||
}
|
}
|
||||||
|
|
||||||
if(partial.getItem() instanceof IPartiallyFillable) {
|
if(partial.getItem() instanceof IPartiallyFillable) {
|
||||||
@ -180,7 +181,7 @@ public class FluidTank {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(slots[in].getItem() instanceof ItemArmor) {
|
if(slots[in].getItem() instanceof ItemArmor && partial.getItem() instanceof ItemArmorMod) {
|
||||||
ArmorModHandler.applyMod(slots[in], partial);
|
ArmorModHandler.applyMod(slots[in], partial);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -143,21 +143,32 @@ public class OreDictManager {
|
|||||||
/*
|
/*
|
||||||
* STABLE
|
* STABLE
|
||||||
*/
|
*/
|
||||||
|
/** TITANIUM */
|
||||||
public static final DictFrame TI = new DictFrame("Titanium");
|
public static final DictFrame TI = new DictFrame("Titanium");
|
||||||
|
/** COPPER */
|
||||||
public static final DictFrame CU = new DictFrame("Copper");
|
public static final DictFrame CU = new DictFrame("Copper");
|
||||||
public static final DictFrame MINGRADE = new DictFrame("Mingrade");
|
public static final DictFrame MINGRADE = new DictFrame("Mingrade");
|
||||||
public static final DictFrame ALLOY = new DictFrame("AdvancedAlloy");
|
public static final DictFrame ALLOY = new DictFrame("AdvancedAlloy");
|
||||||
|
/** TUNGSTEN */
|
||||||
public static final DictFrame W = new DictFrame("Tungsten");
|
public static final DictFrame W = new DictFrame("Tungsten");
|
||||||
|
/** ALUMINUM */
|
||||||
public static final DictFrame AL = new DictFrame("Aluminum");
|
public static final DictFrame AL = new DictFrame("Aluminum");
|
||||||
public static final DictFrame STEEL = new DictFrame("Steel");
|
public static final DictFrame STEEL = new DictFrame("Steel");
|
||||||
|
/** TECHNETIUM STEEL */
|
||||||
public static final DictFrame TCALLOY = new DictFrame("TcAlloy");
|
public static final DictFrame TCALLOY = new DictFrame("TcAlloy");
|
||||||
|
/** LEAD */
|
||||||
public static final DictFrame PB = new DictFrame("Lead");
|
public static final DictFrame PB = new DictFrame("Lead");
|
||||||
//public static final DictFrame BI = new DictFrame("Bismuth");
|
//public static final DictFrame BI = new DictFrame("Bismuth");
|
||||||
|
/** TANTALUM */
|
||||||
public static final DictFrame TA = new DictFrame("Tantalum");
|
public static final DictFrame TA = new DictFrame("Tantalum");
|
||||||
public static final DictFrame COLTAN = new DictFrame("Coltan");
|
public static final DictFrame COLTAN = new DictFrame("Coltan");
|
||||||
|
/** NIOBIUM */
|
||||||
public static final DictFrame NB = new DictFrame("Niobium");
|
public static final DictFrame NB = new DictFrame("Niobium");
|
||||||
|
/** BERYLLIUM */
|
||||||
public static final DictFrame BE = new DictFrame("Beryllium");
|
public static final DictFrame BE = new DictFrame("Beryllium");
|
||||||
|
/** COBALT */
|
||||||
public static final DictFrame CO = new DictFrame("Cobalt");
|
public static final DictFrame CO = new DictFrame("Cobalt");
|
||||||
|
/** BORON */
|
||||||
public static final DictFrame B = new DictFrame("Boron");
|
public static final DictFrame B = new DictFrame("Boron");
|
||||||
public static final DictFrame GRAPHITE = new DictFrame("Graphite");
|
public static final DictFrame GRAPHITE = new DictFrame("Graphite");
|
||||||
public static final DictFrame DURA = new DictFrame("DuraSteel");
|
public static final DictFrame DURA = new DictFrame("DuraSteel");
|
||||||
@ -177,8 +188,11 @@ public class OreDictManager {
|
|||||||
/*
|
/*
|
||||||
* DUST AND GEM ORES
|
* DUST AND GEM ORES
|
||||||
*/
|
*/
|
||||||
|
/** SULFUR */
|
||||||
public static final DictFrame S = new DictFrame("Sulfur");
|
public static final DictFrame S = new DictFrame("Sulfur");
|
||||||
|
/** SALTPETER/NITER */
|
||||||
public static final DictFrame KNO = new DictFrame("Saltpeter");
|
public static final DictFrame KNO = new DictFrame("Saltpeter");
|
||||||
|
/** FLUORITE */
|
||||||
public static final DictFrame F = new DictFrame("Fluorite");
|
public static final DictFrame F = new DictFrame("Fluorite");
|
||||||
public static final DictFrame LIGNITE = new DictFrame("Lignite");
|
public static final DictFrame LIGNITE = new DictFrame("Lignite");
|
||||||
public static final DictFrame COALCOKE = new DictFrame("CoalCoke");
|
public static final DictFrame COALCOKE = new DictFrame("CoalCoke");
|
||||||
@ -190,6 +204,7 @@ public class OreDictManager {
|
|||||||
/*
|
/*
|
||||||
* HAZARDS, MISC
|
* HAZARDS, MISC
|
||||||
*/
|
*/
|
||||||
|
/** LITHIUM */
|
||||||
public static final DictFrame LI = new DictFrame("Lithium");
|
public static final DictFrame LI = new DictFrame("Lithium");
|
||||||
/*
|
/*
|
||||||
* PHOSPHORUS
|
* PHOSPHORUS
|
||||||
@ -208,18 +223,28 @@ public class OreDictManager {
|
|||||||
/*
|
/*
|
||||||
* RARE EARTHS
|
* RARE EARTHS
|
||||||
*/
|
*/
|
||||||
|
/** LANTHANUM */
|
||||||
public static final DictFrame LA = new DictFrame("Lanthanum");
|
public static final DictFrame LA = new DictFrame("Lanthanum");
|
||||||
|
/** ZIRCONIUM */
|
||||||
public static final DictFrame ZR = new DictFrame("Zirconium");
|
public static final DictFrame ZR = new DictFrame("Zirconium");
|
||||||
|
/** NEODYMIUM */
|
||||||
public static final DictFrame ND = new DictFrame("Neodymium");
|
public static final DictFrame ND = new DictFrame("Neodymium");
|
||||||
|
/** CERIUM */
|
||||||
public static final DictFrame CE = new DictFrame("Cerium");
|
public static final DictFrame CE = new DictFrame("Cerium");
|
||||||
/*
|
/*
|
||||||
* NITAN
|
* NITAN
|
||||||
*/
|
*/
|
||||||
|
/** IODINE */
|
||||||
public static final DictFrame I = new DictFrame("Iodine");
|
public static final DictFrame I = new DictFrame("Iodine");
|
||||||
|
/** ASTATINE */
|
||||||
public static final DictFrame AT = new DictFrame("Astatine");
|
public static final DictFrame AT = new DictFrame("Astatine");
|
||||||
|
/** CAESIUM */
|
||||||
public static final DictFrame CS = new DictFrame("Caesium");
|
public static final DictFrame CS = new DictFrame("Caesium");
|
||||||
|
/** STRONTIUM */
|
||||||
public static final DictFrame ST = new DictFrame("Strontium");
|
public static final DictFrame ST = new DictFrame("Strontium");
|
||||||
|
/** BROMINE */
|
||||||
public static final DictFrame BR = new DictFrame("Bromine");
|
public static final DictFrame BR = new DictFrame("Bromine");
|
||||||
|
/** TENNESSINE */
|
||||||
public static final DictFrame TS = new DictFrame("Tennessine") ;
|
public static final DictFrame TS = new DictFrame("Tennessine") ;
|
||||||
/*
|
/*
|
||||||
* FISSION FRAGMENTS
|
* FISSION FRAGMENTS
|
||||||
|
|||||||
@ -415,6 +415,14 @@ public class RecipesCommon {
|
|||||||
public MetaBlock(Block block) {
|
public MetaBlock(Block block) {
|
||||||
this(block, 0);
|
this(block, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getID() {
|
||||||
|
final int prime = 31;
|
||||||
|
int result = 1;
|
||||||
|
result = prime * result + Block.getIdFromBlock(block);
|
||||||
|
result = prime * result + meta;
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,66 @@
|
|||||||
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
|
import com.hbm.inventory.SlotUpgrade;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
|
||||||
|
|
||||||
|
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 ContainerChemfac extends Container {
|
||||||
|
|
||||||
|
private TileEntityMachineChemfac chemfac;
|
||||||
|
|
||||||
|
public ContainerChemfac(InventoryPlayer playerInv, TileEntityMachineChemfac tile) {
|
||||||
|
chemfac = tile;
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(tile, 0, 234, 79));
|
||||||
|
|
||||||
|
for(int i = 0; i < 2; i++) {
|
||||||
|
for(int j = 0; j < 2; j++) {
|
||||||
|
this.addSlotToContainer(new SlotUpgrade(tile, 1 + i * 2 + j, 217 + j * 18, 172 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 4; i++) {
|
||||||
|
for(int j = 0; j < 2; j++) {
|
||||||
|
|
||||||
|
for(int k = 0; k < 2; k++) {
|
||||||
|
for(int l = 0; l < 2; l++) {
|
||||||
|
this.addSlotToContainer(new Slot(tile, this.inventorySlots.size(), 7 + j * 110 + l * 16, 14 + i * 38 + k * 16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int k = 0; k < 2; k++) {
|
||||||
|
for(int l = 0; l < 2; l++) {
|
||||||
|
this.addSlotToContainer(new Slot(tile, this.inventorySlots.size(), 69 + j * 110 + l * 16, 14 + i * 38 + k * 16));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
this.addSlotToContainer(new Slot(tile, this.inventorySlots.size(), 51 + j * 110, 30 + i * 38));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 3; i++) {
|
||||||
|
for(int j = 0; j < 9; j++) {
|
||||||
|
this.addSlotToContainer(new Slot(playerInv, j + i * 9 + 9, 34 + j * 18, 174 + i * 18));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
for(int i = 0; i < 9; i++) {
|
||||||
|
this.addSlotToContainer(new Slot(playerInv, i, 34 + i * 18, 232));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean canInteractWith(EntityPlayer player) {
|
||||||
|
return chemfac.isUseableByPlayer(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
package com.hbm.inventory.container;
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
import com.hbm.tileentity.machine.TileEntityStorageDrum;
|
import com.hbm.tileentity.machine.TileEntityStorageDrum;
|
||||||
|
import com.hbm.util.InventoryUtil;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
@ -47,10 +48,11 @@ public class ContainerStorageDrum extends Container {
|
|||||||
var3 = var5.copy();
|
var3 = var5.copy();
|
||||||
|
|
||||||
if(par2 <= drum.getSizeInventory() - 1) {
|
if(par2 <= drum.getSizeInventory() - 1) {
|
||||||
if(!this.mergeItemStack(var5, drum.getSizeInventory(), this.inventorySlots.size(), true)) {
|
|
||||||
|
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, drum.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if(!this.mergeItemStack(var5, 0, drum.getSizeInventory(), false)) {
|
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, drum.getSizeInventory(), false)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.hbm.inventory.container;
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
import com.hbm.tileentity.machine.TileEntityWasteDrum;
|
import com.hbm.tileentity.machine.TileEntityWasteDrum;
|
||||||
|
import com.hbm.util.InventoryUtil;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.entity.player.InventoryPlayer;
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
@ -52,10 +53,10 @@ public class ContainerWasteDrum extends Container {
|
|||||||
var3 = var5.copy();
|
var3 = var5.copy();
|
||||||
|
|
||||||
if(par2 <= diFurnace.getSizeInventory() - 1) {
|
if(par2 <= diFurnace.getSizeInventory() - 1) {
|
||||||
if(!this.mergeItemStack(var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) {
|
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
} else if(!this.mergeItemStack(var5, 0, 0, false)) {
|
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, 0, false)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
92
src/main/java/com/hbm/inventory/gui/GUIChemfac.java
Normal file
92
src/main/java/com/hbm/inventory/gui/GUIChemfac.java
Normal file
@ -0,0 +1,92 @@
|
|||||||
|
package com.hbm.inventory.gui;
|
||||||
|
|
||||||
|
import org.lwjgl.input.Keyboard;
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.inventory.container.ContainerChemfac;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachineChemfac;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class GUIChemfac extends GuiInfoContainer {
|
||||||
|
|
||||||
|
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_chemfac.png");
|
||||||
|
private TileEntityMachineChemfac chemfac;
|
||||||
|
|
||||||
|
public GUIChemfac(InventoryPlayer invPlayer, TileEntityMachineChemfac tedf) {
|
||||||
|
super(new ContainerChemfac(invPlayer, tedf));
|
||||||
|
chemfac = tedf;
|
||||||
|
|
||||||
|
this.xSize = 256;
|
||||||
|
this.ySize = 256;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
|
super.drawScreen(mouseX, mouseY, f);
|
||||||
|
|
||||||
|
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 234, guiTop + 25, 16, 52, chemfac.power, chemfac.getMaxPower());
|
||||||
|
|
||||||
|
for(int i = 0; i < 8; i ++) {
|
||||||
|
|
||||||
|
int offX = guiLeft + 110 * (i % 2);
|
||||||
|
int offY = guiTop + 38 * (i / 2);
|
||||||
|
chemfac.tanks[i * 4 + 0].renderTankInfo(this, mouseX, mouseY, offX + 40, offY + 45 - 32, 5, 34);
|
||||||
|
chemfac.tanks[i * 4 + 1].renderTankInfo(this, mouseX, mouseY, offX + 45, offY + 45 - 32, 5, 34);
|
||||||
|
chemfac.tanks[i * 4 + 2].renderTankInfo(this, mouseX, mouseY, offX + 102, offY + 45 - 32, 5, 34);
|
||||||
|
chemfac.tanks[i * 4 + 3].renderTankInfo(this, mouseX, mouseY, offX + 107, offY + 45 - 32, 5, 34);
|
||||||
|
}
|
||||||
|
|
||||||
|
chemfac.water.renderTankInfo(this, mouseX, mouseY, guiLeft + 233, guiTop + 108, 9, 54);
|
||||||
|
chemfac.steam.renderTankInfo(this, mouseX, mouseY, guiLeft + 242, guiTop + 108, 9, 54);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int i, int j) { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float interp, int mX, int mY) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, 167);
|
||||||
|
drawTexturedModalRect(guiLeft + 26, guiTop + 167, 26, 167, 230, 44);
|
||||||
|
drawTexturedModalRect(guiLeft + 26, guiTop + 211, 26, 211, 176, 45);
|
||||||
|
|
||||||
|
int p = (int) (chemfac.power * 52 / chemfac.getMaxPower());
|
||||||
|
drawTexturedModalRect(guiLeft + 234, guiTop + 77 - p, 0, 219 - p, 16, p);
|
||||||
|
|
||||||
|
if(chemfac.power > 0)
|
||||||
|
drawTexturedModalRect(guiLeft + 238, guiTop + 11, 0, 219, 9, 12);
|
||||||
|
|
||||||
|
for(int i = 0; i < 8; i ++) {
|
||||||
|
|
||||||
|
int offX = guiLeft + 110 * (i % 2);
|
||||||
|
int offY = guiTop + 38 * (i / 2);
|
||||||
|
|
||||||
|
int prog = chemfac.progress[i];
|
||||||
|
int j = prog * 17 / Math.max(chemfac.maxProgress[i], 1);
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
|
drawTexturedModalRect(offX + 51, offY + 16, 202, 247, j, 11);
|
||||||
|
|
||||||
|
chemfac.tanks[i * 4 + 0].renderTank(offX + 41, offY + 46, this.zLevel, 3, 32);
|
||||||
|
chemfac.tanks[i * 4 + 1].renderTank(offX + 46, offY + 46, this.zLevel, 3, 32);
|
||||||
|
chemfac.tanks[i * 4 + 2].renderTank(offX + 103, offY + 46, this.zLevel, 3, 32);
|
||||||
|
chemfac.tanks[i * 4 + 3].renderTank(offX + 108, offY + 46, this.zLevel, 3, 32);
|
||||||
|
}
|
||||||
|
|
||||||
|
chemfac.water.renderTank(guiLeft + 234, guiTop + 161, this.zLevel, 7, 52);
|
||||||
|
chemfac.steam.renderTank(guiLeft + 243, guiTop + 161, this.zLevel, 7, 52);
|
||||||
|
|
||||||
|
if(Keyboard.isKeyDown(Keyboard.KEY_LMENU))
|
||||||
|
for(int i = 0; i < this.inventorySlots.inventorySlots.size(); i++) {
|
||||||
|
Slot s = this.inventorySlots.getSlot(i);
|
||||||
|
|
||||||
|
this.fontRendererObj.drawStringWithShadow(i + "", guiLeft + s.xDisplayPosition + 2, guiTop + s.yDisplayPosition, 0xffffff);
|
||||||
|
this.fontRendererObj.drawStringWithShadow(s.getSlotIndex() + "", guiLeft + s.xDisplayPosition + 2, guiTop + s.yDisplayPosition + 8, 0xff8080);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -75,29 +75,26 @@ public class GUIMachineBoilerElectric extends GuiInfoContainer {
|
|||||||
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
//<insert witty line here>
|
|
||||||
TileEntityMachineBoilerElectric dud = diFurnace;
|
|
||||||
|
|
||||||
if(diFurnace.isInvalid() && diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) instanceof TileEntityMachineBoilerElectric)
|
if(diFurnace.isInvalid() && diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord) instanceof TileEntityMachineBoilerElectric)
|
||||||
dud = (TileEntityMachineBoilerElectric) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
|
diFurnace = (TileEntityMachineBoilerElectric) diFurnace.getWorldObj().getTileEntity(diFurnace.xCoord, diFurnace.yCoord, diFurnace.zCoord);
|
||||||
|
|
||||||
if(dud.power > 0)
|
if(diFurnace.power > 0)
|
||||||
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 176, 0, 18, 18);
|
drawTexturedModalRect(guiLeft + 97, guiTop + 34, 176, 0, 18, 18);
|
||||||
|
|
||||||
int j = (int)dud.getHeatScaled(17);
|
int j = (int)diFurnace.getHeatScaled(17);
|
||||||
drawTexturedModalRect(guiLeft + 103, guiTop + 33 - j, 194, 16 - j, 6, j);
|
drawTexturedModalRect(guiLeft + 103, guiTop + 33 - j, 194, 16 - j, 6, j);
|
||||||
|
|
||||||
int i = (int)dud.getPowerScaled(34);
|
int i = (int)diFurnace.getPowerScaled(34);
|
||||||
drawTexturedModalRect(guiLeft + 123, guiTop + 69 - i, 200, 34 - i, 7, i);
|
drawTexturedModalRect(guiLeft + 123, guiTop + 69 - i, 200, 34 - i, 7, i);
|
||||||
|
|
||||||
this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2);
|
this.drawInfoPanel(guiLeft - 16, guiTop + 36, 16, 16, 2);
|
||||||
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 16, 16, 16, 3);
|
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 16, 16, 16, 3);
|
||||||
|
|
||||||
if(dud.tanks[1].getTankType().name().equals(Fluids.NONE.name())) {
|
if(diFurnace.tanks[1].getTankType().name().equals(Fluids.NONE.name())) {
|
||||||
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32, 16, 16, 6);
|
this.drawInfoPanel(guiLeft - 16, guiTop + 36 + 32, 16, 16, 6);
|
||||||
}
|
}
|
||||||
|
|
||||||
dud.tanks[0].renderTank(guiLeft + 62, guiTop + 69, this.zLevel, 16, 52);
|
diFurnace.tanks[0].renderTank(guiLeft + 62, guiTop + 69, this.zLevel, 16, 52);
|
||||||
dud.tanks[1].renderTank(guiLeft + 134, guiTop + 69, this.zLevel, 16, 52);
|
diFurnace.tanks[1].renderTank(guiLeft + 134, guiTop + 69, this.zLevel, 16, 52);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@ package com.hbm.inventory.gui;
|
|||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
import com.hbm.inventory.FluidTank;
|
|
||||||
import com.hbm.inventory.container.ContainerSolidifier;
|
import com.hbm.inventory.container.ContainerSolidifier;
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;
|
import com.hbm.tileentity.machine.oil.TileEntityMachineSolidifier;
|
||||||
|
|||||||
@ -165,9 +165,9 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModItems.dysfunctional_reactor, 1), new AStack[] {new OreDictStack(STEEL.plate(), 15), new OreDictStack(PB.ingot(), 5), new ComparableStack(ModItems.rod_quad_empty, 10), new OreDictStack("dyeBrown", 3), },200);
|
makeRecipe(new ComparableStack(ModItems.dysfunctional_reactor, 1), new AStack[] {new OreDictStack(STEEL.plate(), 15), new OreDictStack(PB.ingot(), 5), new ComparableStack(ModItems.rod_quad_empty, 10), new OreDictStack("dyeBrown", 3), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.missile_assembly, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.hull_small_aluminium, 4), new OreDictStack(STEEL.ingot(), 2), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.wire_aluminium, 6), new ComparableStack(ModItems.canister_full, 3, Fluids.KEROSENE.getID()), new ComparableStack(ModItems.circuit_targeting_tier1, 1), },200);
|
makeRecipe(new ComparableStack(ModItems.missile_assembly, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.hull_small_aluminium, 4), new OreDictStack(STEEL.ingot(), 2), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.wire_aluminium, 6), new ComparableStack(ModItems.canister_full, 3, Fluids.KEROSENE.getID()), new ComparableStack(ModItems.circuit_targeting_tier1, 1), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.missile_carrier, 1), new AStack[] {new ComparableStack(ModItems.fluid_barrel_full, 16, Fluids.KEROSENE.ordinal()), new ComparableStack(ModItems.thruster_medium, 4), new ComparableStack(ModItems.thruster_large, 1), new ComparableStack(ModItems.hull_big_titanium, 6), new ComparableStack(ModItems.hull_big_steel, 2), new ComparableStack(ModItems.hull_small_aluminium, 12), new OreDictStack(TI.plate(), 24), new ComparableStack(ModItems.plate_polymer, 128), new ComparableStack(ModBlocks.det_cord, 8), new ComparableStack(ModItems.circuit_targeting_tier3, 12), new ComparableStack(ModItems.circuit_targeting_tier4, 3), },4800);
|
makeRecipe(new ComparableStack(ModItems.missile_carrier, 1), new AStack[] {new ComparableStack(ModItems.fluid_barrel_full, 16, Fluids.KEROSENE.ordinal()), new ComparableStack(ModItems.thruster_medium, 4), new ComparableStack(ModItems.thruster_large, 1), new ComparableStack(ModItems.hull_big_titanium, 6), new ComparableStack(ModItems.hull_big_steel, 2), new ComparableStack(ModItems.hull_small_aluminium, 12), new OreDictStack(TI.plate(), 24), new ComparableStack(ModItems.plate_polymer, 128), new ComparableStack(ModBlocks.det_cord, 8), new ComparableStack(ModItems.circuit_targeting_tier3, 12), new ComparableStack(ModItems.circuit_targeting_tier4, 3), },4800);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_generic_small, 1), new AStack[] {new OreDictStack(TI.plate(), 5), new OreDictStack(STEEL.plate(), 3), new ComparableStack(Blocks.tnt, 2), },100);
|
makeRecipe(new ComparableStack(ModItems.warhead_generic_small, 1), new AStack[] {new OreDictStack(TI.plate(), 5), new OreDictStack(STEEL.plate(), 3), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 2), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_generic_medium, 1), new AStack[] {new OreDictStack(TI.plate(), 8), new OreDictStack(STEEL.plate(), 5), new ComparableStack(Blocks.tnt, 4), },150);
|
makeRecipe(new ComparableStack(ModItems.warhead_generic_medium, 1), new AStack[] {new OreDictStack(TI.plate(), 8), new OreDictStack(STEEL.plate(), 5), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 4), },150);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_generic_large, 1), new AStack[] {new OreDictStack(TI.plate(), 15), new OreDictStack(STEEL.plate(), 8), new ComparableStack(Blocks.tnt, 8), },200);
|
makeRecipe(new ComparableStack(ModItems.warhead_generic_large, 1), new AStack[] {new OreDictStack(TI.plate(), 15), new OreDictStack(STEEL.plate(), 8), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 8), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_incendiary_small, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_small, 1), new OreDictStack(P_RED.dust(), 4), },100);
|
makeRecipe(new ComparableStack(ModItems.warhead_incendiary_small, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_small, 1), new OreDictStack(P_RED.dust(), 4), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_incendiary_medium, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_medium, 1), new OreDictStack(P_RED.dust(), 8), },150);
|
makeRecipe(new ComparableStack(ModItems.warhead_incendiary_medium, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_medium, 1), new OreDictStack(P_RED.dust(), 8), },150);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_incendiary_large, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_large, 1), new OreDictStack(P_RED.dust(), 16), },200);
|
makeRecipe(new ComparableStack(ModItems.warhead_incendiary_large, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_large, 1), new OreDictStack(P_RED.dust(), 16), },200);
|
||||||
@ -178,8 +178,6 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModItems.warhead_buster_medium, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_medium, 1), new ComparableStack(ModBlocks.det_cord, 4), new ComparableStack(ModBlocks.det_charge, 4), },150);
|
makeRecipe(new ComparableStack(ModItems.warhead_buster_medium, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_medium, 1), new ComparableStack(ModBlocks.det_cord, 4), new ComparableStack(ModBlocks.det_charge, 4), },150);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_buster_large, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_large, 1), new ComparableStack(ModBlocks.det_charge, 8), },200);
|
makeRecipe(new ComparableStack(ModItems.warhead_buster_large, 1), new AStack[] {new ComparableStack(ModItems.warhead_generic_large, 1), new ComparableStack(ModBlocks.det_charge, 8), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_nuclear, 1), new AStack[] {new ComparableStack(ModItems.boy_shielding, 1), new ComparableStack(ModItems.boy_target, 1), new ComparableStack(ModItems.boy_bullet, 1), new OreDictStack(TI.plate(), 20), new OreDictStack(STEEL.plate(), 12), },300);
|
makeRecipe(new ComparableStack(ModItems.warhead_nuclear, 1), new AStack[] {new ComparableStack(ModItems.boy_shielding, 1), new ComparableStack(ModItems.boy_target, 1), new ComparableStack(ModItems.boy_bullet, 1), new OreDictStack(TI.plate(), 20), new OreDictStack(STEEL.plate(), 12), },300);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_mirvlet, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 5), new OreDictStack(STEEL.plate(), 18), new OreDictStack(PU239.ingot(), 1), new ComparableStack(Blocks.tnt, 2), },250);
|
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_mirv, 1), new AStack[] {new OreDictStack(TI.plate(), 20), new OreDictStack(STEEL.plate(), 12), new OreDictStack(PU239.ingot(), 1), new ComparableStack(Blocks.tnt, 8), new OreDictStack(OreDictManager.getReflector(), 6), new OreDictStack(LI.ingot(), 4), new ComparableStack(ModItems.cell_deuterium, 6), },500);
|
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_volcano, 1), new AStack[] {new OreDictStack(TI.plate(), 24), new OreDictStack(STEEL.plate(), 16), new ComparableStack(ModBlocks.det_nuke, 3), new OreDictStack(U238.block(), 24), new ComparableStack(ModItems.circuit_tantalium, 5) }, 600);
|
makeRecipe(new ComparableStack(ModItems.warhead_volcano, 1), new AStack[] {new OreDictStack(TI.plate(), 24), new OreDictStack(STEEL.plate(), 16), new ComparableStack(ModBlocks.det_nuke, 3), new OreDictStack(U238.block(), 24), new ComparableStack(ModItems.circuit_tantalium, 5) }, 600);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_thermo_endo, 1), new AStack[] {new ComparableStack(ModBlocks.therm_endo, 2), new OreDictStack(TI.plate(), 12), new OreDictStack(STEEL.plate(), 6), },300);
|
makeRecipe(new ComparableStack(ModItems.warhead_thermo_endo, 1), new AStack[] {new ComparableStack(ModBlocks.therm_endo, 2), new OreDictStack(TI.plate(), 12), new OreDictStack(STEEL.plate(), 6), },300);
|
||||||
makeRecipe(new ComparableStack(ModItems.warhead_thermo_exo, 1), new AStack[] {new ComparableStack(ModBlocks.therm_exo, 2), new OreDictStack(TI.plate(), 12), new OreDictStack(STEEL.plate(), 6), },300);
|
makeRecipe(new ComparableStack(ModItems.warhead_thermo_exo, 1), new AStack[] {new ComparableStack(ModBlocks.therm_exo, 2), new OreDictStack(TI.plate(), 12), new OreDictStack(STEEL.plate(), 6), },300);
|
||||||
@ -362,15 +360,15 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModItems.grenade_nuclear, 1), new AStack[] {new OreDictStack(IRON.plate(), 1), new OreDictStack(STEEL.plate(), 1), new OreDictStack(PU239.nugget(), 2), new ComparableStack(ModItems.wire_red_copper, 2), },200);
|
makeRecipe(new ComparableStack(ModItems.grenade_nuclear, 1), new AStack[] {new OreDictStack(IRON.plate(), 1), new OreDictStack(STEEL.plate(), 1), new OreDictStack(PU239.nugget(), 2), new ComparableStack(ModItems.wire_red_copper, 2), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.grenade_zomg, 1), new AStack[] {new ComparableStack(ModItems.plate_paa, 3), new OreDictStack(OreDictManager.getReflector(), 1), new ComparableStack(ModItems.coil_magnetized_tungsten, 3), new ComparableStack(ModItems.powder_power, 3), },300);
|
makeRecipe(new ComparableStack(ModItems.grenade_zomg, 1), new AStack[] {new ComparableStack(ModItems.plate_paa, 3), new OreDictStack(OreDictManager.getReflector(), 1), new ComparableStack(ModItems.coil_magnetized_tungsten, 3), new ComparableStack(ModItems.powder_power, 3), },300);
|
||||||
makeRecipe(new ComparableStack(ModItems.grenade_black_hole, 1), new AStack[] {new OreDictStack(ANY_PLASTIC.ingot(), 6), new OreDictStack(OreDictManager.getReflector(), 3), new ComparableStack(ModItems.coil_magnetized_tungsten, 2), new ComparableStack(ModItems.black_hole, 1), },500);
|
makeRecipe(new ComparableStack(ModItems.grenade_black_hole, 1), new AStack[] {new OreDictStack(ANY_PLASTIC.ingot(), 6), new OreDictStack(OreDictManager.getReflector(), 3), new ComparableStack(ModItems.coil_magnetized_tungsten, 2), new ComparableStack(ModItems.black_hole, 1), },500);
|
||||||
makeRecipe(new ComparableStack(ModItems.gadget_explosive, 1), new AStack[] {new ComparableStack(Blocks.tnt, 3), new OreDictStack(STEEL.plate(), 2), new OreDictStack(AL.plate(), 4), new ComparableStack(ModItems.wire_gold, 3), },200);
|
makeRecipe(new ComparableStack(ModItems.gadget_explosive, 1), new AStack[] {new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 4), new OreDictStack(STEEL.plate(), 2), new OreDictStack(AL.plate(), 4), new ComparableStack(ModItems.wire_gold, 3), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.gadget_wireing, 1), new AStack[] {new OreDictStack(IRON.plate(), 1), new ComparableStack(ModItems.wire_gold, 12), },100);
|
makeRecipe(new ComparableStack(ModItems.gadget_wireing, 1), new AStack[] {new OreDictStack(IRON.plate(), 1), new ComparableStack(ModItems.wire_gold, 12), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.gadget_core, 1), new AStack[] {new OreDictStack(PU239.nugget(), 7), new OreDictStack(U238.nugget(), 3), },200);
|
makeRecipe(new ComparableStack(ModItems.gadget_core, 1), new AStack[] {new OreDictStack(PU239.nugget(), 7), new OreDictStack(U238.nugget(), 3), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.boy_shielding, 1), new AStack[] {new OreDictStack(OreDictManager.getReflector(), 12), new OreDictStack(STEEL.plate(), 4), },150);
|
makeRecipe(new ComparableStack(ModItems.boy_shielding, 1), new AStack[] {new OreDictStack(OreDictManager.getReflector(), 12), new OreDictStack(STEEL.plate(), 4), },150);
|
||||||
makeRecipe(new ComparableStack(ModItems.boy_target, 1), new AStack[] {new OreDictStack(U235.nugget(), 7), },200);
|
makeRecipe(new ComparableStack(ModItems.boy_target, 1), new AStack[] {new OreDictStack(U235.nugget(), 7), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.boy_bullet, 1), new AStack[] {new OreDictStack(U235.nugget(), 3), },100);
|
makeRecipe(new ComparableStack(ModItems.boy_bullet, 1), new AStack[] {new OreDictStack(U235.nugget(), 3), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.boy_propellant, 1), new AStack[] {new ComparableStack(Blocks.tnt, 3), new OreDictStack(IRON.plate(), 8), new OreDictStack(AL.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 4), },100);
|
makeRecipe(new ComparableStack(ModItems.boy_propellant, 1), new AStack[] {new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 3), new OreDictStack(IRON.plate(), 8), new OreDictStack(AL.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 4), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.boy_igniter, 1), new AStack[] {new OreDictStack(AL.plate(), 6), new OreDictStack(STEEL.plate(), 1), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.wire_red_copper, 3), },150);
|
makeRecipe(new ComparableStack(ModItems.boy_igniter, 1), new AStack[] {new OreDictStack(AL.plate(), 6), new OreDictStack(STEEL.plate(), 1), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.wire_red_copper, 3), },150);
|
||||||
makeRecipe(new ComparableStack(ModItems.man_explosive, 1), new AStack[] {new ComparableStack(Blocks.tnt, 2), new ComparableStack(ModItems.ball_tnt, 3), new OreDictStack(STEEL.plate(), 2), new OreDictStack(TI.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 3), },200);
|
makeRecipe(new ComparableStack(ModItems.man_explosive, 1), new AStack[] {new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 3), new OreDictStack(ANY_PLASTICEXPLOSIVE.ingot(), 2), new OreDictStack(STEEL.plate(), 2), new OreDictStack(TI.plate(), 4), new ComparableStack(ModItems.wire_red_copper, 3), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.man_igniter, 1), new AStack[] {new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.wire_red_copper, 9), },150);
|
makeRecipe(new ComparableStack(ModItems.man_igniter, 1), new AStack[] {new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.circuit_red_copper, 1), new ComparableStack(ModItems.wire_red_copper, 9), },150);
|
||||||
makeRecipe(new ComparableStack(ModItems.man_core, 1), new AStack[] {new OreDictStack(PU239.nugget(), 8), new OreDictStack(BE.nugget(), 2), },250);
|
makeRecipe(new ComparableStack(ModItems.man_core, 1), new AStack[] {new OreDictStack(PU239.nugget(), 8), new OreDictStack(BE.nugget(), 2), },250);
|
||||||
makeRecipe(new ComparableStack(ModItems.mike_core, 1), new AStack[] {new OreDictStack(U238.nugget(), 24), new OreDictStack(PB.ingot(), 6), },250);
|
makeRecipe(new ComparableStack(ModItems.mike_core, 1), new AStack[] {new OreDictStack(U238.nugget(), 24), new OreDictStack(PB.ingot(), 6), },250);
|
||||||
@ -378,10 +376,10 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModItems.mike_cooling_unit, 1), new AStack[] {new OreDictStack(IRON.plate(), 8), new ComparableStack(ModItems.coil_copper, 5), new ComparableStack(ModItems.coil_tungsten, 5), new ComparableStack(ModItems.motor, 2), },200);
|
makeRecipe(new ComparableStack(ModItems.mike_cooling_unit, 1), new AStack[] {new OreDictStack(IRON.plate(), 8), new ComparableStack(ModItems.coil_copper, 5), new ComparableStack(ModItems.coil_tungsten, 5), new ComparableStack(ModItems.motor, 2), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.fleija_igniter, 1), new AStack[] {new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.wire_schrabidium, 2), new ComparableStack(ModItems.circuit_schrabidium, 1), },300);
|
makeRecipe(new ComparableStack(ModItems.fleija_igniter, 1), new AStack[] {new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.wire_schrabidium, 2), new ComparableStack(ModItems.circuit_schrabidium, 1), },300);
|
||||||
makeRecipe(new ComparableStack(ModItems.fleija_core, 1), new AStack[] {new OreDictStack(U235.nugget(), 8), new OreDictStack(NP237.nugget(), 2), new OreDictStack(BE.nugget(), 4), new ComparableStack(ModItems.coil_copper, 2), },500);
|
makeRecipe(new ComparableStack(ModItems.fleija_core, 1), new AStack[] {new OreDictStack(U235.nugget(), 8), new OreDictStack(NP237.nugget(), 2), new OreDictStack(BE.nugget(), 4), new ComparableStack(ModItems.coil_copper, 2), },500);
|
||||||
makeRecipe(new ComparableStack(ModItems.fleija_propellant, 1), new AStack[] {new ComparableStack(Blocks.tnt, 3), new OreDictStack(SA326.plate(), 8), },400);
|
makeRecipe(new ComparableStack(ModItems.fleija_propellant, 1), new AStack[] {new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 3), new OreDictStack(SA326.plate(), 8), },400);
|
||||||
makeRecipe(new ComparableStack(ModItems.solinium_igniter, 1), new AStack[] {new OreDictStack(TI.plate(), 4), new ComparableStack(ModItems.wire_advanced_alloy, 2), new ComparableStack(ModItems.circuit_schrabidium, 1), new ComparableStack(ModItems.coil_gold, 1), },400);
|
makeRecipe(new ComparableStack(ModItems.solinium_igniter, 1), new AStack[] {new OreDictStack(TI.plate(), 4), new ComparableStack(ModItems.wire_advanced_alloy, 2), new ComparableStack(ModItems.circuit_schrabidium, 1), new ComparableStack(ModItems.coil_gold, 1), },400);
|
||||||
makeRecipe(new ComparableStack(ModItems.solinium_core, 1), new AStack[] {new OreDictStack(SA327.nugget(), 9), new OreDictStack(EUPH.nugget(), 1), },400);
|
makeRecipe(new ComparableStack(ModItems.solinium_core, 1), new AStack[] {new OreDictStack(SA327.nugget(), 9), new OreDictStack(EUPH.nugget(), 1), },400);
|
||||||
makeRecipe(new ComparableStack(ModItems.solinium_propellant, 1), new AStack[] {new ComparableStack(Blocks.tnt, 3), new OreDictStack(OreDictManager.getReflector(), 2), new ComparableStack(ModItems.plate_polymer, 6), new ComparableStack(ModItems.wire_tungsten, 6), new ComparableStack(ModItems.biomass_compressed, 4), },350);
|
makeRecipe(new ComparableStack(ModItems.solinium_propellant, 1), new AStack[] {new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 3), new OreDictStack(OreDictManager.getReflector(), 2), new ComparableStack(ModItems.plate_polymer, 6), new ComparableStack(ModItems.wire_tungsten, 6), new ComparableStack(ModItems.biomass_compressed, 4), },350);
|
||||||
makeRecipe(new ComparableStack(ModItems.schrabidium_hammer, 1), new AStack[] {new OreDictStack(SA326.block(), 35), new ComparableStack(ModItems.billet_yharonite, 128), new ComparableStack(Items.nether_star, 3), new ComparableStack(ModItems.fragment_meteorite, 512), },1000);
|
makeRecipe(new ComparableStack(ModItems.schrabidium_hammer, 1), new AStack[] {new OreDictStack(SA326.block(), 35), new ComparableStack(ModItems.billet_yharonite, 128), new ComparableStack(Items.nether_star, 3), new ComparableStack(ModItems.fragment_meteorite, 512), },1000);
|
||||||
makeRecipe(new ComparableStack(ModItems.component_limiter, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 2), new OreDictStack(STEEL.plate(), 32), new OreDictStack(TI.plate(), 18), new ComparableStack(ModItems.plate_desh, 12), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.circuit_gold, 8), new ComparableStack(ModItems.circuit_schrabidium, 4), new OreDictStack(STAR.ingot(), 14), new ComparableStack(ModItems.plate_dalekanium, 5), new ComparableStack(ModItems.powder_magic, 16), new ComparableStack(ModBlocks.fwatz_computer, 3), },2500);
|
makeRecipe(new ComparableStack(ModItems.component_limiter, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 2), new OreDictStack(STEEL.plate(), 32), new OreDictStack(TI.plate(), 18), new ComparableStack(ModItems.plate_desh, 12), new ComparableStack(ModItems.pipes_steel, 4), new ComparableStack(ModItems.circuit_gold, 8), new ComparableStack(ModItems.circuit_schrabidium, 4), new OreDictStack(STAR.ingot(), 14), new ComparableStack(ModItems.plate_dalekanium, 5), new ComparableStack(ModItems.powder_magic, 16), new ComparableStack(ModBlocks.fwatz_computer, 3), },2500);
|
||||||
makeRecipe(new ComparableStack(ModItems.component_emitter, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 3), new ComparableStack(ModItems.hull_big_titanium, 2), new OreDictStack(STEEL.plate(), 32), new OreDictStack(PB.plate(), 24), new ComparableStack(ModItems.plate_desh, 24), new ComparableStack(ModItems.pipes_steel, 8), new ComparableStack(ModItems.circuit_gold, 12), new ComparableStack(ModItems.circuit_schrabidium, 8), new OreDictStack(STAR.ingot(), 26), new ComparableStack(ModItems.powder_magic, 48), new ComparableStack(ModBlocks.fwatz_computer, 2), new ComparableStack(ModItems.crystal_xen, 1), },2500);
|
makeRecipe(new ComparableStack(ModItems.component_emitter, 1), new AStack[] {new ComparableStack(ModItems.hull_big_steel, 3), new ComparableStack(ModItems.hull_big_titanium, 2), new OreDictStack(STEEL.plate(), 32), new OreDictStack(PB.plate(), 24), new ComparableStack(ModItems.plate_desh, 24), new ComparableStack(ModItems.pipes_steel, 8), new ComparableStack(ModItems.circuit_gold, 12), new ComparableStack(ModItems.circuit_schrabidium, 8), new OreDictStack(STAR.ingot(), 26), new ComparableStack(ModItems.powder_magic, 48), new ComparableStack(ModBlocks.fwatz_computer, 2), new ComparableStack(ModItems.crystal_xen, 1), },2500);
|
||||||
@ -424,10 +422,10 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModItems.mp_fuselage_10_15_balefire, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new ComparableStack(ModItems.seg_15, 1), new ComparableStack(ModBlocks.steel_scaffold, 9), new OreDictStack(TI.plate(), 36), new OreDictStack(BIGMT.plate(), 9), },500);
|
makeRecipe(new ComparableStack(ModItems.mp_fuselage_10_15_balefire, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new ComparableStack(ModItems.seg_15, 1), new ComparableStack(ModBlocks.steel_scaffold, 9), new OreDictStack(TI.plate(), 36), new OreDictStack(BIGMT.plate(), 9), },500);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_fuselage_15_20_kerosene, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new ComparableStack(ModItems.seg_20, 1), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(TI.plate(), 64), new OreDictStack(STEEL.plate(), 16), },600);
|
makeRecipe(new ComparableStack(ModItems.mp_fuselage_15_20_kerosene, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new ComparableStack(ModItems.seg_20, 1), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(TI.plate(), 64), new OreDictStack(STEEL.plate(), 16), },600);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_fuselage_15_20_solid, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new ComparableStack(ModItems.seg_20, 1), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(TI.plate(), 64), new OreDictStack(AL.plate(), 16), },600);
|
makeRecipe(new ComparableStack(ModItems.mp_fuselage_15_20_solid, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new ComparableStack(ModItems.seg_20, 1), new ComparableStack(ModBlocks.steel_scaffold, 16), new OreDictStack(TI.plate(), 64), new OreDictStack(AL.plate(), 16), },600);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_he, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 6), new ComparableStack(Blocks.tnt, 3), new ComparableStack(ModItems.circuit_targeting_tier2, 1), },100);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_he, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 6), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 3), new ComparableStack(ModItems.circuit_targeting_tier2, 1), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_incendiary, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(TI.plate(), 4), new OreDictStack(P_RED.dust(), 3), new ComparableStack(Blocks.tnt, 2), new ComparableStack(ModItems.circuit_targeting_tier2, 1), },100);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_incendiary, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(TI.plate(), 4), new OreDictStack(P_RED.dust(), 3), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 2), new ComparableStack(ModItems.circuit_targeting_tier2, 1), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_buster, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(TI.plate(), 4), new ComparableStack(ModBlocks.det_charge, 1), new ComparableStack(ModBlocks.det_cord, 4), new ComparableStack(ModItems.board_copper, 4), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },100);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_buster, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(TI.plate(), 4), new ComparableStack(ModBlocks.det_charge, 1), new ComparableStack(ModBlocks.det_cord, 4), new ComparableStack(ModItems.board_copper, 4), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_nuclear, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 6), new OreDictStack(PU239.ingot(), 1), new ComparableStack(Blocks.tnt, 2), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },200);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_nuclear, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 6), new OreDictStack(PU239.ingot(), 1), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 2), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_nuclear_large, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 8), new OreDictStack(AL.plate(), 4), new OreDictStack(PU239.ingot(), 2), new ComparableStack(ModBlocks.det_charge, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 1), },300);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_nuclear_large, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 8), new OreDictStack(AL.plate(), 4), new OreDictStack(PU239.ingot(), 2), new ComparableStack(ModBlocks.det_charge, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 1), },300);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_taint, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.powder_magic, 12), new ComparableStack(ModItems.bucket_mud, 1), },100);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_taint, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.powder_magic, 12), new ComparableStack(ModItems.bucket_mud, 1), },100);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_cloud, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.grenade_pink_cloud, 2), },100);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_10_cloud, 1), new AStack[] {new ComparableStack(ModItems.seg_10, 1), new OreDictStack(STEEL.plate(), 12), new ComparableStack(ModBlocks.det_cord, 2), new ComparableStack(ModItems.grenade_pink_cloud, 2), },100);
|
||||||
@ -435,7 +433,7 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_incendiary, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 16), new ComparableStack(ModBlocks.det_charge, 2), new OreDictStack(P_RED.dust(), 8), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },200);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_incendiary, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 16), new ComparableStack(ModBlocks.det_charge, 2), new OreDictStack(P_RED.dust(), 8), new ComparableStack(ModItems.circuit_targeting_tier3, 1), },200);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_nuclear, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 24), new OreDictStack(TI.plate(), 12), new OreDictStack(PU239.ingot(), 3), new ComparableStack(ModBlocks.det_charge, 4), new ComparableStack(ModItems.circuit_targeting_tier4, 1), },500);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_nuclear, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 24), new OreDictStack(TI.plate(), 12), new OreDictStack(PU239.ingot(), 3), new ComparableStack(ModBlocks.det_charge, 4), new ComparableStack(ModItems.circuit_targeting_tier4, 1), },500);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_n2, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 8), new OreDictStack(TI.plate(), 20), new ComparableStack(ModBlocks.det_charge, 24), new ComparableStack(Blocks.redstone_block, 12), new OreDictStack(MAGTUNG.dust(), 6), new ComparableStack(ModItems.circuit_targeting_tier4, 1), },400);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_n2, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(STEEL.plate(), 8), new OreDictStack(TI.plate(), 20), new ComparableStack(ModBlocks.det_charge, 24), new ComparableStack(Blocks.redstone_block, 12), new OreDictStack(MAGTUNG.dust(), 6), new ComparableStack(ModItems.circuit_targeting_tier4, 1), },400);
|
||||||
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_balefire, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(OreDictManager.getReflector(), 16), new ComparableStack(ModItems.powder_magic, 6), new ComparableStack(ModItems.egg_balefire_shard, 4), new ComparableStack(ModItems.ball_tnt, 8), new ComparableStack(ModItems.circuit_targeting_tier4, 1), }, 60);
|
makeRecipe(new ComparableStack(ModItems.mp_warhead_15_balefire, 1), new AStack[] {new ComparableStack(ModItems.seg_15, 1), new OreDictStack(OreDictManager.getReflector(), 16), new ComparableStack(ModItems.powder_magic, 6), new ComparableStack(ModItems.egg_balefire_shard, 4), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 8), new ComparableStack(ModItems.circuit_targeting_tier4, 1), }, 60);
|
||||||
makeRecipe(new ComparableStack(ModItems.missile_soyuz, 1), new AStack[] {new ComparableStack(ModItems.rocket_fuel, 40), new ComparableStack(ModBlocks.det_cord, 20), new ComparableStack(ModItems.thruster_medium, 12), new ComparableStack(ModItems.thruster_small, 12), new ComparableStack(ModItems.tank_steel, 10), new ComparableStack(ModItems.circuit_targeting_tier4, 4), new ComparableStack(ModItems.circuit_targeting_tier3, 8), new ComparableStack(ModItems.plate_polymer, 64), new ComparableStack(ModItems.fins_small_steel, 4), new ComparableStack(ModItems.hull_big_titanium, 40), new ComparableStack(ModItems.hull_big_steel, 24), new OreDictStack(FIBER.ingot(), 64), },600);
|
makeRecipe(new ComparableStack(ModItems.missile_soyuz, 1), new AStack[] {new ComparableStack(ModItems.rocket_fuel, 40), new ComparableStack(ModBlocks.det_cord, 20), new ComparableStack(ModItems.thruster_medium, 12), new ComparableStack(ModItems.thruster_small, 12), new ComparableStack(ModItems.tank_steel, 10), new ComparableStack(ModItems.circuit_targeting_tier4, 4), new ComparableStack(ModItems.circuit_targeting_tier3, 8), new ComparableStack(ModItems.plate_polymer, 64), new ComparableStack(ModItems.fins_small_steel, 4), new ComparableStack(ModItems.hull_big_titanium, 40), new ComparableStack(ModItems.hull_big_steel, 24), new OreDictStack(FIBER.ingot(), 64), },600);
|
||||||
makeRecipe(new ComparableStack(ModItems.missile_soyuz_lander, 1), new AStack[] {new ComparableStack(ModItems.rocket_fuel, 10), new ComparableStack(ModItems.thruster_small, 3), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModItems.circuit_targeting_tier3, 4), new ComparableStack(ModItems.plate_polymer, 32), new ComparableStack(ModItems.hull_big_aluminium, 2), new ComparableStack(ModItems.sphere_steel, 1), new OreDictStack(FIBER.ingot(), 12), },600);
|
makeRecipe(new ComparableStack(ModItems.missile_soyuz_lander, 1), new AStack[] {new ComparableStack(ModItems.rocket_fuel, 10), new ComparableStack(ModItems.thruster_small, 3), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModItems.circuit_targeting_tier3, 4), new ComparableStack(ModItems.plate_polymer, 32), new ComparableStack(ModItems.hull_big_aluminium, 2), new ComparableStack(ModItems.sphere_steel, 1), new OreDictStack(FIBER.ingot(), 12), },600);
|
||||||
makeRecipe(new ComparableStack(ModItems.fusion_shield_tungsten, 1), new AStack[] {new OreDictStack(W.block(), 32), new OreDictStack(OreDictManager.getReflector(), 96)}, 600);
|
makeRecipe(new ComparableStack(ModItems.fusion_shield_tungsten, 1), new AStack[] {new OreDictStack(W.block(), 32), new OreDictStack(OreDictManager.getReflector(), 96)}, 600);
|
||||||
@ -558,7 +556,7 @@ public class AssemblerRecipes {
|
|||||||
new OreDictStack(CU.plate(), 1),
|
new OreDictStack(CU.plate(), 1),
|
||||||
new ComparableStack(ModItems.primer_50, 5),
|
new ComparableStack(ModItems.primer_50, 5),
|
||||||
new ComparableStack(ModItems.casing_50, 5),
|
new ComparableStack(ModItems.casing_50, 5),
|
||||||
new ComparableStack(ModItems.ingot_semtex, 2),
|
new OreDictStack(ANY_PLASTICEXPLOSIVE.ingot(), 2),
|
||||||
new ComparableStack(ModItems.cordite, 3),
|
new ComparableStack(ModItems.cordite, 3),
|
||||||
new OreDictStack(U238.ingot(), 1)
|
new OreDictStack(U238.ingot(), 1)
|
||||||
}, 60);
|
}, 60);
|
||||||
@ -568,7 +566,7 @@ public class AssemblerRecipes {
|
|||||||
new OreDictStack(CU.plate(), 1),
|
new OreDictStack(CU.plate(), 1),
|
||||||
new ComparableStack(ModItems.primer_50, 5),
|
new ComparableStack(ModItems.primer_50, 5),
|
||||||
new ComparableStack(ModItems.casing_50, 5),
|
new ComparableStack(ModItems.casing_50, 5),
|
||||||
new ComparableStack(ModItems.ingot_semtex, 3),
|
new OreDictStack(ANY_PLASTICEXPLOSIVE.ingot(), 3),
|
||||||
new ComparableStack(ModItems.cordite, 3),
|
new ComparableStack(ModItems.cordite, 3),
|
||||||
new OreDictStack(P_WHITE.ingot(), 3)
|
new OreDictStack(P_WHITE.ingot(), 3)
|
||||||
}, 60);
|
}, 60);
|
||||||
@ -578,7 +576,7 @@ public class AssemblerRecipes {
|
|||||||
new OreDictStack(CU.plate(), 1),
|
new OreDictStack(CU.plate(), 1),
|
||||||
new ComparableStack(ModItems.primer_50, 5),
|
new ComparableStack(ModItems.primer_50, 5),
|
||||||
new ComparableStack(ModItems.casing_50, 5),
|
new ComparableStack(ModItems.casing_50, 5),
|
||||||
new ComparableStack(ModItems.ball_tnt, 5),
|
new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 5),
|
||||||
new ComparableStack(ModItems.cordite, 5),
|
new ComparableStack(ModItems.cordite, 5),
|
||||||
new OreDictStack(REDSTONE.dust(), 3)
|
new OreDictStack(REDSTONE.dust(), 3)
|
||||||
}, 60);
|
}, 60);
|
||||||
@ -766,14 +764,27 @@ public class AssemblerRecipes {
|
|||||||
makeRecipe(new ComparableStack(ModBlocks.machine_deuterium_extractor, 1), new AStack[] {
|
makeRecipe(new ComparableStack(ModBlocks.machine_deuterium_extractor, 1), new AStack[] {
|
||||||
new ComparableStack(ModItems.deuterium_filter, 1),
|
new ComparableStack(ModItems.deuterium_filter, 1),
|
||||||
new ComparableStack(ModItems.sulfur, 12),
|
new ComparableStack(ModItems.sulfur, 12),
|
||||||
new OreDictStack("plateSteel", 8),
|
new OreDictStack(STEEL.plate(), 8),
|
||||||
new OreDictStack("plateAluminum", 4),
|
new OreDictStack(AL.plate(), 4),
|
||||||
new ComparableStack(ModItems.pipes_steel),
|
new ComparableStack(ModItems.pipes_steel),
|
||||||
new ComparableStack(ModItems.board_copper, 2),
|
new ComparableStack(ModItems.board_copper, 2),
|
||||||
new ComparableStack(ModItems.turbine_titanium, 2),
|
new ComparableStack(ModItems.turbine_titanium, 2),
|
||||||
new ComparableStack(ModItems.circuit_aluminium, 3)
|
new ComparableStack(ModItems.circuit_aluminium, 3)
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|
||||||
|
makeRecipe(new ComparableStack(ModBlocks.machine_chemfac, 1), new AStack[] {
|
||||||
|
new OreDictStack(STEEL.ingot(), 48),
|
||||||
|
new OreDictStack(TCALLOY.ingot(), 8),
|
||||||
|
new OreDictStack(NB.ingot(), 4),
|
||||||
|
new OreDictStack(RUBBER.ingot(), 16),
|
||||||
|
new ComparableStack(ModItems.hull_big_steel, 12),
|
||||||
|
new ComparableStack(ModItems.tank_steel, 8),
|
||||||
|
new ComparableStack(ModItems.motor_desh, 4),
|
||||||
|
new ComparableStack(ModItems.coil_tungsten, 24),
|
||||||
|
new ComparableStack(ModItems.pipes_steel, 1),
|
||||||
|
new ComparableStack(ModItems.circuit_gold, 3)
|
||||||
|
}, 400);
|
||||||
|
|
||||||
makeRecipe(new ComparableStack(ModItems.missile_shuttle, 1), new AStack[] {
|
makeRecipe(new ComparableStack(ModItems.missile_shuttle, 1), new AStack[] {
|
||||||
new ComparableStack(ModItems.missile_generic, 2),
|
new ComparableStack(ModItems.missile_generic, 2),
|
||||||
new ComparableStack(ModItems.missile_strong, 1),
|
new ComparableStack(ModItems.missile_strong, 1),
|
||||||
@ -781,7 +792,7 @@ public class AssemblerRecipes {
|
|||||||
new ComparableStack(ModItems.canister_full, 24, Fluids.GASOLINE_LEADED.getID()),
|
new ComparableStack(ModItems.canister_full, 24, Fluids.GASOLINE_LEADED.getID()),
|
||||||
new OreDictStack(FIBER.ingot(), 12),
|
new OreDictStack(FIBER.ingot(), 12),
|
||||||
new ComparableStack(ModItems.circuit_copper, 2),
|
new ComparableStack(ModItems.circuit_copper, 2),
|
||||||
new ComparableStack(ModItems.ingot_semtex, 8),
|
new OreDictStack(ANY_PLASTICEXPLOSIVE.ingot(), 8),
|
||||||
new OreDictStack(KEY_ANYPANE, 6),
|
new OreDictStack(KEY_ANYPANE, 6),
|
||||||
new OreDictStack(STEEL.plate(), 4),
|
new OreDictStack(STEEL.plate(), 4),
|
||||||
}, 100);
|
}, 100);
|
||||||
|
|||||||
@ -166,7 +166,7 @@ public class RefineryRecipes {
|
|||||||
ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)
|
ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)
|
||||||
};
|
};
|
||||||
|
|
||||||
recipes.put(in, recipe.getValue().getValue().type == Fluids.NONE ? ItemFluidIcon.make(recipe.getValue().getKey()) : out);
|
recipes.put(in, recipe.getValue().getValue().type == Fluids.NONE ? new ItemStack[] {ItemFluidIcon.make(recipe.getValue().getKey()), ItemFluidIcon.make(Fluids.SPENTSTEAM, 2)} : out);
|
||||||
}
|
}
|
||||||
|
|
||||||
return recipes;
|
return recipes;
|
||||||
|
|||||||
@ -12,14 +12,12 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
|||||||
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||||
import com.hbm.inventory.recipes.AssemblerRecipes;
|
import com.hbm.inventory.recipes.AssemblerRecipes;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemRTGPelletDepleted.DepletedRTGMaterial;
|
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.init.Blocks;
|
import net.minecraft.init.Blocks;
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraftforge.oredict.OreDictionary;
|
|
||||||
|
|
||||||
|
|
||||||
public class AnvilRecipes {
|
public class AnvilRecipes {
|
||||||
@ -334,7 +332,7 @@ public class AnvilRecipes {
|
|||||||
{ModItems.ammo_44_du, STAR.ingot(), ModItems.ammo_44_star, 10, 3},
|
{ModItems.ammo_44_du, STAR.ingot(), ModItems.ammo_44_star, 10, 3},
|
||||||
{ModItems.ammo_44, ModItems.pellet_chlorophyte, ModItems.ammo_44_chlorophyte, 10, 3},
|
{ModItems.ammo_44, ModItems.pellet_chlorophyte, ModItems.ammo_44_chlorophyte, 10, 3},
|
||||||
|
|
||||||
{ModItems.ammo_5mm, ModItems.ingot_semtex, ModItems.ammo_5mm_explosive, 20, 2},
|
{ModItems.ammo_5mm, ANY_HIGHEXPLOSIVE.ingot(), ModItems.ammo_5mm_explosive, 20, 2},
|
||||||
{ModItems.ammo_5mm, U238.ingot(), ModItems.ammo_5mm_du, 20, 2},
|
{ModItems.ammo_5mm, U238.ingot(), ModItems.ammo_5mm_du, 20, 2},
|
||||||
{ModItems.ammo_5mm, STAR.ingot(), ModItems.ammo_5mm_star, 10, 3},
|
{ModItems.ammo_5mm, STAR.ingot(), ModItems.ammo_5mm_star, 10, 3},
|
||||||
{ModItems.ammo_5mm, ModItems.pellet_chlorophyte, ModItems.ammo_5mm_chlorophyte, 10, 3},
|
{ModItems.ammo_5mm, ModItems.pellet_chlorophyte, ModItems.ammo_5mm_chlorophyte, 10, 3},
|
||||||
@ -348,7 +346,7 @@ public class AnvilRecipes {
|
|||||||
|
|
||||||
{ModItems.ammo_50bmg, P_RED.dust(), ModItems.ammo_50bmg_incendiary, 20, 2},
|
{ModItems.ammo_50bmg, P_RED.dust(), ModItems.ammo_50bmg_incendiary, 20, 2},
|
||||||
{ModItems.ammo_50bmg, P_WHITE.ingot(), ModItems.ammo_50bmg_phosphorus, 20, 2},
|
{ModItems.ammo_50bmg, P_WHITE.ingot(), ModItems.ammo_50bmg_phosphorus, 20, 2},
|
||||||
{ModItems.ammo_50bmg, ModItems.ingot_semtex, ModItems.ammo_50bmg_explosive, 20, 2},
|
{ModItems.ammo_50bmg, ANY_HIGHEXPLOSIVE.ingot(), ModItems.ammo_50bmg_explosive, 20, 2},
|
||||||
{ModItems.ammo_50bmg, DURA.ingot(), ModItems.ammo_50bmg_ap, 20, 2},
|
{ModItems.ammo_50bmg, DURA.ingot(), ModItems.ammo_50bmg_ap, 20, 2},
|
||||||
{ModItems.ammo_50bmg, U238.ingot(), ModItems.ammo_50bmg_du, 20, 2},
|
{ModItems.ammo_50bmg, U238.ingot(), ModItems.ammo_50bmg_du, 20, 2},
|
||||||
{ModItems.ammo_50bmg_du, STAR.ingot(), ModItems.ammo_50bmg_star, 10, 3},
|
{ModItems.ammo_50bmg_du, STAR.ingot(), ModItems.ammo_50bmg_star, 10, 3},
|
||||||
|
|||||||
@ -1636,6 +1636,7 @@ public class ModItems {
|
|||||||
public static Item gun_uzi_ammo;
|
public static Item gun_uzi_ammo;
|
||||||
public static Item gun_uboinik;
|
public static Item gun_uboinik;
|
||||||
public static Item gun_uboinik_ammo;
|
public static Item gun_uboinik_ammo;
|
||||||
|
public static Item gun_spas12;
|
||||||
public static Item gun_supershotgun;
|
public static Item gun_supershotgun;
|
||||||
public static Item gun_ks23;
|
public static Item gun_ks23;
|
||||||
public static Item gun_sauer;
|
public static Item gun_sauer;
|
||||||
@ -1690,6 +1691,7 @@ public class ModItems {
|
|||||||
public static Item gun_dampfmaschine;
|
public static Item gun_dampfmaschine;
|
||||||
public static Item gun_waluigi;
|
public static Item gun_waluigi;
|
||||||
public static Item gun_darter;
|
public static Item gun_darter;
|
||||||
|
public static Item gun_detonator;
|
||||||
|
|
||||||
public static Item crucible;
|
public static Item crucible;
|
||||||
|
|
||||||
@ -1714,6 +1716,7 @@ public class ModItems {
|
|||||||
public static Item grenade_schrabidium;
|
public static Item grenade_schrabidium;
|
||||||
public static Item grenade_lemon;
|
public static Item grenade_lemon;
|
||||||
public static Item grenade_gascan;
|
public static Item grenade_gascan;
|
||||||
|
public static Item grenade_kyiv;
|
||||||
public static Item grenade_mk2;
|
public static Item grenade_mk2;
|
||||||
public static Item grenade_aschrab;
|
public static Item grenade_aschrab;
|
||||||
public static Item grenade_nuke;
|
public static Item grenade_nuke;
|
||||||
@ -2350,6 +2353,7 @@ public class ModItems {
|
|||||||
public static Item spawn_chopper;
|
public static Item spawn_chopper;
|
||||||
public static Item spawn_worm;
|
public static Item spawn_worm;
|
||||||
public static Item spawn_ufo;
|
public static Item spawn_ufo;
|
||||||
|
public static Item spawn_duck;
|
||||||
|
|
||||||
public static Item key;
|
public static Item key;
|
||||||
public static Item key_red;
|
public static Item key_red;
|
||||||
@ -4302,6 +4306,7 @@ public class ModItems {
|
|||||||
gun_uzi_saturnite_silencer = new ItemGunBase(Gun22LRFactory.getSaturniteConfig().silenced()).setUnlocalizedName("gun_uzi_saturnite_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite_silencer");
|
gun_uzi_saturnite_silencer = new ItemGunBase(Gun22LRFactory.getSaturniteConfig().silenced()).setUnlocalizedName("gun_uzi_saturnite_silencer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uzi_saturnite_silencer");
|
||||||
gun_uboinik_ammo = new Item().setUnlocalizedName("gun_uboinik_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_uboinik_ammo");
|
gun_uboinik_ammo = new Item().setUnlocalizedName("gun_uboinik_ammo").setCreativeTab(null).setTextureName(RefStrings.MODID + ":gun_uboinik_ammo");
|
||||||
gun_uboinik = new ItemGunBase(Gun12GaugeFactory.getUboinikConfig()).setUnlocalizedName("gun_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
gun_uboinik = new ItemGunBase(Gun12GaugeFactory.getUboinikConfig()).setUnlocalizedName("gun_uboinik").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||||
|
gun_spas12 = new ItemGunBase(Gun12GaugeFactory.getSpas12Config(), Gun12GaugeFactory.getSpas12AltConfig()).setUnlocalizedName("gun_spas12").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_spas12");
|
||||||
gun_supershotgun = new ItemGunShotty(Gun12GaugeFactory.getShottyConfig()).setUnlocalizedName("gun_supershotgun").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
gun_supershotgun = new ItemGunShotty(Gun12GaugeFactory.getShottyConfig()).setUnlocalizedName("gun_supershotgun").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||||
gun_ks23 = new ItemGunBase(Gun4GaugeFactory.getKS23Config()).setUnlocalizedName("gun_ks23").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
gun_ks23 = new ItemGunBase(Gun4GaugeFactory.getKS23Config()).setUnlocalizedName("gun_ks23").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||||
gun_sauer = new ItemGunBase(Gun4GaugeFactory.getSauerConfig()).setUnlocalizedName("gun_sauer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
gun_sauer = new ItemGunBase(Gun4GaugeFactory.getSauerConfig()).setUnlocalizedName("gun_sauer").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_uboinik");
|
||||||
@ -4356,6 +4361,7 @@ public class ModItems {
|
|||||||
gun_moist_nugget = new ItemNugget(3, false).setUnlocalizedName("gun_moist_nugget").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_moist_nugget");
|
gun_moist_nugget = new ItemNugget(3, false).setUnlocalizedName("gun_moist_nugget").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_moist_nugget");
|
||||||
gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_dampfmaschine");
|
gun_dampfmaschine = new GunDampfmaschine().setUnlocalizedName("gun_dampfmaschine").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_dampfmaschine");
|
||||||
gun_darter = new ItemGunDart(GunDartFactory.getDarterConfig()).setFull3D().setUnlocalizedName("gun_darter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
|
gun_darter = new ItemGunDart(GunDartFactory.getDarterConfig()).setFull3D().setUnlocalizedName("gun_darter").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
|
||||||
|
gun_detonator = new ItemGunDetonator(GunDetonatorFactory.getDetonatorConfig()).setFull3D().setUnlocalizedName("gun_detonator").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":gun_darter");
|
||||||
|
|
||||||
ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 10, 3, 50.0F, 100.0F, 0);
|
ToolMaterial matCrucible = EnumHelper.addToolMaterial("CRUCIBLE", 10, 3, 50.0F, 100.0F, 0);
|
||||||
crucible = new ItemCrucible(5000, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible");
|
crucible = new ItemCrucible(5000, 1F, matCrucible).setUnlocalizedName("crucible").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":crucible");
|
||||||
@ -4381,6 +4387,7 @@ public class ModItems {
|
|||||||
grenade_schrabidium = new ItemGrenade(7).setUnlocalizedName("grenade_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_schrabidium_alt");
|
grenade_schrabidium = new ItemGrenade(7).setUnlocalizedName("grenade_schrabidium").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_schrabidium_alt");
|
||||||
grenade_lemon = new ItemGrenade(4).setUnlocalizedName("grenade_lemon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_lemon");
|
grenade_lemon = new ItemGrenade(4).setUnlocalizedName("grenade_lemon").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_lemon");
|
||||||
grenade_gascan = new ItemGrenade(-1).setUnlocalizedName("grenade_gascan").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_gascan");
|
grenade_gascan = new ItemGrenade(-1).setUnlocalizedName("grenade_gascan").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_gascan");
|
||||||
|
grenade_kyiv = new ItemGrenadeKyiv(-1).setUnlocalizedName("grenade_kyiv").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_kyiv");
|
||||||
grenade_mk2 = new ItemGrenade(5).setUnlocalizedName("grenade_mk2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mk2_alt");
|
grenade_mk2 = new ItemGrenade(5).setUnlocalizedName("grenade_mk2").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_mk2_alt");
|
||||||
grenade_aschrab = new ItemGrenade(-1).setUnlocalizedName("grenade_aschrab").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_aschrab");
|
grenade_aschrab = new ItemGrenade(-1).setUnlocalizedName("grenade_aschrab").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_aschrab");
|
||||||
grenade_nuke = new ItemGrenade(-1).setUnlocalizedName("grenade_nuke").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_nuke_alt");
|
grenade_nuke = new ItemGrenade(-1).setUnlocalizedName("grenade_nuke").setCreativeTab(MainRegistry.weaponTab).setTextureName(RefStrings.MODID + ":grenade_nuke_alt");
|
||||||
@ -4701,6 +4708,7 @@ public class ModItems {
|
|||||||
spawn_chopper = new ItemChopper().setUnlocalizedName("chopper").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chopper");
|
spawn_chopper = new ItemChopper().setUnlocalizedName("chopper").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":chopper");
|
||||||
spawn_worm = new ItemChopper().setUnlocalizedName("spawn_worm").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":spawn_worm");
|
spawn_worm = new ItemChopper().setUnlocalizedName("spawn_worm").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":spawn_worm");
|
||||||
spawn_ufo = new ItemChopper().setUnlocalizedName("spawn_ufo").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":spawn_ufo");
|
spawn_ufo = new ItemChopper().setUnlocalizedName("spawn_ufo").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":spawn_ufo");
|
||||||
|
spawn_duck = new ItemChopper().setUnlocalizedName("spawn_duck").setMaxStackSize(16).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":spawn_duck");
|
||||||
linker = new ItemTeleLink().setUnlocalizedName("linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":linker");
|
linker = new ItemTeleLink().setUnlocalizedName("linker").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":linker");
|
||||||
reactor_sensor = new ItemReactorSensor().setUnlocalizedName("reactor_sensor").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":reactor_sensor");
|
reactor_sensor = new ItemReactorSensor().setUnlocalizedName("reactor_sensor").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":reactor_sensor");
|
||||||
oil_detector = new ItemOilDetector().setUnlocalizedName("oil_detector").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":oil_detector");
|
oil_detector = new ItemOilDetector().setUnlocalizedName("oil_detector").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":oil_detector");
|
||||||
@ -4872,17 +4880,17 @@ public class ModItems {
|
|||||||
|
|
||||||
ArmorMaterial aMatDesh = EnumHelper.addArmorMaterial("HBM_DESH", 150, new int[] { 3, 8, 6, 3 }, 0);
|
ArmorMaterial aMatDesh = EnumHelper.addArmorMaterial("HBM_DESH", 150, new int[] { 3, 8, 6, 3 }, 0);
|
||||||
aMatDesh.customCraftingMaterial = ModItems.ingot_desh;
|
aMatDesh.customCraftingMaterial = ModItems.ingot_desh;
|
||||||
steamsuit_helmet = new ArmorDesh(aMatDesh, 2, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 216000, 500, 1, 50).setCap(15F).setMod(0.5F)
|
steamsuit_helmet = new ArmorDesh(aMatDesh, 2, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 360000, 500, 50, 1).setThreshold(5F).setMod(0.8F)
|
||||||
.setFireproof(true)
|
.setFireproof(true)
|
||||||
.setHasHardLanding(true)
|
.setHasHardLanding(true)
|
||||||
.addEffect(new PotionEffect(Potion.digSpeed.id, 20, 2))
|
.addEffect(new PotionEffect(Potion.digSpeed.id, 20, 4))
|
||||||
.setBlastProtection(0.5F)
|
.setBlastProtection(0.5F)
|
||||||
.addResistance("monoxide", 0F)
|
.addResistance("monoxide", 0F)
|
||||||
.addResistance("fall", 0)
|
.addResistance("fall", 0)
|
||||||
.setUnlocalizedName("steamsuit_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_helmet");
|
.setUnlocalizedName("steamsuit_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_helmet");
|
||||||
steamsuit_plate = new ArmorDesh(aMatDesh, 2, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 216000, 500, 1, 50).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_plate");
|
steamsuit_plate = new ArmorDesh(aMatDesh, 2, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 360000, 500, 50, 1).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_plate");
|
||||||
steamsuit_legs = new ArmorDesh(aMatDesh, 2, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", Fluids.STEAM, 216000, 500, 1, 50).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_legs");
|
steamsuit_legs = new ArmorDesh(aMatDesh, 2, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", Fluids.STEAM, 360000, 500, 50, 1).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_legs");
|
||||||
steamsuit_boots = new ArmorDesh(aMatDesh, 2, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 216000, 500, 1, 50).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_boots");
|
steamsuit_boots = new ArmorDesh(aMatDesh, 2, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 360000, 500, 50, 1).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_boots").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_boots");
|
||||||
|
|
||||||
ArmorMaterial aMatAJR = EnumHelper.addArmorMaterial("HBM_T45AJR", 150, new int[] { 3, 8, 6, 3 }, 100);
|
ArmorMaterial aMatAJR = EnumHelper.addArmorMaterial("HBM_T45AJR", 150, new int[] { 3, 8, 6, 3 }, 100);
|
||||||
aMatAJR.customCraftingMaterial = ModItems.plate_armor_ajr;
|
aMatAJR.customCraftingMaterial = ModItems.plate_armor_ajr;
|
||||||
@ -6778,6 +6786,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(spawn_chopper, spawn_chopper.getUnlocalizedName());
|
GameRegistry.registerItem(spawn_chopper, spawn_chopper.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(spawn_worm, spawn_worm.getUnlocalizedName());
|
GameRegistry.registerItem(spawn_worm, spawn_worm.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(spawn_ufo, spawn_ufo.getUnlocalizedName());
|
GameRegistry.registerItem(spawn_ufo, spawn_ufo.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(spawn_duck, spawn_duck.getUnlocalizedName());
|
||||||
|
|
||||||
//Computer Tools
|
//Computer Tools
|
||||||
GameRegistry.registerItem(designator, designator.getUnlocalizedName());
|
GameRegistry.registerItem(designator, designator.getUnlocalizedName());
|
||||||
@ -7036,6 +7045,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(gun_uzi_saturnite, gun_uzi_saturnite.getUnlocalizedName());
|
GameRegistry.registerItem(gun_uzi_saturnite, gun_uzi_saturnite.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_uzi_saturnite_silencer,gun_uzi_saturnite_silencer.getUnlocalizedName());
|
GameRegistry.registerItem(gun_uzi_saturnite_silencer,gun_uzi_saturnite_silencer.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_uboinik, gun_uboinik.getUnlocalizedName());
|
GameRegistry.registerItem(gun_uboinik, gun_uboinik.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(gun_spas12, gun_spas12.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_supershotgun, gun_supershotgun.getUnlocalizedName());
|
GameRegistry.registerItem(gun_supershotgun, gun_supershotgun.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_ks23, gun_ks23.getUnlocalizedName());
|
GameRegistry.registerItem(gun_ks23, gun_ks23.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_sauer, gun_sauer.getUnlocalizedName());
|
GameRegistry.registerItem(gun_sauer, gun_sauer.getUnlocalizedName());
|
||||||
@ -7072,6 +7082,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(gun_moist_nugget, gun_moist_nugget.getUnlocalizedName());
|
GameRegistry.registerItem(gun_moist_nugget, gun_moist_nugget.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_dampfmaschine, gun_dampfmaschine.getUnlocalizedName());
|
GameRegistry.registerItem(gun_dampfmaschine, gun_dampfmaschine.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(gun_darter, gun_darter.getUnlocalizedName());
|
GameRegistry.registerItem(gun_darter, gun_darter.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(gun_detonator, gun_detonator.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(crucible, crucible.getUnlocalizedName());
|
GameRegistry.registerItem(crucible, crucible.getUnlocalizedName());
|
||||||
|
|
||||||
//Ammo
|
//Ammo
|
||||||
@ -7336,6 +7347,7 @@ public class ModItems {
|
|||||||
GameRegistry.registerItem(grenade_nuke, grenade_nuke.getUnlocalizedName());
|
GameRegistry.registerItem(grenade_nuke, grenade_nuke.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(grenade_lemon, grenade_lemon.getUnlocalizedName());
|
GameRegistry.registerItem(grenade_lemon, grenade_lemon.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(grenade_gascan, grenade_gascan.getUnlocalizedName());
|
GameRegistry.registerItem(grenade_gascan, grenade_gascan.getUnlocalizedName());
|
||||||
|
GameRegistry.registerItem(grenade_kyiv, grenade_kyiv.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(grenade_mk2, grenade_mk2.getUnlocalizedName());
|
GameRegistry.registerItem(grenade_mk2, grenade_mk2.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(grenade_aschrab, grenade_aschrab.getUnlocalizedName());
|
GameRegistry.registerItem(grenade_aschrab, grenade_aschrab.getUnlocalizedName());
|
||||||
GameRegistry.registerItem(grenade_nuclear, grenade_nuclear.getUnlocalizedName());
|
GameRegistry.registerItem(grenade_nuclear, grenade_nuclear.getUnlocalizedName());
|
||||||
|
|||||||
@ -1,8 +1,14 @@
|
|||||||
package com.hbm.items.armor;
|
package com.hbm.items.armor;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.interfaces.IPartiallyFillable;
|
import com.hbm.interfaces.IPartiallyFillable;
|
||||||
import com.hbm.inventory.fluid.FluidType;
|
import com.hbm.inventory.fluid.FluidType;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
|
import com.hbm.util.I18nUtil;
|
||||||
|
|
||||||
|
import cpw.mods.fml.relauncher.Side;
|
||||||
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
@ -22,6 +28,7 @@ public class ArmorFSBFueled extends ArmorFSB implements IPartiallyFillable {
|
|||||||
this.fillRate = fillRate;
|
this.fillRate = fillRate;
|
||||||
this.consumption = consumption;
|
this.consumption = consumption;
|
||||||
this.drain = drain;
|
this.drain = drain;
|
||||||
|
this.maxFuel = maxFuel;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -33,7 +40,8 @@ public class ArmorFSBFueled extends ArmorFSB implements IPartiallyFillable {
|
|||||||
public int getFill(ItemStack stack) {
|
public int getFill(ItemStack stack) {
|
||||||
if(stack.stackTagCompound == null) {
|
if(stack.stackTagCompound == null) {
|
||||||
stack.stackTagCompound = new NBTTagCompound();
|
stack.stackTagCompound = new NBTTagCompound();
|
||||||
return 0;
|
setFill(stack, maxFuel);
|
||||||
|
return maxFuel;
|
||||||
}
|
}
|
||||||
|
|
||||||
return stack.stackTagCompound.getInteger("fuel");
|
return stack.stackTagCompound.getInteger("fuel");
|
||||||
@ -68,6 +76,11 @@ public class ArmorFSBFueled extends ArmorFSB implements IPartiallyFillable {
|
|||||||
this.setFill(stack, Math.max(this.getFill(stack) - (damage * consumption), 0));
|
this.setFill(stack, Math.max(this.getFill(stack) - (damage * consumption), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean isArmorEnabled(ItemStack stack) {
|
||||||
|
return getFill(stack) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
public void onArmorTick(World world, EntityPlayer player, ItemStack stack) {
|
||||||
|
|
||||||
@ -77,4 +90,20 @@ public class ArmorFSBFueled extends ArmorFSB implements IPartiallyFillable {
|
|||||||
this.setFill(stack, Math.max(this.getFill(stack) - this.drain, 0));
|
this.setFill(stack, Math.max(this.getFill(stack) - this.drain, 0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SideOnly(Side.CLIENT)
|
||||||
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||||
|
list.add(I18nUtil.resolveKey(this.fuelType.getUnlocalizedName()) + ": " + BobMathUtil.getShortNumber(getFill(stack)) + " / " + BobMathUtil.getShortNumber(getMaxFill(stack)));
|
||||||
|
super.addInformation(stack, player, list, ext);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean showDurabilityBar(ItemStack stack) {
|
||||||
|
return getFill(stack) < getMaxFill(stack);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public double getDurabilityForDisplay(ItemStack stack) {
|
||||||
|
return 1 - (double) getFill(stack) / (double) getMaxFill(stack);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -8,7 +8,9 @@ import com.hbm.items.ModItems;
|
|||||||
import net.minecraft.entity.EntityLivingBase;
|
import net.minecraft.entity.EntityLivingBase;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.util.DamageSource;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||||
|
|
||||||
public class ItemModPads extends ItemArmorMod {
|
public class ItemModPads extends ItemArmorMod {
|
||||||
|
|
||||||
@ -41,6 +43,13 @@ public class ItemModPads extends ItemArmorMod {
|
|||||||
list.add(EnumChatFormatting.DARK_PURPLE + " " + stack.getDisplayName() + " (-" + Math.round((1F - damageMod) * 100) + "% fall dmg)");
|
list.add(EnumChatFormatting.DARK_PURPLE + " " + stack.getDisplayName() + " (-" + Math.round((1F - damageMod) * 100) + "% fall dmg)");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void modDamage(LivingHurtEvent event, ItemStack armor) {
|
||||||
|
|
||||||
|
if(event.source == DamageSource.fall)
|
||||||
|
event.ammount *= damageMod;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void modUpdate(EntityLivingBase entity, ItemStack armor) {
|
public void modUpdate(EntityLivingBase entity, ItemStack armor) {
|
||||||
|
|
||||||
|
|||||||
@ -64,9 +64,9 @@ public class ItemPlateFuel extends ItemFuelRod {
|
|||||||
|
|
||||||
switch(this.function) {
|
switch(this.function) {
|
||||||
case LOGARITHM: return (int) (Math.log10(flux + 1) * 0.5D * reactivity);
|
case LOGARITHM: return (int) (Math.log10(flux + 1) * 0.5D * reactivity);
|
||||||
case SQUARE_ROOT: return (int) (Math.sqrt(flux) * this.reactivity / 10);
|
case SQUARE_ROOT: return (int) (Math.sqrt(flux) * this.reactivity / 10D);
|
||||||
case NEGATIVE_QUADRATIC: return (int) (Math.max(flux - (flux * flux / 10000) / 100 * reactivity, 0));
|
case NEGATIVE_QUADRATIC: return (int) (Math.max((flux - (flux * flux / 10000D)) / 100D * reactivity, 0));
|
||||||
case LINEAR: return (int) (flux / 100 * reactivity);
|
case LINEAR: return (int) (flux / 100D * reactivity);
|
||||||
case PASSIVE:
|
case PASSIVE:
|
||||||
setLifeTime(stack, getLifeTime(stack) + reactivity);
|
setLifeTime(stack, getLifeTime(stack) + reactivity);
|
||||||
return reactivity;
|
return reactivity;
|
||||||
|
|||||||
@ -9,15 +9,11 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
import net.minecraft.creativetab.CreativeTabs;
|
import net.minecraft.creativetab.CreativeTabs;
|
||||||
import net.minecraft.entity.Entity;
|
|
||||||
import net.minecraft.entity.EntityLivingBase;
|
|
||||||
import net.minecraft.entity.item.EntityItem;
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
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.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.world.World;
|
|
||||||
|
|
||||||
public class ItemRBMKPellet extends ItemNuclearWaste {
|
public class ItemRBMKPellet extends ItemNuclearWaste {
|
||||||
|
|
||||||
|
|||||||
@ -239,7 +239,7 @@ public class ItemRBMKRod extends Item {
|
|||||||
case PASSIVE: return selfRate * enrichment;
|
case PASSIVE: return selfRate * enrichment;
|
||||||
case LOG_TEN: return Math.log10(flux + 1) * 0.5D * reactivity;
|
case LOG_TEN: return Math.log10(flux + 1) * 0.5D * reactivity;
|
||||||
case PLATEU: return (1 - Math.pow(Math.E, -flux / 25D)) * reactivity;
|
case PLATEU: return (1 - Math.pow(Math.E, -flux / 25D)) * reactivity;
|
||||||
case ARCH: return Math.max(flux - (flux * flux / 10000D) / 100D * reactivity, 0D);
|
case ARCH: return Math.max((flux - (flux * flux / 10000D)) / 100D * reactivity, 0D);
|
||||||
case SIGMOID: return reactivity / (1 + Math.pow(Math.E, -(flux - 50D) / 10D));
|
case SIGMOID: return reactivity / (1 + Math.pow(Math.E, -(flux - 50D) / 10D));
|
||||||
case SQUARE_ROOT: return Math.sqrt(flux) * reactivity / 10D;
|
case SQUARE_ROOT: return Math.sqrt(flux) * reactivity / 10D;
|
||||||
case LINEAR: return flux / 100D * reactivity;
|
case LINEAR: return flux / 100D * reactivity;
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.hbm.items.special;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.entity.mob.EntityDuck;
|
||||||
import com.hbm.entity.mob.EntityHunterChopper;
|
import com.hbm.entity.mob.EntityHunterChopper;
|
||||||
import com.hbm.entity.mob.EntityUFO;
|
import com.hbm.entity.mob.EntityUFO;
|
||||||
import com.hbm.entity.mob.botprime.EntityBOTPrimeHead;
|
import com.hbm.entity.mob.botprime.EntityBOTPrimeHead;
|
||||||
@ -116,6 +117,9 @@ public class ItemChopper extends Item {
|
|||||||
y += 35;
|
y += 35;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(this == ModItems.spawn_duck)
|
||||||
|
entity = new EntityDuck(world);
|
||||||
|
|
||||||
if(entity != null) {
|
if(entity != null) {
|
||||||
|
|
||||||
EntityLiving entityliving = (EntityLiving) entity;
|
EntityLiving entityliving = (EntityLiving) entity;
|
||||||
|
|||||||
@ -16,6 +16,7 @@ import com.hbm.explosion.ExplosionChaos;
|
|||||||
import com.hbm.explosion.ExplosionLarge;
|
import com.hbm.explosion.ExplosionLarge;
|
||||||
import com.hbm.explosion.ExplosionNT;
|
import com.hbm.explosion.ExplosionNT;
|
||||||
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
import com.hbm.explosion.ExplosionNT.ExAttrib;
|
||||||
|
import com.hbm.explosion.vanillant.ExplosionVNT;
|
||||||
import com.hbm.interfaces.IBomb;
|
import com.hbm.interfaces.IBomb;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
@ -85,15 +86,12 @@ public class ItemDrop extends Item {
|
|||||||
|
|
||||||
if (stack.getItem() != null && stack.getItem() == ModItems.cell_antimatter && WeaponConfig.dropCell) {
|
if (stack.getItem() != null && stack.getItem() == ModItems.cell_antimatter && WeaponConfig.dropCell) {
|
||||||
if (!entityItem.worldObj.isRemote) {
|
if (!entityItem.worldObj.isRemote) {
|
||||||
entityItem.worldObj.createExplosion(entityItem, entityItem.posX, entityItem.posY,
|
new ExplosionVNT(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ, 3F).makeAmat().explode();
|
||||||
entityItem.posZ, 10.0F, true);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stack.getItem() != null && stack.getItem() == ModItems.pellet_antimatter && WeaponConfig.dropCell) {
|
if (stack.getItem() != null && stack.getItem() == ModItems.pellet_antimatter && WeaponConfig.dropCell) {
|
||||||
if (!entityItem.worldObj.isRemote) {
|
if (!entityItem.worldObj.isRemote) {
|
||||||
new ExplosionNT(entityItem.worldObj, entityItem, entityItem.posX, entityItem.posY, entityItem.posZ, 30).overrideResolution(64).addAttrib(ExAttrib.FIRE).addAttrib(ExAttrib.NOSOUND).explode();
|
new ExplosionVNT(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ, 20F).makeAmat().explode();
|
||||||
ExplosionLarge.spawnParticles(entityItem.worldObj, entityItem.posX, entityItem.posY, entityItem.posZ, ExplosionLarge.cloudFunction(100));
|
|
||||||
entityItem.worldObj.playSoundEffect(entityItem.posX, entityItem.posY, entityItem.posZ, "hbm:weapon.mukeExplosion", 15.0F, 1.0F);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (stack.getItem() != null && stack.getItem() == ModItems.cell_anti_schrabidium && WeaponConfig.dropCell) {
|
if (stack.getItem() != null && stack.getItem() == ModItems.cell_anti_schrabidium && WeaponConfig.dropCell) {
|
||||||
|
|||||||
@ -10,10 +10,13 @@ import com.hbm.interfaces.IBomb.BombReturnCode;
|
|||||||
import com.hbm.interfaces.IHoldableWeapon;
|
import com.hbm.interfaces.IHoldableWeapon;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
import com.hbm.packet.PlayerInformPacket;
|
||||||
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
import com.hbm.render.util.RenderScreenOverlay.Crosshair;
|
||||||
import com.hbm.util.ChatBuilder;
|
import com.hbm.util.ChatBuilder;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.EntityPlayerMP;
|
||||||
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;
|
||||||
@ -44,19 +47,11 @@ public class ItemLaserDetonator extends Item implements IHoldableWeapon {
|
|||||||
MainRegistry.logger.log(Level.INFO, "[DET] Tried to detonate block at " + x + " / " + y + " / " + z + " by " + player.getDisplayName() + "!");
|
MainRegistry.logger.log(Level.INFO, "[DET] Tried to detonate block at " + x + " / " + y + " / " + z + " by " + player.getDisplayName() + "!");
|
||||||
|
|
||||||
world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
|
world.playSoundAtEntity(player, "hbm:item.techBleep", 1.0F, 1.0F);
|
||||||
|
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start("").nextTranslation(ret.getUnlocalizedMessage()).color(ret.wasSuccessful() ? EnumChatFormatting.YELLOW : EnumChatFormatting.RED).flush()), (EntityPlayerMP) player);
|
||||||
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
|
|
||||||
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
|
|
||||||
.next("] ").color(EnumChatFormatting.DARK_AQUA)
|
|
||||||
.nextTranslation(ret.getUnlocalizedMessage()).color(ret.wasSuccessful() ? EnumChatFormatting.YELLOW : EnumChatFormatting.RED).flush());
|
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F);
|
world.playSoundAtEntity(player, "hbm:item.techBoop", 1.0F, 1.0F);
|
||||||
|
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(ChatBuilder.start("").nextTranslation(BombReturnCode.ERROR_NO_BOMB.getUnlocalizedMessage()).color(EnumChatFormatting.RED).flush()), (EntityPlayerMP) player);
|
||||||
player.addChatMessage(ChatBuilder.start("[").color(EnumChatFormatting.DARK_AQUA)
|
|
||||||
.nextTranslation(this.getUnlocalizedName() + ".name").color(EnumChatFormatting.DARK_AQUA)
|
|
||||||
.next("] ").color(EnumChatFormatting.DARK_AQUA)
|
|
||||||
.nextTranslation(BombReturnCode.ERROR_NO_BOMB.getUnlocalizedMessage()).color(EnumChatFormatting.RED).flush());
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
|||||||
45
src/main/java/com/hbm/items/weapon/ItemGenericGrenade.java
Normal file
45
src/main/java/com/hbm/items/weapon/ItemGenericGrenade.java
Normal file
@ -0,0 +1,45 @@
|
|||||||
|
package com.hbm.items.weapon;
|
||||||
|
|
||||||
|
import com.hbm.entity.grenade.EntityGrenadeBouncyGeneric;
|
||||||
|
import com.hbm.entity.grenade.EntityGrenadeImpactGeneric;
|
||||||
|
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemGenericGrenade extends ItemGrenade {
|
||||||
|
|
||||||
|
public ItemGenericGrenade(int fuse) {
|
||||||
|
super(fuse);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
|
||||||
|
if(!player.capabilities.isCreativeMode) {
|
||||||
|
--stack.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
world.playSoundAtEntity(player, "random.bow", 0.5F, 0.4F / (itemRand.nextFloat() * 0.4F + 0.8F));
|
||||||
|
|
||||||
|
if(!world.isRemote) {
|
||||||
|
|
||||||
|
if(fuse == -1)
|
||||||
|
world.spawnEntityInWorld(new EntityGrenadeImpactGeneric(world, player).setType(this));
|
||||||
|
else
|
||||||
|
world.spawnEntityInWorld(new EntityGrenadeBouncyGeneric(world, player).setType(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
return stack;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void explode(World world, double x, double y, double z) { }
|
||||||
|
|
||||||
|
public int getMaxTimer() {
|
||||||
|
return this.fuse * 20;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getBounceMod() {
|
||||||
|
return 0.5D;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -316,5 +316,4 @@ public class ItemGrenade extends Item {
|
|||||||
public static int getFuseTicks(Item grenade) {
|
public static int getFuseTicks(Item grenade) {
|
||||||
return ((ItemGrenade)grenade).fuse * 20;
|
return ((ItemGrenade)grenade).fuse * 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
14
src/main/java/com/hbm/items/weapon/ItemGrenadeKyiv.java
Normal file
14
src/main/java/com/hbm/items/weapon/ItemGrenadeKyiv.java
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package com.hbm.items.weapon;
|
||||||
|
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
|
public class ItemGrenadeKyiv extends ItemGenericGrenade {
|
||||||
|
|
||||||
|
public ItemGrenadeKyiv(int fuse) {
|
||||||
|
super(fuse);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void explode(World world, double x, double y, double z) {
|
||||||
|
world.newExplosion(null, x, y, z, 5F, true, true);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -2,17 +2,14 @@ package com.hbm.items.weapon;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.lwjgl.input.Keyboard;
|
|
||||||
import org.lwjgl.input.Mouse;
|
import org.lwjgl.input.Mouse;
|
||||||
|
|
||||||
import com.hbm.config.GeneralConfig;
|
import com.hbm.config.GeneralConfig;
|
||||||
import com.hbm.entity.projectile.EntityBulletBase;
|
import com.hbm.entity.projectile.EntityBulletBase;
|
||||||
import com.hbm.extprop.HbmPlayerProps;
|
|
||||||
import com.hbm.handler.BulletConfigSyncingUtil;
|
import com.hbm.handler.BulletConfigSyncingUtil;
|
||||||
import com.hbm.handler.BulletConfiguration;
|
import com.hbm.handler.BulletConfiguration;
|
||||||
import com.hbm.handler.GunConfiguration;
|
import com.hbm.handler.GunConfiguration;
|
||||||
import com.hbm.handler.HbmKeybinds;
|
import com.hbm.handler.HbmKeybinds;
|
||||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
|
||||||
import com.hbm.interfaces.IHoldableWeapon;
|
import com.hbm.interfaces.IHoldableWeapon;
|
||||||
import com.hbm.interfaces.IItemHUD;
|
import com.hbm.interfaces.IItemHUD;
|
||||||
import com.hbm.packet.AuxParticlePacketNT;
|
import com.hbm.packet.AuxParticlePacketNT;
|
||||||
@ -28,6 +25,7 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import net.minecraft.client.Minecraft;
|
import net.minecraft.client.Minecraft;
|
||||||
import net.minecraft.client.resources.I18n;
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.client.settings.GameSettings;
|
||||||
import net.minecraft.enchantment.Enchantment;
|
import net.minecraft.enchantment.Enchantment;
|
||||||
import net.minecraft.enchantment.EnchantmentHelper;
|
import net.minecraft.enchantment.EnchantmentHelper;
|
||||||
import net.minecraft.entity.Entity;
|
import net.minecraft.entity.Entity;
|
||||||
@ -36,7 +34,6 @@ import net.minecraft.entity.player.EntityPlayerMP;
|
|||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.ChatComponentText;
|
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
|
||||||
@ -110,7 +107,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
|
|
||||||
if(mainConfig.reloadType != mainConfig.RELOAD_NONE || (altConfig != null && altConfig.reloadType != 0)) {
|
if(mainConfig.reloadType != mainConfig.RELOAD_NONE || (altConfig != null && altConfig.reloadType != 0)) {
|
||||||
|
|
||||||
if(Keyboard.isKeyDown(HbmKeybinds.reloadKey.getKeyCode()) && (getMag(stack) < mainConfig.ammoCap || (mainConfig.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0))) {
|
if(GameSettings.isKeyDown(HbmKeybinds.reloadKey) && (getMag(stack) < mainConfig.ammoCap || hasInfinity(stack, mainConfig))) {
|
||||||
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 2));
|
PacketDispatcher.wrapper.sendToServer(new GunButtonPacket(true, (byte) 2));
|
||||||
setIsReloading(stack, true);
|
setIsReloading(stack, true);
|
||||||
resetReloadCycle(stack);
|
resetReloadCycle(stack);
|
||||||
@ -160,11 +157,16 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
|
|
||||||
public boolean hasAmmo(ItemStack stack, EntityPlayer player, boolean main) {
|
public boolean hasAmmo(ItemStack stack, EntityPlayer player, boolean main) {
|
||||||
|
|
||||||
if(mainConfig.reloadType == mainConfig.RELOAD_NONE || !main) {
|
GunConfiguration config = mainConfig;
|
||||||
|
|
||||||
|
if(!main)
|
||||||
|
config = altConfig;
|
||||||
|
|
||||||
|
if(config.reloadType == mainConfig.RELOAD_NONE) {
|
||||||
return getBeltSize(player, getBeltType(player, stack, main)) > 0;
|
return getBeltSize(player, getBeltType(player, stack, main)) > 0;
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return getMag(stack) > 0;
|
return getMag(stack) >= 0 + config.roundsPerCycle;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,7 +218,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
if(altConfig == null)
|
if(altConfig == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
BulletConfiguration config = getBeltCfg(player, stack, false);
|
BulletConfiguration config = altConfig.reloadType == altConfig.RELOAD_NONE ? getBeltCfg(player, stack, false) : BulletConfigSyncingUtil.pullConfig(altConfig.config.get(getMagType(stack)));
|
||||||
|
|
||||||
|
//System.out.println(config.ammo.getUnlocalizedName());
|
||||||
|
|
||||||
int bullets = config.bulletsMin;
|
int bullets = config.bulletsMin;
|
||||||
|
|
||||||
@ -444,12 +448,12 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
//initiates a reload
|
//initiates a reload
|
||||||
public void startReloadAction(ItemStack stack, World world, EntityPlayer player) {
|
public void startReloadAction(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
|
||||||
if(player.isSneaking() && mainConfig.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0) {
|
if(player.isSneaking() && hasInfinity(stack, mainConfig)) {
|
||||||
|
|
||||||
if(this.getMag(stack) == mainConfig.ammoCap) {
|
if(this.getMag(stack) == mainConfig.ammoCap) {
|
||||||
this.setMag(stack, 0);
|
this.setMag(stack, 0);
|
||||||
this.resetAmmoType(stack, world, player);
|
this.resetAmmoType(stack, world, player);
|
||||||
player.playSound("block.pistonOut", 1.0F, 1.0F);
|
world.playSoundAtEntity(player, "tile.piston.out", 1.0F, 1.0F);
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
@ -473,6 +477,9 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
|
|
||||||
public boolean canReload(ItemStack stack, World world, EntityPlayer player) {
|
public boolean canReload(ItemStack stack, World world, EntityPlayer player) {
|
||||||
|
|
||||||
|
if(getMag(stack) == mainConfig.ammoCap && hasInfinity(stack, mainConfig))
|
||||||
|
return true;
|
||||||
|
|
||||||
if(getMag(stack) == 0) {
|
if(getMag(stack) == 0) {
|
||||||
|
|
||||||
for(Integer config : mainConfig.config) {
|
for(Integer config : mainConfig.config) {
|
||||||
@ -618,7 +625,7 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
if(!main)
|
if(!main)
|
||||||
config = altConfig;
|
config = altConfig;
|
||||||
|
|
||||||
if(config.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0)
|
if(hasInfinity(stack, config))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
|
||||||
@ -629,6 +636,10 @@ public class ItemGunBase extends Item implements IHoldableWeapon, IItemHUD {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean hasInfinity(ItemStack stack, GunConfiguration config) {
|
||||||
|
return config.allowsInfinity && EnchantmentHelper.getEnchantmentLevel(Enchantment.infinity.effectId, stack) > 0;
|
||||||
|
}
|
||||||
|
|
||||||
/*//returns main config from itemstack
|
/*//returns main config from itemstack
|
||||||
public static GunConfiguration extractConfig(ItemStack stack) {
|
public static GunConfiguration extractConfig(ItemStack stack) {
|
||||||
|
|
||||||
|
|||||||
17
src/main/java/com/hbm/items/weapon/ItemGunDetonator.java
Normal file
17
src/main/java/com/hbm/items/weapon/ItemGunDetonator.java
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
package com.hbm.items.weapon;
|
||||||
|
|
||||||
|
import com.hbm.handler.GunConfiguration;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ItemGunDetonator extends ItemGunBase {
|
||||||
|
|
||||||
|
public ItemGunDetonator(GunConfiguration config) {
|
||||||
|
super(config);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean hasInfinity(ItemStack stack, GunConfiguration config) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user