mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge remote-tracking branch 'upstream/master'
This commit is contained in:
commit
9dc0d40c2b
@ -1,6 +1,11 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/**
|
||||
* 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.
|
||||
@ -17,14 +22,139 @@ public interface IEnergyConductor extends IEnergyConnector {
|
||||
* @return
|
||||
*/
|
||||
public default int getIdentity() {
|
||||
|
||||
TileEntity te = (TileEntity) this;
|
||||
|
||||
return getIdentityFromTile((TileEntity) this);
|
||||
}
|
||||
|
||||
public static int getIdentityFromTile(TileEntity te) {
|
||||
return getIdentityFromPos(te.xCoord, te.yCoord, te.zCoord);
|
||||
}
|
||||
|
||||
public static int getIdentityFromPos(int x, int y, int z) {
|
||||
final int prime = 31;
|
||||
int result = 1;
|
||||
result = prime * result + te.xCoord;
|
||||
result = prime * result + te.yCoord;
|
||||
result = prime * result + te.zCoord;
|
||||
result = prime * result + x;
|
||||
result = prime * result + y;
|
||||
result = prime * result + z;
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Whether the link should be part of reeval when the network is changed.
|
||||
* I.e. if this link should join any of the new networks (FALSE for switches that are turned off for example)
|
||||
* @return
|
||||
*/
|
||||
public default boolean canReevaluate() {
|
||||
return !((TileEntity) this).isInvalid();
|
||||
}
|
||||
|
||||
/**
|
||||
* When a link leaves the network, the net has to manually calculate the resulting networks.
|
||||
* Each link has to decide what other links will join the same net.
|
||||
* @param copy
|
||||
*/
|
||||
public default void reevaluate(HashMap<Integer, IEnergyConductor> copy, HashMap<Integer, Integer> proxies) {
|
||||
|
||||
for(int[] pos : getConnectionPoints()) {
|
||||
int newX = pos[0];
|
||||
int newY = pos[1];
|
||||
int newZ = pos[2];
|
||||
int id = IEnergyConductor.getIdentityFromPos(newX, newY, newZ);
|
||||
|
||||
IEnergyConductor neighbor = copy.get(id);
|
||||
|
||||
if(neighbor == null) {
|
||||
Integer newId = proxies.get(id);
|
||||
|
||||
if(newId != null) {
|
||||
neighbor = copy.get(newId);
|
||||
}
|
||||
}
|
||||
|
||||
if(neighbor != null && this.canReevaluate() && neighbor.canReevaluate()) {
|
||||
|
||||
if(neighbor.getPowerNet() != null) {
|
||||
|
||||
//neighbor net and no self net
|
||||
if(this.getPowerNet() == null) {
|
||||
neighbor.getPowerNet().joinLink(this);
|
||||
//neighbor net and self net
|
||||
} else {
|
||||
this.getPowerNet().joinNetworks(neighbor.getPowerNet());
|
||||
}
|
||||
|
||||
//bidirectional re-eval, experimental and technically optional, only useful as a fallback
|
||||
} /*else {
|
||||
|
||||
//no neighbor net and no self net
|
||||
if(this.getPowerNet() == null) {
|
||||
this.setPowerNet(new PowerNet().joinLink(this));
|
||||
neighbor.setPowerNet(this.getPowerNet().joinLink(neighbor));
|
||||
//no neighbor net and self net
|
||||
} else {
|
||||
neighbor.setPowerNet(this.getPowerNet().joinLink(neighbor));
|
||||
}
|
||||
}*/
|
||||
|
||||
//extensive debugging has shown that bidirectional re-eval ic complete shit
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a list of positions for the reeval process. In short - what positions should be considered as connected.
|
||||
* Also used by pylons to quickly figure out what positions to connect to.
|
||||
* DEFAULT: Connects to all six neighboring blocks.
|
||||
* @return
|
||||
*/
|
||||
public default List<int[]> getConnectionPoints() {
|
||||
|
||||
List<int[]> pos = new ArrayList();
|
||||
TileEntity tile = (TileEntity) this;
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
|
||||
int newX = tile.xCoord + dir.offsetX;
|
||||
int newY = tile.yCoord + dir.offsetY;
|
||||
int newZ = tile.zCoord + dir.offsetZ;
|
||||
|
||||
pos.add(new int[] {newX, newY, newZ});
|
||||
}
|
||||
|
||||
return pos;
|
||||
}
|
||||
|
||||
/**
|
||||
* Since isLoaded is only currently used for weeding out unwanted subscribers, and cables shouldn't (although technically can) be
|
||||
* subscribers, we just default to true because I don't feel like wasting time implementing things that we don't actually need.
|
||||
* Perhaps this indicates a minor flaw in the new API, but I physically lack the ability to worry about it.
|
||||
*/
|
||||
@Override
|
||||
public default boolean isLoaded() {
|
||||
return true;
|
||||
}
|
||||
|
||||
//TODO: check if this standard implementation doesn't break anything (it shouldn't but right now it's a bit redundant) also: remove duplicate implementations
|
||||
@Override
|
||||
public default long transferPower(long power) {
|
||||
|
||||
if(this.getPowerNet() == null)
|
||||
return power;
|
||||
|
||||
return this.getPowerNet().transferPower(power);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the conductor has mutliblock proxies which need to be taken into consideration for re-eval.
|
||||
* @return
|
||||
*/
|
||||
public default boolean hasProxies() {
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the identities (position-based) of proxies which resolve into the conductor's own identity.
|
||||
* @return
|
||||
*/
|
||||
public default List<Integer> getProxies() {
|
||||
return new ArrayList();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.packet.PacketDispatcher;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
@ -14,7 +15,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
* This is mean for TILE ENTITIES
|
||||
* @author hbm
|
||||
*/
|
||||
public interface IEnergyConnector {
|
||||
public interface IEnergyConnector extends ILoadedTile {
|
||||
|
||||
/**
|
||||
* Returns the amount of power that remains in the source after transfer
|
||||
@ -94,4 +95,10 @@ public interface IEnergyConnector {
|
||||
}
|
||||
|
||||
public static final boolean particleDebug = false;
|
||||
|
||||
public default Vec3 getDebugParticlePos() {
|
||||
TileEntity te = (TileEntity) this;
|
||||
Vec3 vec = Vec3.createVectorHelper(te.xCoord + 0.5, te.yCoord + 1, te.zCoord + 0.5);
|
||||
return vec;
|
||||
}
|
||||
}
|
||||
|
||||
6
src/main/java/api/hbm/energy/ILoadedTile.java
Normal file
6
src/main/java/api/hbm/energy/ILoadedTile.java
Normal file
@ -0,0 +1,6 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
public interface ILoadedTile {
|
||||
|
||||
public boolean isLoaded();
|
||||
}
|
||||
@ -1,6 +1,7 @@
|
||||
package api.hbm.energy;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -13,7 +14,8 @@ import net.minecraft.tileentity.TileEntity;
|
||||
public class PowerNet implements IPowerNet {
|
||||
|
||||
private boolean valid = true;
|
||||
private List<IEnergyConductor> links = new ArrayList();
|
||||
private HashMap<Integer, IEnergyConductor> links = new HashMap();
|
||||
private HashMap<Integer, Integer> proxies = new HashMap();
|
||||
private List<IEnergyConnector> subscribers = new ArrayList();
|
||||
|
||||
@Override
|
||||
@ -23,8 +25,7 @@ public class PowerNet implements IPowerNet {
|
||||
return; //wtf?!
|
||||
|
||||
for(IEnergyConductor conductor : network.getLinks()) {
|
||||
conductor.setPowerNet(this);
|
||||
this.getLinks().add(conductor);
|
||||
joinLink(conductor);
|
||||
}
|
||||
network.getLinks().clear();
|
||||
|
||||
@ -42,14 +43,29 @@ public class PowerNet implements IPowerNet {
|
||||
conductor.getPowerNet().leaveLink(conductor);
|
||||
|
||||
conductor.setPowerNet(this);
|
||||
this.getLinks().add(conductor);
|
||||
int identity = conductor.getIdentity();
|
||||
this.links.put(identity, conductor);
|
||||
|
||||
if(conductor.hasProxies()) {
|
||||
for(Integer i : conductor.getProxies()) {
|
||||
this.proxies.put(i, identity);
|
||||
}
|
||||
}
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leaveLink(IEnergyConductor conductor) {
|
||||
conductor.setPowerNet(null);
|
||||
this.getLinks().remove(conductor);
|
||||
int identity = conductor.getIdentity();
|
||||
this.links.remove(identity);
|
||||
|
||||
if(conductor.hasProxies()) {
|
||||
for(Integer i : conductor.getProxies()) {
|
||||
this.proxies.remove(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -69,7 +85,14 @@ public class PowerNet implements IPowerNet {
|
||||
|
||||
@Override
|
||||
public List<IEnergyConductor> getLinks() {
|
||||
return this.links;
|
||||
List<IEnergyConductor> linkList = new ArrayList();
|
||||
linkList.addAll(this.links.values());
|
||||
return linkList;
|
||||
}
|
||||
|
||||
public HashMap<Integer, Integer> getProxies() {
|
||||
HashMap<Integer, Integer> proxyCopy = new HashMap(proxies);
|
||||
return proxyCopy;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,10 +103,9 @@ public class PowerNet implements IPowerNet {
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.valid = false;
|
||||
|
||||
this.subscribers.clear();
|
||||
|
||||
for(IEnergyConductor link : this.links) {
|
||||
for(IEnergyConductor link : this.links.values()) {
|
||||
link.setPowerNet(null);
|
||||
}
|
||||
|
||||
@ -95,12 +117,18 @@ public class PowerNet implements IPowerNet {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public long lastCleanup = System.currentTimeMillis();
|
||||
|
||||
@Override
|
||||
public long transferPower(long power) {
|
||||
|
||||
this.subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid()
|
||||
);
|
||||
if(lastCleanup + 45 < System.currentTimeMillis()) {
|
||||
this.subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid() || !x.isLoaded()
|
||||
);
|
||||
|
||||
lastCleanup = System.currentTimeMillis();
|
||||
}
|
||||
|
||||
if(this.subscribers.isEmpty())
|
||||
return power;
|
||||
@ -135,5 +163,25 @@ public class PowerNet implements IPowerNet {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reevaluate() { }
|
||||
public void reevaluate() {
|
||||
|
||||
//this.destroy();//
|
||||
|
||||
HashMap<Integer, IEnergyConductor> copy = new HashMap(links);
|
||||
HashMap<Integer, Integer> proxyCopy = new HashMap(proxies);
|
||||
|
||||
for(IEnergyConductor link : copy.values()) {
|
||||
this.leaveLink(link);
|
||||
}
|
||||
|
||||
for(IEnergyConductor link : copy.values()) {
|
||||
|
||||
link.setPowerNet(null);
|
||||
link.reevaluate(copy, proxyCopy);
|
||||
|
||||
if(link.getPowerNet() == null) {
|
||||
link.setPowerNet(new PowerNet().joinLink(link));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,9 +2,18 @@ package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public interface IFluidConductor {
|
||||
public interface IFluidConductor extends IFluidConnector {
|
||||
|
||||
public IPipeNet getPipeNet(FluidType type);
|
||||
|
||||
public void setPipeNet(FluidType type, FluidType network);
|
||||
public void setPipeNet(FluidType type, IPipeNet network);
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
|
||||
if(this.getPipeNet(type) == null)
|
||||
return amount;
|
||||
|
||||
return this.getPipeNet(type).transferFluid(amount);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,7 +1,13 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnector {
|
||||
@ -11,7 +17,7 @@ public interface IFluidConnector {
|
||||
* @param power
|
||||
* @return
|
||||
*/
|
||||
public int transferFluid(FluidType type, int fluid);
|
||||
public long transferFluid(FluidType type, long fluid);
|
||||
|
||||
/**
|
||||
* Whether the given side can be connected to
|
||||
@ -27,5 +33,52 @@ public interface IFluidConnector {
|
||||
* @param type
|
||||
* @return
|
||||
*/
|
||||
public int getDemand(FluidType type);
|
||||
public long getDemand(FluidType type);
|
||||
|
||||
/**
|
||||
* Basic implementation of subscribing to a nearby power grid
|
||||
* @param world
|
||||
* @param x
|
||||
* @param y
|
||||
* @param z
|
||||
*/
|
||||
public default void trySubscribe(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(!con.canConnect(type, dir))
|
||||
return;
|
||||
|
||||
if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this))
|
||||
con.getPipeNet(type).subscribe(this);
|
||||
|
||||
if(con.getPipeNet(type) != null)
|
||||
red = true;
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", red ? "reddust" : "bluedust");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public default void tryUnsubscribe(FluidType type, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && con.getPipeNet(type).isSubscribed(this))
|
||||
con.getPipeNet(type).unsubscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
public static final boolean particleDebug = true;
|
||||
}
|
||||
|
||||
11
src/main/java/api/hbm/fluid/IFluidConnectorBlock.java
Normal file
11
src/main/java/api/hbm/fluid/IFluidConnectorBlock.java
Normal file
@ -0,0 +1,11 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidConnectorBlock {
|
||||
|
||||
public boolean canConnect(FluidType type, IBlockAccess world, int x, int y, int z, ForgeDirection dir);
|
||||
}
|
||||
49
src/main/java/api/hbm/fluid/IFluidStandardReceiver.java
Normal file
49
src/main/java/api/hbm/fluid/IFluidStandardReceiver.java
Normal file
@ -0,0 +1,49 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
/**
|
||||
* Uses default implementation to make the underlying interfaces easier to use for the most common fluid users.
|
||||
* Only handles a single input tank of the same type.
|
||||
* Uses standard FluidTanks which use int32.
|
||||
* Don't use this as part of the API!
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardReceiver extends IFluidUser {
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long amount) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(tank.getFill() + (int) amount);
|
||||
|
||||
if(tank.getFill() > tank.getMaxFill()) {
|
||||
long overshoot = tank.getFill() - tank.getMaxFill();
|
||||
tank.setFill(tank.getMaxFill());
|
||||
return overshoot;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return amount;
|
||||
}
|
||||
|
||||
public FluidTank[] getReceivingTanks();
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type) {
|
||||
|
||||
for(FluidTank tank : getReceivingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getMaxFill() - tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
50
src/main/java/api/hbm/fluid/IFluidStandardSender.java
Normal file
50
src/main/java/api/hbm/fluid/IFluidStandardSender.java
Normal file
@ -0,0 +1,50 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.FluidTank;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
/**
|
||||
* Uses default implementation to make the underlying interfaces easier to use for the most common fluid users.
|
||||
* Only handles a single output tank of the same type.
|
||||
* Uses standard FluidTanks which use int32.
|
||||
* Don't use this as part of the API!
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public interface IFluidStandardSender extends IFluidUser {
|
||||
|
||||
public FluidTank[] getSendingTanks();
|
||||
|
||||
@Override
|
||||
public default long getTotalFluidForSend(FluidType type) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
return tank.getFill();
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) {
|
||||
|
||||
for(FluidTank tank : getSendingTanks()) {
|
||||
if(tank.getTankType() == type) {
|
||||
tank.setFill(tank.getFill() - (int) amount);
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long transferFluid(FluidType type, long fluid) {
|
||||
return fluid;
|
||||
}
|
||||
|
||||
@Override
|
||||
public default long getDemand(FluidType type) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
65
src/main/java/api/hbm/fluid/IFluidUser.java
Normal file
65
src/main/java/api/hbm/fluid/IFluidUser.java
Normal file
@ -0,0 +1,65 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
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.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public interface IFluidUser extends IFluidConnector {
|
||||
|
||||
public default void sendFluid(FluidType type, World world, int x, int y, int z, ForgeDirection dir) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
boolean wasSubscribed = false;
|
||||
boolean red = false;
|
||||
|
||||
if(te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).unsubscribe(this);
|
||||
wasSubscribed = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(te instanceof IFluidConnector) {
|
||||
IFluidConnector con = (IFluidConnector) te;
|
||||
|
||||
if(con.canConnect(type, dir.getOpposite())) {
|
||||
long toSend = this.getTotalFluidForSend(type);
|
||||
long transfer = toSend - con.transferFluid(type, toSend);
|
||||
this.removeFluidForTransfer(type, transfer);
|
||||
red = true;
|
||||
}
|
||||
}
|
||||
|
||||
if(wasSubscribed && te instanceof IFluidConductor) {
|
||||
IFluidConductor con = (IFluidConductor) te;
|
||||
|
||||
if(con.getPipeNet(type) != null && !con.getPipeNet(type).isSubscribed(this)) {
|
||||
con.getPipeNet(type).subscribe(this);
|
||||
}
|
||||
}
|
||||
|
||||
if(particleDebug) {
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "vanillaExt");
|
||||
data.setString("mode", red ? "reddust" : "greendust");
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, x + world.rand.nextDouble(), y + world.rand.nextDouble(), z + world.rand.nextDouble()), new TargetPoint(world.provider.dimensionId, x + 0.5, y + 0.5, z + 0.5, 25));
|
||||
}
|
||||
}
|
||||
|
||||
public default long getTotalFluidForSend(FluidType type) { return 0; }
|
||||
public default void removeFluidForTransfer(FluidType type, long amount) { }
|
||||
|
||||
public default void updateStandardPipes(FluidType type, World world, int x, int y, int z) {
|
||||
|
||||
for(ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS)
|
||||
this.trySubscribe(type, world, x + dir.offsetX, y + dir.offsetY, z + dir.offsetZ, dir);
|
||||
}
|
||||
}
|
||||
@ -1,8 +1,28 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import api.hbm.energy.IPowerNet;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
public interface IPipeNet {
|
||||
|
||||
public void joinNetworks(IPowerNet network);
|
||||
public void joinNetworks(IPipeNet network);
|
||||
|
||||
public List<IFluidConductor> getLinks();
|
||||
public HashSet<IFluidConnector> getSubscribers();
|
||||
|
||||
public IPipeNet joinLink(IFluidConductor conductor);
|
||||
public void leaveLink(IFluidConductor conductor);
|
||||
|
||||
public void subscribe(IFluidConnector connector);
|
||||
public void unsubscribe(IFluidConnector connector);
|
||||
public boolean isSubscribed(IFluidConnector connector);
|
||||
|
||||
public void destroy();
|
||||
|
||||
public boolean isValid();
|
||||
|
||||
public long transferFluid(long fill);
|
||||
public FluidType getType();
|
||||
}
|
||||
|
||||
142
src/main/java/api/hbm/fluid/PipeNet.java
Normal file
142
src/main/java/api/hbm/fluid/PipeNet.java
Normal file
@ -0,0 +1,142 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class PipeNet implements IPipeNet {
|
||||
|
||||
private boolean valid = true;
|
||||
private FluidType type;
|
||||
private List<IFluidConductor> links = new ArrayList();
|
||||
private HashSet<IFluidConnector> subscribers = new HashSet();
|
||||
|
||||
public PipeNet(FluidType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void joinNetworks(IPipeNet network) {
|
||||
|
||||
if(network == this)
|
||||
return;
|
||||
|
||||
for(IFluidConductor conductor : network.getLinks()) {
|
||||
conductor.setPipeNet(type, this);
|
||||
this.getLinks().add(conductor);
|
||||
}
|
||||
network.getLinks().clear();
|
||||
|
||||
for(IFluidConnector connector : network.getSubscribers()) {
|
||||
this.subscribe(connector);
|
||||
}
|
||||
|
||||
network.destroy();
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<IFluidConductor> getLinks() {
|
||||
return links;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashSet<IFluidConnector> getSubscribers() {
|
||||
return subscribers;
|
||||
}
|
||||
|
||||
@Override
|
||||
public IPipeNet joinLink(IFluidConductor conductor) {
|
||||
|
||||
if(conductor.getPipeNet(type) != null)
|
||||
conductor.getPipeNet(type).leaveLink(conductor);
|
||||
|
||||
conductor.setPipeNet(type, this);
|
||||
this.links.add(conductor);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leaveLink(IFluidConductor conductor) {
|
||||
conductor.setPipeNet(type, null);
|
||||
this.links.remove(conductor);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void subscribe(IFluidConnector connector) {
|
||||
this.subscribers.add(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void unsubscribe(IFluidConnector connector) {
|
||||
this.subscribers.remove(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isSubscribed(IFluidConnector connector) {
|
||||
return this.subscribers.contains(connector);
|
||||
}
|
||||
|
||||
@Override
|
||||
public long transferFluid(long fill) {
|
||||
|
||||
this.subscribers.removeIf(x ->
|
||||
x == null || !(x instanceof TileEntity) || ((TileEntity)x).isInvalid()
|
||||
);
|
||||
|
||||
if(this.subscribers.isEmpty())
|
||||
return fill;
|
||||
|
||||
List<IFluidConnector> subList = new ArrayList(subscribers);
|
||||
|
||||
List<Long> weight = new ArrayList();
|
||||
long totalReq = 0;
|
||||
|
||||
for(IFluidConnector con : subList) {
|
||||
long req = con.getDemand(type);
|
||||
weight.add(req);
|
||||
totalReq += req;
|
||||
}
|
||||
|
||||
if(totalReq == 0)
|
||||
return fill;
|
||||
|
||||
long totalGiven = 0;
|
||||
|
||||
for(int i = 0; i < subList.size(); i++) {
|
||||
IFluidConnector con = subList.get(i);
|
||||
long req = weight.get(i);
|
||||
double fraction = (double)req / (double)totalReq;
|
||||
|
||||
long given = (long) Math.floor(fraction * fill);
|
||||
|
||||
totalGiven += (given - con.transferFluid(type, given));
|
||||
}
|
||||
|
||||
return fill - totalGiven;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
this.valid = false;
|
||||
this.subscribers.clear();
|
||||
|
||||
for(IFluidConductor con : this.links)
|
||||
con.setPipeNet(type, null);
|
||||
|
||||
this.links.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return this.valid;
|
||||
}
|
||||
}
|
||||
64
src/main/java/com/hbm/blocks/BlockEnumMulti.java
Normal file
64
src/main/java/com/hbm/blocks/BlockEnumMulti.java
Normal file
@ -0,0 +1,64 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
|
||||
public class BlockEnumMulti extends BlockBase {
|
||||
|
||||
public Class<? extends Enum> theEnum;
|
||||
public boolean multiName;
|
||||
private boolean multiTexture;
|
||||
|
||||
public BlockEnumMulti(Material mat, Class<? extends Enum> theEnum, boolean multiName, boolean multiTexture) {
|
||||
super(mat);
|
||||
this.theEnum = theEnum;
|
||||
this.multiName = multiName;
|
||||
this.multiTexture = multiTexture;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageDropped(int meta) {
|
||||
return meta;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
for(int i = 0; i < theEnum.getEnumConstants().length; ++i) {
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
}
|
||||
|
||||
private IIcon[] icons;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
|
||||
if(multiTexture) {
|
||||
Enum[] enums = theEnum.getEnumConstants();
|
||||
this.icons = new IIcon[enums.length];
|
||||
|
||||
for(int i = 0; i < icons.length; i++) {
|
||||
Enum num = enums[i];
|
||||
this.icons[i] = reg.registerIcon(this.getTextureName() + "." + num.name().toLowerCase());
|
||||
}
|
||||
} else {
|
||||
this.blockIcon = reg.registerIcon(this.getTextureName());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return this.icons[meta % this.icons.length];
|
||||
}
|
||||
}
|
||||
9
src/main/java/com/hbm/blocks/BlockEnums.java
Normal file
9
src/main/java/com/hbm/blocks/BlockEnums.java
Normal file
@ -0,0 +1,9 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
public class BlockEnums {
|
||||
|
||||
public static enum EnumStoneType {
|
||||
SULFUR,
|
||||
ASBESTOS
|
||||
}
|
||||
}
|
||||
@ -49,6 +49,7 @@ public interface ILookOverlay {
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks;
|
||||
|
||||
import com.hbm.blocks.generic.*;
|
||||
import com.hbm.blocks.generic.BlockHazard.ExtDisplayEffect;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres.ItemRandomOreBlock;
|
||||
import com.hbm.blocks.bomb.*;
|
||||
import com.hbm.blocks.fluid.*;
|
||||
import com.hbm.blocks.gas.*;
|
||||
@ -21,9 +22,12 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.DoorDecl;
|
||||
|
||||
import cpw.mods.fml.common.registry.GameRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockFalling;
|
||||
import net.minecraft.block.material.*;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
import net.minecraftforge.fluids.FluidRegistry;
|
||||
@ -50,6 +54,7 @@ public class ModBlocks {
|
||||
public static Block test_core;
|
||||
public static Block test_charge;
|
||||
public static Block test_conductor;
|
||||
public static Block test_pipe;
|
||||
public static Block test_ct;
|
||||
public static Block test_rail;
|
||||
public static Block test_bb_bork;
|
||||
@ -79,6 +84,8 @@ public class ModBlocks {
|
||||
public static Block ore_cinnebar;
|
||||
public static Block ore_coltan;
|
||||
public static Block ore_alexandrite;
|
||||
|
||||
public static Block ore_random;
|
||||
|
||||
public static Block ore_bedrock_coltan;
|
||||
|
||||
@ -132,6 +139,9 @@ public class ModBlocks {
|
||||
public static Block ore_depth_nether_neodymium;
|
||||
|
||||
public static Block stone_porous;
|
||||
public static Block stone_resource;
|
||||
public static Block stalagmite;
|
||||
public static Block stalactite;
|
||||
|
||||
public static Block depth_brick;
|
||||
public static Block depth_tiles;
|
||||
@ -453,6 +463,7 @@ public class ModBlocks {
|
||||
public static Block dirt_oily;
|
||||
public static Block sand_dirty;
|
||||
public static Block sand_dirty_red;
|
||||
public static Block stone_cracked;
|
||||
public static Block burning_earth;
|
||||
public static Block tektite;
|
||||
public static Block ore_tektite_osmiridium;
|
||||
@ -461,6 +472,8 @@ public class ModBlocks {
|
||||
public static Block fallout;
|
||||
public static Block foam_layer;
|
||||
public static Block sand_boron_layer;
|
||||
public static Block leaves_layer;
|
||||
|
||||
|
||||
public static Block sellafield_slaked;
|
||||
public static Block sellafield_0;
|
||||
@ -475,6 +488,9 @@ public class ModBlocks {
|
||||
public static Block geysir_vapor;
|
||||
public static Block geysir_nether;
|
||||
|
||||
public static Block observer_off;
|
||||
public static Block observer_on;
|
||||
|
||||
public static Block flame_war;
|
||||
public static Block float_bomb;
|
||||
public static Block therm_endo;
|
||||
@ -710,6 +726,7 @@ public class ModBlocks {
|
||||
|
||||
public static Block red_wire_coated;
|
||||
public static Block red_cable;
|
||||
public static Block red_cable_classic;
|
||||
public static Block red_connector;
|
||||
public static Block red_pylon;
|
||||
public static Block red_pylon_large;
|
||||
@ -1176,6 +1193,9 @@ public class ModBlocks {
|
||||
public static Fluid volcanic_lava_fluid;
|
||||
public static final Material fluidvolcanic = (new MaterialLiquid(MapColor.redColor));
|
||||
|
||||
public static Block sulfuric_acid_block;
|
||||
public static Fluid sulfuric_acid_fluid;
|
||||
|
||||
public static Block volcano_core;
|
||||
|
||||
public static Block dummy_block_flare;
|
||||
@ -1252,6 +1272,7 @@ public class ModBlocks {
|
||||
test_core = new TestCore(Material.iron).setBlockName("test_core").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_core");
|
||||
test_charge = new TestCharge(Material.iron).setBlockName("test_charge").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F);
|
||||
test_conductor = new TestConductor(Material.iron).setBlockName("test_conductor").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":cable_neo");
|
||||
test_pipe = new TestPipe(Material.iron).setBlockName("test_pipe").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":pipe_neo");
|
||||
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_bb_bork = new TestBB(Material.iron).setBlockName("test_bb_bork").setCreativeTab(null).setHardness(2.5F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":test_bb_bork");
|
||||
@ -1327,6 +1348,8 @@ public class ModBlocks {
|
||||
cluster_depth_titanium = new BlockDepthOre().setBlockName("cluster_depth_titanium").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":cluster_depth_titanium");
|
||||
cluster_depth_tungsten = new BlockDepthOre().setBlockName("cluster_depth_tungsten").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":cluster_depth_tungsten");
|
||||
ore_alexandrite = new BlockDepthOre().setBlockName("ore_alexandrite").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_alexandrite");
|
||||
|
||||
ore_random = new BlockMotherOfAllOres().setBlockName("ore_random").setCreativeTab(MainRegistry.blockTab);
|
||||
|
||||
depth_brick = new BlockDepth().setBlockName("depth_brick").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_brick");
|
||||
depth_tiles = new BlockDepth().setBlockName("depth_tiles").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":depth_tiles");
|
||||
@ -1338,6 +1361,9 @@ public class ModBlocks {
|
||||
ore_depth_nether_neodymium = new BlockDepthOre().setBlockName("ore_depth_nether_neodymium").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":ore_depth_nether_neodymium");
|
||||
|
||||
stone_porous = new BlockPorous().setBlockName("stone_porous").setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":stone_porous");
|
||||
stone_resource = new BlockResourceStone().setBlockName("stone_resource").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F);
|
||||
stalagmite = new BlockStalagmite().setBlockName("stalagmite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
stalactite = new BlockStalagmite().setBlockName("stalactite").setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.0F);
|
||||
|
||||
basalt = new BlockGeneric(Material.rock).setBlockName("basalt").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt");
|
||||
basalt_sulfur = new BlockOre(Material.rock).setBlockName("basalt_sulfur").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":basalt_sulfur");
|
||||
@ -1475,14 +1501,14 @@ public class ModBlocks {
|
||||
block_cap_sunset = new BlockCap(Material.iron, RefStrings.MODID + ":block_cap_sunset_top").setStepSound(Block.soundTypeMetal).setBlockName("block_cap_sunset").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":block_cap_sunset");
|
||||
block_cap_star = new BlockCap(Material.iron, RefStrings.MODID + ":block_cap_star_top").setStepSound(Block.soundTypeMetal).setBlockName("block_cap_star").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.blockTab).setBlockTextureName(RefStrings.MODID + ":block_cap_star");
|
||||
|
||||
deco_titanium = new BlockOre(Material.iron).setBlockName("deco_titanium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_titanium");
|
||||
deco_red_copper = new BlockDecoCT(Material.iron).setBlockName("deco_red_copper").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_red_copper");
|
||||
deco_tungsten = new BlockDecoCT(Material.iron).setBlockName("deco_tungsten").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_tungsten");
|
||||
deco_aluminium = new BlockDecoCT(Material.iron).setBlockName("deco_aluminium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_aluminium");
|
||||
deco_steel = new BlockDecoCT(Material.iron).setBlockName("deco_steel").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_steel");
|
||||
deco_lead = new BlockDecoCT(Material.iron).setBlockName("deco_lead").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_lead");
|
||||
deco_beryllium = new BlockDecoCT(Material.iron).setBlockName("deco_beryllium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_beryllium");
|
||||
deco_asbestos = new BlockOutgas(Material.cloth, true, 5, true).setBlockName("deco_asbestos").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_asbestos");
|
||||
deco_titanium = new BlockOre(Material.iron).noFortune().setBlockName("deco_titanium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_titanium");
|
||||
deco_red_copper = new BlockDecoCT(Material.iron).noFortune().setBlockName("deco_red_copper").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_red_copper");
|
||||
deco_tungsten = new BlockDecoCT(Material.iron).noFortune().setBlockName("deco_tungsten").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_tungsten");
|
||||
deco_aluminium = new BlockDecoCT(Material.iron).noFortune().setBlockName("deco_aluminium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_aluminium");
|
||||
deco_steel = new BlockDecoCT(Material.iron).noFortune().setBlockName("deco_steel").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_steel");
|
||||
deco_lead = new BlockDecoCT(Material.iron).noFortune().setBlockName("deco_lead").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_lead");
|
||||
deco_beryllium = new BlockDecoCT(Material.iron).noFortune().setBlockName("deco_beryllium").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_beryllium");
|
||||
deco_asbestos = new BlockOutgas(Material.cloth, true, 5, true).noFortune().setBlockName("deco_asbestos").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":deco_asbestos");
|
||||
deco_rbmk = new BlockGeneric(Material.iron).setBlockName("deco_rbmk").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_side");
|
||||
deco_rbmk_smooth = new BlockGeneric(Material.iron).setBlockName("deco_rbmk_smooth").setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(10.0F).setBlockTextureName(RefStrings.MODID + ":rbmk/rbmk_top");
|
||||
|
||||
@ -1546,11 +1572,11 @@ public class ModBlocks {
|
||||
siege_emergency = new BlockBase(Material.iron).setBlockName("siege_emergency").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(20000.0F).setBlockTextureName(RefStrings.MODID + ":siege_emergency");
|
||||
siege_hole = new SiegeHole(Material.iron).setBlockName("siege_hole").setCreativeTab(MainRegistry.blockTab).setBlockUnbreakable().setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":siege_hole");
|
||||
|
||||
block_meteor = new BlockOre(Material.rock).setBlockName("block_meteor").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor");
|
||||
block_meteor_cobble = new BlockOre(Material.rock).setBlockName("block_meteor_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_cobble");
|
||||
block_meteor_broken = new BlockOre(Material.rock).setBlockName("block_meteor_broken").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_crushed");
|
||||
block_meteor_molten = new BlockOre(Material.rock, true).setBlockName("block_meteor_molten").setLightLevel(0.75F).setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_cobble_molten");
|
||||
block_meteor_treasure = new BlockOre(Material.rock).setBlockName("block_meteor_treasure").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_treasure");
|
||||
block_meteor = new BlockOre(Material.rock).noFortune().setBlockName("block_meteor").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor");
|
||||
block_meteor_cobble = new BlockOre(Material.rock).noFortune().setBlockName("block_meteor_cobble").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_cobble");
|
||||
block_meteor_broken = new BlockOre(Material.rock).noFortune().setBlockName("block_meteor_broken").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_crushed");
|
||||
block_meteor_molten = new BlockOre(Material.rock, true).noFortune().setBlockName("block_meteor_molten").setLightLevel(0.75F).setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_cobble_molten");
|
||||
block_meteor_treasure = new BlockOre(Material.rock).noFortune().setBlockName("block_meteor_treasure").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_treasure");
|
||||
meteor_polished = new BlockGeneric(Material.rock).setBlockName("meteor_polished").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_polished");
|
||||
meteor_brick = new BlockGeneric(Material.rock).setBlockName("meteor_brick").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_brick");
|
||||
meteor_brick_mossy = new BlockGeneric(Material.rock).setBlockName("meteor_brick_mossy").setCreativeTab(MainRegistry.blockTab).setHardness(15.0F).setResistance(900.0F).setBlockTextureName(RefStrings.MODID + ":meteor_brick_mossy");
|
||||
@ -1642,8 +1668,8 @@ public class ModBlocks {
|
||||
|
||||
waste_earth = new WasteEarth(Material.ground, true).setBlockName("waste_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_earth");
|
||||
waste_mycelium = new WasteEarth(Material.ground, true).setBlockName("waste_mycelium").setStepSound(Block.soundTypeGrass).setLightLevel(1F).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":waste_mycelium_side");
|
||||
waste_trinitite = new BlockOre(Material.sand).setBlockName("waste_trinitite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite");
|
||||
waste_trinitite_red = new BlockOre(Material.sand).setBlockName("waste_trinitite_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite_red");
|
||||
waste_trinitite = new BlockOre(Material.sand).noFortune().setBlockName("waste_trinitite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite");
|
||||
waste_trinitite_red = new BlockOre(Material.sand).noFortune().setBlockName("waste_trinitite_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_trinitite_red");
|
||||
waste_log = new WasteLog(Material.wood).setBlockName("waste_log").setStepSound(Block.soundTypeWood).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setResistance(2.5F);
|
||||
waste_leaves = new WasteLeaves(Material.leaves).setBlockName("waste_leaves").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setBlockTextureName(RefStrings.MODID + ":waste_leaves");
|
||||
waste_planks = new BlockOre(Material.wood).setBlockName("waste_planks").setStepSound(Block.soundTypeWood).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setResistance(2.5F).setBlockTextureName(RefStrings.MODID + ":waste_planks");
|
||||
@ -1654,15 +1680,17 @@ public class ModBlocks {
|
||||
fallout = new BlockFallout(Material.snow).setBlockName("fallout").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":ash");
|
||||
foam_layer = new BlockLayering(Material.snow).setBlockName("foam_layer").setStepSound(Block.soundTypeSnow).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":foam");
|
||||
sand_boron_layer = new BlockLayering(Material.sand).setBlockName("sand_boron_layer").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":sand_boron");
|
||||
leaves_layer = new BlockLayering(Material.leaves).setBlockName("leaves_layer").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.1F).setLightOpacity(0).setBlockTextureName(RefStrings.MODID + ":waste_leaves");
|
||||
|
||||
burning_earth = new WasteEarth(Material.ground, true).setBlockName("burning_earth").setStepSound(Block.soundTypeGrass).setCreativeTab(MainRegistry.blockTab).setHardness(0.6F).setBlockTextureName(RefStrings.MODID + ":burning_earth");
|
||||
tektite = new BlockGeneric(Material.sand).setBlockName("tektite").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":tektite");
|
||||
ore_tektite_osmiridium = new BlockGeneric(Material.sand).setBlockName("ore_tektite_osmiridium").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":ore_tektite_osmiridium");
|
||||
impact_dirt = new BlockDirt(Material.ground, true).setBlockName("impact_dirt").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":waste_earth_bottom");
|
||||
dirt_dead = new BlockGeneric(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
|
||||
dirt_oily = new BlockGeneric(Material.ground).setBlockName("dirt_oily").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_oily");
|
||||
dirt_dead = new BlockFalling(Material.ground).setBlockName("dirt_dead").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_dead");
|
||||
dirt_oily = new BlockFalling(Material.ground).setBlockName("dirt_oily").setStepSound(Block.soundTypeGravel).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":dirt_oily");
|
||||
sand_dirty = new BlockFalling(Material.sand).setBlockName("sand_dirty").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty");
|
||||
sand_dirty_red = new BlockFalling(Material.sand).setBlockName("sand_dirty_red").setStepSound(Block.soundTypeSand).setCreativeTab(MainRegistry.blockTab).setHardness(0.5F).setBlockTextureName(RefStrings.MODID + ":sand_dirty_red");
|
||||
stone_cracked = new BlockFalling(Material.rock).setBlockName("stone_cracked").setStepSound(Block.soundTypeStone).setCreativeTab(MainRegistry.blockTab).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":stone_cracked");
|
||||
|
||||
sellafield_slaked = new BlockGeneric(Material.rock).setBlockName("sellafield_slaked").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_slaked");
|
||||
sellafield_0 = new BlockHazard(Material.rock).setBlockName("sellafield_0").setStepSound(Block.soundTypeStone).setHardness(5.0F).setBlockTextureName(RefStrings.MODID + ":sellafield_0");
|
||||
@ -1677,6 +1705,9 @@ public class ModBlocks {
|
||||
geysir_vapor = new BlockGeysir(Material.rock).setBlockName("geysir_vapor").setStepSound(Block.soundTypeStone).setHardness(5.0F);
|
||||
geysir_nether = new BlockGeysir(Material.rock).setBlockName("geysir_nether").setLightLevel(1.0F).setStepSound(Block.soundTypeStone).setHardness(2.0F);
|
||||
|
||||
observer_off = new BlockObserver(Material.iron, false).setBlockName("observer_off").setStepSound(Block.soundTypeStone).setHardness(2.0F);
|
||||
observer_on = new BlockObserver(Material.iron, true).setBlockName("observer_on").setStepSound(Block.soundTypeStone).setHardness(2.0F);
|
||||
|
||||
nuke_gadget = new NukeGadget(Material.iron).setBlockName("nuke_gadget").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":theGadget");
|
||||
nuke_boy = new NukeBoy(Material.iron).setBlockName("nuke_boy").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":lilBoy");
|
||||
nuke_man = new NukeMan(Material.iron).setBlockName("nuke_man").setCreativeTab(MainRegistry.nukeTab).setHardness(5.0F).setResistance(6000.0F).setBlockTextureName(RefStrings.MODID + ":fatMan");
|
||||
@ -1827,6 +1858,7 @@ public class ModBlocks {
|
||||
|
||||
red_wire_coated = new WireCoated(Material.iron).setBlockName("red_wire_coated").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_wire_coated");
|
||||
red_cable = new BlockCable(Material.iron).setBlockName("red_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":cable_neo");
|
||||
red_cable_classic = new BlockCable(Material.iron).setBlockName("red_cable_classic").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_cable_classic");
|
||||
rf_cable = new BlockRFCable(Material.iron).setBlockName("rf_cable").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":rf_cable_icon");
|
||||
red_connector = new ConnectorRedWire(Material.iron).setBlockName("red_connector").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_connector");
|
||||
red_pylon = new PylonRedWire(Material.iron).setBlockName("red_pylon").setHardness(5.0F).setResistance(10.0F).setCreativeTab(MainRegistry.machineTab).setBlockTextureName(RefStrings.MODID + ":red_pylon");
|
||||
@ -2198,6 +2230,10 @@ public class ModBlocks {
|
||||
FluidRegistry.registerFluid(volcanic_lava_fluid);
|
||||
volcanic_lava_block = new VolcanicBlock(volcanic_lava_fluid, Material.lava).setBlockName("volcanic_lava_block").setResistance(500F);
|
||||
|
||||
sulfuric_acid_fluid = new GenericFluid("sulfuric_acid_fluid").setDensity(1840).setViscosity(1000).setTemperature(273);
|
||||
FluidRegistry.registerFluid(sulfuric_acid_fluid);
|
||||
sulfuric_acid_block = new GenericFluidBlock(sulfuric_acid_fluid, Material.water, "sulfuric_acid_still", "sulfuric_acid_flowing").setDamage(ModDamageSource.acid, 5F).setBlockName("sulfuric_acid_block").setResistance(500F);
|
||||
|
||||
dummy_block_flare = new DummyBlockFlare(Material.iron, false).setBlockName("dummy_block_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_port_flare = new DummyBlockFlare(Material.iron, true).setBlockName("dummy_port_flare").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_aluminium");
|
||||
dummy_block_drill = new DummyBlockDrill(Material.iron, false).setBlockName("dummy_block_drill").setHardness(5.0F).setResistance(10.0F).setCreativeTab(null).setBlockTextureName(RefStrings.MODID + ":block_lead");
|
||||
@ -2260,6 +2296,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(test_core, test_core.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(test_charge, test_charge.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(test_conductor, test_conductor.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(test_pipe, test_pipe.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(test_ct, test_ct.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(test_rail, test_rail.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(test_bb_bork, test_bb_bork.getUnlocalizedName());
|
||||
@ -2368,12 +2405,20 @@ public class ModBlocks {
|
||||
//End Ores
|
||||
GameRegistry.registerBlock(ore_tikite, ore_tikite.getUnlocalizedName());
|
||||
|
||||
//It's a meme you dip
|
||||
GameRegistry.registerBlock(ore_random, ItemRandomOreBlock.class, ore_random.getUnlocalizedName());
|
||||
|
||||
//Crystals
|
||||
GameRegistry.registerBlock(crystal_power, crystal_power.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_energy, crystal_energy.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_robust, crystal_robust.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(crystal_trixite, crystal_trixite.getUnlocalizedName());
|
||||
|
||||
//Resource-bearing Stones
|
||||
GameRegistry.registerBlock(stone_resource, ItemBlockBase.class, stone_resource.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stalagmite, ItemBlockBase.class, stalagmite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stalactite, ItemBlockBase.class, stalactite.getUnlocalizedName());
|
||||
|
||||
//Stone Variants
|
||||
GameRegistry.registerBlock(stone_porous, stone_porous.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stone_gneiss, stone_gneiss.getUnlocalizedName());
|
||||
@ -2664,9 +2709,11 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(dirt_oily, dirt_oily.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sand_dirty, sand_dirty.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sand_dirty_red, sand_dirty_red.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(stone_cracked, stone_cracked.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(fallout, fallout.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(foam_layer, foam_layer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sand_boron_layer, sand_boron_layer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(leaves_layer, leaves_layer.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(burning_earth, burning_earth.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(tektite, tektite.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(ore_tektite_osmiridium, ore_tektite_osmiridium.getUnlocalizedName());
|
||||
@ -2826,6 +2873,9 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(bomber, bomber.getUnlocalizedName());
|
||||
|
||||
//Machines
|
||||
//GameRegistry.registerBlock(observer_off, observer_off.getUnlocalizedName());
|
||||
//GameRegistry.registerBlock(observer_on, observer_on.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(anvil_iron, ItemBlockBase.class, anvil_iron.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(anvil_lead, ItemBlockBase.class, anvil_lead.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(anvil_steel, ItemBlockBase.class, anvil_steel.getUnlocalizedName());
|
||||
@ -2930,6 +2980,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(pribris_digamma, pribris_digamma.getUnlocalizedName());
|
||||
|
||||
GameRegistry.registerBlock(red_cable, red_cable.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_cable_classic, red_cable_classic.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_wire_coated, red_wire_coated.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_connector, ItemBlockBase.class, red_connector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(red_pylon, ItemBlockBase.class, red_pylon.getUnlocalizedName());
|
||||
@ -3178,6 +3229,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(schrabidic_block, schrabidic_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(corium_block, corium_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(volcanic_lava_block, volcanic_lava_block.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(sulfuric_acid_block, sulfuric_acid_block.getUnlocalizedName());
|
||||
|
||||
//Multiblock Dummy Blocks
|
||||
GameRegistry.registerBlock(dummy_block_flare, dummy_block_flare.getUnlocalizedName());
|
||||
|
||||
@ -11,21 +11,25 @@ public class AcidFluid extends Fluid {
|
||||
super("acid_fluid");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
public AcidFluid(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getStillIcon() {
|
||||
return AcidBlock.stillIcon;
|
||||
}
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return AcidBlock.flowingIcon;
|
||||
}
|
||||
public IIcon getStillIcon() {
|
||||
return AcidBlock.stillIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return AcidBlock.flowingIcon;
|
||||
}
|
||||
}
|
||||
|
||||
31
src/main/java/com/hbm/blocks/fluid/GenericFluid.java
Normal file
31
src/main/java/com/hbm/blocks/fluid/GenericFluid.java
Normal file
@ -0,0 +1,31 @@
|
||||
package com.hbm.blocks.fluid;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class GenericFluid extends Fluid {
|
||||
|
||||
public GenericFluid(String name) {
|
||||
super(name);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon() {
|
||||
return getStillIcon();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getStillIcon() {
|
||||
return this.block.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getFlowingIcon() {
|
||||
return this.block.getIcon(1, 0);
|
||||
}
|
||||
}
|
||||
93
src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java
Normal file
93
src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java
Normal file
@ -0,0 +1,93 @@
|
||||
package com.hbm.blocks.fluid;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.fluids.BlockFluidClassic;
|
||||
import net.minecraftforge.fluids.Fluid;
|
||||
|
||||
public class GenericFluidBlock extends BlockFluidClassic {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon stillIcon;
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static IIcon flowingIcon;
|
||||
public Random rand = new Random();
|
||||
|
||||
private String stillName;
|
||||
private String flowingName;
|
||||
|
||||
public float damage;
|
||||
public DamageSource damageSource;
|
||||
|
||||
public GenericFluidBlock(Fluid fluid, Material material, String still, String flowing) {
|
||||
super(fluid, material);
|
||||
setCreativeTab(null);
|
||||
stillName = still;
|
||||
flowingName = flowing;
|
||||
displacements.put(this, false);
|
||||
}
|
||||
|
||||
public GenericFluidBlock setDamage(DamageSource source, float amount) {
|
||||
damageSource = source;
|
||||
damage = amount;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
return (side == 0 || side == 1) ? stillIcon : flowingIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister register) {
|
||||
stillIcon = register.registerIcon(RefStrings.MODID + ":" + stillName);
|
||||
flowingIcon = register.registerIcon(RefStrings.MODID + ":" + flowingName);
|
||||
}
|
||||
|
||||
/** Only temporary, will be moved into a subclass */
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
|
||||
if(damageSource != null) {
|
||||
|
||||
if(entity instanceof EntityItem) {
|
||||
|
||||
entity.motionX = 0;
|
||||
entity.motionY = 0;
|
||||
entity.motionZ = 0;
|
||||
|
||||
if(entity.ticksExisted % 20 == 0 && !world.isRemote) {
|
||||
entity.attackEntityFrom(damageSource, damage * 0.1F);
|
||||
}
|
||||
if(entity.ticksExisted % 5 == 0) {
|
||||
world.spawnParticle("cloud", entity.posX, entity.posY, entity.posZ, 0.0, 0.0, 0.0);
|
||||
}
|
||||
} else {
|
||||
|
||||
if(entity.motionY < -0.2)
|
||||
entity.motionY *= 0.5;
|
||||
|
||||
if(!world.isRemote) {
|
||||
entity.attackEntityFrom(damageSource, damage);
|
||||
}
|
||||
}
|
||||
|
||||
if(entity.ticksExisted % 5 == 0) {
|
||||
world.playSoundAtEntity(entity, "random.fizz", 0.2F, 1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -77,7 +77,9 @@ public class SchrabidicBlock extends BlockFluidClassic {
|
||||
|
||||
@Override
|
||||
public void onEntityCollidedWithBlock(World world, int x, int y, int z, Entity entity) {
|
||||
entity.setInWeb();
|
||||
|
||||
if(this.getMaterial() == ModBlocks.fluidschrabidic)
|
||||
entity.setInWeb();
|
||||
|
||||
if(entity instanceof EntityLivingBase)
|
||||
ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.CREATIVE, 1.0F);
|
||||
@ -97,7 +99,7 @@ public class SchrabidicBlock extends BlockFluidClassic {
|
||||
}
|
||||
|
||||
public boolean reactToBlocks(World world, int x, int y, int z) {
|
||||
if(world.getBlock(x, y, z).getMaterial() != ModBlocks.fluidschrabidic) {
|
||||
if(world.getBlock(x, y, z).getMaterial() != this.getMaterial()) {
|
||||
if(world.getBlock(x, y, z).getMaterial().isLiquid()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -5,9 +5,6 @@ import java.util.Random;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
|
||||
@ -10,7 +10,6 @@ import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
@ -15,7 +15,6 @@ import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
@ -6,9 +6,6 @@ import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
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;
|
||||
|
||||
@ -12,7 +12,6 @@ import com.hbm.util.ContaminationUtil.HazardType;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.util.ArmorRegistry;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
import com.hbm.util.ContaminationUtil;
|
||||
import com.hbm.util.ContaminationUtil.ContaminationType;
|
||||
import com.hbm.util.ContaminationUtil.HazardType;
|
||||
@ -52,8 +53,13 @@ public class BlockGasRadonTomb extends BlockGasBase {
|
||||
public void onEntityCollidedWithBlock(World world, int p_149670_2_, int p_149670_3_, int p_149670_4_, Entity entity) {
|
||||
|
||||
if(entity instanceof EntityLivingBase) {
|
||||
ContaminationUtil.contaminate((EntityLivingBase)entity, HazardType.RADIATION, ContaminationType.RAD_BYPASS, 0.5F);
|
||||
HbmLivingProps.incrementFibrosis((EntityLivingBase)entity, 10);
|
||||
EntityLivingBase living = (EntityLivingBase) entity;
|
||||
|
||||
living.removePotionEffect(HbmPotion.radaway.id); //get fucked
|
||||
living.removePotionEffect(HbmPotion.radx.id);
|
||||
|
||||
ContaminationUtil.contaminate(living, HazardType.RADIATION, ContaminationType.RAD_BYPASS, 0.5F);
|
||||
HbmLivingProps.incrementFibrosis(living, 10);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -84,9 +84,9 @@ public class BlockLayering extends Block {
|
||||
}
|
||||
|
||||
public void updateTick(World p_149674_1_, int p_149674_2_, int p_149674_3_, int p_149674_4_, Random p_149674_5_) {
|
||||
if(p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) {
|
||||
/*if(p_149674_1_.getSavedLightValue(EnumSkyBlock.Block, p_149674_2_, p_149674_3_, p_149674_4_) > 11) {
|
||||
p_149674_1_.setBlockToAir(p_149674_2_, p_149674_3_, p_149674_4_);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
|
||||
320
src/main/java/com/hbm/blocks/generic/BlockMotherOfAllOres.java
Normal file
320
src/main/java/com/hbm/blocks/generic/BlockMotherOfAllOres.java
Normal file
@ -0,0 +1,320 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.google.common.collect.HashBiMap;
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.WorldConfig;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.util.ColorUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
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.IIcon;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.oredict.OreDictionary;
|
||||
|
||||
public class BlockMotherOfAllOres extends BlockContainer implements IBlockMultiPass {
|
||||
|
||||
public static int override = -1;
|
||||
|
||||
public static void shuffleOverride(Random rand) {
|
||||
override = rand.nextInt(uniqueItems.size());
|
||||
}
|
||||
|
||||
public static void resetOverride() {
|
||||
override = -1;
|
||||
}
|
||||
|
||||
public BlockMotherOfAllOres() {
|
||||
super(Material.rock);
|
||||
this.setBlockTextureName("stone");
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRandomOre();
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void getSubBlocks(Item item, CreativeTabs tab, List list) {
|
||||
|
||||
for(int i = 0; i < uniqueItems.size(); i++)
|
||||
list.add(new ItemStack(item, 1, i));
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack getPickBlock(MovingObjectPosition target, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
TileEntityRandomOre ore = (TileEntityRandomOre) te;
|
||||
return new ItemStack(this, 1, ore.getStackId());
|
||||
}
|
||||
|
||||
return new ItemStack(ModItems.nothing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<ItemStack> getDrops(World world, int x, int y, int z, int metadata, int fortune) {
|
||||
ArrayList<ItemStack> ret = new ArrayList<ItemStack>();
|
||||
|
||||
if(fortune == 0xFECE00) {
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
TileEntityRandomOre ore = (TileEntityRandomOre) te;
|
||||
ComparableStack item = ore.getCompStack();
|
||||
ret.add(item.toStack());
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block block, int meta) {
|
||||
this.dropBlockAsItemWithChance(world, x, y, z, meta, 1, 0xFECE00);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
|
||||
((TileEntityRandomOre)world.getTileEntity(x, y, z)).setItem(stack.getItemDamage());
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType(){
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPasses() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
private IIcon[] overlays = new IIcon[10];
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister reg) {
|
||||
|
||||
this.blockIcon = reg.registerIcon("stone");
|
||||
for(int i = 0; i < overlays.length; i++) {
|
||||
overlays[i] = reg.registerIcon(RefStrings.MODID + ":ore_random_" + (i + 1));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(IBlockAccess world, int x, int y, int z, int side) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return Blocks.stone.getIcon(0, 0);
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
TileEntityRandomOre ore = (TileEntityRandomOre) te;
|
||||
int index = ore.getStackId() % overlays.length;
|
||||
return overlays[index];
|
||||
}
|
||||
|
||||
return Blocks.stone.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int meta) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return Blocks.stone.getIcon(0, 0);
|
||||
|
||||
int index = meta % overlays.length;
|
||||
return overlays[index];
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return 0xffffff;
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
TileEntityRandomOre ore = (TileEntityRandomOre) te;
|
||||
ItemStack stack = ore.getStack();
|
||||
int color = ColorUtil.getAverageColorFromStack(stack);
|
||||
color = ColorUtil.amplifyColor(color);
|
||||
|
||||
Color col = new Color(color);
|
||||
int r = col.getRed();
|
||||
int g = col.getGreen();
|
||||
int b = col.getBlue();
|
||||
|
||||
float[] hsb = new Color(color).RGBtoHSB(r, g, b, new float[3]);
|
||||
|
||||
if(hsb[1] > 0F && hsb[1] < 0.75F)
|
||||
hsb[1] = 0.75F;
|
||||
|
||||
color = Color.HSBtoRGB(hsb[0], hsb[1], hsb[2]);
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
public static class TileEntityRandomOre extends TileEntity {
|
||||
|
||||
private ComparableStack stack;
|
||||
|
||||
public TileEntityRandomOre() {
|
||||
if(override != -1) {
|
||||
setItem(override);
|
||||
}
|
||||
}
|
||||
|
||||
public void setItem(int id) {
|
||||
ComparableStack comp = itemMap.get(id);
|
||||
this.stack = comp != null ? ((ComparableStack) comp.copy()) : null;
|
||||
|
||||
if(this.worldObj != null)
|
||||
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
}
|
||||
|
||||
public int getStackId() {
|
||||
return itemMap.inverse().get(getCompStack());
|
||||
}
|
||||
|
||||
public ItemStack getStack() {
|
||||
return getCompStack().toStack();
|
||||
}
|
||||
|
||||
public ComparableStack getCompStack() {
|
||||
|
||||
if(stack == null) {
|
||||
int rand = worldObj.rand.nextInt(uniqueItems.size());
|
||||
stack = (ComparableStack) itemMap.get(rand).copy();
|
||||
this.worldObj.markTileEntityChunkModified(this.xCoord, this.yCoord, this.zCoord, this);
|
||||
}
|
||||
|
||||
return stack != null ? stack : new ComparableStack(ModItems.nothing);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
int key = nbt.getInteger("item");
|
||||
this.setItem(key);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
try {
|
||||
Integer key = itemMap.inverse().get(getCompStack());
|
||||
nbt.setInteger("item", key != null ? key : 0);
|
||||
} catch(Exception ex) { }
|
||||
}
|
||||
|
||||
@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());
|
||||
}
|
||||
}
|
||||
|
||||
public static class ItemRandomOreBlock extends ItemBlock {
|
||||
|
||||
public ItemRandomOreBlock(Block block) {
|
||||
super(block);
|
||||
this.setHasSubtypes(true);
|
||||
this.setMaxDamage(0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getItemStackDisplayName(ItemStack stack) {
|
||||
ComparableStack comp = itemMap.get(stack.getItemDamage());
|
||||
ItemStack name = comp != null ? comp.toStack() : new ItemStack(ModItems.nothing);
|
||||
if(name.getItemDamage() == OreDictionary.WILDCARD_VALUE) {
|
||||
name.setItemDamage(0);
|
||||
}
|
||||
return I18nUtil.resolveKey(this.getUnlocalizedName() + ".name", name.getItem().getItemStackDisplayName(name));
|
||||
}
|
||||
}
|
||||
|
||||
public static HashSet<ComparableStack> uniqueItems = new HashSet();
|
||||
public static HashBiMap<Integer, ComparableStack> itemMap = HashBiMap.create();
|
||||
|
||||
public static void init() {
|
||||
|
||||
if(WorldConfig.enableRandom) {
|
||||
for(Object b : Block.blockRegistry.getKeys()) {
|
||||
Block block = Block.getBlockFromName((String) b);
|
||||
if(block != null && Item.getItemFromBlock(block) != null)
|
||||
uniqueItems.add(new ComparableStack(block));
|
||||
}
|
||||
|
||||
for(Object i : Item.itemRegistry.getKeys()) {
|
||||
Item item = (Item) Item.itemRegistry.getObject((String) i);
|
||||
uniqueItems.add(new ComparableStack(item));
|
||||
}
|
||||
|
||||
for(String i : OreDictionary.getOreNames()) {
|
||||
for(ItemStack stack : OreDictionary.getOres(i)) {
|
||||
uniqueItems.add(new ComparableStack(stack));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uniqueItems.add(new ComparableStack(ModItems.nothing));
|
||||
}
|
||||
|
||||
int i = 0;
|
||||
for(ComparableStack stack : uniqueItems) {
|
||||
itemMap.put(i++, stack);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -241,10 +241,17 @@ public class BlockOre extends Block {
|
||||
return 1;
|
||||
}
|
||||
|
||||
public boolean allowFortune = true;
|
||||
|
||||
public BlockOre noFortune() {
|
||||
this.allowFortune = false;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int quantityDroppedWithBonus(int fortune, Random rand) {
|
||||
|
||||
if(fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, rand, fortune)) {
|
||||
if(fortune > 0 && Item.getItemFromBlock(this) != this.getItemDropped(0, rand, fortune) && allowFortune) {
|
||||
int mult = rand.nextInt(fortune + 2) - 1;
|
||||
|
||||
if(mult < 0) {
|
||||
|
||||
25
src/main/java/com/hbm/blocks/generic/BlockResourceStone.java
Normal file
25
src/main/java/com/hbm/blocks/generic/BlockResourceStone.java
Normal file
@ -0,0 +1,25 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class BlockResourceStone extends BlockEnumMulti {
|
||||
|
||||
public BlockResourceStone() {
|
||||
super(Material.rock, BlockEnums.EnumStoneType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void dropBlockAsItemWithChance(World world, int x, int y, int z, int meta, float chance, int fortune) {
|
||||
|
||||
if(meta == BlockEnums.EnumStoneType.ASBESTOS.ordinal()) {
|
||||
world.setBlock(x, y, z, ModBlocks.gas_asbestos);
|
||||
}
|
||||
|
||||
super.dropBlockAsItemWithChance(world, x, y, z, meta, chance, fortune);
|
||||
}
|
||||
}
|
||||
71
src/main/java/com/hbm/blocks/generic/BlockStalagmite.java
Normal file
71
src/main/java/com/hbm/blocks/generic/BlockStalagmite.java
Normal file
@ -0,0 +1,71 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.BlockEnums;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockStalagmite extends BlockEnumMulti {
|
||||
|
||||
public BlockStalagmite() {
|
||||
super(Material.rock, BlockEnums.EnumStoneType.class, true, true);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rang, int fortune) {
|
||||
|
||||
switch(meta) {
|
||||
case 0: return ModItems.sulfur;
|
||||
case 1: return ModItems.powder_asbestos;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canPlaceBlockAt(World world, int x, int y, int z) {
|
||||
|
||||
if(this == ModBlocks.stalagmite)
|
||||
return World.doesBlockHaveSolidTopSurface(world, x, y - 1, z);
|
||||
if(this == ModBlocks.stalactite)
|
||||
return world.isSideSolid(x, y + 1, z, ForgeDirection.DOWN);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
if(!canPlaceBlockAt(world, x, y, z)) {
|
||||
world.func_147480_a(x, y, z, true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public AxisAlignedBB getCollisionBoundingBoxFromPool(World world, int x, int y, int z) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@ -4,8 +4,8 @@ import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.potion.HbmPotion;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -159,7 +159,7 @@ public class WasteEarth extends Block {
|
||||
|
||||
if(this == ModBlocks.waste_earth || this == ModBlocks.waste_mycelium) {
|
||||
|
||||
if(GeneralConfig.enableAutoCleanup || (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2)) {
|
||||
if(RadiationConfig.cleanupDeadDirt || (world.getBlockLightValue(x, y + 1, z) < 4 && world.getBlockLightOpacity(x, y + 1, z) > 2)) {
|
||||
world.setBlock(x, y, z, Blocks.dirt);
|
||||
|
||||
}
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
@ -10,16 +11,17 @@ 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.item.EntityFallingBlock;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class WasteLeaves extends Block {
|
||||
|
||||
public WasteLeaves(Material mat) {
|
||||
super(mat);
|
||||
this.setTickRandomly(true);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -36,8 +38,15 @@ public class WasteLeaves extends Block {
|
||||
@Override
|
||||
public void updateTick(World world, int x, int y, int z, Random rand) {
|
||||
|
||||
if(rand.nextInt(60) == 0) {
|
||||
if(rand.nextInt(30) == 0) {
|
||||
world.setBlockToAir(x, y, z);
|
||||
|
||||
if(world.getBlock(x, y - 1, z).getMaterial() == Material.air) {
|
||||
EntityFallingBlock leaves = new EntityFallingBlock(world, x + 0.5, y + 0.5, z + 0.5, ModBlocks.leaves_layer);
|
||||
leaves.field_145812_b = 2;
|
||||
leaves.field_145813_c = false;
|
||||
world.spawnEntityInWorld(leaves);
|
||||
}
|
||||
}
|
||||
|
||||
super.updateTick(world, x, y, z, rand);
|
||||
|
||||
83
src/main/java/com/hbm/blocks/machine/BlockObserver.java
Normal file
83
src/main/java/com/hbm/blocks/machine/BlockObserver.java
Normal file
@ -0,0 +1,83 @@
|
||||
package com.hbm.blocks.machine;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockObserver extends Block {
|
||||
|
||||
private boolean isActive;
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconFront;
|
||||
@SideOnly(Side.CLIENT)
|
||||
private IIcon iconBack;
|
||||
|
||||
public BlockObserver(Material mat, boolean isActive) {
|
||||
super(mat);
|
||||
this.isActive = isActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
this.iconBack = iconRegister.registerIcon(RefStrings.MODID + (this.isActive ? ":observer_back_on" : ":observer_back_off"));
|
||||
this.iconFront = iconRegister.registerIcon(RefStrings.MODID + ":observer_front");
|
||||
this.blockIcon = iconRegister.registerIcon(RefStrings.MODID + ":observer_side");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(metadata);
|
||||
ForgeDirection opp = dir.getOpposite();
|
||||
return side == dir.ordinal() ? iconFront : side == opp.ordinal() ? iconBack : blockIcon;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item getItemDropped(int meta, Random rand, int luck) {
|
||||
return Item.getItemFromBlock(ModBlocks.observer_off);
|
||||
}
|
||||
|
||||
@Override
|
||||
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);
|
||||
|
||||
if(this.isActive)
|
||||
world.scheduleBlockUpdate(x, y, z, this, 2);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onNeighborBlockChange(World world, int x, int y, int z, Block block) {
|
||||
|
||||
if(!this.isActive) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canProvidePower() {
|
||||
return this.isActive;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int isProvidingWeakPower(IBlockAccess world, int x, int y, int z, int side) {
|
||||
return this.isActive ? 15 : 0;
|
||||
}
|
||||
}
|
||||
@ -160,63 +160,55 @@ public class SoyuzLauncher extends BlockDummyable {
|
||||
private static boolean keepInventory;
|
||||
|
||||
@Override
|
||||
public void breakBlock(World world, int x, int y, int z, Block p_149749_5_, int i)
|
||||
{
|
||||
if (!keepInventory)
|
||||
{
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory)world.getTileEntity(x, y, z);
|
||||
public void breakBlock(World world, int x, int y, int z, Block p_149749_5_, int i) {
|
||||
if(!keepInventory) {
|
||||
ISidedInventory tileentityfurnace = (ISidedInventory) world.getTileEntity(x, y, z);
|
||||
|
||||
if (tileentityfurnace != null)
|
||||
{
|
||||
for (int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1)
|
||||
{
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
if(tileentityfurnace != null) {
|
||||
for(int i1 = 0; i1 < tileentityfurnace.getSizeInventory(); ++i1) {
|
||||
ItemStack itemstack = tileentityfurnace.getStackInSlot(i1);
|
||||
|
||||
if (itemstack != null)
|
||||
{
|
||||
float f = 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;
|
||||
if(itemstack != null) {
|
||||
float f = 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;
|
||||
|
||||
while (itemstack.stackSize > 0)
|
||||
{
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
while(itemstack.stackSize > 0) {
|
||||
int j1 = this.field_149933_a.nextInt(21) + 10;
|
||||
|
||||
if (j1 > itemstack.stackSize)
|
||||
{
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
if(j1 > itemstack.stackSize) {
|
||||
j1 = itemstack.stackSize;
|
||||
}
|
||||
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
itemstack.stackSize -= j1;
|
||||
EntityItem entityitem = new EntityItem(world, x + f, y + f1, z + f2, new ItemStack(itemstack.getItem(), j1, itemstack.getItemDamage()));
|
||||
|
||||
if (itemstack.hasTagCompound())
|
||||
{
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound)itemstack.getTagCompound().copy());
|
||||
}
|
||||
if(itemstack.hasTagCompound()) {
|
||||
entityitem.getEntityItem().setTagCompound((NBTTagCompound) itemstack.getTagCompound().copy());
|
||||
}
|
||||
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float)this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float)this.field_149933_a.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int l = 0; l < 10; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_launcher, 38)));
|
||||
for(int l = 0; l < 8; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.concrete_smooth, 41)));
|
||||
for(int l = 0; l < 6; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 53)));
|
||||
|
||||
world.func_147453_f(x, y, z, p_149749_5_);
|
||||
}
|
||||
}
|
||||
float f3 = 0.05F;
|
||||
entityitem.motionX = (float) this.field_149933_a.nextGaussian() * f3;
|
||||
entityitem.motionY = (float) this.field_149933_a.nextGaussian() * f3 + 0.2F;
|
||||
entityitem.motionZ = (float) this.field_149933_a.nextGaussian() * f3;
|
||||
world.spawnEntityInWorld(entityitem);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, p_149749_5_, i);
|
||||
}
|
||||
for(int l = 0; l < 10; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_launcher, 38)));
|
||||
for(int l = 0; l < 8; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.concrete_smooth, 41)));
|
||||
for(int l = 0; l < 6; l++)
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 64)));
|
||||
world.spawnEntityInWorld(new EntityItem(world, x + 0.5, y + 0.5, z + 0.5, new ItemStack(ModBlocks.struct_scaffold, 53)));
|
||||
|
||||
world.func_147453_f(x, y, z, p_149749_5_);
|
||||
}
|
||||
}
|
||||
|
||||
super.breakBlock(world, x, y, z, p_149749_5_, i);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@ -1,9 +1,11 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.test.TestConductor;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.network.TileEntityCableBaseNT;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -21,9 +23,15 @@ public class BlockCable extends BlockContainer {
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityCableBaseNT();
|
||||
}
|
||||
|
||||
public static int renderIDClassic = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
|
||||
if(this == ModBlocks.red_cable_classic)
|
||||
return renderIDClassic;
|
||||
|
||||
return TestConductor.renderID;
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.tileentity.conductor.TileEntityFluidDuct;
|
||||
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -8,8 +14,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockFluidDuct extends BlockContainer {
|
||||
public class BlockFluidDuct extends BlockContainer implements ILookOverlay {
|
||||
|
||||
public BlockFluidDuct(Material p_i45386_1_) {
|
||||
super(p_i45386_1_);
|
||||
@ -79,4 +86,18 @@ public class BlockFluidDuct extends BlockContainer {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityFluidDuctSimple))
|
||||
return;
|
||||
|
||||
TileEntityFluidDuctSimple duct = (TileEntityFluidDuctSimple) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,13 @@
|
||||
package com.hbm.blocks.network;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.tileentity.conductor.TileEntityFluidDuctSimple;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -13,8 +18,9 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
|
||||
public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPass {
|
||||
public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPass, ILookOverlay {
|
||||
|
||||
public BlockFluidDuctSolid(Material mat) {
|
||||
super(mat);
|
||||
@ -64,4 +70,19 @@ public class BlockFluidDuctSolid extends BlockContainer implements IBlockMultiPa
|
||||
|
||||
return 0xffffff;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void printHook(Pre event, World world, int x, int y, int z) {
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof TileEntityFluidDuctSimple))
|
||||
return;
|
||||
|
||||
TileEntityFluidDuctSimple duct = (TileEntityFluidDuctSimple) te;
|
||||
|
||||
List<String> text = new ArrayList();
|
||||
text.add("&[" + duct.getType().getColor() + "&]" +I18nUtil.resolveKey(duct.getType().getUnlocalizedName()));
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@ import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ILookOverlay;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
@ -119,7 +120,7 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
|
||||
return new TileEntityDiode();
|
||||
}
|
||||
|
||||
public static class TileEntityDiode extends TileEntity implements IEnergyUser {
|
||||
public static class TileEntityDiode extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
@Override
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.hbm.blocks.test;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.material.Material;
|
||||
|
||||
@ -9,10 +7,5 @@ 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);
|
||||
}
|
||||
}
|
||||
|
||||
58
src/main/java/com/hbm/blocks/test/TestPipe.java
Normal file
58
src/main/java/com/hbm/blocks/test/TestPipe.java
Normal file
@ -0,0 +1,58 @@
|
||||
package com.hbm.blocks.test;
|
||||
|
||||
import com.hbm.tileentity.network.TileEntityPipeBaseNT;
|
||||
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TestPipe extends BlockContainer {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
protected IIcon overlay;
|
||||
|
||||
public TestPipe(Material mat) {
|
||||
super(mat);
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void registerBlockIcons(IIconRegister iconRegister) {
|
||||
super.registerBlockIcons(iconRegister);
|
||||
this.overlay = iconRegister.registerIcon(this.getTextureName() + "_overlay");
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIcon(int side, int metadata) {
|
||||
return side == 0 ? this.blockIcon : this.overlay;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityPipeBaseNT();
|
||||
}
|
||||
|
||||
public static int renderID = RenderingRegistry.getNextAvailableRenderId();
|
||||
|
||||
@Override
|
||||
public int getRenderType() {
|
||||
return renderID;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isOpaqueCube() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderAsNormalBlock() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@ -25,10 +25,12 @@ public class BombConfig {
|
||||
public static int falloutRange = 100;
|
||||
public static int fDelay = 4;
|
||||
public static int limitExplosionLifespan = 0;
|
||||
public static int rain = 0;
|
||||
public static int cont = 0;
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_NUKES = "03_nukes";
|
||||
final String CATEGORY_NUKES = CommonConfig.CATEGORY_NUKES;
|
||||
Property propGadget = config.get(CATEGORY_NUKES, "3.00_gadgetRadius", 150);
|
||||
propGadget.comment = "Radius of the Gadget";
|
||||
gadgetRadius = propGadget.getInt();
|
||||
@ -72,7 +74,7 @@ public class BombConfig {
|
||||
propN2.comment = "Radius of the N2 mine";
|
||||
n2Radius = propN2.getInt();
|
||||
|
||||
final String CATEGORY_NUKE = "06_explosions";
|
||||
final String CATEGORY_NUKE = CommonConfig.CATEGORY_EXPLOSIONS;
|
||||
Property propLimitExplosionLifespan = config.get(CATEGORY_NUKE, "6.00_limitExplosionLifespan", 0);
|
||||
propLimitExplosionLifespan.comment = "How long an explosion can be unloaded until it dies in seconds. Based of system time. 0 disables the effect";
|
||||
limitExplosionLifespan = propLimitExplosionLifespan.getInt();
|
||||
@ -91,5 +93,12 @@ public class BombConfig {
|
||||
Property falloutDelayProp = config.get(CATEGORY_NUKE, "6.04_falloutDelay", 4);
|
||||
falloutDelayProp.comment = "How many ticks to wait for the next fallout chunk computation";
|
||||
fDelay = falloutDelayProp.getInt();
|
||||
|
||||
Property radRain = config.get(CATEGORY_NUKE, "6.05_falloutRainDuration", 0);
|
||||
radRain.comment = "Duration of the thunderstorm after fallout in ticks (only large explosions)";
|
||||
rain = radRain.getInt();
|
||||
Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0);
|
||||
rainCont.comment = "Radiation in 100th RADs created by fallout rain";
|
||||
cont = rainCont.getInt();
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,22 @@ import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
public class CommonConfig {
|
||||
|
||||
public static final String CATEGORY_GENERAL = "01_general";
|
||||
public static final String CATEGORY_ORES = "02_ores";
|
||||
public static final String CATEGORY_NUKES = "03_nukes";
|
||||
public static final String CATEGORY_DUNGEONS = "04_dungeons";
|
||||
public static final String CATEGORY_METEORS = "05_meteors";
|
||||
public static final String CATEGORY_EXPLOSIONS = "06_explosions";
|
||||
public static final String CATEGORY_MISSILE = "07_missile_machines";
|
||||
public static final String CATEGORY_POTION = "08_potion_effects";
|
||||
public static final String CATEGORY_MACHINES = "09_machines";
|
||||
public static final String CATEGORY_DROPS = "10_dangerous_drops";
|
||||
public static final String CATEGORY_TOOLS = "11_tools";
|
||||
public static final String CATEGORY_MOBS = "12_mobs";
|
||||
public static final String CATEGORY_RADIATION = "13_radiation";
|
||||
|
||||
public static final String CATEGORY_528 = "528";
|
||||
|
||||
public static int setDefZero(int value, int def) {
|
||||
|
||||
@ -30,28 +46,30 @@ public class CommonConfig {
|
||||
}
|
||||
|
||||
public static int createConfigInt(Configuration config, String category, String name, String comment, int def) {
|
||||
|
||||
Property prop = config.get(category, name, def);
|
||||
prop.comment = comment;
|
||||
return prop.getInt();
|
||||
}
|
||||
|
||||
public static boolean createConfigBool(Configuration config, String category, String name, String comment, boolean def) {
|
||||
public static double createConfigDouble(Configuration config, String category, String name, String comment, double def) {
|
||||
Property prop = config.get(category, name, def);
|
||||
prop.comment = comment;
|
||||
return prop.getDouble();
|
||||
}
|
||||
|
||||
public static boolean createConfigBool(Configuration config, String category, String name, String comment, boolean def) {
|
||||
Property prop = config.get(category, name, def);
|
||||
prop.comment = comment;
|
||||
return prop.getBoolean();
|
||||
}
|
||||
|
||||
public static String createConfigString(Configuration config, String category, String name, String comment, String def) {
|
||||
|
||||
Property prop = config.get(category, name, def);
|
||||
prop.comment = comment;
|
||||
return prop.getString();
|
||||
}
|
||||
|
||||
public static String[] createConfigStringList(Configuration config, String category, String name, String comment) {
|
||||
|
||||
Property prop = config.get(category, name, new String[] { "PLACEHOLDER" });
|
||||
prop.comment = comment;
|
||||
return prop.getStringList();
|
||||
|
||||
@ -13,14 +13,8 @@ public class GeneralConfig {
|
||||
public static boolean enableRad = true;
|
||||
public static boolean enableNITAN = true;
|
||||
public static boolean enableNukeClouds = true;
|
||||
public static boolean enableAutoCleanup = false;
|
||||
public static boolean enableMeteorStrikes = true;
|
||||
public static boolean enableMeteorShowers = true;
|
||||
public static boolean enableMeteorTails = true;
|
||||
public static boolean enableSpecialMeteors = true;
|
||||
public static boolean enableBomberShortMode = false;
|
||||
public static boolean enableVaults = true;
|
||||
public static boolean enableRads = true;
|
||||
public static boolean enableCataclysm = false;
|
||||
public static boolean enableExtendedLogging = false;
|
||||
public static boolean enableHardcoreTaint = false;
|
||||
@ -42,7 +36,7 @@ public class GeneralConfig {
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_GENERAL = "01_general";
|
||||
final String CATEGORY_GENERAL = CommonConfig.CATEGORY_GENERAL;
|
||||
enableDebugMode = config.get(CATEGORY_GENERAL, "1.00_enableDebugMode", false).getBoolean(false);
|
||||
enableMycelium = config.get(CATEGORY_GENERAL, "1.01_enableMyceliumSpread", false).getBoolean(false);
|
||||
enablePlutoniumOre = config.get(CATEGORY_GENERAL, "1.02_enablePlutoniumNetherOre", false).getBoolean(false);
|
||||
@ -52,14 +46,8 @@ public class GeneralConfig {
|
||||
enableRad = config.get(CATEGORY_GENERAL, "1.06_enableRadHotspotSpawn", true).getBoolean(true);
|
||||
enableNITAN = config.get(CATEGORY_GENERAL, "1.07_enableNITANChestSpawn", true).getBoolean(true);
|
||||
enableNukeClouds = config.get(CATEGORY_GENERAL, "1.08_enableMushroomClouds", true).getBoolean(true);
|
||||
enableAutoCleanup = config.get(CATEGORY_GENERAL, "1.09_enableAutomaticRadCleanup", false).getBoolean(false);
|
||||
enableMeteorStrikes = config.get(CATEGORY_GENERAL, "1.10_enableMeteorStrikes", true).getBoolean(true);
|
||||
enableMeteorShowers = config.get(CATEGORY_GENERAL, "1.11_enableMeteorShowers", true).getBoolean(true);
|
||||
enableMeteorTails = config.get(CATEGORY_GENERAL, "1.12_enableMeteorTails", true).getBoolean(true);
|
||||
enableSpecialMeteors = config.get(CATEGORY_GENERAL, "1.13_enableSpecialMeteors", false).getBoolean(false);
|
||||
enableBomberShortMode = config.get(CATEGORY_GENERAL, "1.14_enableBomberShortMode", false).getBoolean(false);
|
||||
enableVaults = config.get(CATEGORY_GENERAL, "1.15_enableVaultSpawn", true).getBoolean(true);
|
||||
enableRads = config.get(CATEGORY_GENERAL, "1.16_enableNewRadiation", true).getBoolean(true);
|
||||
enableCataclysm = config.get(CATEGORY_GENERAL, "1.17_enableCataclysm", false).getBoolean(false);
|
||||
enableExtendedLogging = config.get(CATEGORY_GENERAL, "1.18_enableExtendedLogging", false).getBoolean(false);
|
||||
enableHardcoreTaint = config.get(CATEGORY_GENERAL, "1.19_enableHardcoreTaint", false).getBoolean(false);
|
||||
@ -70,7 +58,7 @@ public class GeneralConfig {
|
||||
enableReflectorCompat = config.get(CATEGORY_GENERAL, "1.24_enableReflectorCompat", false).getBoolean(false);
|
||||
enableRenderDistCheck = config.get(CATEGORY_GENERAL, "1.25_enableRenderDistCheck", true).getBoolean(true);
|
||||
|
||||
final String CATEGORY_528 = "528";
|
||||
final String CATEGORY_528 = CommonConfig.CATEGORY_528;
|
||||
|
||||
config.addCustomCategoryComment(CATEGORY_528, "CAUTION\n"
|
||||
+ "528 Mode: Please proceed with caution!\n"
|
||||
|
||||
@ -9,7 +9,7 @@ public class MachineConfig {
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_MACHINE = "09_machines";
|
||||
final String CATEGORY_MACHINE = CommonConfig.CATEGORY_MACHINES;
|
||||
|
||||
scaleRTGPower = CommonConfig.createConfigBool(config, CATEGORY_MACHINE, "9.00_scaleRTGPower", "Should RTG/Betavoltaic fuel power scale down as it decays?", false);
|
||||
doRTGsDecay = CommonConfig.createConfigBool(config, CATEGORY_MACHINE, "9.01_doRTGsDecay", "Should RTG/Betavoltaic fuel decay at all?", true);
|
||||
|
||||
@ -29,7 +29,7 @@ public class MobConfig {
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY = "12_mobs";
|
||||
final String CATEGORY = CommonConfig.CATEGORY_MOBS;
|
||||
|
||||
enableMaskman = CommonConfig.createConfigBool(config, CATEGORY, "12.M00_enableMaskman", "Whether mask man should spawn", true);
|
||||
maskmanDelay = CommonConfig.createConfigInt(config, CATEGORY, "12.M01_maskmanDelay", "How many world ticks need to pass for a check to be performed", 60 * 60 * 60);
|
||||
|
||||
@ -20,7 +20,7 @@ public class PotionConfig {
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_POTION = "08_potion_effects";
|
||||
final String CATEGORY_POTION = CommonConfig.CATEGORY_POTION;
|
||||
taintID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.00_taintPotionID", "What potion ID the taint effect will have", 62);
|
||||
radiationID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.01_radiationPotionID", "What potion ID the radiation effect will have", 63);
|
||||
bangID = CommonConfig.createConfigInt(config, CATEGORY_POTION, "8.02_bangPotionID", "What potion ID the B93 timebomb effect will have", 64);
|
||||
|
||||
@ -5,37 +5,31 @@ import net.minecraftforge.common.config.Property;
|
||||
|
||||
public class RadiationConfig {
|
||||
|
||||
public static int rain = 0;
|
||||
public static int cont = 0;
|
||||
public static int fogRad = 100;
|
||||
public static int fogCh = 20;
|
||||
public static float hellRad = 0.1F;
|
||||
public static double hellRad = 0.1;
|
||||
public static int worldRad = 10;
|
||||
public static int worldRadThreshold = 20;
|
||||
public static boolean worldRadEffects = true;
|
||||
public static boolean cleanupDeadDirt = false;
|
||||
|
||||
public static boolean enableContamination = true;
|
||||
public static boolean enableChunkRads = true;
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_NUKE = "06_explosions";
|
||||
final String CATEGORY_NUKE = CommonConfig.CATEGORY_RADIATION;
|
||||
|
||||
Property radRain = config.get(CATEGORY_NUKE, "6.05_falloutRainDuration", 0);
|
||||
radRain.comment = "Duration of the thunderstorm after fallout in ticks (only large explosions)";
|
||||
rain = radRain.getInt();
|
||||
Property rainCont = config.get(CATEGORY_NUKE, "6.06_falloutRainRadiation", 0);
|
||||
rainCont.comment = "Radiation in 100th RADs created by fallout rain";
|
||||
cont = rainCont.getInt();
|
||||
Property fogThresh = config.get(CATEGORY_NUKE, "6.07_fogThreshold", 100);
|
||||
fogThresh.comment = "Radiation in RADs required for fog to spawn";
|
||||
fogRad = fogThresh.getInt();
|
||||
Property fogChance = config.get(CATEGORY_NUKE, "6.08_fogChance", 10);
|
||||
fogChance.comment = "1:n chance of fog spawning every second";
|
||||
fogCh = fogChance.getInt();
|
||||
Property netherRad = config.get(CATEGORY_NUKE, "6.09_netherRad", 10);
|
||||
netherRad.comment = "RAD/s in the nether in hundredths";
|
||||
hellRad = netherRad.getInt() * 0.01F;
|
||||
worldRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "6.10_worldRadCount", "How many block operations radiation can perform per tick", 10);
|
||||
worldRadThreshold = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "6.11_worldRadThreshold", "The least amount of RADs required for block modification to happen", 20);
|
||||
worldRadEffects = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "6.12_worldRadEffects", "Whether high radiation levels should perform changes in the world", true);
|
||||
fogRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "FOG_00_threshold", "Radiation in RADs required for fog to spawn", 100);
|
||||
fogCh = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "FOG_01_threshold", "1:n chance of fog spawning every second", 20);
|
||||
hellRad = CommonConfig.createConfigDouble(config, CATEGORY_NUKE, "AMBIENT_00_nether", "RAD/s in the nether", 0.1D);
|
||||
worldRadEffects = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADWORLD_00_toggle", "Whether high radiation levels should perform changes in the world", true);
|
||||
worldRad = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "RADWORLD_01_amount", "How many block operations radiation can perform per tick", 10);
|
||||
worldRadThreshold = CommonConfig.createConfigInt(config, CATEGORY_NUKE, "RADWORLD_02_minimum", "The least amount of RADs required for block modification to happen", 20);
|
||||
cleanupDeadDirt = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADWORLD_03_regrow", "Whether dead grass and mycelium should decay into dirt", false);
|
||||
|
||||
enableContamination = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADIATION_00_enableContamination", "Toggles player contamination (and negative effects from radiation poisoning)", true);
|
||||
enableChunkRads = CommonConfig.createConfigBool(config, CATEGORY_NUKE, "RADIATION_01_enableChunkRads", "Toggles the world radiation system (chunk radiation only, some blocks use an AoE!)", true);
|
||||
|
||||
fogCh = CommonConfig.setDef(fogCh, 20);
|
||||
}
|
||||
|
||||
@ -21,7 +21,7 @@ public class ToolConfig {
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_TOOLS = "11_tools";
|
||||
final String CATEGORY_TOOLS = CommonConfig.CATEGORY_TOOLS;
|
||||
recursionDepth = CommonConfig.createConfigInt(config, CATEGORY_TOOLS, "11.00_recursionDepth", "Limits veinminer's recursive function. Usually not an issue, unless you're using bukkit which is especially sensitive for some reason.", 1000);
|
||||
recursiveStone = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.01_recursionStone", "Determines whether veinminer can break stone", false);
|
||||
recursiveNetherrack = CommonConfig.createConfigBool(config, CATEGORY_TOOLS, "11.02_recursionNetherrack", "Determines whether veinminer can break netherrack", false);
|
||||
|
||||
@ -18,7 +18,7 @@ public class WeaponConfig {
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_MISSILE = "07_missile_machines";
|
||||
final String CATEGORY_MISSILE = CommonConfig.CATEGORY_MISSILE;
|
||||
Property propRadarRange = config.get(CATEGORY_MISSILE, "7.00_radarRange", 1000);
|
||||
propRadarRange.comment = "Range of the radar, 50 will result in 100x100 block area covered";
|
||||
radarRange = propRadarRange.getInt();
|
||||
@ -32,7 +32,7 @@ public class WeaponConfig {
|
||||
propCiwsHitrate.comment = "Additional modifier for CIWS accuracy";
|
||||
ciwsHitrate = propRadarAltitude.getInt();
|
||||
|
||||
final String CATEGORY_DROPS = "10_dangerous_drops";
|
||||
final String CATEGORY_DROPS = CommonConfig.CATEGORY_DROPS;
|
||||
dropCell = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.00_dropCell", "Whether antimatter cells should explode when dropped", true);
|
||||
dropSing = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.01_dropBHole", "Whether singularities and black holes should spawn when dropped", true);
|
||||
dropStar = CommonConfig.createConfigBool(config, CATEGORY_DROPS, "10.02_dropStar", "Whether rigged star blaster cells should explode when dropped", true);
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.config;
|
||||
|
||||
import net.minecraftforge.common.config.Configuration;
|
||||
import net.minecraftforge.common.config.Property;
|
||||
|
||||
public class WorldConfig {
|
||||
|
||||
@ -47,6 +46,9 @@ public class WorldConfig {
|
||||
|
||||
public static int endTikiteSpawn = 8;
|
||||
|
||||
public static boolean enableRandom = false;
|
||||
public static int randomSpawn = 0;
|
||||
|
||||
public static int radioStructure = 500;
|
||||
public static int antennaStructure = 250;
|
||||
public static int atomStructure = 500;
|
||||
@ -74,13 +76,17 @@ public class WorldConfig {
|
||||
public static int radfreq = 5000;
|
||||
public static int vaultfreq = 2500;
|
||||
|
||||
public static boolean enableMeteorStrikes = true;
|
||||
public static boolean enableMeteorShowers = true;
|
||||
public static boolean enableMeteorTails = true;
|
||||
public static boolean enableSpecialMeteors = true;
|
||||
public static int meteorStrikeChance = 20 * 60 * 180;
|
||||
public static int meteorShowerChance = 20 * 60 * 5;
|
||||
public static int meteorShowerDuration = 6000;
|
||||
|
||||
public static void loadFromConfig(Configuration config) {
|
||||
|
||||
final String CATEGORY_OREGEN = "02_ores";
|
||||
final String CATEGORY_OREGEN = CommonConfig.CATEGORY_ORES;
|
||||
|
||||
overworldOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D00_overworldOres", "General switch for whether overworld ores should be generated. Does not include special structures like oil.", true);
|
||||
netherOre = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.D01_netherOres", "General switch for whether nether ores should be generated.", true);
|
||||
@ -124,7 +130,10 @@ public class WorldConfig {
|
||||
|
||||
endTikiteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.E00_tikiteSpawnrate", "Amount of end trixite per chunk", 8);
|
||||
|
||||
final String CATEGORY_DUNGEON = "04_dungeons";
|
||||
enableRandom = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.R00_enableRandomOre", "Amount of random ore per chunk", false);
|
||||
randomSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.R01_randomOreSpawnrate", "Amount of random ore per chunk", 0);
|
||||
|
||||
final String CATEGORY_DUNGEON = CommonConfig.CATEGORY_DUNGEONS;
|
||||
radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
|
||||
antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250);
|
||||
atomStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.02_atomSpawn", "Spawn power plant on every nTH chunk", 500);
|
||||
@ -151,16 +160,14 @@ public class WorldConfig {
|
||||
jungleStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.23_jungleDungeonSpawn", "Spawn jungle dungeon on every nTH chunk", 2000);
|
||||
pyramidStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.24_pyramidSpawn", "Spawn pyramid on every nTH chunk", 4000);
|
||||
|
||||
final String CATEGORY_METEOR = "05_meteors";
|
||||
Property propMeteorStrikeChance = config.get(CATEGORY_METEOR, "5.00_meteorStrikeChance", 20 * 60 * 60 * 5);
|
||||
propMeteorStrikeChance.comment = "The probability of a meteor spawning (an average of once every nTH ticks)";
|
||||
meteorStrikeChance = propMeteorStrikeChance.getInt();
|
||||
Property propMeteorShowerChance = config.get(CATEGORY_METEOR, "5.01_meteorShowerChance", 20 * 60 * 15);
|
||||
propMeteorShowerChance.comment = "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)";
|
||||
meteorShowerChance = propMeteorShowerChance.getInt();
|
||||
Property propMeteorShowerDuration = config.get(CATEGORY_METEOR, "5.02_meteorShowerDuration", 20 * 60 * 30);
|
||||
propMeteorShowerDuration.comment = "Max duration of meteor shower in ticks";
|
||||
meteorShowerDuration = propMeteorShowerDuration.getInt();
|
||||
final String CATEGORY_METEOR = CommonConfig.CATEGORY_METEORS;
|
||||
enableMeteorStrikes = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.00_enableMeteorStrikes", "Toggles the spawning of meteors", true);
|
||||
enableMeteorShowers = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.01_enableMeteorShowers", "Toggles meteor showers, which start with a 1% chance for every spawned meteor", true);
|
||||
enableMeteorTails = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.02_enableMeteorTails", "Toggles the particle effect created by falling meteors", true);
|
||||
enableSpecialMeteors = CommonConfig.createConfigBool(config, CATEGORY_METEOR, "5.03_enableSpecialMeteors", "Toggles rare, special meteor types with different impact effects", true);
|
||||
meteorStrikeChance = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.03_meteorStrikeChance", "The probability of a meteor spawning (an average of once every nTH ticks)", 20 * 60 * 60 * 5);
|
||||
meteorShowerChance = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.04_meteorShowerChance", "The probability of a meteor spawning during meteor shower (an average of once every nTH ticks)", 20 * 60 * 15);
|
||||
meteorShowerDuration = CommonConfig.createConfigInt(config, CATEGORY_METEOR, "5.05_meteorShowerDuration", "Max duration of meteor shower in ticks", 20 * 60 * 30);
|
||||
|
||||
radioStructure = CommonConfig.setDefZero(radioStructure, 1000);
|
||||
antennaStructure = CommonConfig.setDefZero(antennaStructure, 1000);
|
||||
|
||||
@ -137,6 +137,7 @@ public class ToolRecipes {
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.mirror_tool), new Object[] { " A ", " IA", "I ", 'A', AL.ingot(), 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.rbmk_tool), new Object[] { " A ", " IA", "I ", 'A', PB.ingot(), 'I', IRON.ingot() });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.power_net_tool), new Object[] { "WRW", " I ", " B ", 'W', ModItems.wire_red_copper, 'R', REDSTONE.dust(), 'I', IRON.ingot(), 'B', ModItems.battery_su });
|
||||
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.kit_toolbox_empty), new Object[] { "CCC", "CIC", 'C', CU.plate(), 'I', IRON.ingot() });
|
||||
|
||||
|
||||
@ -65,12 +65,12 @@ public class EntityFalloutRain extends Entity {
|
||||
tickDelay--;
|
||||
|
||||
if(this.isDead) {
|
||||
if(RadiationConfig.rain > 0 && getScale() > 150) {
|
||||
if(BombConfig.rain > 0 && getScale() > 150) {
|
||||
worldObj.getWorldInfo().setRaining(true);
|
||||
worldObj.getWorldInfo().setThundering(true);
|
||||
worldObj.getWorldInfo().setRainTime(RadiationConfig.rain);
|
||||
worldObj.getWorldInfo().setThunderTime(RadiationConfig.rain);
|
||||
AuxSavedData.setThunder(worldObj, RadiationConfig.rain);
|
||||
worldObj.getWorldInfo().setRainTime(BombConfig.rain);
|
||||
worldObj.getWorldInfo().setThunderTime(BombConfig.rain);
|
||||
AuxSavedData.setThunder(worldObj, BombConfig.rain);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -17,29 +17,29 @@ import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityMissileAntiBallistic extends Entity implements IRadarDetectable {
|
||||
|
||||
|
||||
int activationTimer;
|
||||
|
||||
public EntityMissileAntiBallistic(World p_i1582_1_) {
|
||||
super(p_i1582_1_);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void onUpdate() {
|
||||
|
||||
public void onUpdate() {
|
||||
|
||||
if(activationTimer < 40) {
|
||||
activationTimer++;
|
||||
|
||||
|
||||
motionY = 1.5D;
|
||||
|
||||
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote)
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote && this.posY < 400)
|
||||
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||
|
||||
|
||||
} else {
|
||||
|
||||
|
||||
if(activationTimer == 40) {
|
||||
ExplosionLarge.spawnParticlesRadial(worldObj, posX, posY, posZ, 15);
|
||||
activationTimer = 100;
|
||||
@ -50,9 +50,9 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
||||
targetMissile();
|
||||
|
||||
this.setLocationAndAngles(posX + this.motionX, posY + this.motionY, posZ + this.motionZ, 0, 0);
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote)
|
||||
this.rotation();
|
||||
|
||||
if(!this.worldObj.isRemote && this.posY < 400)
|
||||
this.worldObj.spawnEntityInWorld(new EntitySmokeFX(this.worldObj, this.posX, this.posY, this.posZ, 0.0, 0.0, 0.0));
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 5, posY - 5, posZ - 5, posX + 5, posY + 5, posZ + 5));
|
||||
@ -66,70 +66,66 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(this.posY > 2000)
|
||||
this.setDead();
|
||||
|
||||
if(this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.air &&
|
||||
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.water &&
|
||||
this.worldObj.getBlock((int)this.posX, (int)this.posY, (int)this.posZ) != Blocks.flowing_water) {
|
||||
|
||||
if(!this.worldObj.isRemote)
|
||||
{
|
||||
if(this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.air && this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.water && this.worldObj.getBlock((int) this.posX, (int) this.posY, (int) this.posZ) != Blocks.flowing_water) {
|
||||
|
||||
if(!this.worldObj.isRemote) {
|
||||
ExplosionLarge.explode(worldObj, posX, posY, posZ, 10F, true, true, true);
|
||||
}
|
||||
this.setDead();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
protected void rotation() {
|
||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float)(Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
for (this.rotationPitch = (float)(Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F)
|
||||
{
|
||||
;
|
||||
}
|
||||
|
||||
while (this.rotationPitch - this.prevRotationPitch >= 180.0F)
|
||||
{
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw < -180.0F)
|
||||
{
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while (this.rotationYaw - this.prevRotationYaw >= 180.0F)
|
||||
{
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected void rotation() {
|
||||
float f2 = MathHelper.sqrt_double(this.motionX * this.motionX + this.motionZ * this.motionZ);
|
||||
this.rotationYaw = (float) (Math.atan2(this.motionX, this.motionZ) * 180.0D / Math.PI);
|
||||
|
||||
for(this.rotationPitch = (float) (Math.atan2(this.motionY, f2) * 180.0D / Math.PI) - 90; this.rotationPitch - this.prevRotationPitch < -180.0F; this.prevRotationPitch -= 360.0F) {
|
||||
;
|
||||
}
|
||||
|
||||
while(this.rotationPitch - this.prevRotationPitch >= 180.0F) {
|
||||
this.prevRotationPitch += 360.0F;
|
||||
}
|
||||
|
||||
while(this.rotationYaw - this.prevRotationYaw < -180.0F) {
|
||||
this.prevRotationYaw -= 360.0F;
|
||||
}
|
||||
|
||||
while(this.rotationYaw - this.prevRotationYaw >= 180.0F) {
|
||||
this.prevRotationYaw += 360.0F;
|
||||
}
|
||||
}
|
||||
|
||||
private void targetMissile() {
|
||||
|
||||
|
||||
List<Entity> list = worldObj.getEntitiesWithinAABBExcludingEntity(null, AxisAlignedBB.getBoundingBox(posX - 500, 0, posZ - 500, posX + 500, 5000, posZ + 500));
|
||||
|
||||
|
||||
Entity target = null;
|
||||
double closest = 1000D;
|
||||
|
||||
|
||||
for(Entity e : list) {
|
||||
if(e instanceof EntityMissileBaseAdvanced || e instanceof EntityMissileCustom) {
|
||||
double dis = Math.sqrt(Math.pow(e.posX - posX, 2) + Math.pow(e.posY - posY, 2) + Math.pow(e.posZ - posZ, 2));
|
||||
|
||||
|
||||
if(dis < closest) {
|
||||
closest = dis;
|
||||
target = e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if(target != null) {
|
||||
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(target.posX - posX, target.posY - posY, target.posZ - posZ);
|
||||
|
||||
vec.normalize();
|
||||
|
||||
|
||||
this.motionX = vec.xCoord * 0.065D;
|
||||
this.motionY = vec.yCoord * 0.065D;
|
||||
this.motionZ = vec.zCoord * 0.065D;
|
||||
@ -138,25 +134,24 @@ public class EntityMissileAntiBallistic extends Entity implements IRadarDetectab
|
||||
|
||||
@Override
|
||||
protected void entityInit() {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void readEntityFromNBT(NBTTagCompound p_70037_1_) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void writeEntityToNBT(NBTTagCompound p_70014_1_) {
|
||||
|
||||
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean isInRangeToRenderDist(double distance)
|
||||
{
|
||||
return distance < 500000;
|
||||
}
|
||||
public boolean isInRangeToRenderDist(double distance) {
|
||||
return distance < 500000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public RadarTargetType getTargetType() {
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
package com.hbm.entity.projectile;
|
||||
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.WorldConfig;
|
||||
import com.hbm.explosion.ExplosionLarge;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.world.feature.Meteorite;
|
||||
@ -36,7 +36,7 @@ public class EntityMeteor extends Entity {
|
||||
if(!this.worldObj.isRemote && this.onGround && this.posY < 260) {
|
||||
|
||||
worldObj.createExplosion(this, this.posX, this.posY, this.posZ, 5 + rand.nextFloat(), true);
|
||||
if(GeneralConfig.enableMeteorTails) {
|
||||
if(WorldConfig.enableMeteorTails) {
|
||||
ExplosionLarge.spawnParticles(worldObj, posX, posY + 5, posZ, 75);
|
||||
ExplosionLarge.spawnParticles(worldObj, posX + 5, posY, posZ, 75);
|
||||
ExplosionLarge.spawnParticles(worldObj, posX - 5, posY, posZ, 75);
|
||||
@ -49,7 +49,7 @@ public class EntityMeteor extends Entity {
|
||||
this.setDead();
|
||||
}
|
||||
|
||||
if(GeneralConfig.enableMeteorTails && worldObj.isRemote) {
|
||||
if(WorldConfig.enableMeteorTails && worldObj.isRemote) {
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "exhaust");
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.entity.mob.EntityDuck;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
@ -63,14 +64,22 @@ public class HbmLivingProps implements IExtendedEntityProperties {
|
||||
|
||||
/// RADIATION ///
|
||||
public static float getRadiation(EntityLivingBase entity) {
|
||||
if(!RadiationConfig.enableContamination)
|
||||
return 0;
|
||||
|
||||
return getData(entity).radiation;
|
||||
}
|
||||
|
||||
public static void setRadiation(EntityLivingBase entity, float rad) {
|
||||
getData(entity).radiation = rad;
|
||||
if(RadiationConfig.enableContamination)
|
||||
getData(entity).radiation = rad;
|
||||
}
|
||||
|
||||
public static void incrementRadiation(EntityLivingBase entity, float rad) {
|
||||
|
||||
if(!RadiationConfig.enableContamination)
|
||||
return;
|
||||
|
||||
HbmLivingProps data = getData(entity);
|
||||
float radiation = getData(entity).radiation + rad;
|
||||
|
||||
|
||||
@ -117,7 +117,7 @@ public class BossSpawnHandler {
|
||||
}
|
||||
}
|
||||
|
||||
if(GeneralConfig.enableMeteorStrikes && !world.isRemote) {
|
||||
if(WorldConfig.enableMeteorStrikes && !world.isRemote) {
|
||||
meteorUpdate(world);
|
||||
}
|
||||
|
||||
@ -198,7 +198,7 @@ public class BossSpawnHandler {
|
||||
MainRegistry.logger.info("Ended meteor shower.");
|
||||
}
|
||||
|
||||
if(meteorRand.nextInt(WorldConfig.meteorStrikeChance * 100) == 0 && GeneralConfig.enableMeteorShowers) {
|
||||
if(meteorRand.nextInt(WorldConfig.meteorStrikeChance * 100) == 0 && WorldConfig.enableMeteorShowers) {
|
||||
meteorShower = (int)(WorldConfig.meteorShowerDuration * 0.75 + WorldConfig.meteorShowerDuration * 0.25 * meteorRand.nextFloat());
|
||||
|
||||
if(GeneralConfig.enableDebugMode)
|
||||
|
||||
@ -4,6 +4,7 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.config.BombConfig;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
@ -121,15 +122,14 @@ public class EntityEffectHandler {
|
||||
float rad = ChunkRadiationManager.proxy.getRadiation(world, ix, iy, iz);
|
||||
|
||||
if(world.provider.isHellWorld && RadiationConfig.hellRad > 0 && rad < RadiationConfig.hellRad)
|
||||
rad = RadiationConfig.hellRad;
|
||||
rad = (float) RadiationConfig.hellRad;
|
||||
|
||||
if(rad > 0) {
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, rad / 20F);
|
||||
}
|
||||
|
||||
if(entity.worldObj.isRaining() && RadiationConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && entity.worldObj.canBlockSeeTheSky(ix, iy, iz)) {
|
||||
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, RadiationConfig.cont * 0.0005F);
|
||||
if(entity.worldObj.isRaining() && BombConfig.cont > 0 && AuxSavedData.getThunder(entity.worldObj) > 0 && entity.worldObj.canBlockSeeTheSky(ix, iy, iz)) {
|
||||
ContaminationUtil.contaminate(entity, HazardType.RADIATION, ContaminationType.CREATIVE, BombConfig.cont * 0.0005F);
|
||||
}
|
||||
|
||||
if(entity instanceof EntityPlayer && ((EntityPlayer)entity).capabilities.isCreativeMode)
|
||||
@ -441,7 +441,6 @@ public class EntityEffectHandler {
|
||||
ItemStack armorStack = player.inventory.armorInventory[armorSlot];
|
||||
|
||||
if(armorStack != null && armorStack.getItem() instanceof ItemArmor) {
|
||||
ItemArmor armor = (ItemArmor)armorStack.getItem();
|
||||
|
||||
for(int modSlot = 0; modSlot < 8; modSlot++) {
|
||||
ItemStack mod = ArmorModHandler.pryMods(armorStack)[modSlot];
|
||||
@ -472,10 +471,18 @@ public class EntityEffectHandler {
|
||||
if(props.getDashCooldown() <= 0) {
|
||||
|
||||
if(!player.capabilities.isFlying && player.isSneaking() && stamina >= perDash) {
|
||||
|
||||
Vec3 lookingIn = player.getLookVec();
|
||||
|
||||
player.addVelocity(lookingIn.xCoord, 0, lookingIn.zCoord);
|
||||
Vec3 lookingIn = player.getLookVec();
|
||||
Vec3 strafeVec = player.getLookVec();
|
||||
strafeVec.rotateAroundY((float)Math.PI * 0.5F);
|
||||
|
||||
int forward = (int) Math.signum(player.moveForward);
|
||||
int strafe = (int) Math.signum(player.moveStrafing);
|
||||
|
||||
if(forward == 0 && strafe == 0)
|
||||
forward = 1;
|
||||
|
||||
player.addVelocity(lookingIn.xCoord * forward + strafeVec.xCoord * strafe, 0, lookingIn.zCoord * forward + strafeVec.zCoord * strafe);
|
||||
player.playSound("hbm:player.dash", 1.0F, 1.0F);
|
||||
|
||||
props.setDashCooldown(HbmPlayerProps.dashCooldownLength);
|
||||
|
||||
@ -29,7 +29,7 @@ public class MultiblockHandlerXR {
|
||||
if(a == ox && b == oy && c == oz)
|
||||
continue;
|
||||
|
||||
if(!world.getBlock(a, b, c).canPlaceBlockAt(world, a, b, c)) {
|
||||
if(!world.getBlock(a, b, c).isReplaceable(world, a, b, c)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
@ -41,7 +41,7 @@ public class Gun12GaugeFactory {
|
||||
|
||||
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("\"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>();
|
||||
|
||||
@ -10,6 +10,7 @@ import com.hbm.handler.BulletConfiguration;
|
||||
import com.hbm.interfaces.IBulletImpactBehavior;
|
||||
import com.hbm.interfaces.IBulletUpdateBehavior;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
@ -92,6 +93,7 @@ public class GunNPCFactory {
|
||||
bullet.explosive = 0.5F;
|
||||
bullet.setToBolt(BulletConfiguration.BOLT_LACUNAE);
|
||||
bullet.vPFX = "reddust";
|
||||
bullet.damageType = ModDamageSource.s_laser;
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -124,6 +126,7 @@ public class GunNPCFactory {
|
||||
bullet.leadChance = 0;
|
||||
bullet.setToBolt(BulletConfiguration.BOLT_NIGHTMARE);
|
||||
bullet.vPFX = "reddust";
|
||||
bullet.damageType = ModDamageSource.s_laser;
|
||||
|
||||
bullet.bImpact = new IBulletImpactBehavior() {
|
||||
|
||||
@ -210,6 +213,7 @@ public class GunNPCFactory {
|
||||
bullet.leadChance = 0;
|
||||
bullet.doesRicochet = false;
|
||||
bullet.setToBolt(BulletConfiguration.BOLT_WORM);
|
||||
bullet.damageType = ModDamageSource.s_laser;
|
||||
|
||||
return bullet;
|
||||
}
|
||||
@ -226,6 +230,7 @@ public class GunNPCFactory {
|
||||
bullet.leadChance = 0;
|
||||
bullet.doesRicochet = false;
|
||||
bullet.setToBolt(BulletConfiguration.BOLT_LASER);
|
||||
bullet.damageType = ModDamageSource.s_laser;
|
||||
|
||||
return bullet;
|
||||
}
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@ -6,6 +6,11 @@ import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
public class CrackingHandler extends NEIUniversalHandler {
|
||||
|
||||
public CrackingHandler() {
|
||||
super("ntmCracking", "Cracking", ModBlocks.machine_catalytic_cracker, RefineryRecipes.getCrackingRecipesForNEI());
|
||||
super("Cracking", ModBlocks.machine_catalytic_cracker, RefineryRecipes.getCrackingRecipesForNEI());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmCracking";
|
||||
}
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ public class CrystallizerRecipeHandler extends TemplateRecipeHandler {
|
||||
|
||||
public RecipeSet(Object input, ItemStack result) {
|
||||
this.input = new PositionedStack(input, 75, 24);
|
||||
this.acid = new PositionedStack(ItemFluidIcon.addQuantity(new ItemStack(ModItems.fluid_icon, 1, Fluids.ACID.ordinal()), TileEntityMachineCrystallizer.acidRequired), 39, 24);
|
||||
this.acid = new PositionedStack(ItemFluidIcon.addQuantity(new ItemStack(ModItems.fluid_icon, 1, Fluids.ACID.getID()), TileEntityMachineCrystallizer.acidRequired), 39, 24);
|
||||
this.result = new PositionedStack(result, 135, 24);
|
||||
}
|
||||
|
||||
@ -78,6 +78,10 @@ public class CrystallizerRecipeHandler extends TemplateRecipeHandler {
|
||||
Map<Object, Object> recipes = CrystallizerRecipes.getRecipes();
|
||||
|
||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
|
||||
if(recipe.getKey() instanceof ItemStack && ((ItemStack)recipe.getKey()).getItem() == ModItems.scrap_plastic)
|
||||
continue;
|
||||
|
||||
this.arecipes.add(new RecipeSet(recipe.getKey(), (ItemStack)recipe.getValue()));
|
||||
}
|
||||
|
||||
@ -126,7 +130,7 @@ public class CrystallizerRecipeHandler extends TemplateRecipeHandler {
|
||||
for (Map.Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(ingredient, ItemFluidIcon.addQuantity(
|
||||
new ItemStack(ModItems.fluid_icon, 1, Fluids.ACID.ordinal()), TileEntityMachineCrystallizer.acidRequired))) {
|
||||
new ItemStack(ModItems.fluid_icon, 1, Fluids.ACID.getID()), TileEntityMachineCrystallizer.acidRequired))) {
|
||||
|
||||
if(recipe.getKey() instanceof ItemStack) {
|
||||
this.arecipes.add(new RecipeSet(recipe.getKey(), (ItemStack)recipe.getValue()));
|
||||
|
||||
@ -6,6 +6,11 @@ import com.hbm.inventory.recipes.RefineryRecipes;
|
||||
public class FractioningHandler extends NEIUniversalHandler {
|
||||
|
||||
public FractioningHandler() {
|
||||
super("ntmFractioning", "Fractioning", ModBlocks.machine_fraction_tower, RefineryRecipes.getFractionRecipesForNEI());
|
||||
super("Fractioning", ModBlocks.machine_fraction_tower, RefineryRecipes.getFractionRecipesForNEI());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmFractioning";
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,11 @@ import com.hbm.inventory.recipes.LiquefactionRecipes;
|
||||
public class LiquefactionHandler extends NEIUniversalHandler {
|
||||
|
||||
public LiquefactionHandler() {
|
||||
super("ntmLiquefaction", "Liquefaction", ModBlocks.machine_liquefactor, LiquefactionRecipes.getRecipes());
|
||||
super("Liquefaction", ModBlocks.machine_liquefactor, LiquefactionRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmLiquefaction";
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,11 +2,12 @@ package com.hbm.handler.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -16,28 +17,32 @@ import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
|
||||
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
/// SETUP ///
|
||||
public final String display;
|
||||
public final String key;
|
||||
public final ItemStack[] machine;
|
||||
public final HashMap<Object, Object> recipes;
|
||||
/// SETUP ///
|
||||
|
||||
public NEIUniversalHandler(String key, String display, ItemStack machine[], HashMap recipes) {
|
||||
this.key = key;
|
||||
public NEIUniversalHandler(String display, ItemStack machine[], HashMap recipes) {
|
||||
this.display = display;
|
||||
this.machine = machine;
|
||||
this.recipes = recipes;
|
||||
}
|
||||
|
||||
public NEIUniversalHandler(String key, String display, ItemStack machine, HashMap recipes) { this(key, display, new ItemStack[]{machine}, recipes); }
|
||||
public NEIUniversalHandler(String key, String display, Item machine, HashMap recipes) { this(key, display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String key, String display, Block machine, HashMap recipes) { this(key, display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String display, ItemStack machine, HashMap recipes) { this(display, new ItemStack[]{machine}, recipes); }
|
||||
public NEIUniversalHandler(String display, Item machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
public NEIUniversalHandler(String display, Block machine, HashMap recipes) { this(display, new ItemStack(machine), recipes); }
|
||||
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
@ -109,7 +114,7 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if(outputId.equals(key)) {
|
||||
if(outputId.equals(getKey())) {
|
||||
|
||||
for(Entry<Object, Object> recipe : recipes.entrySet()) {
|
||||
ItemStack[][] ins = InventoryUtil.extractObject(recipe.getKey());
|
||||
@ -143,9 +148,8 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
|
||||
if(inputId.equals(key)) {
|
||||
loadCraftingRecipes(key, new Object[0]);
|
||||
if(inputId.equals(getKey())) {
|
||||
loadCraftingRecipes(getKey(), new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
@ -169,4 +173,18 @@ public abstract class NEIUniversalHandler extends TemplateRecipeHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||
//guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(147, 1, 18, 18), getKey()));
|
||||
//transferRectsGui.add(new RecipeTransferRect(new Rectangle(18 * 2 + 2, 89 - 7 - 11, 18 * 5 - 4, 18 + 16), key));
|
||||
//guiGui.add(GUIMachineAssembler.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
//RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
|
||||
public abstract String getKey();
|
||||
}
|
||||
|
||||
@ -8,11 +8,16 @@ import net.minecraft.item.ItemStack;
|
||||
public class RTGRecipeHandler extends NEIUniversalHandler {
|
||||
|
||||
public RTGRecipeHandler() {
|
||||
super("ntmRTG", "RTG", new ItemStack[] {
|
||||
super("RTG", new ItemStack[] {
|
||||
new ItemStack(ModBlocks.machine_rtg_grey),
|
||||
new ItemStack(ModBlocks.machine_difurnace_rtg_off),
|
||||
new ItemStack(ModBlocks.machine_industrial_generator),
|
||||
new ItemStack(ModBlocks.machine_rtg_furnace_off)
|
||||
}, ItemRTGPellet.getRecipeMap());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmRTG";
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,7 +8,6 @@ import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.gui.GUIRadiolysis;
|
||||
import com.hbm.inventory.recipes.RadiolysisRecipes;
|
||||
import com.hbm.lib.RefStrings;
|
||||
@ -16,8 +15,6 @@ import com.hbm.lib.RefStrings;
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRect;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler.RecipeTransferRectHandler;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
|
||||
@ -10,12 +10,10 @@ import java.util.Map;
|
||||
import com.hbm.inventory.gui.GUISILEX;
|
||||
import com.hbm.inventory.recipes.SILEXRecipes;
|
||||
import com.hbm.inventory.recipes.SILEXRecipes.SILEXRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemFELCrystal.EnumWavelengths;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.I18nUtil;
|
||||
import com.hbm.util.WeightedRandomObject;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
@ -23,7 +21,6 @@ import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
|
||||
@ -3,9 +3,16 @@ package com.hbm.handler.nei;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.recipes.SolidificationRecipes;
|
||||
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
|
||||
public class SolidificationHandler extends NEIUniversalHandler {
|
||||
|
||||
public SolidificationHandler() {
|
||||
super("ntmSolidification", "Solidification", ModBlocks.machine_solidifier, SolidificationRecipes.getRecipes());
|
||||
super("Solidification", ModBlocks.machine_solidifier, SolidificationRecipes.getRecipes());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmSolidification";
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,6 +6,11 @@ import com.hbm.tileentity.machine.TileEntityReactorZirnox;
|
||||
public class ZirnoxRecipeHandler extends NEIUniversalHandler {
|
||||
|
||||
public ZirnoxRecipeHandler() {
|
||||
super("ntmZirnox", "ZIRNOX", ModBlocks.reactor_zirnox, TileEntityReactorZirnox.fuelMap);
|
||||
super("ZIRNOX", ModBlocks.reactor_zirnox, TileEntityReactorZirnox.fuelMap);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getKey() {
|
||||
return "ntmZirnox";
|
||||
}
|
||||
}
|
||||
|
||||
@ -16,27 +16,27 @@ public class ChunkRadiationManager {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldLoad(WorldEvent.Load event) {
|
||||
proxy.receiveWorldLoad(event);
|
||||
if(RadiationConfig.enableChunkRads) proxy.receiveWorldLoad(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onWorldUnload(WorldEvent.Unload event) {
|
||||
proxy.receiveWorldUnload(event);
|
||||
if(RadiationConfig.enableChunkRads) proxy.receiveWorldUnload(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkLoad(ChunkDataEvent.Load event) {
|
||||
proxy.receiveChunkLoad(event);
|
||||
if(RadiationConfig.enableChunkRads) proxy.receiveChunkLoad(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkSave(ChunkDataEvent.Save event) {
|
||||
proxy.receiveChunkSave(event);
|
||||
if(RadiationConfig.enableChunkRads) proxy.receiveChunkSave(event);
|
||||
}
|
||||
|
||||
@SubscribeEvent
|
||||
public void onChunkUnload(ChunkEvent.Unload event) {
|
||||
proxy.receiveChunkUnload(event);
|
||||
if(RadiationConfig.enableChunkRads) proxy.receiveChunkUnload(event);
|
||||
}
|
||||
|
||||
int eggTimer = 0;
|
||||
@ -44,7 +44,7 @@ public class ChunkRadiationManager {
|
||||
@SubscribeEvent
|
||||
public void updateSystem(TickEvent.ServerTickEvent event) {
|
||||
|
||||
if(event.side == Side.SERVER && event.phase == Phase.END) {
|
||||
if(RadiationConfig.enableChunkRads && event.side == Side.SERVER && event.phase == Phase.END) {
|
||||
|
||||
eggTimer++;
|
||||
|
||||
|
||||
@ -6,7 +6,7 @@ import static com.hbm.inventory.OreDictManager.*;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.hazard.modifier.*;
|
||||
import com.hbm.hazard.transformer.HazardTransformerRadiationNBT;
|
||||
import com.hbm.hazard.transformer.*;
|
||||
import com.hbm.hazard.type.*;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBreedingRod.BreedingRodType;
|
||||
@ -153,23 +153,18 @@ public class HazardRegistry {
|
||||
HazardSystem.register(Items.pumpkin_pie, makeData(EXPLOSIVE, 1F));
|
||||
|
||||
HazardSystem.register(ball_dynamite, makeData(EXPLOSIVE, 2F));
|
||||
HazardSystem.register(ball_tnt, makeData(EXPLOSIVE, 3F));
|
||||
HazardSystem.register(ingot_semtex, makeData(EXPLOSIVE, 5F));
|
||||
HazardSystem.register(ingot_c4, makeData(EXPLOSIVE, 5F));
|
||||
HazardSystem.register(stick_dynamite, makeData(EXPLOSIVE, 1F));
|
||||
HazardSystem.register(stick_tnt, makeData(EXPLOSIVE, 1.5F));
|
||||
HazardSystem.register(stick_semtex, makeData(EXPLOSIVE, 2.5F));
|
||||
HazardSystem.register(stick_c4, makeData(EXPLOSIVE, 2.5F));
|
||||
|
||||
HazardSystem.register(cordite, makeData(EXPLOSIVE, 2F));
|
||||
HazardSystem.register(ballistite, makeData(EXPLOSIVE, 1F));
|
||||
|
||||
HazardSystem.register("dustCoal", makeData(COAL, powder));
|
||||
HazardSystem.register("dustTinyCoal", makeData(COAL, powder_tiny));
|
||||
HazardSystem.register("dustLignite", makeData(COAL, powder));
|
||||
HazardSystem.register("dustTinyLignite", makeData(COAL, powder_tiny));
|
||||
|
||||
HazardSystem.register(block_semtex, makeData(EXPLOSIVE, 25F));
|
||||
HazardSystem.register(block_c4, makeData(EXPLOSIVE, 25F));
|
||||
HazardSystem.register(cordite, makeData(EXPLOSIVE, 2F));
|
||||
HazardSystem.register(ballistite, makeData(EXPLOSIVE, 1F));
|
||||
|
||||
HazardSystem.register(insert_polonium, makeData(RADIATION, 100F));
|
||||
|
||||
@ -474,6 +469,7 @@ public class HazardRegistry {
|
||||
|
||||
public static void registerTrafos() {
|
||||
HazardSystem.trafos.add(new HazardTransformerRadiationNBT());
|
||||
HazardSystem.trafos.add(new HazardTransformerRadiationME());
|
||||
}
|
||||
|
||||
private static HazardData makeData() { return new HazardData(); }
|
||||
|
||||
@ -0,0 +1,33 @@
|
||||
package com.hbm.hazard.transformer;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.hazard.HazardEntry;
|
||||
import com.hbm.hazard.HazardRegistry;
|
||||
import com.hbm.hazard.HazardSystem;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class HazardTransformerRadiationME extends HazardTransformerBase {
|
||||
|
||||
@Override
|
||||
public void transformPre(ItemStack stack, List<HazardEntry> entries) { }
|
||||
|
||||
@Override
|
||||
public void transformPost(ItemStack stack, List<HazardEntry> entries) {
|
||||
|
||||
if(stack.getItem().getClass().getName().equals("appeng.items.storage.ItemBasicStorageCell")) {
|
||||
List<ItemStack> stacks = Compat.scrapeItemFromME(stack);
|
||||
float radiation = 0;
|
||||
|
||||
for(ItemStack held : stacks) {
|
||||
radiation += HazardSystem.getHazardLevelFromStack(held, HazardRegistry.RADIATION);
|
||||
}
|
||||
|
||||
if(radiation > 0) {
|
||||
entries.add(new HazardEntry(HazardRegistry.RADIATION, radiation));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -21,7 +21,7 @@ public class HazardTypeBlinding extends HazardTypeBase {
|
||||
public void onUpdate(EntityLivingBase target, float level, ItemStack stack) {
|
||||
|
||||
if(!ArmorRegistry.hasProtection(target, 3, HazardClass.LIGHT)) {
|
||||
target.addPotionEffect(new PotionEffect(Potion.blindness.id, (int)level, 0));
|
||||
target.addPotionEffect(new PotionEffect(Potion.blindness.id, (int)Math.ceil(level), 0));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -55,6 +55,9 @@ public class HazardTypeRadiation extends HazardTypeBase {
|
||||
|
||||
level = HazardModifier.evalAllModifiers(stack, player, level, modifiers);
|
||||
|
||||
if(level < 1e-5)
|
||||
return;
|
||||
|
||||
list.add(EnumChatFormatting.GREEN + "[" + I18nUtil.resolveKey("trait.radioactive") + "]");
|
||||
String rad = "" + (Math.floor(level* 1000) / 1000);
|
||||
list.add(EnumChatFormatting.YELLOW + (rad + "RAD/s"));
|
||||
|
||||
@ -126,16 +126,19 @@ public class FluidTank {
|
||||
}
|
||||
|
||||
if(slots[in] != null && inType.getName().equals(type.getName()) && fluid + FluidContainerRegistry.getFluidContent(slots[in], type) <= maxFluid) {
|
||||
|
||||
ItemStack emptyContainer = FluidContainerRegistry.getEmptyContainer(slots[in]);
|
||||
|
||||
if(slots[out] == null) {
|
||||
fluid += FluidContainerRegistry.getFluidContent(slots[in], type);
|
||||
slots[out] = FluidContainerRegistry.getEmptyContainer(slots[in]);
|
||||
slots[out] = emptyContainer;
|
||||
slots[in].stackSize--;
|
||||
if(slots[in].stackSize <= 0)
|
||||
slots[in] = null;
|
||||
} else if(slots[out] != null && (FluidContainerRegistry.getEmptyContainer(slots[in]) == null || slots[out].getItem() == FluidContainerRegistry.getEmptyContainer(slots[in]).getItem()) && slots[out].stackSize < slots[out].getMaxStackSize()) {
|
||||
} else if(slots[out] != null && (emptyContainer == null || (slots[out].getItem() == emptyContainer.getItem() && slots[out].getItemDamage() == emptyContainer.getItemDamage() && slots[out].stackSize < slots[out].getMaxStackSize()))) {
|
||||
fluid += FluidContainerRegistry.getFluidContent(slots[in], type);
|
||||
|
||||
if(FluidContainerRegistry.getEmptyContainer(slots[in]) != null)
|
||||
if(emptyContainer != null)
|
||||
slots[out].stackSize++;
|
||||
|
||||
slots[in].stackSize--;
|
||||
@ -213,13 +216,14 @@ public class FluidTank {
|
||||
return;
|
||||
|
||||
if(slots[in] != null && fluid - FluidContainerRegistry.getFluidContent(full, type) >= 0) {
|
||||
ItemStack fullContainer = FluidContainerRegistry.getFullContainer(slots[in], type);
|
||||
if(slots[out] == null) {
|
||||
fluid -= FluidContainerRegistry.getFluidContent(full, type);
|
||||
slots[out] = full.copy();
|
||||
slots[in].stackSize--;
|
||||
if(slots[in].stackSize <= 0)
|
||||
slots[in] = null;
|
||||
} else if(slots[out] != null && slots[out].getItem() == FluidContainerRegistry.getFullContainer(slots[in], type).getItem() && slots[out].stackSize < slots[out].getMaxStackSize()) {
|
||||
} else if(slots[out] != null && slots[out].getItem() == fullContainer.getItem() && slots[out].getItemDamage() == fullContainer.getItemDamage() && slots[out].stackSize < slots[out].getMaxStackSize()) {
|
||||
fluid -= FluidContainerRegistry.getFluidContent(full, type);
|
||||
slots[in].stackSize--;
|
||||
if(slots[in].stackSize <= 0)
|
||||
|
||||
@ -10,6 +10,7 @@ import static com.hbm.items.ModItems.*;
|
||||
import static com.hbm.blocks.ModBlocks.*;
|
||||
import static com.hbm.inventory.OreDictManager.DictFrame.*;
|
||||
|
||||
import com.hbm.blocks.BlockEnums.EnumStoneType;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.hazard.HazardData;
|
||||
import com.hbm.hazard.HazardEntry;
|
||||
@ -78,6 +79,8 @@ public class OreDictManager {
|
||||
public static final String KEY_TOOL_SCREWDRIVER = "ntmscrewdriver";
|
||||
public static final String KEY_TOOL_HANDDRILL = "ntmhanddrill";
|
||||
public static final String KEY_TOOL_CHEMISTRYSET = "ntmchemistryset";
|
||||
|
||||
public static final String KEY_CIRCUIT_BISMUTH = "circuitVersatile";
|
||||
|
||||
/*
|
||||
* PREFIXES
|
||||
@ -304,11 +307,11 @@ public class OreDictManager {
|
||||
AC227 .rad(HazardRegistry.ac227) .nugget(nugget_actinium) .billet(billet_actinium) .ingot(ingot_actinium) .dust(powder_actinium) .block(block_actinium) .dustSmall(powder_actinium_tiny);
|
||||
CO60 .rad(HazardRegistry.co60) .hot(1) .nugget(nugget_co60) .billet(billet_co60) .ingot(ingot_co60) .dust(powder_co60);
|
||||
AU198 .rad(HazardRegistry.au198) .hot(5) .nugget(nugget_au198) .billet(billet_au198) .ingot(ingot_au198) .dust(powder_au198);
|
||||
PB209 .rad(HazardRegistry.pb209) .blinding(3F) .hot(7) .nugget(nugget_pb209) .billet(billet_pb209) .ingot(ingot_pb209);
|
||||
SA326 .rad(HazardRegistry.sa326) .blinding(3F) .nugget(nugget_schrabidium) .billet(billet_schrabidium) .ingot(ingot_schrabidium) .dust(powder_schrabidium) .plate(plate_schrabidium) .block(block_schrabidium) .ore(ore_schrabidium, ore_gneiss_schrabidium, ore_nether_schrabidium) .oreNether(ore_nether_schrabidium);
|
||||
SA327 .rad(HazardRegistry.sa327) .blinding(3F) .nugget(nugget_solinium) .billet(billet_solinium) .ingot(ingot_solinium) .block(block_solinium);
|
||||
SBD .rad(HazardRegistry.sb) .blinding(1F) .ingot(ingot_schrabidate) .dust(powder_schrabidate) .block(block_schrabidate);
|
||||
SRN .rad(HazardRegistry.sr) .blinding(1F) .ingot(ingot_schraranium) .block(block_schraranium);
|
||||
PB209 .rad(HazardRegistry.pb209) .blinding(50F) .hot(7) .nugget(nugget_pb209) .billet(billet_pb209) .ingot(ingot_pb209);
|
||||
SA326 .rad(HazardRegistry.sa326) .blinding(50F) .nugget(nugget_schrabidium) .billet(billet_schrabidium) .ingot(ingot_schrabidium) .dust(powder_schrabidium) .plate(plate_schrabidium) .block(block_schrabidium) .ore(ore_schrabidium, ore_gneiss_schrabidium, ore_nether_schrabidium) .oreNether(ore_nether_schrabidium);
|
||||
SA327 .rad(HazardRegistry.sa327) .blinding(50F) .nugget(nugget_solinium) .billet(billet_solinium) .ingot(ingot_solinium) .block(block_solinium);
|
||||
SBD .rad(HazardRegistry.sb) .blinding(50F) .ingot(ingot_schrabidate) .dust(powder_schrabidate) .block(block_schrabidate);
|
||||
SRN .rad(HazardRegistry.sr) .blinding(50F) .ingot(ingot_schraranium) .block(block_schraranium);
|
||||
GH336 .rad(HazardRegistry.gh336) .nugget(nugget_gh336) .billet(billet_gh336) .ingot(ingot_gh336);
|
||||
|
||||
/*
|
||||
@ -343,13 +346,13 @@ public class OreDictManager {
|
||||
EUPH .nugget(nugget_euphemium) .ingot(ingot_euphemium) .dust(powder_euphemium) .block(block_euphemium);
|
||||
DNT .nugget(nugget_dineutronium) .ingot(ingot_dineutronium) .dust(powder_dineutronium) .block(block_dineutronium);
|
||||
FIBER .ingot(ingot_fiberglass) .block(block_fiberglass);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos);
|
||||
ASBESTOS .asbestos(1F) .ingot(ingot_asbestos) .dust(powder_asbestos) .block(block_asbestos) .ore(ore_asbestos, ore_gneiss_asbestos, basalt_asbestos, DictFrame.fromOne(stone_resource, EnumStoneType.ASBESTOS));
|
||||
OSMIRIDIUM .nugget(nugget_osmiridium) .ingot(ingot_osmiridium);
|
||||
|
||||
/*
|
||||
* DUST AND GEM ORES
|
||||
*/
|
||||
S .dust(sulfur) .block(block_sulfur) .ore(ore_sulfur, ore_nether_sulfur, basalt_sulfur, ore_meteor_sulfur) .oreNether(ore_nether_sulfur);
|
||||
S .dust(sulfur) .block(block_sulfur) .ore(ore_sulfur, ore_nether_sulfur, basalt_sulfur, ore_meteor_sulfur, DictFrame.fromOne(stone_resource, EnumStoneType.SULFUR)) .oreNether(ore_nether_sulfur);
|
||||
KNO .dust(niter) .block(block_niter) .ore(ore_niter);
|
||||
F .dust(fluorite) .block(block_fluorite) .ore(ore_fluorite, basalt_fluorite);
|
||||
LIGNITE .gem(lignite) .dust(powder_lignite) .ore(ore_lignite);
|
||||
@ -432,6 +435,9 @@ public class OreDictManager {
|
||||
OreDictionary.registerOre(KEY_TOOL_HANDDRILL, new ItemStack(hand_drill_desh, 1, OreDictionary.WILDCARD_VALUE));
|
||||
OreDictionary.registerOre(KEY_TOOL_CHEMISTRYSET, new ItemStack(chemistry_set, 1, OreDictionary.WILDCARD_VALUE));
|
||||
OreDictionary.registerOre(KEY_TOOL_CHEMISTRYSET, new ItemStack(chemistry_set_boron, 1, OreDictionary.WILDCARD_VALUE));
|
||||
|
||||
OreDictionary.registerOre(KEY_CIRCUIT_BISMUTH, circuit_bismuth);
|
||||
OreDictionary.registerOre(KEY_CIRCUIT_BISMUTH, circuit_arsenic);
|
||||
|
||||
OreDictionary.registerOre(getReflector(), neutron_reflector);
|
||||
OreDictionary.registerOre("oreRareEarth", ore_rare);
|
||||
@ -572,9 +578,15 @@ public class OreDictManager {
|
||||
public static ItemStack fromOne(Item item, Enum en) {
|
||||
return new ItemStack(item, 1, en.ordinal());
|
||||
}
|
||||
public static ItemStack fromOne(Block block, Enum en) {
|
||||
return new ItemStack(block, 1, en.ordinal());
|
||||
}
|
||||
public static ItemStack fromOne(Item item, Enum en, int stacksize) {
|
||||
return new ItemStack(item, stacksize, en.ordinal());
|
||||
}
|
||||
public static ItemStack fromOne(Block block, Enum en, int stacksize) {
|
||||
return new ItemStack(block, stacksize, en.ordinal());
|
||||
}
|
||||
/** Same as fromOne but with an array of ItemStacks. The array type is Object[] so that the ODM methods work with it. Generates ItemStacks for the entire enum class. */
|
||||
public static Object[] fromAll(Item item, Class<? extends Enum> en) {
|
||||
Enum[] vals = en.getEnumConstants();
|
||||
|
||||
@ -114,15 +114,15 @@ public class Fluids {
|
||||
ULTRAHOTSTEAM = new FluidType( "ULTRAHOTSTEAM", 0xE39393, 4, 0, 0, EnumSymbol.NONE).setTemp(600);
|
||||
COOLANT = new FluidType( "COOLANT", 0xd8fcff, 1, 0, 0, EnumSymbol.NONE);
|
||||
LAVA = new FluidType( "LAVA", 0xFF3300, 4, 0, 0, EnumSymbol.NOWATER).setTemp(1200);
|
||||
DEUTERIUM = new FluidTypeCombustible( "DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE);
|
||||
TRITIUM = new FluidTypeCombustible( "TRITIUM", 0x000099, 3, 4, 0, EnumSymbol.RADIATION);
|
||||
DEUTERIUM = new FluidTypeCombustible( "DEUTERIUM", 0x0000FF, 3, 4, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 10_000).setHeatEnergy(5_000);
|
||||
TRITIUM = new FluidTypeCombustible( "TRITIUM", 0x000099, 3, 4, 0, EnumSymbol.RADIATION).setCombustionEnergy(FuelGrade.HIGH, 10_000).setHeatEnergy(5_000);
|
||||
OIL = new FluidTypeFlammable( "OIL", 0x020202, 2, 1, 0, EnumSymbol.NONE).addContainers(0x424242, ExtContainer.CANISTER);
|
||||
HOTOIL = new FluidTypeFlammable( "HOTOIL", 0x300900, 2, 3, 0, EnumSymbol.NONE).setTemp(350);
|
||||
HEAVYOIL = new FluidTypeFlammable( "HEAVYOIL", 0x141312, 2, 1, 0, EnumSymbol.NONE).addContainers(0x513F39, ExtContainer.CANISTER);
|
||||
BITUMEN = new FluidType( "BITUMEN", 0x1f2426, 2, 0, 0, EnumSymbol.NONE).addContainers(0x5A5877, ExtContainer.CANISTER);
|
||||
SMEAR = new FluidTypeFlammable( "SMEAR", 0x190f01, 2, 1, 0, EnumSymbol.NONE).setHeatEnergy(50_000).addContainers(0x624F3B, ExtContainer.CANISTER);
|
||||
HEATINGOIL = new FluidTypeCombustible( "HEATINGOIL", 0x211806, 2, 2, 0, EnumSymbol.NONE).setHeatEnergy(75_000).addContainers(0x694235, ExtContainer.CANISTER); //TODO: and so forth
|
||||
RECLAIMED = new FluidTypeCombustible( "RECLAIMED", 0x332b22, 2, 2, 0, EnumSymbol.NONE).setHeatEnergy(100_000).addContainers(0xF65723, ExtContainer.CANISTER);
|
||||
HEATINGOIL = new FluidTypeCombustible( "HEATINGOIL", 0x211806, 2, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.LOW, 100_000).setHeatEnergy(150_000).addContainers(0x694235, ExtContainer.CANISTER); //TODO: and so forth
|
||||
RECLAIMED = new FluidTypeCombustible( "RECLAIMED", 0x332b22, 2, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.LOW, 200_000).setHeatEnergy(100_000).addContainers(0xF65723, ExtContainer.CANISTER);
|
||||
PETROIL = new FluidTypeCombustible( "PETROIL", 0x44413d, 1, 3, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.MEDIUM, 300_000).setHeatEnergy(125_000).addContainers(0x2369F6, ExtContainer.CANISTER);
|
||||
LUBRICANT = new FluidType( "LUBRICANT", 0x606060, 2, 1, 0, EnumSymbol.NONE).addContainers(0xF1CC05, ExtContainer.CANISTER);
|
||||
NAPHTHA = new FluidTypeFlammable( "NAPHTHA", 0x595744, 2, 1, 0, EnumSymbol.NONE).addContainers(0x5F6D44, ExtContainer.CANISTER);
|
||||
@ -173,8 +173,8 @@ public class Fluids {
|
||||
NAPHTHA_CRACK = new FluidTypeFlammable( "NAPHTHA_CRACK", 0x595744, 2, 1, 0, EnumSymbol.NONE);
|
||||
LIGHTOIL_CRACK = new FluidTypeFlammable( "LIGHTOIL_CRACK", 0x8c7451, 1, 2, 0, EnumSymbol.NONE);
|
||||
DIESEL_CRACK = new FluidTypeCombustible( "DIESEL_CRACK", 0xf2eed5, 1, 2, 0, EnumSymbol.NONE).setCombustionEnergy(FuelGrade.HIGH, 450_000).setHeatEnergy(200_000);
|
||||
AROMATICS = new FluidTypeFlammable( "AROMATICS", 0xfffeed, 1, 4, 1, EnumSymbol.NONE);
|
||||
UNSATURATEDS = new FluidTypeFlammable( "UNSATURATEDS", 0xfffeed, 1, 4, 1, EnumSymbol.NONE);
|
||||
AROMATICS = new FluidTypeFlammable( "AROMATICS", 0x68A09A, 1, 4, 1, EnumSymbol.NONE);
|
||||
UNSATURATEDS = new FluidTypeFlammable( "UNSATURATEDS", 0x628FAE, 1, 4, 1, EnumSymbol.NONE);
|
||||
SALIENT = new FluidType(69, "SALIENT", 0x457F2D, 0, 0, 0, EnumSymbol.NONE);
|
||||
XPJUICE = new FluidType( "XPJUICE", 0xBBFF09, 0, 0, 0, EnumSymbol.NONE);
|
||||
ENDERJUICE = new FluidType( "ENDERJUICE", 0x127766, 0, 0, 0, EnumSymbol.NONE);
|
||||
|
||||
@ -164,7 +164,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.entanglement_kit, 1), new AStack[] {new ComparableStack(ModItems.coil_magnetized_tungsten, 6), new OreDictStack(PB.plate(), 16), new OreDictStack(OreDictManager.getReflector(), 4), new ComparableStack(ModItems.singularity_counter_resonant, 1), new ComparableStack(ModItems.singularity_super_heated, 1), new ComparableStack(ModItems.powder_power, 4), },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_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.getID()), 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 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 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 OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 8), },200);
|
||||
@ -178,6 +178,7 @@ 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_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_mirv, 1), new AStack[] {new OreDictStack(TI.plate(), 20), new OreDictStack(STEEL.plate(), 12), new OreDictStack(PU239.ingot(), 1), new OreDictStack(ANY_HIGHEXPLOSIVE.ingot(), 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_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);
|
||||
@ -188,15 +189,15 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_medium, 1), new AStack[] {new ComparableStack(ModItems.thruster_small, 1), new OreDictStack(STEEL.plate(), 2), new ComparableStack(ModItems.hull_small_steel, 1), new ComparableStack(ModItems.hull_big_steel, 1), new ComparableStack(ModItems.wire_copper, 4), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_large, 1), new AStack[] {new ComparableStack(ModItems.thruster_medium, 1), new OreDictStack(STEEL.plate(), 4), new ComparableStack(ModItems.hull_big_steel, 2), new ComparableStack(ModItems.wire_red_copper, 4), },200);
|
||||
makeRecipe(new ComparableStack(ModItems.thruster_nuclear, 1), new AStack[] {new ComparableStack(ModItems.thruster_large, 1), new ComparableStack(ModItems.tank_steel, 2), new ComparableStack(ModBlocks.deco_pipe_quad, 3), new ComparableStack(ModItems.board_copper, 6), new ComparableStack(ModItems.motor, 1), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModBlocks.reactor_research, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_base, 1), new AStack[] {new ComparableStack(ModItems.thruster_large, 1), new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.hull_big_titanium, 3), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.ordinal()), new ComparableStack(ModItems.photo_panel, 24), new ComparableStack(ModItems.board_copper, 12), new ComparableStack(ModItems.circuit_gold, 6), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },500);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_base, 1), new AStack[] {new ComparableStack(ModItems.thruster_large, 1), new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.hull_big_titanium, 3), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.getID()), new ComparableStack(ModItems.photo_panel, 24), new ComparableStack(ModItems.board_copper, 12), new ComparableStack(ModItems.circuit_gold, 6), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },500);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_mapper, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(STEEL.plate(), 6), new ComparableStack(ModItems.hull_small_steel, 3), new ComparableStack(ModItems.plate_desh, 2), new ComparableStack(ModItems.circuit_gold, 2), new ComparableStack(ModItems.plate_polymer, 12), new OreDictStack(REDSTONE.dust(), 6), new ComparableStack(Items.diamond, 1), new ComparableStack(Blocks.glass_pane, 6), },400);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_scanner, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 6), new OreDictStack(TI.plate(), 32), new ComparableStack(ModItems.plate_desh, 6), new ComparableStack(ModItems.magnetron, 6), new ComparableStack(ModItems.coil_advanced_torus, 2), new ComparableStack(ModItems.circuit_gold, 6), new ComparableStack(ModItems.plate_polymer, 6), new ComparableStack(Items.diamond, 1), },400);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_radar, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 4), new OreDictStack(TI.plate(), 32), new ComparableStack(ModItems.magnetron, 12), new ComparableStack(ModItems.plate_polymer, 16), new ComparableStack(ModItems.wire_red_copper, 16), new ComparableStack(ModItems.coil_gold, 3), new ComparableStack(ModItems.circuit_gold, 5), new ComparableStack(Items.diamond, 1), },400);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_laser, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 12), new OreDictStack(W.ingot(), 16), new OreDictStack(ANY_PLASTIC.ingot(), 6), new ComparableStack(ModItems.plate_polymer, 16), new ComparableStack(ModItems.board_copper, 24), new ComparableStack(ModItems.circuit_targeting_tier5, 2), new OreDictStack(REDSTONE.dust(), 16), new ComparableStack(Items.diamond, 5), new ComparableStack(Blocks.glass_pane, 16), },450);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_head_resonator, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 32), new OreDictStack(ANY_PLASTIC.ingot(), 48), new ComparableStack(ModItems.plate_polymer, 8), new ComparableStack(ModItems.crystal_xen, 1), new OreDictStack(STAR.ingot(), 7), new ComparableStack(ModItems.circuit_targeting_tier5, 6), new ComparableStack(ModItems.circuit_targeting_tier6, 2), },1000);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_foeq, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new OreDictStack(TI.plate(), 12), new ComparableStack(ModItems.plate_desh, 8), new ComparableStack(ModItems.hull_big_titanium, 3), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.HYDROGEN.ordinal()), new ComparableStack(ModItems.photo_panel, 16), new ComparableStack(ModItems.thruster_nuclear, 1), new ComparableStack(ModItems.ingot_uranium_fuel, 6), new ComparableStack(ModItems.circuit_targeting_tier5, 6), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },1200);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_miner, 1), new AStack[] {new OreDictStack(BIGMT.plate(), 24), new ComparableStack(ModItems.plate_desh, 8), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.drill_titanium, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.ordinal()), new ComparableStack(ModItems.thruster_small, 1), new ComparableStack(ModItems.photo_panel, 12), new ComparableStack(ModItems.centrifuge_element, 4), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.plate_polymer, 12), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_lunar_miner, 1), new AStack[] {new ComparableStack(ModItems.ingot_meteorite, 4), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.motor_desh, 2), new ComparableStack(ModItems.drill_titanium, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.ordinal()), new ComparableStack(ModItems.thruster_small, 1), new ComparableStack(ModItems.photo_panel, 12), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.plate_polymer, 12), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_foeq, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new OreDictStack(TI.plate(), 12), new ComparableStack(ModItems.plate_desh, 8), new ComparableStack(ModItems.hull_big_titanium, 3), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.HYDROGEN.getID()), new ComparableStack(ModItems.photo_panel, 16), new ComparableStack(ModItems.thruster_nuclear, 1), new ComparableStack(ModItems.ingot_uranium_fuel, 6), new ComparableStack(ModItems.circuit_targeting_tier5, 6), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },1200);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_miner, 1), new AStack[] {new OreDictStack(BIGMT.plate(), 24), new ComparableStack(ModItems.plate_desh, 8), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.drill_titanium, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.getID()), new ComparableStack(ModItems.thruster_small, 1), new ComparableStack(ModItems.photo_panel, 12), new ComparableStack(ModItems.centrifuge_element, 4), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.plate_polymer, 12), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.sat_lunar_miner, 1), new AStack[] {new ComparableStack(ModItems.ingot_meteorite, 4), new ComparableStack(ModItems.plate_desh, 4), new ComparableStack(ModItems.motor_desh, 2), new ComparableStack(ModItems.drill_titanium, 2), new ComparableStack(ModItems.circuit_targeting_tier4, 2), new ComparableStack(ModItems.fluid_barrel_full, 1, Fluids.KEROSENE.getID()), new ComparableStack(ModItems.thruster_small, 1), new ComparableStack(ModItems.photo_panel, 12), new ComparableStack(ModItems.magnetron, 3), new ComparableStack(ModItems.plate_polymer, 12), new ComparableStack(ModItems.battery_lithium_cell_6, 1), },600);
|
||||
makeRecipe(new ComparableStack(ModItems.chopper_head, 1), new AStack[] {new ComparableStack(ModBlocks.reinforced_glass, 2), new ComparableStack(ModBlocks.fwatz_computer, 1), new OreDictStack(CMB.ingot(), 22), new ComparableStack(ModItems.wire_magnetized_tungsten, 4), },300);
|
||||
makeRecipe(new ComparableStack(ModItems.chopper_gun, 1), new AStack[] {new OreDictStack(CMB.plate(), 4), new OreDictStack(CMB.ingot(), 2), new ComparableStack(ModItems.wire_tungsten, 6), new ComparableStack(ModItems.coil_magnetized_tungsten, 1), new ComparableStack(ModItems.motor, 1), },150);
|
||||
makeRecipe(new ComparableStack(ModItems.chopper_torso, 1), new AStack[] {new OreDictStack(CMB.ingot(), 26), new ComparableStack(ModBlocks.fwatz_computer, 1), new ComparableStack(ModItems.wire_magnetized_tungsten, 4), new ComparableStack(ModItems.motor, 2), new ComparableStack(ModItems.chopper_blades, 2), },350);
|
||||
@ -240,7 +241,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModItems.upgrade_health, 1), new AStack[] {new ComparableStack(ModItems.upgrade_template, 1), new ComparableStack(Items.glowstone_dust, 6), new OreDictStack(TI.dust(), 4), },500);
|
||||
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_1, 1), new AStack[] {new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new OreDictStack(DESH.ingot(), 8), new ComparableStack(ModItems.powder_power, 16), new ComparableStack(ModItems.crystal_lithium, 4), new ComparableStack(ModItems.circuit_schrabidium, 1), }, 200);
|
||||
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_2, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_1, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 8), new ComparableStack(ModItems.circuit_tantalium, 16), }, 300);
|
||||
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 16), new ComparableStack(ModItems.circuit_bismuth, 1), }, 500);
|
||||
makeRecipe(new ComparableStack(ModItems.upgrade_overdrive_3, 1), new AStack[] {new ComparableStack(ModItems.upgrade_overdrive_2, 1), new ComparableStack(ModItems.upgrade_afterburn_1, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.upgrade_effect_3, 1), new ComparableStack(ModItems.crystal_lithium, 16), new OreDictStack(KEY_CIRCUIT_BISMUTH), }, 500);
|
||||
makeRecipe(new ComparableStack(ModItems.fuse, 1), new AStack[] {new OreDictStack(STEEL.plate(), 2), new ComparableStack(Blocks.glass_pane, 1), new ComparableStack(ModItems.wire_aluminium, 1), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.redcoil_capacitor, 1), new AStack[] {new OreDictStack(GOLD.plate(), 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_advanced_alloy, 4), new ComparableStack(ModItems.coil_advanced_alloy, 6), new ComparableStack(Blocks.redstone_block, 2), },200);
|
||||
makeRecipe(new ComparableStack(ModItems.titanium_filter, 1), new AStack[] {new OreDictStack(PB.plate(), 3), new ComparableStack(ModItems.fuse, 1), new ComparableStack(ModItems.wire_tungsten, 4), new OreDictStack(TI.plate(), 6), new OreDictStack(U238.ingot(), 2), },200);
|
||||
@ -302,7 +303,7 @@ public class AssemblerRecipes {
|
||||
makeRecipe(new ComparableStack(ModBlocks.fwatz_hatch, 1), new AStack[] {new OreDictStack(W.ingot(), 6), new OreDictStack(CMB.plate(), 4), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.fwatz_conductor, 1), new AStack[] {new OreDictStack(CMB.plate(), 2), new ComparableStack(ModItems.coil_magnetized_tungsten, 5), },250);
|
||||
makeRecipe(new ComparableStack(ModBlocks.fwatz_computer, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), new ComparableStack(ModItems.wire_magnetized_tungsten, 16), new OreDictStack(DIAMOND.dust(), 6), new OreDictStack(MAGTUNG.dust(), 6), new OreDictStack(DESH.dust(), 4), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.fwatz_core, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), new ComparableStack(ModItems.wire_magnetized_tungsten, 24), new OreDictStack(DIAMOND.dust(), 8), new OreDictStack(MAGTUNG.dust(), 12), new OreDictStack(DESH.dust(), 8), new ComparableStack(ModItems.upgrade_power_3, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new ComparableStack(ModItems.circuit_bismuth, 8)},450);
|
||||
makeRecipe(new ComparableStack(ModBlocks.fwatz_core, 1), new AStack[] {new ComparableStack(ModBlocks.block_meteor, 1), new ComparableStack(ModItems.wire_magnetized_tungsten, 24), new OreDictStack(DIAMOND.dust(), 8), new OreDictStack(MAGTUNG.dust(), 12), new OreDictStack(DESH.dust(), 8), new ComparableStack(ModItems.upgrade_power_3, 1), new ComparableStack(ModItems.upgrade_speed_3, 1), new OreDictStack(KEY_CIRCUIT_BISMUTH, 8)},450);
|
||||
makeRecipe(new ComparableStack(ModBlocks.nuke_gadget, 1), new AStack[] {new ComparableStack(ModItems.sphere_steel, 1), new ComparableStack(ModItems.fins_flat, 2), new ComparableStack(ModItems.pedestal_steel, 1), new ComparableStack(ModItems.circuit_targeting_tier3, 1), new ComparableStack(ModItems.wire_gold, 6), new OreDictStack("dyeGray", 6), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.nuke_boy, 1), new AStack[] {new ComparableStack(ModItems.hull_small_steel, 2), new ComparableStack(ModItems.fins_small_steel, 1), new ComparableStack(ModItems.circuit_targeting_tier2, 1), new ComparableStack(ModItems.wire_aluminium, 6), new OreDictStack("dyeBlue", 4), },300);
|
||||
makeRecipe(new ComparableStack(ModBlocks.nuke_man, 1), new AStack[] {new ComparableStack(ModItems.sphere_steel, 1), new ComparableStack(ModItems.hull_big_steel, 2), new ComparableStack(ModItems.fins_big_steel, 1), new ComparableStack(ModItems.circuit_targeting_tier2, 2), new ComparableStack(ModItems.wire_copper, 6), new OreDictStack("dyeYellow", 6), },300);
|
||||
@ -459,7 +460,7 @@ public class AssemblerRecipes {
|
||||
new ComparableStack(ModItems.coil_advanced_alloy, 12),
|
||||
new OreDictStack(ANY_PLASTIC.ingot(), 8),
|
||||
new ComparableStack(ModItems.circuit_red_copper, 8),
|
||||
new ComparableStack(ModItems.circuit_bismuth, 1)
|
||||
new OreDictStack(KEY_CIRCUIT_BISMUTH, 1)
|
||||
}, 600);
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_large_turbine, 1), new AStack[] {
|
||||
new ComparableStack(ModItems.hull_big_steel, 1),
|
||||
|
||||
@ -93,6 +93,12 @@ public class ChemplantRecipes {
|
||||
.inputItems(new OreDictStack(KNO.dust()))
|
||||
.inputFluids(new FluidStack(Fluids.AROMATICS, 500))
|
||||
.outputItems(new ItemStack(ModItems.ball_tnt, 4)));
|
||||
recipes.add(new ChemRecipe(89, "DYNAMITE", 50)
|
||||
.inputItems(
|
||||
new ComparableStack(Items.sugar),
|
||||
new OreDictStack(KNO.dust()),
|
||||
new OreDictStack("sand"))
|
||||
.outputItems(new ItemStack(ModItems.ball_dynamite, 2)));
|
||||
recipes.add(new ChemRecipe(84, "C4", 150)
|
||||
.inputItems(new OreDictStack(KNO.dust()))
|
||||
.inputFluids(new FluidStack(Fluids.UNSATURATEDS, 500))
|
||||
|
||||
@ -75,6 +75,7 @@ public class PressRecipes {
|
||||
|
||||
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_raw), ModItems.circuit_aluminium);
|
||||
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_bismuth_raw), ModItems.circuit_bismuth);
|
||||
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_arsenic_raw), ModItems.circuit_arsenic);
|
||||
makeRecipe(StampType.CIRCUIT, new ComparableStack(ModItems.circuit_tantalium_raw), ModItems.circuit_tantalium);
|
||||
|
||||
makeRecipe(StampType.C357, new ComparableStack(ModItems.assembly_iron), ModItems.gun_revolver_iron_ammo);
|
||||
|
||||
@ -252,7 +252,7 @@ public class AnvilRecipes {
|
||||
}, new AnvilOutput(new ItemStack(ModItems.demon_core_open))).setTier(3));
|
||||
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(POLYMER.dust(), 2), new OreDictStack(DURA.ingot(), 1)},
|
||||
new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(ANY_PLASTIC.dust(), 2), new OreDictStack(DURA.ingot(), 1)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_desh, 4))).setTier(3));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new ComparableStack(ModItems.nugget_bismuth, 2), new OreDictStack(U238.billet(), 2), new OreDictStack(NB.dust(), 1)},
|
||||
|
||||
@ -271,6 +271,8 @@ public class ModItems {
|
||||
public static Item nugget_lead;
|
||||
public static Item ingot_bismuth;
|
||||
public static Item nugget_bismuth;
|
||||
public static Item ingot_arsenic;
|
||||
public static Item nugget_arsenic;
|
||||
public static Item ingot_tantalium;
|
||||
public static Item nugget_tantalium;
|
||||
public static Item ingot_niobium;
|
||||
@ -544,6 +546,8 @@ public class ModItems {
|
||||
public static Item circuit_schrabidium;
|
||||
public static Item circuit_bismuth_raw;
|
||||
public static Item circuit_bismuth;
|
||||
public static Item circuit_arsenic_raw;
|
||||
public static Item circuit_arsenic;
|
||||
public static Item circuit_tantalium_raw;
|
||||
public static Item circuit_tantalium;
|
||||
public static Item crt_display;
|
||||
@ -938,6 +942,7 @@ public class ModItems {
|
||||
public static Item can_luna;
|
||||
public static Item can_bepis;
|
||||
public static Item can_breen;
|
||||
public static Item can_mug;
|
||||
public static Item mucho_mango;
|
||||
public static Item bottle_empty;
|
||||
public static Item bottle_nuka;
|
||||
@ -1208,6 +1213,7 @@ public class ModItems {
|
||||
public static Item mirror_tool;
|
||||
public static Item rbmk_tool;
|
||||
public static Item coltan_tool;
|
||||
public static Item power_net_tool;
|
||||
|
||||
public static Item template_folder;
|
||||
public static Item journal_pip;
|
||||
@ -2387,6 +2393,7 @@ public class ModItems {
|
||||
public static Item bucket_acid;
|
||||
public static Item bucket_toxic;
|
||||
public static Item bucket_schrabidic_acid;
|
||||
public static Item bucket_sulfuric_acid;
|
||||
|
||||
public static Item door_metal;
|
||||
public static Item door_office;
|
||||
@ -2811,6 +2818,8 @@ public class ModItems {
|
||||
nugget_lead = new Item().setUnlocalizedName("nugget_lead").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_lead");
|
||||
ingot_bismuth = new ItemCustomLore().setUnlocalizedName("ingot_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_bismuth");
|
||||
nugget_bismuth = new Item().setUnlocalizedName("nugget_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_bismuth");
|
||||
ingot_arsenic = new ItemCustomLore().setUnlocalizedName("ingot_arsenic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_arsenic");
|
||||
nugget_arsenic = new Item().setUnlocalizedName("nugget_arsenic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_arsenic");
|
||||
ingot_tantalium = new ItemCustomLore().setUnlocalizedName("ingot_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_tantalium");
|
||||
nugget_tantalium = new ItemCustomLore().setUnlocalizedName("nugget_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_tantalium");
|
||||
ingot_niobium = new Item().setUnlocalizedName("ingot_niobium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_niobium");
|
||||
@ -3098,6 +3107,8 @@ public class ModItems {
|
||||
circuit_schrabidium = new ItemCustomLore().setRarity(EnumRarity.rare).setUnlocalizedName("circuit_schrabidium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_schrabidium");
|
||||
circuit_bismuth_raw = new Item().setUnlocalizedName("circuit_bismuth_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_bismuth_raw");
|
||||
circuit_bismuth = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_bismuth");
|
||||
circuit_arsenic_raw = new Item().setUnlocalizedName("circuit_arsenic_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_arsenic_raw");
|
||||
circuit_arsenic = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_arsenic").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_arsenic");
|
||||
circuit_tantalium_raw = new Item().setUnlocalizedName("circuit_tantalium_raw").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_tantalium_raw");
|
||||
circuit_tantalium = new ItemCustomLore().setRarity(EnumRarity.uncommon).setUnlocalizedName("circuit_tantalium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":circuit_tantalium");
|
||||
crt_display = new Item().setUnlocalizedName("crt_display").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":crt_display");
|
||||
@ -3458,8 +3469,9 @@ public class ModItems {
|
||||
can_mrsugar = new ItemEnergy().setUnlocalizedName("can_mrsugar").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_mrsugar");
|
||||
can_overcharge = new ItemEnergy().setUnlocalizedName("can_overcharge").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_overcharge");
|
||||
can_luna = new ItemEnergy().setUnlocalizedName("can_luna").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_luna");
|
||||
can_bepis = new ItemEnergy().setUnlocalizedName("can_bepis").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_bepis");;
|
||||
can_bepis = new ItemEnergy().setUnlocalizedName("can_bepis").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_bepis");
|
||||
can_breen = new ItemEnergy().setUnlocalizedName("can_breen").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_breen");
|
||||
can_mug = new ItemEnergy().setUnlocalizedName("can_mug").setContainerItem(ModItems.can_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":can_mug");
|
||||
bottle_empty = new Item().setUnlocalizedName("bottle_empty").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bottle_empty");
|
||||
bottle_nuka = new ItemEnergy().setUnlocalizedName("bottle_nuka").setContainerItem(ModItems.bottle_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bottle_nuka");
|
||||
bottle_cherry = new ItemEnergy().setUnlocalizedName("bottle_cherry").setContainerItem(ModItems.bottle_empty).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":bottle_cherry");
|
||||
@ -4730,6 +4742,7 @@ public class ModItems {
|
||||
mirror_tool = new ItemMirrorTool().setUnlocalizedName("mirror_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":mirror_tool");
|
||||
rbmk_tool = new ItemRBMKTool().setUnlocalizedName("rbmk_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":rbmk_tool");
|
||||
coltan_tool = new ItemColtanCompass().setUnlocalizedName("coltan_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":coltass");
|
||||
power_net_tool = new ItemPowerNetTool().setUnlocalizedName("power_net_tool").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":power_net_tool");
|
||||
|
||||
key = new ItemKey().setUnlocalizedName("key").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":key");
|
||||
key_red = new ItemCustomLore().setUnlocalizedName("key_red").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":key_red");
|
||||
@ -5470,6 +5483,7 @@ public class ModItems {
|
||||
bucket_acid = new ItemModBucket(ModBlocks.acid_block).setUnlocalizedName("bucket_acid").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_acid");
|
||||
bucket_toxic = new ItemModBucket(ModBlocks.toxic_block).setUnlocalizedName("bucket_toxic").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_toxic");
|
||||
bucket_schrabidic_acid = new ItemModBucket(ModBlocks.schrabidic_block).setUnlocalizedName("bucket_schrabidic_acid").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_schrabidic_acid");
|
||||
bucket_sulfuric_acid = new ItemModBucket(ModBlocks.sulfuric_acid_block).setUnlocalizedName("bucket_sulfuric_acid").setContainerItem(Items.bucket).setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":bucket_sulfuric_acid");
|
||||
|
||||
door_metal = new ItemModDoor().setUnlocalizedName("door_metal").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_metal");
|
||||
door_office = new ItemModDoor().setUnlocalizedName("door_office").setCreativeTab(MainRegistry.blockTab).setTextureName(RefStrings.MODID + ":door_office");
|
||||
@ -5619,6 +5633,7 @@ public class ModItems {
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.acid_block, ModItems.bucket_acid);
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.toxic_block, ModItems.bucket_toxic);
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.schrabidic_block, ModItems.bucket_schrabidic_acid);
|
||||
BucketHandler.INSTANCE.buckets.put(ModBlocks.sulfuric_acid_block, ModItems.bucket_sulfuric_acid);
|
||||
MinecraftForge.EVENT_BUS.register(BucketHandler.INSTANCE);
|
||||
}
|
||||
|
||||
@ -5678,6 +5693,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(ingot_tcalloy, ingot_tcalloy.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_lead, ingot_lead.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_bismuth, ingot_bismuth.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_arsenic, ingot_arsenic.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_tantalium, ingot_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_niobium, ingot_niobium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(ingot_beryllium, ingot_beryllium.getUnlocalizedName());
|
||||
@ -5998,6 +6014,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(nugget_actinium, nugget_actinium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_lead, nugget_lead.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_bismuth, nugget_bismuth.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_arsenic, nugget_arsenic.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_tantalium, nugget_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_beryllium, nugget_beryllium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(nugget_schrabidium, nugget_schrabidium.getUnlocalizedName());
|
||||
@ -6210,6 +6227,8 @@ public class ModItems {
|
||||
GameRegistry.registerItem(circuit_schrabidium, circuit_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_bismuth_raw, circuit_bismuth_raw.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_bismuth, circuit_bismuth.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_arsenic_raw, circuit_arsenic_raw.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_arsenic, circuit_arsenic.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_tantalium_raw, circuit_tantalium_raw.getUnlocalizedName());
|
||||
GameRegistry.registerItem(circuit_tantalium, circuit_tantalium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(crt_display, crt_display.getUnlocalizedName());
|
||||
@ -6836,6 +6855,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(mirror_tool, mirror_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(rbmk_tool, rbmk_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(coltan_tool, coltan_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(power_net_tool, power_net_tool.getUnlocalizedName());
|
||||
GameRegistry.registerItem(dosimeter, dosimeter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(geiger_counter, geiger_counter.getUnlocalizedName());
|
||||
GameRegistry.registerItem(digamma_diagnostic, digamma_diagnostic.getUnlocalizedName());
|
||||
@ -7602,6 +7622,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(can_luna, can_luna.getUnlocalizedName());
|
||||
GameRegistry.registerItem(can_bepis, can_bepis.getUnlocalizedName());
|
||||
GameRegistry.registerItem(can_breen, can_breen.getUnlocalizedName());
|
||||
GameRegistry.registerItem(can_mug, can_mug.getUnlocalizedName());
|
||||
|
||||
//Coffee
|
||||
GameRegistry.registerItem(coffee, coffee.getUnlocalizedName());
|
||||
@ -8000,6 +8021,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(bucket_acid, bucket_acid.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bucket_toxic, bucket_toxic.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bucket_schrabidic_acid, bucket_schrabidic_acid.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bucket_sulfuric_acid, bucket_sulfuric_acid.getUnlocalizedName());
|
||||
|
||||
//Door Items
|
||||
GameRegistry.registerItem(door_metal, door_metal.getUnlocalizedName());
|
||||
|
||||
@ -27,6 +27,7 @@ import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.resources.I18n;
|
||||
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.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -530,6 +531,9 @@ public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
|
||||
List<Entity> entities = player.worldObj.getEntitiesWithinAABBExcludingEntity(player, player.boundingBox.expand(3, 0, 3));
|
||||
|
||||
for(Entity e : entities) {
|
||||
|
||||
if(e instanceof EntityItem)
|
||||
continue;
|
||||
|
||||
Vec3 vec = Vec3.createVectorHelper(player.posX - e.posX, 0, player.posZ - e.posZ);
|
||||
|
||||
|
||||
@ -2,7 +2,9 @@ package com.hbm.items.block;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockEnumMulti;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
@ -14,6 +16,31 @@ public class ItemBlockBase extends ItemBlock {
|
||||
|
||||
public ItemBlockBase(Block block) {
|
||||
super(block);
|
||||
|
||||
if(block instanceof BlockEnumMulti) {
|
||||
this.setMaxDamage(0);
|
||||
this.setHasSubtypes(true);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getMetadata(int meta) {
|
||||
if(field_150939_a instanceof BlockEnumMulti)
|
||||
return meta;
|
||||
else
|
||||
return super.getMetadata(meta);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getUnlocalizedName(ItemStack stack) {
|
||||
|
||||
if(field_150939_a instanceof BlockEnumMulti && ((BlockEnumMulti)field_150939_a).multiName) {
|
||||
|
||||
Enum num = EnumUtil.grabEnumSafely(((BlockEnumMulti)field_150939_a).theEnum, stack.getItemDamage());
|
||||
return super.getUnlocalizedName() + "." + num.name().toLowerCase();
|
||||
} else {
|
||||
return super.getUnlocalizedName(stack);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -13,7 +13,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.StatCollector;
|
||||
|
||||
public class ItemChemistryIcon extends Item {
|
||||
@ -59,6 +58,12 @@ public class ItemChemistryIcon extends Item {
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public IIcon getIconFromDamage(int i) {
|
||||
return this.icons[ChemplantRecipes.indexMapping.get(i).listing % this.icons.length];
|
||||
ChemRecipe rec = ChemplantRecipes.indexMapping.get(i);
|
||||
|
||||
if(rec != null) {
|
||||
return this.icons[rec.listing % this.icons.length];
|
||||
} else {
|
||||
return ModItems.nothing.getIconFromDamage(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ModItems;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -29,7 +28,7 @@ public class ItemStamp extends Item {
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
if(this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT)
|
||||
if((this.type == StampType.PLATE || this.type == StampType.WIRE || this.type == StampType.CIRCUIT) && this.getMaxDamage() > 0)
|
||||
list.add("[CREATED USING TEMPLATE FOLDER]");
|
||||
}
|
||||
|
||||
|
||||
@ -10,6 +10,7 @@ public class ItemCraftingDegradation extends Item {
|
||||
public ItemCraftingDegradation(int durability) {
|
||||
this.setMaxStackSize(1);
|
||||
this.setMaxDamage(durability);
|
||||
this.setNoRepair();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
110
src/main/java/com/hbm/items/tool/ItemPowerNetTool.java
Normal file
110
src/main/java/com/hbm/items/tool/ItemPowerNetTool.java
Normal file
@ -0,0 +1,110 @@
|
||||
package com.hbm.items.tool;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.util.ChatBuilder;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.energy.IEnergyConnector;
|
||||
import api.hbm.energy.IPowerNet;
|
||||
import api.hbm.energy.PowerNet;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemPowerNetTool extends Item {
|
||||
|
||||
@Override
|
||||
public boolean onItemUse(ItemStack stack, EntityPlayer player, World world, int x, int y, int z, int side, float fX, float fY, float fZ) {
|
||||
|
||||
Block b = world.getBlock(x, y, z);
|
||||
|
||||
if(b instanceof BlockDummyable) {
|
||||
int[] pos = ((BlockDummyable) b).findCore(world, x, y, z);
|
||||
|
||||
if(pos != null) {
|
||||
x = pos[0];
|
||||
y = pos[1];
|
||||
z = pos[2];
|
||||
}
|
||||
}
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(!(te instanceof IEnergyConductor))
|
||||
return false;
|
||||
|
||||
if(world.isRemote)
|
||||
return true;
|
||||
|
||||
IEnergyConductor con = (IEnergyConductor) te;
|
||||
IPowerNet net = con.getPowerNet();
|
||||
|
||||
if(net == null) {
|
||||
player.addChatComponentMessage(ChatBuilder.start("Error: No network found! This should be impossible!").color(EnumChatFormatting.RED).flush());
|
||||
return true;
|
||||
}
|
||||
|
||||
if(!(net instanceof PowerNet)) {
|
||||
player.addChatComponentMessage(ChatBuilder.start("Error: Cannot print diagnostic for non-standard power net implementation!").color(EnumChatFormatting.RED).flush());
|
||||
}
|
||||
|
||||
PowerNet network = (PowerNet) net;
|
||||
String id = Integer.toHexString(net.hashCode());
|
||||
|
||||
player.addChatComponentMessage(ChatBuilder.start("Start of diagnostic for network " + id).color(EnumChatFormatting.GOLD).flush());
|
||||
player.addChatComponentMessage(ChatBuilder.start("Links: " + network.getLinks().size()).color(EnumChatFormatting.YELLOW).flush());
|
||||
player.addChatComponentMessage(ChatBuilder.start("Proxies: " + network.getProxies().size()).color(EnumChatFormatting.YELLOW).flush());
|
||||
player.addChatComponentMessage(ChatBuilder.start("Subscribers: " + network.getSubscribers().size()).color(EnumChatFormatting.YELLOW).flush());
|
||||
player.addChatComponentMessage(ChatBuilder.start("End of diagnostic for network " + id).color(EnumChatFormatting.GOLD).flush());
|
||||
|
||||
for(IEnergyConductor link : network.getLinks()) {
|
||||
Vec3 pos = link.getDebugParticlePos();
|
||||
|
||||
boolean errored = link.getPowerNet() != net;
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "debug");
|
||||
data.setInteger("color", errored ? 0xff0000 : 0xffff00);
|
||||
data.setFloat("scale", 0.5F);
|
||||
data.setString("text", id);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, radius));
|
||||
}
|
||||
|
||||
for(IEnergyConnector subscriber : network.getSubscribers()) {
|
||||
Vec3 pos = subscriber.getDebugParticlePos();
|
||||
|
||||
NBTTagCompound data = new NBTTagCompound();
|
||||
data.setString("type", "debug");
|
||||
data.setInteger("color", 0x0000ff);
|
||||
data.setFloat("scale", 1.5F);
|
||||
data.setString("text", id);
|
||||
PacketDispatcher.wrapper.sendToAllAround(new AuxParticlePacketNT(data, pos.xCoord, pos.yCoord, pos.zCoord), new TargetPoint(world.provider.dimensionId, pos.xCoord, pos.yCoord, pos.zCoord, radius));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static final int radius = 20;
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
list.add(EnumChatFormatting.RED + "Right-click cable to analyze the power net.");
|
||||
list.add(EnumChatFormatting.RED + "Links (cables, poles, etc.) are YELLOW");
|
||||
list.add(EnumChatFormatting.RED + "Subscribers (any receiver) are BLUE");
|
||||
list.add(EnumChatFormatting.RED + "Links with mismatching network info (BUGGED!) are RED");
|
||||
list.add(EnumChatFormatting.RED + "Displays stats such as link and subscriber count");
|
||||
list.add(EnumChatFormatting.RED + "Proxies are connection points for multiblock links (e.g. 4 for substations)");
|
||||
list.add(EnumChatFormatting.RED + "Particles only spawn in a " + radius + " block radius!");
|
||||
}
|
||||
}
|
||||
@ -17,7 +17,6 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.ChatComponentText;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.ChatStyle;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
@ -9,9 +9,11 @@ import com.hbm.lib.Library;
|
||||
|
||||
import net.minecraft.entity.EntityLiving;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntityZombie;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MovingObjectPosition;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
@ -27,10 +29,17 @@ public class ItemWandD extends Item {
|
||||
|
||||
if(pos != null) {
|
||||
|
||||
EntitySiegeTunneler tunneler = new EntitySiegeTunneler(world);
|
||||
List<EntityZombie> zombies = world.getEntitiesWithinAABB(EntityZombie.class, AxisAlignedBB.getBoundingBox(pos.blockX - 2, pos.blockY - 2, pos.blockZ - 2, pos.blockX + 2, pos.blockY + 2, pos.blockZ + 2));
|
||||
|
||||
for(EntityZombie zombie : zombies) {
|
||||
zombie.setChild(true);
|
||||
zombie.setCurrentItemOrArmor(4, new ItemStack(ModItems.gas_mask_m65));
|
||||
}
|
||||
|
||||
/*EntitySiegeTunneler tunneler = new EntitySiegeTunneler(world);
|
||||
tunneler.setPosition(pos.blockX, pos.blockY + 1, pos.blockZ);
|
||||
tunneler.onSpawnWithEgg(null);
|
||||
world.spawnEntityInWorld(tunneler);
|
||||
world.spawnEntityInWorld(tunneler);*/
|
||||
|
||||
//CellularDungeonFactory.meteor.generate(world, x, y, z, world.rand);
|
||||
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.lib;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres;
|
||||
import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.WorldConfig;
|
||||
import com.hbm.items.ModItems;
|
||||
@ -116,6 +117,12 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.titaniumClusterSpawn, 6, 15, 30, ModBlocks.cluster_titanium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.aluminiumClusterSpawn, 6, 15, 35, ModBlocks.cluster_aluminium);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, WorldConfig.copperClusterSpawn, 6, 15, 20, ModBlocks.cluster_copper);
|
||||
|
||||
for(int k = 0; k < WorldConfig.randomSpawn; k++) {
|
||||
BlockMotherOfAllOres.shuffleOverride(rand);
|
||||
DungeonToolbox.generateOre(world, rand, i, j, 1, 10, 4, 30, ModBlocks.ore_random);
|
||||
}
|
||||
BlockMotherOfAllOres.resetOverride();
|
||||
|
||||
if(GeneralConfig.enable528ColtanSpawn) {
|
||||
DungeonToolbox.generateOre(world, rand, i, j, GeneralConfig.coltanRate, 4, 15, 40, ModBlocks.ore_coltan);
|
||||
|
||||
@ -74,6 +74,8 @@ public class Library {
|
||||
public static String SolsticeUnlimitd = "f5574fd2-ec28-4927-9d11-3c0c731771f4";
|
||||
public static String FrizzleFrazzle = "fc4cc2ee-12e8-4097-b26a-1c6cb1b96531";
|
||||
public static String the_NCR = "28ae585f-4431-4491-9ce8-3def6126e3c6";
|
||||
public static String Barnaby99_x = "711aaf78-a862-4b7e-921a-216349716e9a";
|
||||
public static String Ma118 = "1121cb7a-8773-491f-8e2b-221290c93d81";
|
||||
|
||||
public static Set<String> contributors = Sets.newHashSet(new String[] {
|
||||
"06ab7c03-55ce-43f8-9d3c-2850e3c652de", //mustang_rudolf
|
||||
|
||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
||||
public class RefStrings {
|
||||
public static final String MODID = "hbm";
|
||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||
public static final String VERSION = "1.0.27 BETA (4179)";
|
||||
public static final String VERSION = "1.0.27 BETA (4193)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -678,7 +678,9 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderBattery());
|
||||
RenderingRegistry.registerBlockHandler(new RenderAnvil());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCrystal());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestCable());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCable());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCableClassic());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestPipe());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockCT());
|
||||
RenderingRegistry.registerBlockHandler(new RenderDetCord());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockMultipass());
|
||||
@ -1161,17 +1163,20 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
double motionX = BobMathUtil.safeClamp(p.motionX + moX, -5, 5);
|
||||
double motionY = BobMathUtil.safeClamp(p.motionY + moY, -2, 2);
|
||||
double motionZ = BobMathUtil.safeClamp(p.motionZ + moZ, -5, 5);
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, motionX * 2, motionY * 2, motionZ * 2));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, motionX * 2, motionY * 2, motionZ * 2));
|
||||
double mX2 = BobMathUtil.safeClamp(p.motionX + moX * 2, -5, 5);
|
||||
double mY2 = BobMathUtil.safeClamp(p.motionY + moY * 2, -5, 5);
|
||||
double mZ2 = BobMathUtil.safeClamp(p.motionZ + moZ * 2, -5, 5);
|
||||
double mX3 = BobMathUtil.safeClamp(p.motionX + moX * 2, -10, 10);
|
||||
double mY3 = BobMathUtil.safeClamp(p.motionY + moY * 2, -10, 10);
|
||||
double mZ3 = BobMathUtil.safeClamp(p.motionZ + moZ * 2, -10, 10);
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, mX2, mY2, mZ2));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, mX2, mY2, mZ2));
|
||||
|
||||
if(particleSetting == 0) {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix + ox, iy, iz + oz, motionX * 3, motionY * 3, motionZ * 3));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix - ox, iy, iz - oz, motionX * 3, motionY * 3, motionZ * 3));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix + ox, iy, iz + oz, mX3, mY3, mZ3));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix - ox, iy, iz - oz, mX3, mY3, mZ3));
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1566,6 +1571,15 @@ public class ClientProxy extends ServerProxy {
|
||||
if("amat".equals(type)) {
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new ParticleAmatFlash(world, x, y, z, data.getFloat("scale")));
|
||||
}
|
||||
|
||||
if("debug".equals(type)) {
|
||||
String t = data.getString("text");
|
||||
int color = data.getInteger("color");
|
||||
float scale = data.getFloat("scale");
|
||||
ParticleText text = new ParticleText(world, x, y, z, color, t);
|
||||
text.multipleParticleScaleBy(scale);
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(text);
|
||||
}
|
||||
}
|
||||
|
||||
private HashMap<Integer, Long> vanished = new HashMap();
|
||||
|
||||
@ -242,7 +242,9 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cable_detector, 1), new Object[] { "S", "W", 'S', REDSTONE.dust(), 'W', ModBlocks.red_wire_coated });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cable_diode, 1), new Object[] { " Q ", "CAC", " Q ", 'Q', NETHERQUARTZ.gem(), 'C', ModBlocks.red_cable, 'A', AL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_detector, 1), new Object[] { "IRI", "CTC", "IRI", 'I', ModItems.plate_polymer, 'R', REDSTONE.dust(), 'C', ModItems.wire_red_copper, 'T', ModItems.coil_tungsten });
|
||||
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.red_cable), 16), new Object[] { " W ", "RRR", " W ", 'W', ModItems.plate_polymer, 'R', ModItems.wire_red_copper });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_cable, 16), new Object[] { " W ", "RRR", " W ", 'W', ModItems.plate_polymer, 'R', ModItems.wire_red_copper });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.red_cable_classic, 1), new Object[] { ModBlocks.red_cable });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.red_cable, 1), new Object[] { ModBlocks.red_cable_classic });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_connector, 4), new Object[] { "C", "I", "S", 'C', ModItems.coil_copper, 'I', ModItems.plate_polymer, 'S', STEEL.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.red_pylon, 4), new Object[] { "CWC", "PWP", " T ", 'C', ModItems.coil_copper, 'W', KEY_PLANKS, 'P', ModItems.plate_polymer, 'T', ModBlocks.red_wire_coated });
|
||||
addRecipeAuto(new ItemStack(Item.getItemFromBlock(ModBlocks.oil_duct_solid), 16), new Object[] { "SPS", "P P", "SPS", 'S', STEEL.ingot(), 'P', IRON.plate() });
|
||||
@ -727,7 +729,7 @@ public class CraftingManager {
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_euphemium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_dagaz, ModItems.rune_dagaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, EUPH.dust(), EUPH.dust(), EUPH.dust(), EUPH.dust() });
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_schrabidium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_dagaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, SA326.dust(), SA326.dust(), SA326.dust(), SA326.dust() });
|
||||
addShapelessAuto(new ItemStack(ModItems.ams_catalyst_dineutronium, 1), new Object[] { ModItems.ams_catalyst_blank, ModItems.rune_hagalaz, ModItems.rune_hagalaz, ModItems.rune_thurisaz, ModItems.rune_thurisaz, DNT.dust(), DNT.dust(), DNT.dust(), DNT.dust() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_core, 1), new Object[] { "DLD", "LML", "DLD", 'D', ModItems.ingot_bismuth, 'L', DNT.block(), 'M', ModItems.circuit_bismuth });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_core, 1), new Object[] { "DLD", "LML", "DLD", 'D', ModItems.ingot_bismuth, 'L', DNT.block(), 'M', KEY_CIRCUIT_BISMUTH });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_emitter, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModItems.crystal_xen, 'L', ModItems.sat_head_laser });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_receiver, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', ModItems.plate_desh, 'T', ModBlocks.machine_transformer_dnt, 'X', ModBlocks.sellafield_core, 'L', ModItems.hull_small_steel });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.dfc_injector, 1), new Object[] { "SDS", "TXL", "SDS", 'S', OSMIRIDIUM.ingot(), 'D', CMB.plate(), 'T', ModBlocks.machine_fluidtank, 'X', ModItems.motor, 'L', ModItems.pipes_steel });
|
||||
|
||||
@ -5,7 +5,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
||||
import net.minecraft.dispenser.BehaviorProjectileDispense;
|
||||
import net.minecraft.dispenser.IPosition;
|
||||
import net.minecraft.entity.IProjectile;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.Item.ToolMaterial;
|
||||
@ -39,6 +38,7 @@ import org.apache.logging.log4j.Logger;
|
||||
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.blocks.generic.BlockMotherOfAllOres;
|
||||
import com.hbm.config.*;
|
||||
import com.hbm.creativetabs.*;
|
||||
import com.hbm.entity.effect.*;
|
||||
@ -72,7 +72,7 @@ import com.hbm.tileentity.bomb.TileEntityNukeCustom;
|
||||
import com.hbm.tileentity.machine.*;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.world.feature.OreLayer;
|
||||
import com.hbm.world.feature.OreCave;
|
||||
import com.hbm.world.feature.SchistStratum;
|
||||
import com.hbm.world.generator.CellularDungeonFactory;
|
||||
|
||||
@ -973,8 +973,14 @@ public class MainRegistry {
|
||||
|
||||
proxy.registerMissileItems();
|
||||
|
||||
BlockMotherOfAllOres.init();
|
||||
|
||||
//expand for the largest entity we have (currently Quackos who is 17.5m in diameter, that's one fat duck)
|
||||
World.MAX_ENTITY_RADIUS = Math.max(World.MAX_ENTITY_RADIUS, 8.75);
|
||||
|
||||
new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20).withFluid(ModBlocks.sulfuric_acid_block); //sulfur
|
||||
new OreCave(ModBlocks.stone_resource, 1).setThreshold(1.75D).setRangeMult(20).setYLevel(25).setMaxRange(20); //asbestos
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
}
|
||||
|
||||
@EventHandler
|
||||
@ -991,8 +997,6 @@ public class MainRegistry {
|
||||
SchistStratum schist = new SchistStratum();
|
||||
MinecraftForge.EVENT_BUS.register(schist); //DecorateBiomeEvent.Pre
|
||||
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
|
||||
OreDictManager oreMan = new OreDictManager();
|
||||
MinecraftForge.EVENT_BUS.register(oreMan); //OreRegisterEvent
|
||||
|
||||
|
||||
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