mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'HbmMods:master' into master
This commit is contained in:
commit
2d2fee0074
@ -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,96 @@ 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) {
|
||||
|
||||
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 && neighbor.getPowerNet() != null && this.canReevaluate() && neighbor.canReevaluate()) {
|
||||
|
||||
if(this.getPowerNet() == null) {
|
||||
neighbor.getPowerNet().joinLink(this);
|
||||
} else {
|
||||
this.getPowerNet().joinNetworks(neighbor.getPowerNet());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 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);
|
||||
}
|
||||
}
|
||||
|
||||
@ -14,7 +14,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
|
||||
|
||||
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,7 @@ 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 List<IEnergyConnector> subscribers = new ArrayList();
|
||||
|
||||
@Override
|
||||
@ -23,8 +24,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 +42,14 @@ public class PowerNet implements IPowerNet {
|
||||
conductor.getPowerNet().leaveLink(conductor);
|
||||
|
||||
conductor.setPowerNet(this);
|
||||
this.getLinks().add(conductor);
|
||||
this.links.put(conductor.getIdentity(), conductor);
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void leaveLink(IEnergyConductor conductor) {
|
||||
conductor.setPowerNet(null);
|
||||
this.getLinks().remove(conductor);
|
||||
this.links.remove(conductor.getIdentity());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -69,7 +69,9 @@ 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;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -80,10 +82,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 +96,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 +142,22 @@ public class PowerNet implements IPowerNet {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void reevaluate() { }
|
||||
public void reevaluate() {
|
||||
|
||||
HashMap<Integer, IEnergyConductor> copy = new HashMap(links);
|
||||
|
||||
for(IEnergyConductor link : copy.values()) {
|
||||
this.leaveLink(link);
|
||||
}
|
||||
|
||||
for(IEnergyConductor link : copy.values()) {
|
||||
|
||||
link.setPowerNet(null);
|
||||
link.reevaluate(copy);
|
||||
|
||||
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,14 +17,14 @@ 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
|
||||
* @param dir
|
||||
* @return
|
||||
*/
|
||||
public default boolean canConnect(ForgeDirection dir) {
|
||||
public default boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
return dir != ForgeDirection.UNKNOWN;
|
||||
}
|
||||
|
||||
@ -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 = false;
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
}
|
||||
40
src/main/java/api/hbm/fluid/IFluidStandardSender.java
Normal file
40
src/main/java/api/hbm/fluid/IFluidStandardSender.java
Normal file
@ -0,0 +1,40 @@
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
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
|
||||
}
|
||||
}
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.blocks;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
@ -29,26 +28,28 @@ public interface ILookOverlay {
|
||||
int pX = resolution.getScaledWidth() / 2 + 8;
|
||||
int pZ = resolution.getScaledHeight() / 2;
|
||||
|
||||
List<String> exceptions = new ArrayList();
|
||||
exceptions.add("x");
|
||||
exceptions.add("y");
|
||||
exceptions.add("z");
|
||||
exceptions.add("items");
|
||||
exceptions.add("id");
|
||||
|
||||
mc.fontRenderer.drawString(title, pX + 1, pZ - 9, bgCol);
|
||||
mc.fontRenderer.drawString(title, pX, pZ - 10, titleCol);
|
||||
|
||||
for(String line : text) {
|
||||
|
||||
if(exceptions.contains(line))
|
||||
continue;
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(line, pX, pZ, 0xFFFFFF);
|
||||
pZ += 10;
|
||||
try {
|
||||
for(String line : text) {
|
||||
|
||||
int color = 0xFFFFFF;
|
||||
if(line.startsWith("&[")) {
|
||||
int end = line.lastIndexOf("&]");
|
||||
color = Integer.parseInt(line.substring(2, end));
|
||||
line = line.substring(end + 2);
|
||||
}
|
||||
|
||||
mc.fontRenderer.drawStringWithShadow(line, pX, pZ, color);
|
||||
pZ += 10;
|
||||
}
|
||||
} catch(Exception ex) {
|
||||
mc.fontRenderer.drawStringWithShadow(ex.getClass().getSimpleName(), pX, pZ + 10, 0xff0000);
|
||||
}
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glColor3f(1F, 1F, 1F);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
|
||||
@ -21,9 +21,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 +53,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 +83,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 +138,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;
|
||||
@ -475,6 +484,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 +722,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 +1189,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 +1268,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 +1344,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 +1357,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");
|
||||
@ -1677,6 +1699,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 +1852,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 +2224,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 +2290,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());
|
||||
@ -2374,6 +2405,11 @@ public class ModBlocks {
|
||||
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());
|
||||
@ -2826,6 +2862,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 +2969,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());
|
||||
@ -2937,7 +2977,7 @@ public class ModBlocks {
|
||||
GameRegistry.registerBlock(substation, ItemBlockBase.class, substation.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(cable_switch, cable_switch.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(cable_detector, cable_detector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(cable_diode, cable_diode.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(cable_diode, ItemBlockBase.class, cable_diode.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(machine_detector, machine_detector.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(rf_cable, rf_cable.getUnlocalizedName());
|
||||
GameRegistry.registerBlock(oil_duct, oil_duct.getUnlocalizedName());
|
||||
@ -3178,6 +3218,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);
|
||||
}
|
||||
}
|
||||
96
src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java
Normal file
96
src/main/java/com/hbm/blocks/fluid/GenericFluidBlock.java
Normal file
@ -0,0 +1,96 @@
|
||||
package com.hbm.blocks.fluid;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.util.ArmorUtil;
|
||||
|
||||
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.entity.passive.EntitySquid;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
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);
|
||||
}
|
||||
|
||||
@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;
|
||||
}
|
||||
|
||||
109
src/main/java/com/hbm/blocks/generic/BlockMotherOfAllOres.java
Normal file
109
src/main/java/com/hbm/blocks/generic/BlockMotherOfAllOres.java
Normal file
@ -0,0 +1,109 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
|
||||
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.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
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;
|
||||
|
||||
public class BlockMotherOfAllOres extends BlockContainer implements IBlockMultiPass {
|
||||
|
||||
public BlockMotherOfAllOres() {
|
||||
super(Material.rock);
|
||||
this.blockIcon = Blocks.stone.getIcon(0, 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World world, int meta) {
|
||||
return new TileEntityRandomOre();
|
||||
}
|
||||
|
||||
@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) {
|
||||
return ((TileEntityRandomOre) te).getStack().copy();
|
||||
}
|
||||
|
||||
return super.getPickBlock(target, world, 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) {
|
||||
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 this.blockIcon;
|
||||
|
||||
TileEntity te = world.getTileEntity(x, y, z);
|
||||
|
||||
if(te instanceof TileEntityRandomOre) {
|
||||
TileEntityRandomOre ore = (TileEntityRandomOre) te;
|
||||
ItemStack item = ore.getStack();
|
||||
|
||||
if(item != null) {
|
||||
ComparableStack stack = new ComparableStack(item);
|
||||
int index = stack.hashCode() % overlays.length;
|
||||
return overlays[index];
|
||||
}
|
||||
}
|
||||
|
||||
return this.getIcon(side, world.getBlockMetadata(x, y, z));
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public int colorMultiplier(IBlockAccess world, int x, int y, int z) {
|
||||
|
||||
if(RenderBlockMultipass.currentPass == 0)
|
||||
return 0xffffff;
|
||||
|
||||
return super.colorMultiplier(world, x, y, z);
|
||||
}
|
||||
|
||||
public static class TileEntityRandomOre extends TileEntity {
|
||||
|
||||
public ItemStack getStack() {
|
||||
return new ItemStack(Blocks.dirt);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -224,6 +224,12 @@ public class MachineBattery extends BlockContainer implements ILookOverlay {
|
||||
List<String> text = new ArrayList();
|
||||
text.add(BobMathUtil.getShortNumber(battery.getPower()) + " / " + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE");
|
||||
|
||||
double percent = (double) battery.getPower() / (double) battery.getMaxPower();
|
||||
int charge = (int) Math.floor(percent * 10_000D);
|
||||
int color = ((int) (0xFF - 0xFF * percent)) << 16 | ((int)(0xFF * percent) << 8);
|
||||
|
||||
text.add("&[" + color + "&]" + (charge / 100D) + "%");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -83,6 +83,12 @@ public class MachineFENSU extends BlockDummyable implements ILookOverlay {
|
||||
List<String> text = new ArrayList();
|
||||
text.add(BobMathUtil.getShortNumber(battery.getPower()) + " / " + BobMathUtil.getShortNumber(battery.getMaxPower()) + "HE");
|
||||
|
||||
double percent = (double) battery.getPower() / (double) battery.getMaxPower();
|
||||
int charge = (int) Math.floor(percent * 10_000D);
|
||||
int color = ((int) (0xFF - 0xFF * percent)) << 16 | ((int)(0xFF * percent) << 8);
|
||||
|
||||
text.add("&[" + color + "&]" + (charge / 100D) + "%");
|
||||
|
||||
ILookOverlay.printGeneric(event, I18nUtil.resolveKey(getUnlocalizedName() + ".name"), 0xffff00, 0x404000, text);
|
||||
}
|
||||
}
|
||||
|
||||
@ -6,11 +6,9 @@ import org.lwjgl.input.Keyboard;
|
||||
|
||||
import com.hbm.blocks.BlockDummyable;
|
||||
import com.hbm.blocks.ITooltipProvider;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.TileEntityProxyCombo;
|
||||
import com.hbm.tileentity.machine.oil.TileEntityMachineLiquefactor;
|
||||
|
||||
import cpw.mods.fml.common.network.internal.FMLNetworkHandler;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -69,7 +69,9 @@ public class MachineSolidifier extends BlockDummyable implements ITooltipProvide
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean ext) {
|
||||
|
||||
if(Keyboard.isKeyDown(Keyboard.KEY_LSHIFT)) {
|
||||
list.add(EnumChatFormatting.YELLOW + "beb");
|
||||
list.add(EnumChatFormatting.YELLOW + "A universal machine fitted with cooling systems and other");
|
||||
list.add(EnumChatFormatting.YELLOW + "versatile tools for turning fluids solid using various");
|
||||
list.add(EnumChatFormatting.YELLOW + "processes such as freezing and petrochemical polymerization.");
|
||||
} else {
|
||||
list.add(EnumChatFormatting.DARK_GRAY + "" + EnumChatFormatting.ITALIC +"Hold <" +
|
||||
EnumChatFormatting.YELLOW + "" + EnumChatFormatting.ITALIC + "LSHIFT" +
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -5,12 +5,15 @@ 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;
|
||||
|
||||
import api.hbm.block.IToolable;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
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.BlockPistonBase;
|
||||
import net.minecraft.block.material.Material;
|
||||
@ -18,12 +21,12 @@ import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.network.NetworkManager;
|
||||
import net.minecraft.network.Packet;
|
||||
import net.minecraft.network.play.server.S35PacketUpdateTileEntity;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.event.RenderGameOverlayEvent.Pre;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
@ -51,6 +54,12 @@ public class CableDiode extends BlockContainer implements ILookOverlay, IToolabl
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public boolean shouldSideBeRendered(IBlockAccess p_149646_1_, int p_149646_2_, int p_149646_3_, int p_149646_4_, int p_149646_5_) {
|
||||
return true;
|
||||
}
|
||||
|
||||
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);
|
||||
@ -111,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;
|
||||
}
|
||||
}
|
||||
@ -102,6 +102,12 @@ public class ArmorRecipes {
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.steamsuit_legs, 1), new Object[] { "CCC", "DXD", "C C", 'D', DESH.ingot(), 'C', CU.plate(), 'X', ModItems.steel_legs });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.steamsuit_boots, 1), new Object[] { "C C", "DXD", 'D', DESH.ingot(), 'C', CU.plate(), 'X', ModItems.steel_boots });
|
||||
|
||||
//Bismuth fursui- I mean armor
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bismuth_helmet, 1), new Object[] { "GPP", "P ", "FPP", 'G', Items.gold_ingot, 'P', ModItems.plate_bismuth, 'F', ModItems.rag });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bismuth_plate, 1), new Object[] { "RWR", "PCP", "SFS", 'R', ModItems.crystal_rare, 'W', ModItems.wire_gold, 'P', ModItems.plate_bismuth, 'C', ModItems.laser_crystal_bismuth, 'S', ModItems.ring_starmetal, 'F', ModItems.rag });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bismuth_legs, 1), new Object[] { "FSF", " ", "FSF", 'F', ModItems.rag, 'S', ModItems.ring_starmetal });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.bismuth_boots, 1), new Object[] { "W W", "P P", 'W', ModItems.wire_gold, 'P', ModItems.plate_bismuth });
|
||||
|
||||
//Euphemium armor
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.euphemium_helmet, 1), new Object[] { "EEE", "E E", 'E', ModItems.plate_euphemium });
|
||||
CraftingManager.addRecipeAuto(new ItemStack(ModItems.euphemium_plate, 1), new Object[] { "EWE", "EEE", "EEE", 'E', ModItems.plate_euphemium, 'W', ModItems.watch });
|
||||
|
||||
@ -67,8 +67,6 @@ public class EntityMinecartTest extends EntityMinecartModBase
|
||||
this.explodeCart(d0);
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println(this.rotationYaw);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -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,80 +1,113 @@
|
||||
package com.hbm.extprop;
|
||||
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IExtendedEntityProperties;
|
||||
|
||||
public class HbmPlayerProps implements IExtendedEntityProperties {
|
||||
|
||||
public static final String key = "NTM_EXT_PLAYER";
|
||||
public EntityPlayer player;
|
||||
|
||||
public boolean enableHUD = true;
|
||||
public boolean enableBackpack = true;
|
||||
|
||||
private boolean[] keysPressed = new boolean[EnumKeybind.values().length];
|
||||
|
||||
public HbmPlayerProps(EntityPlayer player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public static HbmPlayerProps registerData(EntityPlayer player) {
|
||||
|
||||
player.registerExtendedProperties(key, new HbmPlayerProps(player));
|
||||
return (HbmPlayerProps) player.getExtendedProperties(key);
|
||||
}
|
||||
|
||||
public static HbmPlayerProps getData(EntityPlayer player) {
|
||||
|
||||
HbmPlayerProps props = (HbmPlayerProps) player.getExtendedProperties(key);
|
||||
return props != null ? props : registerData(player);
|
||||
}
|
||||
|
||||
public boolean getKeyPressed(EnumKeybind key) {
|
||||
return keysPressed[key.ordinal()];
|
||||
}
|
||||
|
||||
public boolean isJetpackActive() {
|
||||
return this.enableBackpack && getKeyPressed(EnumKeybind.JETPACK);
|
||||
}
|
||||
|
||||
public void setKeyPressed(EnumKeybind key, boolean pressed) {
|
||||
|
||||
if(!getKeyPressed(key) && pressed) {
|
||||
|
||||
if(key == EnumKeybind.TOGGLE_JETPACK) {
|
||||
this.enableBackpack = !this.enableBackpack;
|
||||
|
||||
if(this.enableBackpack)
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "Jetpack ON");
|
||||
else
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Jetpack OFF");
|
||||
}
|
||||
if(key == EnumKeybind.TOGGLE_HEAD) {
|
||||
this.enableHUD = !this.enableHUD;
|
||||
|
||||
if(this.enableHUD)
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "HUD ON");
|
||||
else
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "HUD OFF");
|
||||
}
|
||||
}
|
||||
|
||||
keysPressed[key.ordinal()] = pressed;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Entity entity, World world) { }
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound compound) { }
|
||||
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound compound) { }
|
||||
}
|
||||
package com.hbm.extprop;
|
||||
|
||||
import com.hbm.handler.HbmKeybinds.EnumKeybind;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import net.minecraft.entity.Entity;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.IExtendedEntityProperties;
|
||||
|
||||
public class HbmPlayerProps implements IExtendedEntityProperties {
|
||||
|
||||
public static final String key = "NTM_EXT_PLAYER";
|
||||
public EntityPlayer player;
|
||||
|
||||
public boolean enableHUD = true;
|
||||
public boolean enableBackpack = true;
|
||||
|
||||
private boolean[] keysPressed = new boolean[EnumKeybind.values().length];
|
||||
|
||||
public static final int dashCooldownLength = 5;
|
||||
public int dashCooldown = 0;
|
||||
|
||||
public int totalDashCount = 0;
|
||||
public int stamina = 0;
|
||||
|
||||
public HbmPlayerProps(EntityPlayer player) {
|
||||
this.player = player;
|
||||
}
|
||||
|
||||
public static HbmPlayerProps registerData(EntityPlayer player) {
|
||||
|
||||
player.registerExtendedProperties(key, new HbmPlayerProps(player));
|
||||
return (HbmPlayerProps) player.getExtendedProperties(key);
|
||||
}
|
||||
|
||||
public static HbmPlayerProps getData(EntityPlayer player) {
|
||||
|
||||
HbmPlayerProps props = (HbmPlayerProps) player.getExtendedProperties(key);
|
||||
return props != null ? props : registerData(player);
|
||||
}
|
||||
|
||||
public boolean getKeyPressed(EnumKeybind key) {
|
||||
return keysPressed[key.ordinal()];
|
||||
}
|
||||
|
||||
public boolean isJetpackActive() {
|
||||
return this.enableBackpack && getKeyPressed(EnumKeybind.JETPACK);
|
||||
}
|
||||
|
||||
public void setKeyPressed(EnumKeybind key, boolean pressed) {
|
||||
|
||||
if(!getKeyPressed(key) && pressed) {
|
||||
|
||||
if(key == EnumKeybind.TOGGLE_JETPACK) {
|
||||
this.enableBackpack = !this.enableBackpack;
|
||||
|
||||
if(this.enableBackpack)
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "Jetpack ON");
|
||||
else
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "Jetpack OFF");
|
||||
}
|
||||
if(key == EnumKeybind.TOGGLE_HEAD) {
|
||||
this.enableHUD = !this.enableHUD;
|
||||
|
||||
if(this.enableHUD)
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.GREEN + "HUD ON");
|
||||
else
|
||||
MainRegistry.proxy.displayTooltip(EnumChatFormatting.RED + "HUD OFF");
|
||||
}
|
||||
}
|
||||
|
||||
keysPressed[key.ordinal()] = pressed;
|
||||
}
|
||||
|
||||
public void setDashCooldown(int cooldown) {
|
||||
this.dashCooldown = cooldown;
|
||||
return;
|
||||
}
|
||||
|
||||
public int getDashCooldown() {
|
||||
return this.dashCooldown;
|
||||
}
|
||||
|
||||
public void setStamina(int stamina) {
|
||||
this.stamina = stamina;
|
||||
return;
|
||||
}
|
||||
|
||||
public int getStamina() {
|
||||
return this.stamina;
|
||||
}
|
||||
|
||||
public void setDashCount(int count) {
|
||||
this.totalDashCount = count;
|
||||
return;
|
||||
}
|
||||
|
||||
public int getDashCount() {
|
||||
return this.totalDashCount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Entity entity, World world) { }
|
||||
|
||||
@Override
|
||||
public void saveNBTData(NBTTagCompound compound) { }
|
||||
|
||||
@Override
|
||||
public void loadNBTData(NBTTagCompound compound) { }
|
||||
}
|
||||
|
||||
@ -8,8 +8,11 @@ import com.hbm.config.GeneralConfig;
|
||||
import com.hbm.config.RadiationConfig;
|
||||
import com.hbm.explosion.ExplosionNukeSmall;
|
||||
import com.hbm.extprop.HbmLivingProps;
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.extprop.HbmLivingProps.ContaminationEffect;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.interfaces.IArmorModDash;
|
||||
import com.hbm.items.armor.ArmorFSB;
|
||||
import com.hbm.lib.ModDamageSource;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.AuxParticlePacketNT;
|
||||
@ -31,11 +34,13 @@ import net.minecraft.entity.item.EntityItem;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayerMP;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemArmor;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.potion.Potion;
|
||||
import net.minecraft.potion.PotionEffect;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class EntityEffectHandler {
|
||||
@ -76,6 +81,8 @@ public class EntityEffectHandler {
|
||||
handleRadiation(entity);
|
||||
handleDigamma(entity);
|
||||
handleLungDisease(entity);
|
||||
|
||||
handleDashing(entity);
|
||||
}
|
||||
|
||||
private static void handleContamination(EntityLivingBase entity) {
|
||||
@ -405,4 +412,99 @@ public class EntityEffectHandler {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void handleDashing(Entity entity) {
|
||||
|
||||
//AAAAAAAAAAAAAAAAAAAAEEEEEEEEEEEEEEEEEEEE
|
||||
if(entity instanceof EntityPlayer) {
|
||||
EntityPlayer player = (EntityPlayer)entity;
|
||||
|
||||
HbmPlayerProps props = HbmPlayerProps.getData(player);
|
||||
|
||||
props.setDashCount(0);
|
||||
|
||||
ArmorFSB chestplate = null;
|
||||
|
||||
int armorDashCount = 0;
|
||||
int armorModDashCount = 0;
|
||||
|
||||
if(ArmorFSB.hasFSBArmor(player)) {
|
||||
ItemStack plate = player.inventory.armorInventory[2];
|
||||
|
||||
chestplate = (ArmorFSB)plate.getItem();
|
||||
}
|
||||
|
||||
if(chestplate != null)
|
||||
armorDashCount = chestplate.dashCount;
|
||||
|
||||
for(int armorSlot = 0; armorSlot < 4; armorSlot++) {
|
||||
ItemStack armorStack = player.inventory.armorInventory[armorSlot];
|
||||
|
||||
if(armorStack != null && armorStack.getItem() instanceof ItemArmor) {
|
||||
|
||||
for(int modSlot = 0; modSlot < 8; modSlot++) {
|
||||
ItemStack mod = ArmorModHandler.pryMods(armorStack)[modSlot];
|
||||
|
||||
if(mod != null && mod.getItem() instanceof IArmorModDash) {
|
||||
int count = ((IArmorModDash)mod.getItem()).getDashes();
|
||||
armorModDashCount += count;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
int dashCount = armorDashCount + armorModDashCount;
|
||||
|
||||
//System.out.println(dashCount);
|
||||
|
||||
if(dashCount * 30 < props.getStamina())
|
||||
props.setStamina(dashCount * 30);
|
||||
|
||||
if(dashCount > 0) {
|
||||
|
||||
int perDash = 30;
|
||||
|
||||
props.setDashCount(dashCount);
|
||||
|
||||
int stamina = props.getStamina();
|
||||
|
||||
if(props.getDashCooldown() <= 0) {
|
||||
|
||||
if(!player.capabilities.isFlying && player.isSneaking() && stamina >= perDash) {
|
||||
|
||||
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);
|
||||
stamina -= perDash;
|
||||
}
|
||||
} else {
|
||||
props.setDashCooldown(props.getDashCooldown() - 1);
|
||||
}
|
||||
|
||||
if(stamina < props.getDashCount() * perDash) {
|
||||
stamina++;
|
||||
|
||||
if(stamina % perDash == perDash-1) {
|
||||
|
||||
player.playSound("hbm:player.dashRecharge", 1.0F, (1.0F + ((1F/12F)*(stamina/perDash))));
|
||||
stamina++;
|
||||
}
|
||||
}
|
||||
|
||||
props.setStamina(stamina);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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));
|
||||
|
||||
|
||||
6
src/main/java/com/hbm/interfaces/IArmorModDash.java
Normal file
6
src/main/java/com/hbm/interfaces/IArmorModDash.java
Normal file
@ -0,0 +1,6 @@
|
||||
package com.hbm.interfaces;
|
||||
|
||||
public interface IArmorModDash {
|
||||
|
||||
public int getDashes();
|
||||
}
|
||||
@ -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;
|
||||
@ -343,13 +344,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);
|
||||
@ -572,9 +573,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();
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.inventory.container;
|
||||
|
||||
import com.hbm.inventory.SlotMachineOutput;
|
||||
import com.hbm.tileentity.machine.TileEntityNukeFurnace;
|
||||
import com.hbm.util.InventoryUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.entity.player.InventoryPlayer;
|
||||
@ -11,116 +12,110 @@ import net.minecraft.inventory.Slot;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerNukeFurnace extends Container {
|
||||
|
||||
|
||||
private TileEntityNukeFurnace diFurnace;
|
||||
private int dualCookTime;
|
||||
private int dualPower;
|
||||
private int lastItemBurnTime;
|
||||
|
||||
|
||||
public ContainerNukeFurnace(InventoryPlayer invPlayer, TileEntityNukeFurnace tedf) {
|
||||
dualCookTime = 0;
|
||||
dualPower = 0;
|
||||
lastItemBurnTime = 0;
|
||||
|
||||
|
||||
diFurnace = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 56, 53));
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 56, 53) {
|
||||
@Override
|
||||
public int getSlotStackLimit() {
|
||||
return 1;
|
||||
}
|
||||
});
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 56, 17));
|
||||
this.addSlotToContainer(new SlotMachineOutput(tedf, 2, 116, 35));
|
||||
|
||||
for(int i = 0; i < 3; i++)
|
||||
{
|
||||
for(int j = 0; j < 9; j++)
|
||||
{
|
||||
|
||||
for(int i = 0; i < 3; i++) {
|
||||
for(int j = 0; j < 9; j++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, j + i * 9 + 9, 8 + j * 18, 84 + i * 18));
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < 9; i++)
|
||||
{
|
||||
|
||||
for(int i = 0; i < 9; i++) {
|
||||
this.addSlotToContainer(new Slot(invPlayer, i, 8 + i * 18, 142));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void addCraftingToCrafters(ICrafting crafting) {
|
||||
super.addCraftingToCrafters(crafting);
|
||||
crafting.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime);
|
||||
crafting.sendProgressBarUpdate(this, 1, this.diFurnace.dualPower);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2)
|
||||
{
|
||||
public ItemStack transferStackInSlot(EntityPlayer p_82846_1_, int par2) {
|
||||
ItemStack var3 = null;
|
||||
Slot var4 = (Slot) this.inventorySlots.get(par2);
|
||||
|
||||
if (var4 != null && var4.getHasStack())
|
||||
{
|
||||
|
||||
if(var4 != null && var4.getHasStack()) {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if (par2 <= 2) {
|
||||
if (!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true))
|
||||
{
|
||||
|
||||
if(par2 <= 2) {
|
||||
if(!this.mergeItemStack(var5, 3, this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
else if (!this.mergeItemStack(var5, 1, 2, false))
|
||||
{
|
||||
if (!this.mergeItemStack(var5, 0, 1, false))
|
||||
} else {
|
||||
|
||||
if(TileEntityNukeFurnace.getFuelValue(var5) > 0) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, 1, false))
|
||||
return null;
|
||||
} else {
|
||||
if(!this.mergeItemStack(var5, 1, 2, false))
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
if (var5.stackSize == 0)
|
||||
{
|
||||
|
||||
if(var5.stackSize == 0) {
|
||||
var4.putStack((ItemStack) null);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return var3;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void detectAndSendChanges() {
|
||||
super.detectAndSendChanges();
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++)
|
||||
{
|
||||
ICrafting par1 = (ICrafting)this.crafters.get(i);
|
||||
|
||||
if(this.dualCookTime != this.diFurnace.dualCookTime)
|
||||
{
|
||||
|
||||
for(int i = 0; i < this.crafters.size(); i++) {
|
||||
ICrafting par1 = (ICrafting) this.crafters.get(i);
|
||||
|
||||
if(this.dualCookTime != this.diFurnace.dualCookTime) {
|
||||
par1.sendProgressBarUpdate(this, 0, this.diFurnace.dualCookTime);
|
||||
}
|
||||
|
||||
if(this.dualPower != this.diFurnace.dualPower)
|
||||
{
|
||||
|
||||
if(this.dualPower != this.diFurnace.dualPower) {
|
||||
par1.sendProgressBarUpdate(this, 1, this.diFurnace.dualPower);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
this.dualCookTime = this.diFurnace.dualCookTime;
|
||||
this.dualPower = this.diFurnace.dualPower;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public void updateProgressBar(int i, int j) {
|
||||
if(i == 0)
|
||||
{
|
||||
if(i == 0) {
|
||||
diFurnace.dualCookTime = j;
|
||||
}
|
||||
if(i == 1)
|
||||
{
|
||||
if(i == 1) {
|
||||
diFurnace.dualPower = j;
|
||||
}
|
||||
}
|
||||
|
||||
@ -48,7 +48,6 @@ public class ContainerStorageDrum extends Container {
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= drum.getSizeInventory() - 1) {
|
||||
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, drum.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -11,10 +11,10 @@ import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ContainerWasteDrum extends Container {
|
||||
|
||||
private TileEntityWasteDrum diFurnace;
|
||||
private TileEntityWasteDrum drum;
|
||||
|
||||
public ContainerWasteDrum(InventoryPlayer invPlayer, TileEntityWasteDrum tedf) {
|
||||
diFurnace = tedf;
|
||||
drum = tedf;
|
||||
|
||||
this.addSlotToContainer(new Slot(tedf, 0, 71, 18));
|
||||
this.addSlotToContainer(new Slot(tedf, 1, 89, 18));
|
||||
@ -52,11 +52,11 @@ public class ContainerWasteDrum extends Container {
|
||||
ItemStack var5 = var4.getStack();
|
||||
var3 = var5.copy();
|
||||
|
||||
if(par2 <= diFurnace.getSizeInventory() - 1) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, diFurnace.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||
if(par2 <= drum.getSizeInventory() - 1) {
|
||||
if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, drum.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||
return null;
|
||||
}
|
||||
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, 0, false)) {
|
||||
} else if(!InventoryUtil.mergeItemStack(this.inventorySlots, var5, 0, drum.getSizeInventory(), false)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -65,6 +65,8 @@ public class ContainerWasteDrum extends Container {
|
||||
} else {
|
||||
var4.onSlotChanged();
|
||||
}
|
||||
|
||||
var4.onPickupFromSlot(p_82846_1_, var5);
|
||||
}
|
||||
|
||||
return var3;
|
||||
@ -72,6 +74,6 @@ public class ContainerWasteDrum extends Container {
|
||||
|
||||
@Override
|
||||
public boolean canInteractWith(EntityPlayer player) {
|
||||
return diFurnace.isUseableByPlayer(player);
|
||||
return drum.isUseableByPlayer(player);
|
||||
}
|
||||
}
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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))
|
||||
|
||||
@ -254,6 +254,9 @@ public class AnvilRecipes {
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(DESH.ingot(), 4), new OreDictStack(POLYMER.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)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_bismuth, 1))).setTier(4));
|
||||
constructionRecipes.add(new AnvilConstructionRecipe(
|
||||
new AStack[] {new OreDictStack(EUPH.ingot(), 4), new OreDictStack(AT.dust(), 2), new OreDictStack(VOLCANIC.gem(), 1)},
|
||||
new AnvilOutput(new ItemStack(ModItems.plate_euphemium, 4))).setTier(6));
|
||||
|
||||
@ -11,6 +11,7 @@ import com.hbm.interfaces.ICustomWarhead.SaltedFuel.HalfLifeType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.items.ItemEnums.EnumLegendaryType;
|
||||
import com.hbm.items.armor.*;
|
||||
import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart;
|
||||
import com.hbm.items.bomb.*;
|
||||
import com.hbm.items.food.*;
|
||||
import com.hbm.items.machine.*;
|
||||
@ -305,6 +306,7 @@ public class ModItems {
|
||||
public static Item plate_kevlar;
|
||||
public static Item plate_dineutronium;
|
||||
public static Item plate_desh;
|
||||
public static Item plate_bismuth;
|
||||
public static Item photo_panel;
|
||||
public static Item sat_base;
|
||||
public static Item thruster_nuclear;
|
||||
@ -936,6 +938,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;
|
||||
@ -2021,6 +2024,10 @@ public class ModItems {
|
||||
public static Item rpa_plate;
|
||||
public static Item rpa_legs;
|
||||
public static Item rpa_boots;
|
||||
public static Item bismuth_helmet;
|
||||
public static Item bismuth_plate;
|
||||
public static Item bismuth_legs;
|
||||
public static Item bismuth_boots;
|
||||
public static Item bj_helmet;
|
||||
public static Item bj_plate;
|
||||
public static Item bj_plate_jetpack;
|
||||
@ -2265,6 +2272,7 @@ public class ModItems {
|
||||
public static Item cape_radiation;
|
||||
public static Item cape_gasmask;
|
||||
public static Item cape_schrabidium;
|
||||
public static Item cape_hidden;
|
||||
/*public static Item cape_hbm;
|
||||
public static Item cape_dafnik;
|
||||
public static Item cape_lpkukin;
|
||||
@ -2642,6 +2650,7 @@ public class ModItems {
|
||||
plate_kevlar = new Item().setUnlocalizedName("plate_kevlar").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_kevlar");
|
||||
plate_dineutronium = new Item().setUnlocalizedName("plate_dineutronium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_dineutronium");
|
||||
plate_desh = new Item().setUnlocalizedName("plate_desh").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_desh");
|
||||
plate_bismuth = new ItemCustomLore().setUnlocalizedName("plate_bismuth").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":plate_bismuth");
|
||||
ingot_solinium = new Item().setUnlocalizedName("ingot_solinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":ingot_solinium");
|
||||
nugget_solinium = new Item().setUnlocalizedName("nugget_solinium").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":nugget_solinium");
|
||||
photo_panel = new Item().setUnlocalizedName("photo_panel").setCreativeTab(MainRegistry.partsTab).setTextureName(RefStrings.MODID + ":photo_panel");
|
||||
@ -3450,8 +3459,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");
|
||||
@ -4798,6 +4808,17 @@ public class ModItems {
|
||||
schrabidium_plate = new ArmorFSB(MainRegistry.aMatSchrab, 7, 1, RefStrings.MODID + ":textures/armor/schrabidium_1.png").cloneStats((ArmorFSB) schrabidium_helmet).setUnlocalizedName("schrabidium_plate").setTextureName(RefStrings.MODID + ":schrabidium_plate");
|
||||
schrabidium_legs = new ArmorFSB(MainRegistry.aMatSchrab, 7, 2, RefStrings.MODID + ":textures/armor/schrabidium_2.png").cloneStats((ArmorFSB) schrabidium_helmet).setCap(4F).setMod(0.1F).setUnlocalizedName("schrabidium_legs").setTextureName(RefStrings.MODID + ":schrabidium_legs");
|
||||
schrabidium_boots = new ArmorFSB(MainRegistry.aMatSchrab, 7, 3, RefStrings.MODID + ":textures/armor/schrabidium_1.png").cloneStats((ArmorFSB) schrabidium_helmet).setCap(4F).setMod(0.1F).setUnlocalizedName("schrabidium_boots").setTextureName(RefStrings.MODID + ":schrabidium_boots");
|
||||
bismuth_helmet = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 0, RefStrings.MODID + ":textures/armor/starmetal_1.png").setCap(8F).setMod(0.3F)
|
||||
.addResistance("fall", 0)
|
||||
.addEffect(new PotionEffect(Potion.jump.id, 20, 6))
|
||||
.addEffect(new PotionEffect(Potion.moveSpeed.id, 20, 6))
|
||||
.addEffect(new PotionEffect(Potion.regeneration.id, 20, 1))
|
||||
.addEffect(new PotionEffect(Potion.nightVision.id, 15 * 20, 0))
|
||||
.setDashCount(3)
|
||||
.setUnlocalizedName("bismuth_helmet").setTextureName(RefStrings.MODID + ":bismuth_helmet");
|
||||
bismuth_plate = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_2.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_plate").setTextureName(RefStrings.MODID + ":bismuth_plate");
|
||||
bismuth_legs = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_legs").setTextureName(RefStrings.MODID + ":bismuth_legs");
|
||||
bismuth_boots = new ArmorBismuth(MainRegistry.aMatBismuth, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png").cloneStats((ArmorFSB) bismuth_helmet).setCap(8F).setMod(0.3F).setUnlocalizedName("bismuth_boots").setTextureName(RefStrings.MODID + ":bismuth_boots");
|
||||
titanium_helmet = new ArmorFSB(MainRegistry.aMatTitan, 7, 0, RefStrings.MODID + ":textures/armor/titanium_1.png").setMod(0.85F).setUnlocalizedName("titanium_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_helmet");
|
||||
titanium_plate = new ArmorFSB(MainRegistry.aMatTitan, 7, 1, RefStrings.MODID + ":textures/armor/titanium_1.png").cloneStats((ArmorFSB) titanium_helmet).setUnlocalizedName("titanium_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_plate");
|
||||
titanium_legs = new ArmorFSB(MainRegistry.aMatTitan, 7, 2, RefStrings.MODID + ":textures/armor/titanium_2.png").cloneStats((ArmorFSB) titanium_helmet).setUnlocalizedName("titanium_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":titanium_legs");
|
||||
@ -4873,6 +4894,7 @@ public class ModItems {
|
||||
.setBlastProtection(0.5F)
|
||||
.addResistance("monoxide", 0F)
|
||||
.addResistance("fall", 0)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("t45_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_helmet");
|
||||
t45_plate = new ArmorT45(aMatT45, 2, 1, 1000000, 10000, 1000, 5).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_plate");
|
||||
t45_legs = new ArmorT45(aMatT45, 2, 2, 1000000, 10000, 1000, 5).cloneStats((ArmorFSB) t45_helmet).setUnlocalizedName("t45_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":t45_legs");
|
||||
@ -4887,6 +4909,7 @@ public class ModItems {
|
||||
.setBlastProtection(0.5F)
|
||||
.addResistance("monoxide", 0F)
|
||||
.addResistance("fall", 0)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("steamsuit_helmet").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_helmet");
|
||||
steamsuit_plate = new ArmorDesh(aMatDesh, 2, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", Fluids.STEAM, 360000, 500, 50, 1).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_plate").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_plate");
|
||||
steamsuit_legs = new ArmorDesh(aMatDesh, 2, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", Fluids.STEAM, 360000, 500, 50, 1).cloneStats((ArmorFSB) steamsuit_helmet).setUnlocalizedName("steamsuit_legs").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":steamsuit_legs");
|
||||
@ -4906,7 +4929,9 @@ public class ModItems {
|
||||
.setJump("hbm:step.iron_jump")
|
||||
.setFall("hbm:step.iron_land")
|
||||
.addResistance("monoxide", 0F)
|
||||
.addResistance("fall", 0).setUnlocalizedName("ajr_helmet").setTextureName(RefStrings.MODID + ":ajr_helmet");
|
||||
.addResistance("fall", 0)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("ajr_helmet").setTextureName(RefStrings.MODID + ":ajr_helmet");
|
||||
ajr_plate = new ArmorAJR(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_plate").setTextureName(RefStrings.MODID + ":ajr_plate");
|
||||
ajr_legs = new ArmorAJR(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_legs").setTextureName(RefStrings.MODID + ":ajr_legs");
|
||||
ajr_boots = new ArmorAJR(aMatAJR, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajr_helmet).setUnlocalizedName("ajr_boots").setTextureName(RefStrings.MODID + ":ajr_boots");
|
||||
@ -4923,7 +4948,9 @@ public class ModItems {
|
||||
.setJump("hbm:step.iron_jump")
|
||||
.setFall("hbm:step.iron_land")
|
||||
.addResistance("monoxide", 0F)
|
||||
.addResistance("fall", 0).setUnlocalizedName("ajro_helmet").setTextureName(RefStrings.MODID + ":ajro_helmet");
|
||||
.addResistance("fall", 0)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("ajro_helmet").setTextureName(RefStrings.MODID + ":ajro_helmet");
|
||||
ajro_plate = new ArmorAJRO(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_plate").setTextureName(RefStrings.MODID + ":ajro_plate");
|
||||
ajro_legs = new ArmorAJRO(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_legs").setTextureName(RefStrings.MODID + ":ajro_legs");
|
||||
ajro_boots = new ArmorAJRO(aMatAJR, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) ajro_helmet).setUnlocalizedName("ajro_boots").setTextureName(RefStrings.MODID + ":ajro_boots");
|
||||
@ -4940,7 +4967,9 @@ public class ModItems {
|
||||
.setStep("hbm:step.powered")
|
||||
.setJump("hbm:step.powered")
|
||||
.setFall("hbm:step.powered")
|
||||
.addResistance("fall", 0).setUnlocalizedName("rpa_helmet").setTextureName(RefStrings.MODID + ":rpa_helmet");
|
||||
.addResistance("fall", 0)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("rpa_helmet").setTextureName(RefStrings.MODID + ":rpa_helmet");
|
||||
rpa_plate = new ArmorRPA(aMatAJR, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_plate").setTextureName(RefStrings.MODID + ":rpa_plate");
|
||||
rpa_legs = new ArmorRPA(aMatAJR, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_legs").setTextureName(RefStrings.MODID + ":rpa_legs");
|
||||
rpa_boots = new ArmorRPA(aMatAJR, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 2500000, 10000, 2000, 25).cloneStats((ArmorFSB) rpa_helmet).setUnlocalizedName("rpa_boots").setTextureName(RefStrings.MODID + ":rpa_boots");
|
||||
@ -4959,13 +4988,12 @@ public class ModItems {
|
||||
.addEffect(new PotionEffect(HbmPotion.radx.id, 20, 0))
|
||||
.setBlastProtection(0.5F)
|
||||
.setProtectionLevel(500F)
|
||||
//.setGravity(0.02D)
|
||||
.setStep("hbm:step.metal")
|
||||
.setJump("hbm:step.iron_jump")
|
||||
.setFall("hbm:step.iron_land")
|
||||
.addResistance("fall", 0).setUnlocalizedName("bj_helmet").setTextureName(RefStrings.MODID + ":bj_helmet");
|
||||
bj_plate = new ArmorBJ(aMatBJ, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate").setTextureName(RefStrings.MODID + ":bj_plate");
|
||||
bj_plate_jetpack = new ArmorBJJetpack(aMatBJ, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_plate_jetpack").setTextureName(RefStrings.MODID + ":bj_plate_jetpack");
|
||||
bj_plate_jetpack = new ArmorBJJetpack(aMatBJ, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).hides(EnumPlayerPart.LEFT_ARM, EnumPlayerPart.RIGHT_ARM).setUnlocalizedName("bj_plate_jetpack").setTextureName(RefStrings.MODID + ":bj_plate_jetpack");
|
||||
bj_legs = new ArmorBJ(aMatBJ, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_legs").setTextureName(RefStrings.MODID + ":bj_legs");
|
||||
bj_boots = new ArmorBJ(aMatBJ, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 1000, 100).cloneStats((ArmorFSB) bj_helmet).setUnlocalizedName("bj_boots").setTextureName(RefStrings.MODID + ":bj_boots");
|
||||
|
||||
@ -4980,7 +5008,9 @@ public class ModItems {
|
||||
.setHasCustomGeiger(true)
|
||||
.addResistance("fall", 0.5F)
|
||||
.addResistance("monoxide", 0F)
|
||||
.addResistance("onFire", 0F).setUnlocalizedName("hev_helmet").setTextureName(RefStrings.MODID + ":hev_helmet");
|
||||
.addResistance("onFire", 0F)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("hev_helmet").setTextureName(RefStrings.MODID + ":hev_helmet");
|
||||
hev_plate = new ArmorHEV(aMatHEV, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_plate").setTextureName(RefStrings.MODID + ":hev_plate");
|
||||
hev_legs = new ArmorHEV(aMatHEV, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_legs").setTextureName(RefStrings.MODID + ":hev_legs");
|
||||
hev_boots = new ArmorHEV(aMatHEV, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000, 10000, 2500, 0).cloneStats((ArmorFSB) hev_helmet).setUnlocalizedName("hev_boots").setTextureName(RefStrings.MODID + ":hev_boots");
|
||||
@ -5003,9 +5033,11 @@ public class ModItems {
|
||||
.setProtectionLevel(1000F)
|
||||
.addResistance("fall", 0F)
|
||||
.addResistance("monoxide", 0F)
|
||||
.setFireproof(true).setUnlocalizedName("fau_helmet").setTextureName(RefStrings.MODID + ":fau_helmet");
|
||||
fau_plate = new ArmorDigamma(aMatFau, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_plate").setTextureName(RefStrings.MODID + ":fau_plate");
|
||||
fau_legs = new ArmorDigamma(aMatFau, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_legs").setTextureName(RefStrings.MODID + ":fau_legs");
|
||||
.setFireproof(true)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("fau_helmet").setTextureName(RefStrings.MODID + ":fau_helmet");
|
||||
fau_plate = new ArmorDigamma(aMatFau, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setFullSetForHide().setUnlocalizedName("fau_plate").setTextureName(RefStrings.MODID + ":fau_plate");
|
||||
fau_legs = new ArmorDigamma(aMatFau, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).hides(EnumPlayerPart.LEFT_LEG, EnumPlayerPart.RIGHT_LEG).setFullSetForHide().setUnlocalizedName("fau_legs").setTextureName(RefStrings.MODID + ":fau_legs");
|
||||
fau_boots = new ArmorDigamma(aMatFau, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 10000000, 10000, 2500, 0).cloneStats((ArmorFSB) fau_helmet).setUnlocalizedName("fau_boots").setTextureName(RefStrings.MODID + ":fau_boots");
|
||||
|
||||
ArmorMaterial aMatDNS = EnumHelper.addArmorMaterial("HBM_DNT_NANO", 150, new int[] { 3, 8, 6, 3 }, 100);
|
||||
@ -5021,7 +5053,9 @@ public class ModItems {
|
||||
.setStep("hbm:step.metal")
|
||||
.setJump("hbm:step.iron_jump")
|
||||
.setFall("hbm:step.iron_land")
|
||||
.setFireproof(true).setUnlocalizedName("dns_helmet").setTextureName(RefStrings.MODID + ":dns_helmet");
|
||||
.setFireproof(true)
|
||||
.hides(EnumPlayerPart.HAT)
|
||||
.setUnlocalizedName("dns_helmet").setTextureName(RefStrings.MODID + ":dns_helmet");
|
||||
dns_plate = new ArmorDNT(aMatDNS, 7, 1, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000000, 1000000, 100000, 115).cloneStats((ArmorFSB) dns_helmet).setUnlocalizedName("dns_plate").setTextureName(RefStrings.MODID + ":dns_plate");
|
||||
dns_legs = new ArmorDNT(aMatDNS, 7, 2, RefStrings.MODID + ":textures/armor/starmetal_2.png", 1000000000, 1000000, 100000, 115).cloneStats((ArmorFSB) dns_helmet).setUnlocalizedName("dns_legs").setTextureName(RefStrings.MODID + ":dns_legs");
|
||||
dns_boots = new ArmorDNT(aMatDNS, 7, 3, RefStrings.MODID + ":textures/armor/starmetal_1.png", 1000000000, 1000000, 100000, 115).cloneStats((ArmorFSB) dns_helmet).setUnlocalizedName("dns_boots").setTextureName(RefStrings.MODID + ":dns_boots");
|
||||
@ -5384,6 +5418,7 @@ public class ModItems {
|
||||
cape_radiation = new ArmorModel(ArmorMaterial.CHAIN, 9, 1).setUnlocalizedName("cape_radiation").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_radiation");
|
||||
cape_gasmask = new ArmorModel(ArmorMaterial.CHAIN, 9, 1).setUnlocalizedName("cape_gasmask").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_gasmask");
|
||||
cape_schrabidium = new ArmorModel(MainRegistry.aMatSchrab, 9, 1).setUnlocalizedName("cape_schrabidium").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_schrabidium");
|
||||
cape_hidden = new ArmorModel(ArmorMaterial.CHAIN, 9, 1).setUnlocalizedName("cape_hidden").setCreativeTab(MainRegistry.consumableTab).setMaxStackSize(1).setTextureName(RefStrings.MODID + ":cape_unknown");
|
||||
|
||||
schrabidium_hammer = new WeaponSpecial(MainRegistry.tMatHammmer).setUnlocalizedName("schrabidium_hammer").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":schrabidium_hammer");
|
||||
shimmer_sledge = new WeaponSpecial(MainRegistry.enumToolMaterialSledge).setUnlocalizedName("shimmer_sledge").setMaxStackSize(1).setTextureName(RefStrings.MODID + ":shimmer_sledge_original");
|
||||
@ -5448,7 +5483,7 @@ public class ModItems {
|
||||
record_glass = new ItemModRecord("glass").setUnlocalizedName("record_glass").setCreativeTab(null).setTextureName(RefStrings.MODID + ":record_glass");
|
||||
|
||||
book_guide = new ItemGuideBook().setUnlocalizedName("book_guide").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":book_guide");
|
||||
holotape_image = new ItemHolotapeImage().setUnlocalizedName("holotape_image").setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":holotape");
|
||||
holotape_image = new ItemHolotapeImage().setUnlocalizedName("holotape_image").setCreativeTab(null).setTextureName(RefStrings.MODID + ":holotape");
|
||||
holotape_damaged = new Item().setUnlocalizedName("holotape_damaged").setCreativeTab(null).setTextureName(RefStrings.MODID + ":holotape_damaged");
|
||||
|
||||
polaroid = new ItemPolaroid().setUnlocalizedName("polaroid").setMaxStackSize(1).setCreativeTab(MainRegistry.consumableTab).setTextureName(RefStrings.MODID + ":polaroid_" + MainRegistry.polaroidID);
|
||||
@ -6012,6 +6047,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(plate_kevlar, plate_kevlar.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_dalekanium, plate_dalekanium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_desh, plate_desh.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_bismuth, plate_bismuth.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_euphemium, plate_euphemium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(plate_dineutronium, plate_dineutronium.getUnlocalizedName());
|
||||
|
||||
@ -7376,6 +7412,7 @@ public class ModItems {
|
||||
GameRegistry.registerItem(cape_radiation, cape_radiation.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_gasmask, cape_gasmask.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_schrabidium, cape_schrabidium.getUnlocalizedName());
|
||||
GameRegistry.registerItem(cape_hidden, cape_hidden.getUnlocalizedName());
|
||||
|
||||
//Tools
|
||||
GameRegistry.registerItem(schrabidium_sword, schrabidium_sword.getUnlocalizedName());
|
||||
@ -7567,6 +7604,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());
|
||||
@ -7883,6 +7921,10 @@ public class ModItems {
|
||||
GameRegistry.registerItem(schrabidium_plate, schrabidium_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(schrabidium_legs, schrabidium_legs.getUnlocalizedName());
|
||||
GameRegistry.registerItem(schrabidium_boots, schrabidium_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bismuth_helmet, bismuth_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bismuth_plate, bismuth_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bismuth_legs, bismuth_legs.getUnlocalizedName());
|
||||
GameRegistry.registerItem(bismuth_boots, bismuth_boots.getUnlocalizedName());
|
||||
GameRegistry.registerItem(euphemium_helmet, euphemium_helmet.getUnlocalizedName());
|
||||
GameRegistry.registerItem(euphemium_plate, euphemium_plate.getUnlocalizedName());
|
||||
GameRegistry.registerItem(euphemium_legs, euphemium_legs.getUnlocalizedName());
|
||||
|
||||
35
src/main/java/com/hbm/items/armor/ArmorBismuth.java
Normal file
35
src/main/java/com/hbm/items/armor/ArmorBismuth.java
Normal file
@ -0,0 +1,35 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import com.hbm.render.model.ModelArmorBismuth;
|
||||
import com.hbm.render.model.ModelArmorRPA;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.client.model.ModelBiped;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ArmorBismuth extends ArmorFSB {
|
||||
|
||||
public ArmorBismuth(ArmorMaterial material, int layer, int slot, String texture) {
|
||||
super(material, layer, slot, texture);
|
||||
}
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
ModelArmorBismuth[] models;
|
||||
|
||||
@Override
|
||||
@SideOnly(Side.CLIENT)
|
||||
public ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, int armorSlot) {
|
||||
|
||||
if(models == null) {
|
||||
models = new ModelArmorBismuth[4];
|
||||
|
||||
for(int i = 0; i < 4; i++)
|
||||
models[i] = new ModelArmorBismuth(i);
|
||||
}
|
||||
|
||||
return models[armorSlot];
|
||||
}
|
||||
|
||||
}
|
||||
@ -2,12 +2,15 @@ package com.hbm.items.armor;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
@ -40,7 +43,7 @@ import net.minecraftforge.event.entity.living.LivingAttackEvent;
|
||||
import net.minecraftforge.event.entity.living.LivingHurtEvent;
|
||||
|
||||
//Armor with full set bonus
|
||||
public class ArmorFSB extends ItemArmor {
|
||||
public class ArmorFSB extends ItemArmor implements IArmorDisableModel {
|
||||
|
||||
private String texture = "";
|
||||
private ResourceLocation overlay = null;
|
||||
@ -60,6 +63,7 @@ public class ArmorFSB extends ItemArmor {
|
||||
public boolean customGeiger = false;
|
||||
public boolean hardLanding = false;
|
||||
public double gravity = 0;
|
||||
public int dashCount = 0;
|
||||
public String step;
|
||||
public String jump;
|
||||
public String fall;
|
||||
@ -148,6 +152,11 @@ public class ArmorFSB extends ItemArmor {
|
||||
this.gravity = gravity;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setDashCount(int dashCount) {
|
||||
this.dashCount = dashCount;
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setStep(String step) {
|
||||
this.step = step;
|
||||
@ -188,6 +197,7 @@ public class ArmorFSB extends ItemArmor {
|
||||
this.customGeiger = original.customGeiger;
|
||||
this.hardLanding = original.hardLanding;
|
||||
this.gravity = original.gravity;
|
||||
this.dashCount = original.dashCount;
|
||||
this.step = original.step;
|
||||
this.jump = original.jump;
|
||||
this.fall = original.fall;
|
||||
@ -270,6 +280,10 @@ public class ArmorFSB extends ItemArmor {
|
||||
if(gravity != 0) {
|
||||
list.add(EnumChatFormatting.BLUE + " " + I18nUtil.resolveKey("armor.gravity", gravity));
|
||||
}
|
||||
|
||||
if(dashCount > 0) {
|
||||
list.add(EnumChatFormatting.AQUA + " " + I18nUtil.resolveKey("armor.dash", dashCount));
|
||||
}
|
||||
|
||||
if(protectionYield != 100F) {
|
||||
list.add(EnumChatFormatting.BLUE + " Protection applies to damage <" + protectionYield);
|
||||
@ -448,6 +462,46 @@ public class ArmorFSB extends ItemArmor {
|
||||
} catch(Exception x) {
|
||||
}
|
||||
}
|
||||
/*
|
||||
if(dashCount > 0) {
|
||||
|
||||
int perDash = 60;
|
||||
|
||||
HbmPlayerProps props = (HbmPlayerProps) player.getExtendedProperties("NTM_EXT_PLAYER");
|
||||
|
||||
props.setDashCount(dashCount);
|
||||
|
||||
int stamina = props.getStamina();
|
||||
|
||||
if(props.getDashCooldown() <= 0) {
|
||||
|
||||
if(!player.capabilities.isFlying && player.isSneaking() && stamina >= perDash) {
|
||||
|
||||
Vec3 lookingIn = player.getLookVec();
|
||||
lookingIn.yCoord = 0;
|
||||
lookingIn.normalize();
|
||||
player.addVelocity(lookingIn.xCoord, 0, lookingIn.zCoord);
|
||||
player.playSound("hbm:player.dash", 1.0F, 1.0F);
|
||||
|
||||
props.setDashCooldown(HbmPlayerProps.dashCooldownLength);
|
||||
stamina -= perDash;
|
||||
}
|
||||
} else {
|
||||
props.setDashCooldown(props.getDashCooldown() - 1);
|
||||
}
|
||||
|
||||
if(stamina < props.getDashCount() * perDash) {
|
||||
stamina++;
|
||||
|
||||
if(stamina % perDash == perDash-1) {
|
||||
|
||||
player.playSound("hbm:player.dashRecharge", 1.0F, (1.0F + ((1F/12F)*(stamina/perDash))));
|
||||
stamina++;
|
||||
}
|
||||
}
|
||||
|
||||
props.setStamina(stamina);
|
||||
} */
|
||||
}
|
||||
}
|
||||
|
||||
@ -579,4 +633,22 @@ public class ArmorFSB extends ItemArmor {
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
|
||||
private HashSet<EnumPlayerPart> hidden = new HashSet();
|
||||
private boolean needsFullSet = false;
|
||||
|
||||
public ArmorFSB hides(EnumPlayerPart... parts) {
|
||||
Collections.addAll(hidden, parts);
|
||||
return this;
|
||||
}
|
||||
|
||||
public ArmorFSB setFullSetForHide() {
|
||||
needsFullSet = true;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean disablesPart(EntityPlayer player, ItemStack stack, EnumPlayerPart part) {
|
||||
return hidden.contains(part) && (!needsFullSet || hasFSBArmorIgnoreCharge(player));
|
||||
}
|
||||
}
|
||||
|
||||
@ -80,7 +80,7 @@ public class ArmorModel extends ItemArmor {
|
||||
return this.modelHat;
|
||||
}
|
||||
}
|
||||
if (this == ModItems.cape_test || this == ModItems.cape_radiation || this == ModItems.cape_gasmask || this == ModItems.cape_schrabidium) {
|
||||
if (this == ModItems.cape_test || this == ModItems.cape_radiation || this == ModItems.cape_gasmask || this == ModItems.cape_schrabidium || this == ModItems.cape_hidden) {
|
||||
if (armorSlot == 1) {
|
||||
if (this.modelCloak == null) {
|
||||
this.modelCloak = new ModelCloak();
|
||||
@ -111,6 +111,9 @@ public class ArmorModel extends ItemArmor {
|
||||
if (stack.getItem() == ModItems.cape_schrabidium) {
|
||||
return "hbm:textures/models/capes/CapeSchrabidium.png";
|
||||
}
|
||||
if (stack.getItem() == ModItems.cape_hidden) {
|
||||
return "hbm:textures/models/capes/CapeHidden.png";
|
||||
}
|
||||
|
||||
return "hbm:textures/models/capes/CapeUnknown.png";
|
||||
}
|
||||
|
||||
19
src/main/java/com/hbm/items/armor/IArmorDisableModel.java
Normal file
19
src/main/java/com/hbm/items/armor/IArmorDisableModel.java
Normal file
@ -0,0 +1,19 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public interface IArmorDisableModel {
|
||||
|
||||
public boolean disablesPart(EntityPlayer player, ItemStack stack, EnumPlayerPart part);
|
||||
|
||||
public static enum EnumPlayerPart {
|
||||
HEAD,
|
||||
HAT,
|
||||
BODY,
|
||||
LEFT_ARM,
|
||||
RIGHT_ARM,
|
||||
LEFT_LEG,
|
||||
RIGHT_LEG
|
||||
}
|
||||
}
|
||||
@ -1,42 +1,47 @@
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemModV1 extends ItemArmorMod {
|
||||
|
||||
private static final UUID speed = UUID.fromString("1d11e63e-28c4-4e14-b09f-fe0bd1be708f");
|
||||
|
||||
public ItemModV1() {
|
||||
super(ArmorModHandler.extra, false, true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "V1 SPEED", 0.5, 2));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
list.add(EnumChatFormatting.RED + "BLOOD IS FUEL");
|
||||
list.add("");
|
||||
super.addInformation(stack, player, list, bool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
list.add(EnumChatFormatting.RED + " " + stack.getDisplayName() + " (BLOOD IS FUEL)");
|
||||
}
|
||||
}
|
||||
package com.hbm.items.armor;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.handler.ArmorModHandler;
|
||||
import com.hbm.interfaces.IArmorModDash;
|
||||
|
||||
import net.minecraft.entity.SharedMonsterAttributes;
|
||||
import net.minecraft.entity.ai.attributes.AttributeModifier;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
|
||||
public class ItemModV1 extends ItemArmorMod implements IArmorModDash {
|
||||
|
||||
private static final UUID speed = UUID.fromString("1d11e63e-28c4-4e14-b09f-fe0bd1be708f");
|
||||
|
||||
public ItemModV1() {
|
||||
super(ArmorModHandler.extra, false, true, false, false);
|
||||
}
|
||||
|
||||
@Override
|
||||
public Multimap getModifiers(ItemStack armor) {
|
||||
Multimap multimap = super.getAttributeModifiers(armor);
|
||||
multimap.put(SharedMonsterAttributes.movementSpeed.getAttributeUnlocalizedName(), new AttributeModifier(speed, "V1 SPEED", 0.5, 2));
|
||||
return multimap;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
list.add(EnumChatFormatting.RED + "BLOOD IS FUEL");
|
||||
list.add("");
|
||||
super.addInformation(stack, player, list, bool);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addDesc(List list, ItemStack stack, ItemStack armor) {
|
||||
list.add(EnumChatFormatting.RED + " " + stack.getDisplayName() + " (BLOOD IS FUEL)");
|
||||
}
|
||||
|
||||
public int getDashes() {
|
||||
return 3;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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 (4174)";
|
||||
public static final String VERSION = "1.0.27 BETA (4186)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -84,7 +84,7 @@ import com.hbm.tileentity.machine.rbmk.*;
|
||||
import com.hbm.tileentity.machine.storage.*;
|
||||
import com.hbm.tileentity.network.*;
|
||||
import com.hbm.tileentity.turret.*;
|
||||
import com.hbm.util.SoundUtil;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
|
||||
import cpw.mods.fml.client.registry.ClientRegistry;
|
||||
import cpw.mods.fml.client.registry.RenderingRegistry;
|
||||
@ -93,6 +93,34 @@ import cpw.mods.fml.relauncher.ReflectionHelper;
|
||||
|
||||
public class ClientProxy extends ServerProxy {
|
||||
|
||||
@Override
|
||||
public void registerRenderInfo() {
|
||||
|
||||
registerClientEventHandler(new ModEventHandlerClient());
|
||||
registerClientEventHandler(new ModEventHandlerRenderer());
|
||||
|
||||
AdvancedModelLoader.registerModelHandler(new HmfModelLoader());
|
||||
ResourceManager.loadAnimatedModels();
|
||||
|
||||
registerTileEntitySpecialRenderer();
|
||||
registerItemRenderer();
|
||||
registerEntityRenderer();
|
||||
registerBlockRenderer();
|
||||
|
||||
RenderingRegistry.addNewArmourRendererPrefix("5");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("6");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("7");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("8");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("9");
|
||||
|
||||
//SoundUtil.addSoundCategory("ntmMachines");
|
||||
}
|
||||
|
||||
private void registerClientEventHandler(Object handler) {
|
||||
MinecraftForge.EVENT_BUS.register(handler);
|
||||
FMLCommonHandler.instance().bus().register(handler);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerTileEntitySpecialRenderer() {
|
||||
//test crap
|
||||
@ -651,6 +679,8 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderAnvil());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCrystal());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestCable());
|
||||
RenderingRegistry.registerBlockHandler(new RenderCableClassic());
|
||||
RenderingRegistry.registerBlockHandler(new RenderTestPipe());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockCT());
|
||||
RenderingRegistry.registerBlockHandler(new RenderDetCord());
|
||||
RenderingRegistry.registerBlockHandler(new RenderBlockMultipass());
|
||||
@ -665,30 +695,6 @@ public class ClientProxy extends ServerProxy {
|
||||
RenderingRegistry.registerBlockHandler(new RenderPribris());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerRenderInfo()
|
||||
{
|
||||
ModEventHandlerClient handler = new ModEventHandlerClient();
|
||||
MinecraftForge.EVENT_BUS.register(handler);
|
||||
FMLCommonHandler.instance().bus().register(handler);
|
||||
|
||||
AdvancedModelLoader.registerModelHandler(new HmfModelLoader());
|
||||
ResourceManager.loadAnimatedModels();
|
||||
|
||||
registerTileEntitySpecialRenderer();
|
||||
registerItemRenderer();
|
||||
registerEntityRenderer();
|
||||
registerBlockRenderer();
|
||||
|
||||
RenderingRegistry.addNewArmourRendererPrefix("5");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("6");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("7");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("8");
|
||||
RenderingRegistry.addNewArmourRendererPrefix("9");
|
||||
|
||||
SoundUtil.addSoundCategory("ntmMachines");
|
||||
}
|
||||
|
||||
@Override
|
||||
public void registerMissileItems() {
|
||||
|
||||
@ -1158,12 +1164,19 @@ public class ClientProxy extends ServerProxy {
|
||||
}
|
||||
}
|
||||
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix + ox, iy, iz + oz, p.motionX + moX * 2, p.motionY + moY * 2, p.motionZ + moZ * 2));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new EntityFlameFX(world, ix - ox, iy, iz - oz, p.motionX + moX * 2, p.motionY + moY * 2, p.motionZ + moZ * 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, p.motionX + moX * 3, p.motionY + moY * 3, p.motionZ + moZ * 3));
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(new net.minecraft.client.particle.EntitySmokeFX(world, ix - ox, iy, iz - oz, p.motionX + moX * 3, p.motionY + moY * 3, p.motionZ + moZ * 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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
@ -72,7 +71,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;
|
||||
|
||||
@ -143,6 +142,7 @@ public class MainRegistry {
|
||||
public static ArmorMaterial aMatSecurity = EnumHelper.addArmorMaterial("HBM_SECURITY", 100, new int[] { 3, 8, 6, 3 }, 15);
|
||||
public static ArmorMaterial aMatCobalt = EnumHelper.addArmorMaterial("HBM_COBALT", 70, new int[] { 3, 8, 6, 3 }, 25);
|
||||
public static ArmorMaterial aMatStarmetal = EnumHelper.addArmorMaterial("HBM_STARMETAL", 150, new int[] { 3, 8, 6, 3 }, 100);
|
||||
public static ArmorMaterial aMatBismuth = EnumHelper.addArmorMaterial("HBM_BISMUTH", 100, new int[] { 3, 8, 6, 3 }, 100);
|
||||
|
||||
// Creative Tabs
|
||||
|
||||
@ -974,6 +974,10 @@ public class MainRegistry {
|
||||
|
||||
//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
|
||||
@ -990,8 +994,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
|
||||
|
||||
|
||||
@ -62,6 +62,7 @@ import com.hbm.util.EntityDamageUtil;
|
||||
import com.hbm.world.WorldProviderNTM;
|
||||
import com.hbm.world.generator.TimedGenerator;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import cpw.mods.fml.common.eventhandler.Event.Result;
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
@ -1160,6 +1161,17 @@ public class ModEventHandler {
|
||||
}
|
||||
|
||||
/// PU RADIATION END ///
|
||||
|
||||
if(player instanceof EntityPlayerMP) {
|
||||
|
||||
int x = (int) Math.floor(player.posX);
|
||||
int y = (int) Math.floor(player.posY - 0.01);
|
||||
int z = (int) Math.floor(player.posZ);
|
||||
|
||||
if(player.worldObj.getTileEntity(x, y, z) instanceof IEnergyConductor) {
|
||||
PacketDispatcher.wrapper.sendTo(new PlayerInformPacket(((IEnergyConductor) player.worldObj.getTileEntity(x, y, z)).getPowerNet() + ""), (EntityPlayerMP) player);
|
||||
}
|
||||
}
|
||||
|
||||
/// NEW ITEM SYS START ///
|
||||
HazardSystem.updatePlayerInventory(player);
|
||||
|
||||
@ -59,6 +59,7 @@ import com.hbm.util.ArmorUtil;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
import com.mojang.authlib.minecraft.MinecraftProfileTexture.Type;
|
||||
|
||||
import api.hbm.energy.IEnergyConductor;
|
||||
import api.hbm.item.IButtonReceiver;
|
||||
import api.hbm.item.IClickReceiver;
|
||||
|
||||
@ -244,6 +245,16 @@ public class ModEventHandlerClient {
|
||||
tess.draw();
|
||||
|
||||
GL11.glEnable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
if(!event.isCanceled() && event.type == event.type.HOTBAR) {
|
||||
|
||||
HbmPlayerProps props = HbmPlayerProps.getData(player);
|
||||
if(props.getDashCount() > 0) {
|
||||
RenderScreenOverlay.renderDashBar(event.resolution, Minecraft.getMinecraft().ingameGUI, props);
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -798,52 +809,6 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
/*private static final ResourceLocation digammaStar = new ResourceLocation("hbm:textures/misc/star_digamma.png");
|
||||
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void onRenderDigammaStar(RenderWorldLastEvent event) {
|
||||
|
||||
World world = Minecraft.getMinecraft().theWorld;
|
||||
|
||||
if(world.provider.dimensionId != 0)
|
||||
return;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDepthMask(false);
|
||||
|
||||
GL11.glEnable(3553);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
OpenGlHelper.glBlendFunc(770, 1, 1, 0);
|
||||
|
||||
float partialTicks = event.partialTicks;
|
||||
|
||||
GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F);
|
||||
GL11.glRotatef(world.getCelestialAngle(partialTicks) * 360.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(140.0F, 1.0F, 0.0F, 0.0F);
|
||||
GL11.glRotatef(-40.0F, 0.0F, 0.0F, 1.0F);
|
||||
|
||||
FMLClientHandler.instance().getClient().renderEngine.bindTexture(digammaStar);
|
||||
|
||||
float var12 = 2.5F;
|
||||
double dist = 150D;
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
tessellator.startDrawingQuads();
|
||||
tessellator.addVertexWithUV(-var12, dist, -var12, 0.0D, 0.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, -var12, 0.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(var12, dist, var12, 1.0D, 1.0D);
|
||||
tessellator.addVertexWithUV(-var12, dist, var12, 1.0D, 0.0D);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glDepthMask(true);
|
||||
|
||||
GL11.glDisable(3042);
|
||||
GL11.glEnable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}*/
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST)
|
||||
public void preRenderEventFirst(RenderLivingEvent.Pre event) {
|
||||
|
||||
|
||||
72
src/main/java/com/hbm/main/ModEventHandlerRenderer.java
Normal file
72
src/main/java/com/hbm/main/ModEventHandlerRenderer.java
Normal file
@ -0,0 +1,72 @@
|
||||
package com.hbm.main;
|
||||
|
||||
import com.hbm.items.armor.IArmorDisableModel;
|
||||
import com.hbm.items.armor.IArmorDisableModel.EnumPlayerPart;
|
||||
|
||||
import cpw.mods.fml.common.eventhandler.EventPriority;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import net.minecraft.client.model.ModelRenderer;
|
||||
import net.minecraft.client.renderer.entity.RenderPlayer;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraftforge.client.event.RenderPlayerEvent;
|
||||
|
||||
public class ModEventHandlerRenderer {
|
||||
|
||||
private static boolean[] partsHidden = new boolean[7];
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.LOWEST, receiveCanceled = true)
|
||||
public void onRenderPlayerPre(RenderPlayerEvent.Pre event) {
|
||||
|
||||
EntityPlayer player = event.entityPlayer;
|
||||
RenderPlayer renderer = event.renderer;
|
||||
|
||||
for(int j = 0; j < 7; j++) {
|
||||
partsHidden[j] = false;
|
||||
}
|
||||
|
||||
for(int i = 1; i < 5; i++) {
|
||||
ItemStack stack = player.getEquipmentInSlot(i);
|
||||
|
||||
if(stack != null && stack.getItem() instanceof IArmorDisableModel) {
|
||||
IArmorDisableModel disable = (IArmorDisableModel) stack.getItem();
|
||||
|
||||
for(int j = 0; j < 7; j++) {
|
||||
EnumPlayerPart type = EnumPlayerPart.values()[j];
|
||||
ModelRenderer box = getBoxFromType(renderer, type);
|
||||
if(disable.disablesPart(player, stack, type) && !box.isHidden) {
|
||||
partsHidden[j] = true;
|
||||
box.isHidden = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@SubscribeEvent(priority = EventPriority.HIGHEST, receiveCanceled = true)
|
||||
public void onRenderPlayerPost(RenderPlayerEvent.Post event) {
|
||||
|
||||
RenderPlayer renderer = event.renderer;
|
||||
|
||||
for(int j = 0; j < 7; j++) {
|
||||
EnumPlayerPart type = EnumPlayerPart.values()[j];
|
||||
if(partsHidden[j]) {
|
||||
getBoxFromType(renderer, type).isHidden = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static ModelRenderer getBoxFromType(RenderPlayer renderer, EnumPlayerPart part) {
|
||||
|
||||
switch(part) {
|
||||
case BODY: return renderer.modelBipedMain.bipedBody;
|
||||
case HAT: return renderer.modelBipedMain.bipedHeadwear;
|
||||
case HEAD: return renderer.modelBipedMain.bipedHead;
|
||||
case LEFT_ARM: return renderer.modelBipedMain.bipedLeftArm;
|
||||
case LEFT_LEG: return renderer.modelBipedMain.bipedLeftLeg;
|
||||
case RIGHT_ARM: return renderer.modelBipedMain.bipedRightArm;
|
||||
case RIGHT_LEG: return renderer.modelBipedMain.bipedRightLeg;
|
||||
default: return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -366,7 +366,7 @@ public class ResourceManager {
|
||||
|
||||
//Tank
|
||||
public static final ResourceLocation tank_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank.png");
|
||||
public static final ResourceLocation tank_label_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank_NONE.png");
|
||||
public static final ResourceLocation tank_label_tex = new ResourceLocation(RefStrings.MODID, "textures/models/tank_label/tank_NONE.png");
|
||||
public static final ResourceLocation bat9000_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/bat9000.png");
|
||||
public static final ResourceLocation orbus_tex = new ResourceLocation(RefStrings.MODID, "textures/models/machines/orbus.png");
|
||||
|
||||
@ -647,6 +647,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom armor_dnt = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/dnt.obj"));
|
||||
public static final IModelCustom armor_steamsuit = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/steamsuit.obj"));
|
||||
public static final IModelCustom armor_remnant = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/remnant.obj"));
|
||||
public static final IModelCustom armor_bismuth = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/bismuth.obj"));
|
||||
public static final IModelCustom armor_mod_tesla = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/mod_tesla.obj"));
|
||||
public static final IModelCustom armor_wings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/murk.obj"));
|
||||
public static final IModelCustom armor_solstice = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/armor/solstice.obj"));
|
||||
@ -765,11 +766,13 @@ public class ResourceManager {
|
||||
public static final ResourceLocation rpa_arm = new ResourceLocation(RefStrings.MODID, "textures/armor/rpa_arm.png");
|
||||
|
||||
public static final ResourceLocation mod_tesla = new ResourceLocation(RefStrings.MODID, "textures/armor/mod_tesla.png");
|
||||
|
||||
public static final ResourceLocation armor_bismuth_tex = new ResourceLocation(RefStrings.MODID, "textures/armor/bismuth.png");
|
||||
|
||||
public static final ResourceLocation wings_murk = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_murk.png");
|
||||
public static final ResourceLocation wings_bob = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_bob.png");
|
||||
public static final ResourceLocation wings_black = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_black.png");
|
||||
public static final ResourceLocation wings_solstice = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_solstice.png");
|
||||
public static final ResourceLocation wings_solstice = new ResourceLocation(RefStrings.MODID, "textures/armor/wings_solstice.png");
|
||||
|
||||
public static final ResourceLocation hat = new ResourceLocation(RefStrings.MODID, "textures/armor/hat.png");
|
||||
public static final ResourceLocation goggles = new ResourceLocation(RefStrings.MODID, "textures/armor/goggles.png");
|
||||
@ -1176,6 +1179,7 @@ public class ResourceManager {
|
||||
public static final IModelCustom crystal_robust = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/crystals_robust.obj"));
|
||||
public static final IModelCustom crystal_trixite = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/crystals_trixite.obj"));
|
||||
public static final IModelCustom cable_neo = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/cable_neo.obj"));
|
||||
public static final IModelCustom pipe_neo = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/pipe_neo.obj"));
|
||||
|
||||
public static final IModelCustom charge_dynamite = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/charge_dynamite.obj"));
|
||||
public static final IModelCustom charge_c4 = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/blocks/charge_c4.obj"));
|
||||
|
||||
@ -66,7 +66,6 @@ public class RenderBlockMultipass implements ISimpleBlockRenderingHandler {
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
//int meta = world.getBlockMetadata(x, y, z);
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
|
||||
@ -82,8 +81,6 @@ public class RenderBlockMultipass implements ISimpleBlockRenderingHandler {
|
||||
|
||||
for(int i = 0; i < passes; i++) {
|
||||
currentPass = i;
|
||||
//System.out.println(multi.getColorFromPass(world, x, y, z, false));
|
||||
//tessellator.setColorOpaque_I(multi.getColorFromPass(world, x, y, z, false));
|
||||
renderer.renderStandardBlock(block, x, y, z);
|
||||
}
|
||||
|
||||
|
||||
66
src/main/java/com/hbm/render/block/RenderCableClassic.java
Normal file
66
src/main/java/com/hbm/render/block/RenderCableClassic.java
Normal file
@ -0,0 +1,66 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import com.hbm.blocks.network.BlockCable;
|
||||
import com.hbm.lib.Library;
|
||||
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
|
||||
public class RenderCableClassic implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) { }
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon iicon = block.getIcon(0, 0);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
iicon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
boolean pX = Library.canConnect(world, x + 1, y, z, Library.NEG_X);
|
||||
boolean nX = Library.canConnect(world, x - 1, y, z, Library.POS_X);
|
||||
boolean pY = Library.canConnect(world, x, y + 1, z, Library.NEG_Y);
|
||||
boolean nY = Library.canConnect(world, x, y - 1, z, Library.POS_Y);
|
||||
boolean pZ = Library.canConnect(world, x, y, z + 1, Library.NEG_Z);
|
||||
boolean nZ = Library.canConnect(world, x, y, z - 1, Library.POS_Z);
|
||||
|
||||
double spanU = iicon.getMaxU() - iicon.getMinU();
|
||||
double spanV = iicon.getMaxV() - iicon.getMinV();
|
||||
double px = 0.0625D;
|
||||
|
||||
double uv_cL = iicon.getMinU();
|
||||
double uv_cR = iicon.getMinU() + spanU * 5 / px;
|
||||
double uv_cT = iicon.getMaxV();
|
||||
double uv_cB = iicon.getMaxV() - spanV * 5 / px;
|
||||
|
||||
double pos_min = px * 5.5D;
|
||||
double pos_max = px * 10.5D;
|
||||
|
||||
//TODO: all that manual tessellator crap
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return BlockCable.renderIDClassic;
|
||||
}
|
||||
|
||||
}
|
||||
130
src/main/java/com/hbm/render/block/RenderTestPipe.java
Normal file
130
src/main/java/com/hbm/render/block/RenderTestPipe.java
Normal file
@ -0,0 +1,130 @@
|
||||
package com.hbm.render.block;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.blocks.test.TestPipe;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.util.ObjUtil;
|
||||
|
||||
import api.hbm.fluid.IFluidConductor;
|
||||
import api.hbm.fluid.IFluidConnector;
|
||||
import cpw.mods.fml.client.registry.ISimpleBlockRenderingHandler;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.client.renderer.RenderBlocks;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraftforge.client.model.obj.WavefrontObject;
|
||||
|
||||
public class RenderTestPipe implements ISimpleBlockRenderingHandler {
|
||||
|
||||
@Override
|
||||
public void renderInventoryBlock(Block block, int metadata, int modelId, RenderBlocks renderer) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon iicon = block.getIcon(0, 0);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
iicon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
GL11.glRotated(180, 0, 1, 0);
|
||||
GL11.glScaled(1.25D, 1.25D, 1.25D);
|
||||
tessellator.startDrawingQuads();
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "pX", iicon, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "nX", iicon, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "pZ", iicon, tessellator, 0, false);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "nZ", iicon, tessellator, 0, false);
|
||||
tessellator.draw();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
|
||||
|
||||
Tessellator tessellator = Tessellator.instance;
|
||||
IIcon iicon = block.getIcon(0, 0);
|
||||
IIcon overlay = block.getIcon(1, 0);
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
if(renderer.hasOverrideBlockTexture()) {
|
||||
iicon = renderer.overrideBlockTexture;
|
||||
}
|
||||
|
||||
tessellator.setBrightness(block.getMixedBrightnessForBlock(world, x, y, z));
|
||||
tessellator.setColorOpaque_F(1, 1, 1);
|
||||
|
||||
boolean pX = world.getTileEntity(x + 1, y, z) instanceof IFluidConductor;
|
||||
boolean nX = world.getTileEntity(x - 1, y, z) instanceof IFluidConductor;
|
||||
boolean pY = world.getTileEntity(x, y + 1, z) instanceof IFluidConductor;
|
||||
boolean nY = world.getTileEntity(x, y - 1, z) instanceof IFluidConductor;
|
||||
boolean pZ = world.getTileEntity(x, y, z + 1) instanceof IFluidConductor;
|
||||
boolean nZ = world.getTileEntity(x, y, z - 1) instanceof IFluidConductor;
|
||||
|
||||
int mask = 0 + (pX ? 32 : 0) + (nX ? 16 : 0) + (pY ? 8 : 0) + (nY ? 4 : 0) + (pZ ? 2 : 0) + (nZ ? 1 : 0);
|
||||
|
||||
tessellator.addTranslation(x + 0.5F, y + 0.5F, z + 0.5F);
|
||||
|
||||
int color = 0xff0000;
|
||||
|
||||
if(mask == 0) {
|
||||
renderDuct(iicon, overlay, color, tessellator, "pX");
|
||||
renderDuct(iicon, overlay, color, tessellator, "nX");
|
||||
renderDuct(iicon, overlay, color, tessellator, "pY");
|
||||
renderDuct(iicon, overlay, color, tessellator, "nY");
|
||||
renderDuct(iicon, overlay, color, tessellator, "pZ");
|
||||
renderDuct(iicon, overlay, color, tessellator, "nZ");
|
||||
} else if(mask == 0b100000 || mask == 0b010000) {
|
||||
renderDuct(iicon, overlay, color, tessellator, "pX");
|
||||
renderDuct(iicon, overlay, color, tessellator, "nX");
|
||||
} else if(mask == 0b001000 || mask == 0b000100) {
|
||||
renderDuct(iicon, overlay, color, tessellator, "pY");
|
||||
renderDuct(iicon, overlay, color, tessellator, "nY");
|
||||
} else if(mask == 0b000010 || mask == 0b000001) {
|
||||
renderDuct(iicon, overlay, color, tessellator, "pZ");
|
||||
renderDuct(iicon, overlay, color, tessellator, "nZ");
|
||||
} else {
|
||||
|
||||
if(pX) renderDuct(iicon, overlay, color, tessellator, "pX");
|
||||
if(nX) renderDuct(iicon, overlay, color, tessellator, "nX");
|
||||
if(pY) renderDuct(iicon, overlay, color, tessellator, "pY");
|
||||
if(nY) renderDuct(iicon, overlay, color, tessellator, "nY");
|
||||
if(pZ) renderDuct(iicon, overlay, color, tessellator, "nZ");
|
||||
if(nZ) renderDuct(iicon, overlay, color, tessellator, "pZ");
|
||||
|
||||
if(!pX && !pY && !pZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "ppn", iicon, tessellator, 0, true);
|
||||
if(!pX && !pY && !nZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "ppp", iicon, tessellator, 0, true);
|
||||
if(!nX && !pY && !pZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "npn", iicon, tessellator, 0, true);
|
||||
if(!nX && !pY && !nZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "npp", iicon, tessellator, 0, true);
|
||||
if(!pX && !nY && !pZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "pnn", iicon, tessellator, 0, true);
|
||||
if(!pX && !nY && !nZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "pnp", iicon, tessellator, 0, true);
|
||||
if(!nX && !nY && !pZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "nnn", iicon, tessellator, 0, true);
|
||||
if(!nX && !nY && !nZ) ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, "nnp", iicon, tessellator, 0, true);
|
||||
}
|
||||
|
||||
tessellator.addTranslation(-x - 0.5F, -y - 0.5F, -z - 0.5F);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private void renderDuct(IIcon iicon, IIcon overlay, int color, Tessellator tessellator, String part) {
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, part, iicon, tessellator, 0, true);
|
||||
ObjUtil.setColor(color);
|
||||
ObjUtil.renderPartWithIcon((WavefrontObject) ResourceManager.pipe_neo, part, overlay, tessellator, 0, true);
|
||||
ObjUtil.clearColor();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean shouldRender3DInInventory(int modelId) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getRenderId() {
|
||||
return TestPipe.renderID;
|
||||
}
|
||||
}
|
||||
@ -23,6 +23,8 @@ public class RenderTNTPrimedBase extends Render {
|
||||
public void doRender(EntityTNTPrimedBase tnt, double x, double y, double z, float f0, float f1) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslatef((float) x, (float) y, (float) z);
|
||||
GL11.glRotatef(-90F, 0F, 1F, 0F);
|
||||
|
||||
float f2;
|
||||
|
||||
if((float) tnt.fuse - f1 + 1.0F < 10.0F) {
|
||||
|
||||
@ -1236,6 +1236,28 @@ public class ItemRenderLibrary {
|
||||
bindTexture(ResourceManager.chemfac_tex); ResourceManager.chemfac.renderPart("Main");
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.red_pylon_large), new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -5, 0);
|
||||
GL11.glScaled(2.25, 2.25, 2.25);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
bindTexture(ResourceManager.pylon_large_tex); ResourceManager.pylon_large.renderAll();
|
||||
}});
|
||||
|
||||
renderers.put(Item.getItemFromBlock(ModBlocks.substation), new ItemRenderBase( ) {
|
||||
public void renderInventory() {
|
||||
GL11.glTranslated(0, -2.5, 0);
|
||||
GL11.glScaled(4.5, 4.5, 4.5);
|
||||
}
|
||||
public void renderCommon() {
|
||||
GL11.glScaled(0.5, 0.5, 0.5);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
bindTexture(ResourceManager.substation_tex); ResourceManager.substation.renderAll();
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
}});
|
||||
}
|
||||
|
||||
private static void bindTexture(ResourceLocation res) {
|
||||
|
||||
57
src/main/java/com/hbm/render/model/ModelArmorBismuth.java
Normal file
57
src/main/java/com/hbm/render/model/ModelArmorBismuth.java
Normal file
@ -0,0 +1,57 @@
|
||||
package com.hbm.render.model;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.render.loader.ModelRendererObj;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.entity.Entity;
|
||||
|
||||
public class ModelArmorBismuth extends ModelArmorBase {
|
||||
|
||||
public ModelArmorBismuth(int type) {
|
||||
super(type);
|
||||
|
||||
head = new ModelRendererObj(ResourceManager.armor_bismuth, "Head");
|
||||
body = new ModelRendererObj(ResourceManager.armor_bismuth, "Body");
|
||||
leftArm = new ModelRendererObj(ResourceManager.armor_bismuth, "LeftArm").setRotationPoint(-5.0F, 2.0F, 0.0F);
|
||||
rightArm = new ModelRendererObj(ResourceManager.armor_bismuth, "RightArm").setRotationPoint(5.0F, 2.0F, 0.0F);
|
||||
leftLeg = new ModelRendererObj(ResourceManager.armor_bismuth, "LeftLeg").setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
rightLeg = new ModelRendererObj(ResourceManager.armor_bismuth, "RightLeg").setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
leftFoot = new ModelRendererObj(ResourceManager.armor_bismuth, "LeftFoot").setRotationPoint(1.9F, 12.0F, 0.0F);
|
||||
rightFoot = new ModelRendererObj(ResourceManager.armor_bismuth, "RightFoot").setRotationPoint(-1.9F, 12.0F, 0.0F);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(ResourceManager.armor_bismuth_tex);
|
||||
|
||||
if(type == 0) {
|
||||
head.render(par7);
|
||||
}
|
||||
if(type == 1) {
|
||||
leftArm.render(par7);
|
||||
rightArm.render(par7);
|
||||
body.render(par7);
|
||||
}
|
||||
if(type == 2) {
|
||||
leftLeg.render(par7);
|
||||
rightLeg.render(par7);
|
||||
}
|
||||
if(type == 3) {
|
||||
leftFoot.render(par7);
|
||||
rightFoot.render(par7);
|
||||
}
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
@ -100,10 +100,20 @@ public class ModelGasMask extends ModelBiped {
|
||||
@Override
|
||||
public void render(Entity par1Entity, float par2, float par3, float par4, float par5, float par6, float par7) {
|
||||
setRotationAngles(par2, par3, par4, par5, par6, par7, par1Entity);
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.15F, 1.15F, 1.15F);
|
||||
this.mask.render(par7);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
if(this.isChild) {
|
||||
float f6 = 2.0F;
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.5F / f6, 1.5F / f6, 1.5F / f6);
|
||||
GL11.glTranslatef(0.0F, 16.0F * par7, 0.0F);
|
||||
this.mask.render(par7);
|
||||
GL11.glPopMatrix();
|
||||
} else {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glScalef(1.15F, 1.15F, 1.15F);
|
||||
this.mask.render(par7);
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
protected void convertToChild(ModelRenderer parParent, ModelRenderer parChild) {
|
||||
|
||||
@ -14,68 +14,52 @@ import net.minecraftforge.client.model.IModelCustom;
|
||||
|
||||
public class RenderFluidTank extends TileEntitySpecialRenderer {
|
||||
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
@Override
|
||||
public void renderTileEntityAt(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glShadeModel(GL11.GL_SMOOTH);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
bindTexture(ResourceManager.tank_tex);
|
||||
bindTexture(ResourceManager.tank_tex);
|
||||
ResourceManager.fluidtank.renderPart("Tank");
|
||||
|
||||
GL11.glShadeModel(GL11.GL_FLAT);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderTileEntityAt2(tileEntity, x, y, z, f);
|
||||
}
|
||||
|
||||
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f)
|
||||
{
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glPopMatrix();
|
||||
|
||||
renderTileEntityAt2(tileEntity, x, y, z, f);
|
||||
}
|
||||
|
||||
public void renderTileEntityAt2(TileEntity tileEntity, double x, double y, double z, float f) {
|
||||
GL11.glPushMatrix();
|
||||
GL11.glTranslated(x + 0.5D, y, z + 0.5D);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
GL11.glDisable(GL11.GL_CULL_FACE);
|
||||
GL11.glRotatef(180, 0F, 1F, 0F);
|
||||
GL11.glRotatef(90, 0F, 1F, 0F);
|
||||
switch(tileEntity.getBlockMetadata())
|
||||
{
|
||||
case 2:
|
||||
GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
case 4:
|
||||
GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
case 3:
|
||||
GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
case 5:
|
||||
GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
//GL11.glTranslated(0.5D, 0.0D, 0.0D);
|
||||
switch(tileEntity.getBlockMetadata()) {
|
||||
case 2: GL11.glRotatef(90, 0F, 1F, 0F); break;
|
||||
case 4: GL11.glRotatef(180, 0F, 1F, 0F); break;
|
||||
case 3: GL11.glRotatef(270, 0F, 1F, 0F); break;
|
||||
case 5: GL11.glRotatef(0, 0F, 1F, 0F); break;
|
||||
}
|
||||
|
||||
String s = "NONE";
|
||||
if(tileEntity instanceof TileEntityMachineFluidTank)
|
||||
s = ((TileEntityMachineFluidTank)tileEntity).tank.getTankType().name();
|
||||
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/tank_" + s + ".png"));
|
||||
ResourceManager.fluidtank.renderPart("Label");
|
||||
s = ((TileEntityMachineFluidTank) tileEntity).tank.getTankType().name();
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
bindTexture(new ResourceLocation(RefStrings.MODID, "textures/models/tank_label/tank_" + s + ".png"));
|
||||
ResourceManager.fluidtank.renderPart("Label");
|
||||
|
||||
GL11.glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
||||
@ -91,7 +91,11 @@ public class ObjUtil {
|
||||
if(brightness < 0.45F)
|
||||
brightness = 0.45F;
|
||||
|
||||
tes.setColorOpaque_F(brightness, brightness, brightness);
|
||||
if(hasColor) {
|
||||
tes.setColorOpaque((int)(red * brightness), (int)(green * brightness), (int)(blue * brightness));
|
||||
} else {
|
||||
tes.setColorOpaque_F(brightness, brightness, brightness);
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < f.vertices.length; i++) {
|
||||
@ -116,4 +120,27 @@ public class ObjUtil {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static int red;
|
||||
private static int green;
|
||||
private static int blue;
|
||||
private static boolean hasColor = false;
|
||||
|
||||
public static void setColor(int color) {
|
||||
red = (color & 0xff0000) >> 16;
|
||||
green = (color & 0x00ff00) >> 8;
|
||||
blue = color & 0x0000ff;
|
||||
hasColor = true;
|
||||
}
|
||||
|
||||
public static void setColor(int r, int g, int b) {
|
||||
red = r;
|
||||
green = g;
|
||||
blue = b;
|
||||
hasColor = true;
|
||||
}
|
||||
|
||||
public static void clearColor() {
|
||||
hasColor = false;
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,198 +1,317 @@
|
||||
package com.hbm.render.util;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderScreenOverlay {
|
||||
|
||||
private static final ResourceLocation misc = new ResourceLocation(RefStrings.MODID + ":textures/misc/overlay_misc.png");
|
||||
private static final RenderItem itemRenderer = RenderItem.getInstance();
|
||||
|
||||
private static long lastSurvey;
|
||||
private static float prevResult;
|
||||
private static float lastResult;
|
||||
|
||||
public static void renderRadCounter(ScaledResolution resolution, float in, Gui gui) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
float radiation = 0;
|
||||
|
||||
radiation = lastResult - prevResult;
|
||||
|
||||
if(System.currentTimeMillis() >= lastSurvey + 1000) {
|
||||
lastSurvey = System.currentTimeMillis();
|
||||
prevResult = lastResult;
|
||||
lastResult = in;
|
||||
}
|
||||
|
||||
int length = 74;
|
||||
int maxRad = 1000;
|
||||
|
||||
int bar = getScaled(in, maxRad, 74);
|
||||
|
||||
//if(radiation >= 1 && radiation <= 999)
|
||||
// bar -= (1 + Minecraft.getMinecraft().theWorld.rand.nextInt(3));
|
||||
|
||||
int posX = 16;
|
||||
int posY = resolution.getScaledHeight() - 18 - 2;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
gui.drawTexturedModalRect(posX, posY, 0, 0, 94, 18);
|
||||
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 19, bar, 16);
|
||||
|
||||
if(radiation >= 25) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
|
||||
|
||||
} else if(radiation >= 10) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
|
||||
|
||||
} else if(radiation >= 2.5) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
|
||||
|
||||
}
|
||||
|
||||
if(radiation > 1000) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
} else if(radiation >= 1) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(((int)Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
|
||||
} else if(radiation > 0) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
private static int getScaled(double cur, double max, double scale) {
|
||||
|
||||
return (int) Math.min(cur / max * scale, scale);
|
||||
}
|
||||
|
||||
|
||||
public static void renderCustomCrosshairs(ScaledResolution resolution, Gui gui, Crosshair cross) {
|
||||
|
||||
if(cross == Crosshair.NONE) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
return;
|
||||
}
|
||||
|
||||
int size = cross.size;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0);
|
||||
gui.drawTexturedModalRect(resolution.getScaledWidth() / 2 - (size / 2), resolution.getScaledHeight() / 2 - (size / 2), cross.x, cross.y, size, size);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
public static void renderAmmo(ScaledResolution resolution, Gui gui, Item ammo, int count, int max, int dura, boolean renderCount) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int pX = resolution.getScaledWidth() / 2 + 62 + 36;
|
||||
int pZ = resolution.getScaledHeight() - 21;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
gui.drawTexturedModalRect(pX, pZ + 16, 94, 0, 52, 3);
|
||||
gui.drawTexturedModalRect(pX + 1, pZ + 16, 95, 3, 50 - dura, 3);
|
||||
|
||||
String cap = max == -1 ? ("∞") : ("" + max);
|
||||
|
||||
if(renderCount)
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(count + " / " + cap, pX + 16, pZ + 6, 0xFFFFFF);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(ammo), pX, pZ);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
public static void renderAmmoAlt(ScaledResolution resolution, Gui gui, Item ammo, int count) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int pX = resolution.getScaledWidth() / 2 + 62 + 36 + 18;
|
||||
int pZ = resolution.getScaledHeight() - 21 - 16;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(count + "x", pX + 16, pZ + 6, 0xFFFFFF);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(ammo), pX, pZ);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
public enum Crosshair {
|
||||
|
||||
NONE(0, 0, 0),
|
||||
CROSS(1, 55, 16),
|
||||
CIRCLE(19, 55, 16),
|
||||
SEMI(37, 55, 16),
|
||||
KRUCK(55, 55, 16),
|
||||
DUAL(1, 73, 16),
|
||||
SPLIT(19, 73, 16),
|
||||
CLASSIC(37, 73, 16),
|
||||
BOX(55, 73, 16),
|
||||
L_CROSS(0, 90, 32),
|
||||
L_KRUCK(32, 90, 32),
|
||||
L_CLASSIC(64, 90, 32),
|
||||
L_CIRCLE(96, 90, 32),
|
||||
L_SPLIT(0, 122, 32),
|
||||
L_ARROWS(32, 122, 32),
|
||||
L_BOX(64, 122, 32),
|
||||
L_CIRCUMFLEX(96, 122, 32),
|
||||
L_RAD(0, 154, 32);
|
||||
|
||||
public int x;
|
||||
public int y;
|
||||
public int size;
|
||||
|
||||
private Crosshair(int x, int y, int size) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
package com.hbm.render.util;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.extprop.HbmPlayerProps;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.Gui;
|
||||
import net.minecraft.client.gui.ScaledResolution;
|
||||
import net.minecraft.client.renderer.OpenGlHelper;
|
||||
import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.entity.RenderItem;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
|
||||
public class RenderScreenOverlay {
|
||||
|
||||
private static final ResourceLocation misc = new ResourceLocation(RefStrings.MODID + ":textures/misc/overlay_misc.png");
|
||||
private static final RenderItem itemRenderer = RenderItem.getInstance();
|
||||
|
||||
private static long lastSurvey;
|
||||
private static float prevResult;
|
||||
private static float lastResult;
|
||||
|
||||
private static float fadeOut = 0F;
|
||||
|
||||
public static void renderRadCounter(ScaledResolution resolution, float in, Gui gui) {
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
float radiation = 0;
|
||||
|
||||
radiation = lastResult - prevResult;
|
||||
|
||||
if(System.currentTimeMillis() >= lastSurvey + 1000) {
|
||||
lastSurvey = System.currentTimeMillis();
|
||||
prevResult = lastResult;
|
||||
lastResult = in;
|
||||
}
|
||||
|
||||
int length = 74;
|
||||
int maxRad = 1000;
|
||||
|
||||
int bar = getScaled(in, maxRad, 74);
|
||||
|
||||
//if(radiation >= 1 && radiation <= 999)
|
||||
// bar -= (1 + Minecraft.getMinecraft().theWorld.rand.nextInt(3));
|
||||
|
||||
int posX = 16;
|
||||
int posY = resolution.getScaledHeight() - 18 - 2;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
gui.drawTexturedModalRect(posX, posY, 0, 0, 94, 18);
|
||||
gui.drawTexturedModalRect(posX + 1, posY + 1, 1, 19, bar, 16);
|
||||
|
||||
if(radiation >= 25) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 36, 36, 18, 18);
|
||||
|
||||
} else if(radiation >= 10) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 18, 36, 18, 18);
|
||||
|
||||
} else if(radiation >= 2.5) {
|
||||
gui.drawTexturedModalRect(posX + length + 2, posY - 18, 0, 36, 18, 18);
|
||||
|
||||
}
|
||||
|
||||
if(radiation > 1000) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(">1000 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
} else if(radiation >= 1) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(((int)Math.round(radiation)) + " RAD/s", posX, posY - 8, 0xFF0000);
|
||||
} else if(radiation > 0) {
|
||||
Minecraft.getMinecraft().fontRenderer.drawString("<1 RAD/s", posX, posY - 8, 0xFF0000);
|
||||
}
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
private static int getScaled(double cur, double max, double scale) {
|
||||
|
||||
return (int) Math.min(cur / max * scale, scale);
|
||||
}
|
||||
|
||||
|
||||
public static void renderCustomCrosshairs(ScaledResolution resolution, Gui gui, Crosshair cross) {
|
||||
|
||||
if(cross == Crosshair.NONE) {
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
return;
|
||||
}
|
||||
|
||||
int size = cross.size;
|
||||
|
||||
GL11.glPushMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_ONE_MINUS_DST_COLOR, GL11.GL_ONE_MINUS_SRC_COLOR, 1, 0);
|
||||
gui.drawTexturedModalRect(resolution.getScaledWidth() / 2 - (size / 2), resolution.getScaledHeight() / 2 - (size / 2), cross.x, cross.y, size, size);
|
||||
OpenGlHelper.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA, 1, 0);
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
public static void renderAmmo(ScaledResolution resolution, Gui gui, Item ammo, int count, int max, int dura, boolean renderCount) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int pX = resolution.getScaledWidth() / 2 + 62 + 36;
|
||||
int pZ = resolution.getScaledHeight() - 21;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
gui.drawTexturedModalRect(pX, pZ + 16, 94, 0, 52, 3);
|
||||
gui.drawTexturedModalRect(pX + 1, pZ + 16, 95, 3, 50 - dura, 3);
|
||||
|
||||
String cap = max == -1 ? ("∞") : ("" + max);
|
||||
|
||||
if(renderCount)
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(count + " / " + cap, pX + 16, pZ + 6, 0xFFFFFF);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(ammo), pX, pZ);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
public static void renderAmmoAlt(ScaledResolution resolution, Gui gui, Item ammo, int count) {
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int pX = resolution.getScaledWidth() / 2 + 62 + 36 + 18;
|
||||
int pZ = resolution.getScaledHeight() - 21 - 16;
|
||||
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(misc);
|
||||
|
||||
Minecraft.getMinecraft().fontRenderer.drawString(count + "x", pX + 16, pZ + 6, 0xFFFFFF);
|
||||
|
||||
GL11.glDisable(GL11.GL_BLEND);
|
||||
GL11.glEnable(GL12.GL_RESCALE_NORMAL);
|
||||
RenderHelper.enableGUIStandardItemLighting();
|
||||
itemRenderer.renderItemAndEffectIntoGUI(mc.fontRenderer, mc.getTextureManager(), new ItemStack(ammo), pX, pZ);
|
||||
RenderHelper.disableStandardItemLighting();
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
@Spaghetti ("like a fella once said, aint that a kick in the head")
|
||||
public static void renderDashBar(ScaledResolution resolution, Gui gui, HbmPlayerProps props) {
|
||||
|
||||
|
||||
GL11.glPushMatrix();
|
||||
|
||||
GL11.glEnable(GL11.GL_BLEND);
|
||||
GL11.glDisable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(false);
|
||||
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
GL11.glDisable(GL11.GL_ALPHA_TEST);
|
||||
|
||||
Minecraft mc = Minecraft.getMinecraft();
|
||||
|
||||
int width = 30;
|
||||
|
||||
int posX = 16;//(int)(resolution.getScaledWidth()/2 - ((props.getDashCount()*(width+2))/2));
|
||||
int posY = resolution.getScaledHeight() - 40 - 2;
|
||||
|
||||
mc.renderEngine.bindTexture(misc);
|
||||
|
||||
gui.drawTexturedModalRect(posX-10, posY, 107, 18, 7, 10);
|
||||
|
||||
int stamina = props.getStamina();
|
||||
|
||||
int dashes = props.getDashCount();
|
||||
|
||||
//int count = props.getDashCount();
|
||||
//int x3count = count / 3;
|
||||
|
||||
int rows = dashes / 3;
|
||||
int finalColumns = dashes % 3;
|
||||
|
||||
for(int y = 0; y < rows; y++) {
|
||||
for(int x = 0; x < 3; x++) {
|
||||
if(y == rows && x > finalColumns)
|
||||
break;
|
||||
gui.drawTexturedModalRect(posX + (width+2)*x, posY - 12*y, 76, 48, width, 10);
|
||||
int staminaDiv = stamina / 30;
|
||||
int staminaMod = stamina % 30;
|
||||
int barID = (3*y)+x;
|
||||
int barStatus = 1; //0 = red, 1 = normal, 2 = greyed, 3 = dashed, 4 = ascended
|
||||
int barSize = width;
|
||||
if(staminaDiv < barID) {
|
||||
barStatus = 3;
|
||||
} else if(staminaDiv == barID) {
|
||||
barStatus = 2;
|
||||
barSize = (int)((float)(stamina % 30) * (width/30F) );
|
||||
if(barID == 0)
|
||||
barStatus = 0;
|
||||
}
|
||||
gui.drawTexturedModalRect(posX + (width+2)*x, posY - 12*y, 76, 18+(10*barStatus), barSize, 10);
|
||||
|
||||
if(staminaDiv == barID && staminaMod >= 27) {
|
||||
fadeOut = 1F;
|
||||
}
|
||||
if(fadeOut > 0 && staminaDiv-1 == barID) {
|
||||
GL11.glColor4f(1F, 1F, 1F, fadeOut);
|
||||
int bar = barID;
|
||||
if(stamina % 30 >= 25)
|
||||
bar++;
|
||||
int yPos = y;
|
||||
if(bar / 3 != y)
|
||||
y++;
|
||||
bar = bar % 3;
|
||||
gui.drawTexturedModalRect(posX + (width+2)*bar, posY - 12*y, 76, 58, width, 10);
|
||||
fadeOut -= 0.04F;
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/*for(int x = 0; x < props.getDashCount(); x++) {
|
||||
int status = 3;
|
||||
gui.drawTexturedModalRect(posX + (24)*x, posY, 76, 48, 24, 10);
|
||||
int staminaDiv = stamina / 60;
|
||||
if(staminaDiv > x) {
|
||||
status = 1;
|
||||
} else if(staminaDiv == x) {
|
||||
width = (int)( (float)(stamina % 60) * (width/60F) );
|
||||
status = 2;
|
||||
if(staminaDiv == 0)
|
||||
status = 0;
|
||||
}
|
||||
/*if(staminaDiv-1 == x && (stamina % 60 < 20 && stamina % 60 != 0)) {
|
||||
status = 4;
|
||||
}
|
||||
/*if(((staminaDiv == x && stamina % 60 >= 55) || (staminaDiv-1 == x && stamina % 60 <= 5)) && !(stamina == props.totalDashCount * 60)) {
|
||||
status = 4;
|
||||
}
|
||||
gui.drawTexturedModalRect(posX + (24)*x, posY, 76, 18+(10*status), width, 10);
|
||||
|
||||
if(staminaDiv == x && stamina % 60 >= 57) {
|
||||
fadeOut = 1F;
|
||||
}
|
||||
if(fadeOut > 0 && staminaDiv-1 == x) {
|
||||
GL11.glColor4f(1F, 1F, 1F, fadeOut);
|
||||
int bar = x;
|
||||
if(stamina % 60 >= 50)
|
||||
bar++;
|
||||
System.out.println(bar);
|
||||
gui.drawTexturedModalRect(posX + 24*bar, posY, 76, 58, width, 10);
|
||||
fadeOut -= 0.04F;
|
||||
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
GL11.glEnable(GL11.GL_DEPTH_TEST);
|
||||
GL11.glDepthMask(true);
|
||||
GL11.glPopMatrix();
|
||||
mc.renderEngine.bindTexture(Gui.icons);
|
||||
}
|
||||
|
||||
public enum Crosshair {
|
||||
|
||||
NONE(0, 0, 0),
|
||||
CROSS(1, 55, 16),
|
||||
CIRCLE(19, 55, 16),
|
||||
SEMI(37, 55, 16),
|
||||
KRUCK(55, 55, 16),
|
||||
DUAL(1, 73, 16),
|
||||
SPLIT(19, 73, 16),
|
||||
CLASSIC(37, 73, 16),
|
||||
BOX(55, 73, 16),
|
||||
L_CROSS(0, 90, 32),
|
||||
L_KRUCK(32, 90, 32),
|
||||
L_CLASSIC(64, 90, 32),
|
||||
L_CIRCLE(96, 90, 32),
|
||||
L_SPLIT(0, 122, 32),
|
||||
L_ARROWS(32, 122, 32),
|
||||
L_BOX(64, 122, 32),
|
||||
L_CIRCUMFLEX(96, 122, 32),
|
||||
L_RAD(0, 154, 32);
|
||||
|
||||
public int x;
|
||||
public int y;
|
||||
public int size;
|
||||
|
||||
private Crosshair(int x, int y, int size) {
|
||||
this.x = x;
|
||||
this.y = y;
|
||||
this.size = size;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
20
src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java
Normal file
20
src/main/java/com/hbm/tileentity/TileEntityLoadedBase.java
Normal file
@ -0,0 +1,20 @@
|
||||
package com.hbm.tileentity;
|
||||
|
||||
import api.hbm.energy.ILoadedTile;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityLoadedBase extends TileEntity implements ILoadedTile {
|
||||
|
||||
public boolean isLoaded = true;
|
||||
|
||||
@Override
|
||||
public boolean isLoaded() {
|
||||
return isLoaded;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
this.isLoaded = false;
|
||||
}
|
||||
}
|
||||
@ -5,6 +5,7 @@ import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
|
||||
import api.hbm.energy.ILoadedTile;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
@ -15,7 +16,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
public abstract class TileEntityMachineBase extends TileEntity implements ISidedInventory, INBTPacketReceiver {
|
||||
public abstract class TileEntityMachineBase extends TileEntityLoadedBase implements ISidedInventory, INBTPacketReceiver {
|
||||
|
||||
public ItemStack slots[];
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import com.hbm.tileentity.machine.TileEntityHadron;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityProxyBase extends TileEntity {
|
||||
public class TileEntityProxyBase extends TileEntityLoadedBase {
|
||||
|
||||
public boolean canUpdate() {
|
||||
return false;
|
||||
|
||||
@ -8,7 +8,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.fluids.FluidTank;
|
||||
|
||||
public abstract class TileEntityTickingBase extends TileEntity implements INBTPacketReceiver {
|
||||
public abstract class TileEntityTickingBase extends TileEntityLoadedBase implements INBTPacketReceiver {
|
||||
|
||||
public TileEntityTickingBase() { }
|
||||
|
||||
|
||||
@ -184,6 +184,7 @@ public class TileMappings {
|
||||
put(TileEntityDeaerator.class, "tileentity_deaerator");
|
||||
put(TileEntityChungus.class, "tileentity_chungus");
|
||||
put(TileEntityCableBaseNT.class, "tileentity_ohgod");
|
||||
put(TileEntityPipeBaseNT.class, "tileentity_pipe_base");
|
||||
put(TileEntityWatz.class, "tileentity_watz");
|
||||
put(TileEntityMachineBAT9000.class, "tileentity_bat9000");
|
||||
put(TileEntityMachineOrbus.class, "tileentity_orbus");
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
@ -39,7 +40,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCompactLauncher extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IEnergyUser {
|
||||
public class TileEntityCompactLauncher extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IFluidAcceptor, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissilePacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -18,7 +19,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLaunchPad extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityLaunchPad extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
public ItemStack slots[];
|
||||
|
||||
|
||||
@ -21,6 +21,7 @@ import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEMissileMultipartPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import api.hbm.item.IDesignatorItem;
|
||||
@ -36,7 +37,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityLaunchTable extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityLaunchTable extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -15,6 +15,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.NBTPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.INBTPacketReceiver;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
@ -25,7 +26,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityChungus extends TileEntity implements IFluidAcceptor, IFluidSource, IEnergyGenerator, INBTPacketReceiver {
|
||||
public class TileEntityChungus extends TileEntityLoadedBase implements IFluidAcceptor, IFluidSource, IEnergyGenerator, INBTPacketReceiver {
|
||||
|
||||
public long power;
|
||||
public static final long maxPower = 100000000000L;
|
||||
|
||||
@ -4,6 +4,7 @@ import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -17,7 +18,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreAdvanced extends TileEntity implements ISidedInventory, IFactory, IEnergyUser {
|
||||
public class TileEntityCoreAdvanced extends TileEntityLoadedBase implements ISidedInventory, IFactory, IEnergyUser {
|
||||
|
||||
public int progress = 0;
|
||||
public long power = 0;
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.interfaces.IFactory;
|
||||
import com.hbm.interfaces.Spaghetti;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemBattery;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -18,7 +19,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityCoreTitanium extends TileEntity implements ISidedInventory, IFactory, IEnergyUser {
|
||||
public class TileEntityCoreTitanium extends TileEntityLoadedBase implements ISidedInventory, IFactory, IEnergyUser {
|
||||
|
||||
public int progress = 0;
|
||||
public long power = 0;
|
||||
|
||||
@ -1,7 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
@ -14,6 +12,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.world.machine.FWatz;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
@ -24,10 +23,9 @@ import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class TileEntityFWatzCore extends TileEntity implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityFWatzCore extends TileEntityLoadedBase implements ISidedInventory, IReactor, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
public long power;
|
||||
public final static long maxPower = 10000000000L;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.TEFFPacket;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -24,7 +25,7 @@ import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityForceField extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityForceField extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.List;
|
||||
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
|
||||
public class TileEntityGeiger extends TileEntity {
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.blocks.machine.BlockHadronPower;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityHadronPower extends TileEntity implements IEnergyUser {
|
||||
public class TileEntityHadronPower extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
public long power;
|
||||
|
||||
|
||||
@ -1,20 +1,15 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.radiation.ChunkRadiationManager;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.world.chunk.Chunk;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineAmgen extends TileEntity implements IEnergyGenerator {
|
||||
public class TileEntityMachineAmgen extends TileEntityLoadedBase implements IEnergyGenerator {
|
||||
|
||||
public long power;
|
||||
public long maxPower = 500;
|
||||
|
||||
@ -7,6 +7,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -19,7 +20,7 @@ import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
public class TileEntityMachineArcFurnace extends TileEntity implements ISidedInventory, IEnergyUser {
|
||||
public class TileEntityMachineArcFurnace extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -16,6 +16,7 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -29,7 +30,7 @@ import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineBoilerElectric extends TileEntity implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyUser {
|
||||
public class TileEntityMachineBoilerElectric extends TileEntityLoadedBase implements ISidedInventory, IFluidContainer, IFluidAcceptor, IFluidSource, IEnergyUser {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,8 +1,5 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
import com.hbm.inventory.FluidTank;
|
||||
@ -12,6 +9,7 @@ import com.hbm.items.ModItems;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
@ -22,10 +20,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineCMBFactory extends TileEntity implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineCMBFactory extends TileEntityLoadedBase implements ISidedInventory, IEnergyUser, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -390,8 +390,9 @@ public class TileEntityMachineChemplant extends TileEntityMachineBase implements
|
||||
for(int j = 0; j < inv.getSizeInventory(); j++) {
|
||||
|
||||
if(inv.getStackInSlot(j) == null) {
|
||||
inv.setInventorySlotContents(j, out.copy());
|
||||
inv.getStackInSlot(j).stackSize = 1;
|
||||
ItemStack copy = out.copy();
|
||||
copy.stackSize = 1;
|
||||
inv.setInventorySlotContents(j, copy);
|
||||
this.decrStackSize(i, 1);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -18,7 +18,6 @@ import com.hbm.util.InventoryUtil;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.inventory.IInventory;
|
||||
import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
|
||||
@ -6,13 +6,9 @@ import net.minecraft.inventory.ISidedInventory;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.nbt.NBTTagList;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.tileentity.TileEntityFurnace;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.machine.MachineCoal;
|
||||
import com.hbm.interfaces.IFluidAcceptor;
|
||||
import com.hbm.interfaces.IFluidContainer;
|
||||
@ -25,12 +21,13 @@ import com.hbm.lib.Library;
|
||||
import com.hbm.packet.AuxElectricityPacket;
|
||||
import com.hbm.packet.AuxGaugePacket;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IBatteryItem;
|
||||
import api.hbm.energy.IEnergyGenerator;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
|
||||
public class TileEntityMachineCoal extends TileEntity implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
public class TileEntityMachineCoal extends TileEntityLoadedBase implements ISidedInventory, IEnergyGenerator, IFluidContainer, IFluidAcceptor {
|
||||
|
||||
private ItemStack slots[];
|
||||
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
package com.hbm.tileentity.machine;
|
||||
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import api.hbm.energy.IEnergyUser;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityMachineDetector extends TileEntity implements IEnergyUser {
|
||||
public class TileEntityMachineDetector extends TileEntityLoadedBase implements IEnergyUser {
|
||||
|
||||
long power;
|
||||
|
||||
|
||||
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