Merge branch 'master' into windows-95
43
changelog
@ -1,25 +1,24 @@
|
||||
## Added
|
||||
* Refueling station
|
||||
* Like a charging station, but for fluids
|
||||
|
||||
## Changed
|
||||
* Particle detectors now print an error for when the recipe could not be completed
|
||||
* Night Vision Goggles toggles with armor HUD
|
||||
* Removed "no ore dict data" line from tooltips with extended view enabled
|
||||
* Added a client config called `GUN_ANIMATION_SPEED` which allows the speed of gun animations to be changed
|
||||
* Mostly for debugging, since it only applies to the bus animation system, things like smoke trails and muzzle flashes are unaffected
|
||||
* Item filters can now filter by bedrock ore grade
|
||||
* Meteorite dungeons now use a new structure system
|
||||
* The rooms have been completely changed, and the dungeons are no longer single-level with fixed room sizes
|
||||
* Dungeons no longer lag the game to hell when generating
|
||||
* Decimated bobmazon
|
||||
* All books have been merged into one with way fewer offers
|
||||
* Sells things like basic gear, MREs, plushies, snow globes, and certain things only found in worldgen like jungle tree saplings and NTM flowers (including mustard willow)
|
||||
* Updated russian localization
|
||||
* Large deposits (hematite, malachite, bauxite) and caves (sulfur, asbestos) can now be toggled in the config
|
||||
* Removed recipes for most old particle accelerator parts
|
||||
* Dense coils no longer have recipes either for the most part, all coils with no recipes can be recycled back into dense wires
|
||||
* Natural gas can now be processed in a pyrolysis oven, 12k of gas yields 8k hydrogen and one graphite ingot
|
||||
* Saturnite now has an alternate recipe, adding one pile of borax for doubled output
|
||||
* All mass storage units (except wood) are now substantially cheaper
|
||||
* Reduced base spread for all 12 and 10 gauge buckshot shells from 0.05 to 0.035
|
||||
* Reduced legendary 12 lever action's spread multiplier from x1.35 to x1.15
|
||||
* Bullet casings now spawn with randomized angular velocity
|
||||
* Bullet casings now correctly bounce off walls, and change angles when bouncing
|
||||
|
||||
## Fixed
|
||||
* Fixed items being annihilated when shift clicking them into the particle source
|
||||
* Fixed packet optimization not allowing packets to be sent when the day night cycle is halted
|
||||
* Fixed particle detectors not always using power when they should
|
||||
* Fixed rotary furnace voiding low pressure steam when dealing with input numbers not divisible by 100
|
||||
* Fixed state leak causing smoke from the right akimbo weapon to glow when the first one is fired
|
||||
* Fixed incorrect default values for new RBMK dials
|
||||
* Fixed an issue where `/ntmreload` would load fluids after recipes, meaning that recipes using newly added fluids would not work correctly, as the fluids don't exist by the time the recipe is loaded
|
||||
* Fixed bedrock coltan being way too common, drowning out almost all other bedrock ores
|
||||
* Fixed rotary furnace not saving its output stack
|
||||
* Fixed strand caster water check being incorrect, creating negative water by allowing operations with insufficient cooling
|
||||
* Fixed radar not using the small remaining amount of power, causing the animation getting stuck
|
||||
* Fixed the new system structures being way too common
|
||||
* Fixed RBMKs losing all their flux when reloading the world
|
||||
* Fixed issue where DODD fuel item stats would only update when the GUI was open
|
||||
* Fixed muzzle flashes not being fullbright
|
||||
* Fixed guns having their name permanently visible over the toolbar
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5230
|
||||
mod_build_number=5243
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
|
||||
@ -2,6 +2,8 @@ package api.hbm.energymk2;
|
||||
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.uninos.IGenProvider;
|
||||
import com.hbm.uninos.networkproviders.PowerProvider;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
@ -12,7 +14,7 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/** If it sends energy, use this */
|
||||
public interface IEnergyProviderMK2 extends IEnergyHandlerMK2 {
|
||||
public interface IEnergyProviderMK2 extends IEnergyHandlerMK2, IGenProvider<PowerProvider> {
|
||||
|
||||
/** Uses up available power, default implementation has no sanity checking, make sure that the requested power is lequal to the current power */
|
||||
public default void usePower(long power) {
|
||||
|
||||
@ -3,6 +3,8 @@ package api.hbm.energymk2;
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.uninos.IGenReceiver;
|
||||
import com.hbm.uninos.networkproviders.PowerProvider;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
@ -14,7 +16,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
/** If it receives energy, use this */
|
||||
@NotableComments
|
||||
public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2 {
|
||||
public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2, IGenReceiver<PowerProvider> {
|
||||
|
||||
public default long transferPower(long power) {
|
||||
if(power + this.getPower() <= this.getMaxPower()) {
|
||||
@ -76,31 +78,6 @@ public interface IEnergyReceiverMK2 extends IEnergyHandlerMK2 {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Project MKUltra was an illegal human experiments program designed and undertaken by the U.S. Central Intelligence Agency (CIA)
|
||||
* to develop procedures and identify drugs that could be used during interrogations to weaken people and force confessions through
|
||||
* brainwashing and psychological torture. It began in 1953 and was halted in 1973. MKUltra used numerous methods to manipulate
|
||||
* its subjects' mental states and brain functions, such as the covert administration of high doses of psychoactive drugs (especially LSD)
|
||||
* and other chemicals without the subjects' consent, electroshocks, hypnosis, sensory deprivation, isolation, verbal and sexual
|
||||
* abuse, and other forms of torture.
|
||||
* MKUltra was preceded by Project Artichoke. It was organized through the CIA's Office of Scientific Intelligence and coordinated
|
||||
* with the United States Army Biological Warfare Laboratories. The program engaged in illegal activities, including the
|
||||
* use of U.S. and Canadian citizens as unwitting test subjects. MKUltra's scope was broad, with activities carried
|
||||
* out under the guise of research at more than 80 institutions aside from the military, including colleges and universities,
|
||||
* hospitals, prisons, and pharmaceutical companies. The CIA operated using front organizations, although some top officials at these
|
||||
* institutions were aware of the CIA's involvement.
|
||||
* MKUltra was revealed to the public in 1975 by the Church Committee of the United States Congress and Gerald Ford's United States
|
||||
* President's Commission on CIA activities within the United States (the Rockefeller Commission). Investigative efforts were hampered
|
||||
* by CIA Director Richard Helms's order that all MKUltra files be destroyed in 1973; the Church Committee and Rockefeller Commission
|
||||
* investigations relied on the sworn testimony of direct participants and on the small number of documents that survived Helms's order.
|
||||
* In 1977, a Freedom of Information Act request uncovered a cache of 20,000 documents relating to MKUltra, which led to Senate hearings.
|
||||
* Some surviving information about MKUltra was declassified in 2001.
|
||||
* */
|
||||
public default ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.NORMAL;
|
||||
}
|
||||
|
||||
/** More is better-er */
|
||||
public enum ConnectionPriority {
|
||||
LOWEST,
|
||||
LOW,
|
||||
|
||||
@ -1,161 +1,40 @@
|
||||
package api.hbm.energymk2;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.interfaces.NotableComments;
|
||||
import com.hbm.uninos.GenNode;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.uninos.networkproviders.PowerProvider;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
/**
|
||||
* The "Nodespace" is an intermediate, "ethereal" layer of abstraction that tracks nodes (i.e. cables) even when they are no longer loaded, allowing continued operation even when unloaded
|
||||
* @author hbm
|
||||
* The dead fucking corpse of nodespace MK1.
|
||||
* A fantastic proof of concept, but ultimately it was killed for being just not that versatile.
|
||||
* This class is mostly just a compatibility husk that should allow uninodespace to slide into the mod with as much lubrication as it deserves.
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
public class Nodespace {
|
||||
|
||||
/** Contains all "NodeWorld" instances, i.e. lists of nodes existing per world */
|
||||
public static HashMap<World, NodeWorld> worlds = new HashMap<>();
|
||||
public static Set<PowerNetMK2> activePowerNets = new HashSet<>();
|
||||
public static final PowerProvider THE_POWER_PROVIDER = new PowerProvider();
|
||||
|
||||
public static PowerNode getNode(World world, int x, int y, int z) {
|
||||
NodeWorld nodeWorld = worlds.get(world);
|
||||
if(nodeWorld != null) return nodeWorld.nodes.get(new BlockPos(x, y, z));
|
||||
return null;
|
||||
@Deprecated public static PowerNode getNode(World world, int x, int y, int z) {
|
||||
return (PowerNode) UniNodespace.getNode(world, x, y, z, THE_POWER_PROVIDER);
|
||||
}
|
||||
|
||||
public static void createNode(World world, PowerNode node) {
|
||||
NodeWorld nodeWorld = worlds.get(world);
|
||||
if(nodeWorld == null) {
|
||||
nodeWorld = new NodeWorld();
|
||||
worlds.put(world, nodeWorld);
|
||||
}
|
||||
nodeWorld.pushNode(node);
|
||||
@Deprecated public static void createNode(World world, PowerNode node) {
|
||||
UniNodespace.createNode(world, node);
|
||||
}
|
||||
|
||||
public static void destroyNode(World world, int x, int y, int z) {
|
||||
PowerNode node = getNode(world, x, y, z);
|
||||
if(node != null) {
|
||||
worlds.get(world).popNode(node);
|
||||
}
|
||||
}
|
||||
|
||||
/** Goes over each node and manages connections */
|
||||
public static void updateNodespace() {
|
||||
|
||||
for(World world : MinecraftServer.getServer().worldServers) {
|
||||
NodeWorld nodes = worlds.get(world);
|
||||
|
||||
if(nodes == null)
|
||||
continue;
|
||||
|
||||
for(Entry<BlockPos, PowerNode> entry : nodes.nodes.entrySet()) {
|
||||
PowerNode node = entry.getValue();
|
||||
if(!node.hasValidNet() || node.recentlyChanged) {
|
||||
checkNodeConnection(world, node);
|
||||
node.recentlyChanged = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updatePowerNets();
|
||||
}
|
||||
|
||||
private static void updatePowerNets() {
|
||||
|
||||
for(PowerNetMK2 net : activePowerNets) net.resetEnergyTracker(); //reset has to be done before everything else
|
||||
for(PowerNetMK2 net : activePowerNets) net.transferPower();
|
||||
}
|
||||
|
||||
/** Goes over each connection point of the given node, tries to find neighbor nodes and to join networks with them */
|
||||
private static void checkNodeConnection(World world, PowerNode node) {
|
||||
|
||||
for(DirPos con : node.connections) {
|
||||
|
||||
PowerNode conNode = getNode(world, con.getX(), con.getY(), con.getZ()); // get whatever neighbor node intersects with that connection
|
||||
|
||||
if(conNode != null) { // if there is a node at that place
|
||||
|
||||
if(conNode.hasValidNet() && conNode.net == node.net) continue; // if the net is valid and both nodes have the same net, skip
|
||||
|
||||
if(checkConnection(conNode, con, false)) {
|
||||
connectToNode(node, conNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(node.net == null || !node.net.isValid()) new PowerNetMK2().joinLink(node);
|
||||
}
|
||||
|
||||
public static boolean checkConnection(PowerNode connectsTo, DirPos connectFrom, boolean skipSideCheck) {
|
||||
|
||||
for(DirPos revCon : connectsTo.connections) {
|
||||
|
||||
if(revCon.getX() - revCon.getDir().offsetX == connectFrom.getX() && revCon.getY() - revCon.getDir().offsetY == connectFrom.getY() && revCon.getZ() - revCon.getDir().offsetZ == connectFrom.getZ() && (revCon.getDir() == connectFrom.getDir().getOpposite() || skipSideCheck)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Links two nodes with different or potentially no networks */
|
||||
private static void connectToNode(PowerNode origin, PowerNode connection) {
|
||||
|
||||
if(origin.hasValidNet() && connection.hasValidNet()) { // both nodes have nets, but the nets are different (previous assumption), join networks
|
||||
if(origin.net.links.size() > connection.net.links.size()) {
|
||||
origin.net.joinNetworks(connection.net);
|
||||
} else {
|
||||
connection.net.joinNetworks(origin.net);
|
||||
}
|
||||
} else if(!origin.hasValidNet() && connection.hasValidNet()) { // origin has no net, connection does, have origin join connection's net
|
||||
connection.net.joinLink(origin);
|
||||
} else if(origin.hasValidNet() && !connection.hasValidNet()) { // ...and vice versa
|
||||
origin.net.joinLink(connection);
|
||||
}
|
||||
}
|
||||
|
||||
public static class NodeWorld {
|
||||
|
||||
/** Contains a map showing where each node is, a node is every spot that a cable exists at.
|
||||
* Instead of the old proxy system, things like substation now create multiple nodes at their connection points */
|
||||
public HashMap<BlockPos, PowerNode> nodes = new HashMap<>();
|
||||
|
||||
/** Adds a node at all its positions to the nodespace */
|
||||
public void pushNode(PowerNode node) {
|
||||
for(BlockPos pos : node.positions) {
|
||||
nodes.put(pos, node);
|
||||
}
|
||||
}
|
||||
|
||||
/** Removes the specified node from all positions from nodespace */
|
||||
public void popNode(PowerNode node) {
|
||||
if(node.net != null) node.net.destroy();
|
||||
for(BlockPos pos : node.positions) {
|
||||
nodes.remove(pos);
|
||||
node.expired = true;
|
||||
}
|
||||
}
|
||||
|
||||
/** Grabs the node at one position, then removes it from all positions it occupies */
|
||||
public void popNode(BlockPos pos) {
|
||||
PowerNode node = nodes.get(pos);
|
||||
if(node != null) popNode(node);
|
||||
}
|
||||
@Deprecated public static void destroyNode(World world, int x, int y, int z) {
|
||||
UniNodespace.destroyNode(world, x, y, z, THE_POWER_PROVIDER);
|
||||
}
|
||||
|
||||
@NotableComments
|
||||
public static class PowerNode {
|
||||
public static class PowerNode extends GenNode<PowerNetMK2> {
|
||||
|
||||
public BlockPos[] positions;
|
||||
public DirPos[] connections;
|
||||
public PowerNetMK2 net;
|
||||
public boolean expired = false;
|
||||
/**
|
||||
* Okay so here's the deal: The code has shit idiot brain fungus. I don't know why. I re-tested every part involved several times.
|
||||
* I don't know why. But for some reason, during neighbor checks, on certain arbitrary fucking places, the joining operation just fails.
|
||||
@ -167,32 +46,16 @@ public class Nodespace {
|
||||
* breaking, but it seems to allow those parts to connect back to their neighbor nets as they are supposed to. I am not proud of this solution,
|
||||
* this issue shouldn't exist to begin with and I am going fucking insane but it is what it is.
|
||||
*/
|
||||
public boolean recentlyChanged = true;
|
||||
|
||||
public PowerNode(BlockPos... positions) {
|
||||
super(THE_POWER_PROVIDER, positions);
|
||||
this.positions = positions;
|
||||
}
|
||||
|
||||
@Override
|
||||
public PowerNode setConnections(DirPos... connections) {
|
||||
this.connections = connections;
|
||||
super.setConnections(connections);
|
||||
return this;
|
||||
}
|
||||
|
||||
public PowerNode addConnection(DirPos connection) {
|
||||
DirPos[] newCons = new DirPos[this.connections.length + 1];
|
||||
for(int i = 0; i < this.connections.length; i++) newCons[i] = this.connections[i];
|
||||
newCons[newCons.length - 1] = connection;
|
||||
this.connections = newCons;
|
||||
return this;
|
||||
}
|
||||
|
||||
public boolean hasValidNet() {
|
||||
return this.net != null && this.net.isValid();
|
||||
}
|
||||
|
||||
public void setNet(PowerNetMK2 net) {
|
||||
this.net = net;
|
||||
this.recentlyChanged = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -2,124 +2,32 @@ package api.hbm.energymk2;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Comparator;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import com.hbm.uninos.NodeNet;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import java.util.Map.Entry;
|
||||
import java.util.Random;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
|
||||
import api.hbm.energymk2.Nodespace.PowerNode;
|
||||
|
||||
public class PowerNetMK2 {
|
||||
|
||||
public static Random rand = new Random();
|
||||
public boolean valid = true;
|
||||
public Set<PowerNode> links = new HashSet();
|
||||
|
||||
/** Maps all active subscribers to a timestamp, handy for handling timeouts. In a good system this shouldn't be necessary, but the previous system taught me to be cautious anyway */
|
||||
public HashMap<IEnergyReceiverMK2, Long> receiverEntries = new HashMap();
|
||||
public HashMap<IEnergyProviderMK2, Long> providerEntries = new HashMap();
|
||||
/**
|
||||
* Technically MK3 since it's now UNINOS compatible, although UNINOS was build out of 95% nodespace code
|
||||
*
|
||||
* @author hbm
|
||||
*/
|
||||
public class PowerNetMK2 extends NodeNet<IEnergyReceiverMK2, IEnergyProviderMK2, PowerNode> {
|
||||
|
||||
public long energyTracker = 0L;
|
||||
|
||||
public PowerNetMK2() {
|
||||
Nodespace.activePowerNets.add(this);
|
||||
}
|
||||
|
||||
/// SUBSCRIBER HANDLING ///
|
||||
public boolean isSubscribed(IEnergyReceiverMK2 receiver) {
|
||||
return this.receiverEntries.containsKey(receiver);
|
||||
}
|
||||
|
||||
public void addReceiver(IEnergyReceiverMK2 receiver) {
|
||||
this.receiverEntries.put(receiver, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void removeReceiver(IEnergyReceiverMK2 receiver) {
|
||||
this.receiverEntries.remove(receiver);
|
||||
}
|
||||
|
||||
/// PROVIDER HANDLING ///
|
||||
public boolean isProvider(IEnergyProviderMK2 provider) {
|
||||
return this.providerEntries.containsKey(provider);
|
||||
}
|
||||
|
||||
public void addProvider(IEnergyProviderMK2 provider) {
|
||||
this.providerEntries.put(provider, System.currentTimeMillis());
|
||||
}
|
||||
|
||||
public void removeProvider(IEnergyProviderMK2 provider) {
|
||||
this.providerEntries.remove(provider);
|
||||
}
|
||||
|
||||
/// LINK JOINING ///
|
||||
|
||||
/** Combines two networks into one */
|
||||
public void joinNetworks(PowerNetMK2 network) {
|
||||
|
||||
if(network == this) return; //wtf?!
|
||||
|
||||
List<PowerNode> oldNodes = new ArrayList(network.links.size());
|
||||
oldNodes.addAll(network.links); // might prevent oddities related to joining - nvm it does nothing
|
||||
|
||||
for(PowerNode conductor : oldNodes) forceJoinLink(conductor);
|
||||
network.links.clear();
|
||||
|
||||
for(IEnergyReceiverMK2 connector : network.receiverEntries.keySet()) this.addReceiver(connector);
|
||||
for(IEnergyProviderMK2 connector : network.providerEntries.keySet()) this.addProvider(connector);
|
||||
network.destroy();
|
||||
}
|
||||
|
||||
/** Adds the power node as part of this network's links */
|
||||
public PowerNetMK2 joinLink(PowerNode node) {
|
||||
if(node.net != null) node.net.leaveLink(node);
|
||||
return forceJoinLink(node);
|
||||
}
|
||||
|
||||
/** Adds the power node as part of this network's links, skips the part about removing it from existing networks */
|
||||
public PowerNetMK2 forceJoinLink(PowerNode node) {
|
||||
this.links.add(node);
|
||||
node.setNet(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Removes the specified power node */
|
||||
public void leaveLink(PowerNode node) {
|
||||
node.setNet(null);
|
||||
this.links.remove(node);
|
||||
}
|
||||
|
||||
/// GENERAL POWER NET CONTROL ///
|
||||
public void invalidate() {
|
||||
this.valid = false;
|
||||
Nodespace.activePowerNets.remove(this);
|
||||
}
|
||||
|
||||
public boolean isValid() {
|
||||
return this.valid;
|
||||
}
|
||||
|
||||
public void destroy() {
|
||||
this.invalidate();
|
||||
for(PowerNode link : this.links) if(link.net == this) link.setNet(null);
|
||||
this.links.clear();
|
||||
this.receiverEntries.clear();
|
||||
this.providerEntries.clear();
|
||||
}
|
||||
|
||||
public void resetEnergyTracker() {
|
||||
this.energyTracker = 0;
|
||||
}
|
||||
|
||||
protected static int timeout = 3_000;
|
||||
|
||||
public void transferPower() {
|
||||
@Override public void resetTrackers() { this.energyTracker = 0; }
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
if(providerEntries.isEmpty()) return;
|
||||
if(receiverEntries.isEmpty()) return;
|
||||
@ -195,118 +103,6 @@ public class PowerNetMK2 {
|
||||
}
|
||||
}
|
||||
|
||||
@Deprecated public void transferPowerOld() {
|
||||
|
||||
if(providerEntries.isEmpty()) return;
|
||||
if(receiverEntries.isEmpty()) return;
|
||||
|
||||
long timestamp = System.currentTimeMillis();
|
||||
long transferCap = 100_000_000_000_000_00L; // that ought to be enough
|
||||
|
||||
long supply = 0;
|
||||
long demand = 0;
|
||||
long[] priorityDemand = new long[ConnectionPriority.values().length];
|
||||
|
||||
Iterator<Entry<IEnergyProviderMK2, Long>> provIt = providerEntries.entrySet().iterator();
|
||||
while(provIt.hasNext()) {
|
||||
Entry<IEnergyProviderMK2, Long> entry = provIt.next();
|
||||
if(timestamp - entry.getValue() > timeout) { provIt.remove(); continue; }
|
||||
supply += Math.min(entry.getKey().getPower(), entry.getKey().getProviderSpeed());
|
||||
}
|
||||
|
||||
if(supply <= 0) return;
|
||||
|
||||
Iterator<Entry<IEnergyReceiverMK2, Long>> recIt = receiverEntries.entrySet().iterator();
|
||||
while(recIt.hasNext()) {
|
||||
Entry<IEnergyReceiverMK2, Long> entry = recIt.next();
|
||||
if(timestamp - entry.getValue() > timeout) { recIt.remove(); continue; }
|
||||
long rec = Math.min(entry.getKey().getMaxPower() - entry.getKey().getPower(), entry.getKey().getReceiverSpeed());
|
||||
demand += rec;
|
||||
for(int i = 0; i <= entry.getKey().getPriority().ordinal(); i++) priorityDemand[i] += rec;
|
||||
}
|
||||
|
||||
if(demand <= 0) return;
|
||||
|
||||
long toTransfer = Math.min(supply, demand);
|
||||
if(toTransfer > transferCap) toTransfer = transferCap;
|
||||
if(toTransfer <= 0) return;
|
||||
|
||||
List<IEnergyProviderMK2> buffers = new ArrayList();
|
||||
List<IEnergyProviderMK2> providers = new ArrayList();
|
||||
Set<IEnergyReceiverMK2> receiverSet = receiverEntries.keySet();
|
||||
for(IEnergyProviderMK2 provider : providerEntries.keySet()) {
|
||||
if(receiverSet.contains(provider)) {
|
||||
buffers.add(provider);
|
||||
} else {
|
||||
providers.add(provider);
|
||||
}
|
||||
}
|
||||
providers.addAll(buffers); //makes buffers go last
|
||||
List<IEnergyReceiverMK2> receivers = new ArrayList() {{ addAll(receiverSet); }};
|
||||
|
||||
receivers.sort(COMP);
|
||||
|
||||
int maxIteration = 1000;
|
||||
|
||||
//how much the current sender/receiver have already sent/received
|
||||
long prevSrc = 0;
|
||||
long prevDest = 0;
|
||||
|
||||
while(!receivers.isEmpty() && !providers.isEmpty() && maxIteration > 0) {
|
||||
maxIteration--;
|
||||
|
||||
IEnergyProviderMK2 src = providers.get(0);
|
||||
IEnergyReceiverMK2 dest = receivers.get(0);
|
||||
|
||||
if(src.getPower() <= 0) { providers.remove(0); prevSrc = 0; continue; }
|
||||
|
||||
if(src == dest) { // STALEMATE DETECTED
|
||||
//if this happens, a buffer will waste both its share of transfer and receiving potential and do effectively nothing, essentially breaking
|
||||
|
||||
//try if placing the conflicting provider at the end of the list does anything
|
||||
//we do this first because providers have no priority, so we may shuffle those around as much as we want
|
||||
if(providers.size() > 1) {
|
||||
providers.add(providers.get(0));
|
||||
providers.remove(0);
|
||||
prevSrc = 0; //this might cause slight issues due to the tracking being effectively lost while there still might be pending operations
|
||||
continue;
|
||||
}
|
||||
//if that didn't work, try shifting the receiver by one place (to minimize priority breakage)
|
||||
if(receivers.size() > 1) {
|
||||
receivers.add(2, receivers.get(0));
|
||||
receivers.remove(0);
|
||||
prevDest = 0; //ditto
|
||||
continue;
|
||||
}
|
||||
|
||||
//if neither option could be performed, the only conclusion is that this buffer mode battery is alone in the power net, in which case: not my provlem
|
||||
}
|
||||
|
||||
long pd = priorityDemand[dest.getPriority().ordinal()];
|
||||
|
||||
long receiverShare = Math.min((long) Math.ceil((double) Math.min(dest.getMaxPower() - dest.getPower(), dest.getReceiverSpeed()) * (double) supply / (double) pd), dest.getReceiverSpeed()) - prevDest;
|
||||
long providerShare = Math.min((long) Math.ceil((double) Math.min(src.getPower(), src.getProviderSpeed()) * (double) demand / (double) supply), src.getProviderSpeed()) - prevSrc;
|
||||
|
||||
long toDrain = Math.min((long) (src.getPower()), providerShare);
|
||||
long toFill = Math.min(dest.getMaxPower() - dest.getPower(), receiverShare);
|
||||
|
||||
long finalTransfer = Math.min(toDrain, toFill);
|
||||
if(toFill <= 0) { receivers.remove(0); prevDest = 0; continue; }
|
||||
|
||||
finalTransfer -= dest.transferPower(finalTransfer);
|
||||
src.usePower(finalTransfer);
|
||||
|
||||
prevSrc += finalTransfer;
|
||||
prevDest += finalTransfer;
|
||||
|
||||
if(prevSrc >= src.getProviderSpeed()) { providers.remove(0); prevSrc = 0; continue; }
|
||||
if(prevDest >= dest.getReceiverSpeed()) { receivers.remove(0); prevDest = 0; continue; }
|
||||
|
||||
toTransfer -= finalTransfer;
|
||||
this.energyTracker += finalTransfer;
|
||||
}
|
||||
}
|
||||
|
||||
public long sendPowerDiode(long power) {
|
||||
|
||||
if(receiverEntries.isEmpty()) return power;
|
||||
|
||||
17
src/main/java/api/hbm/fluid/FluidNet.java
Normal file
@ -0,0 +1,17 @@
|
||||
package api.hbm.fluid;
|
||||
|
||||
import com.hbm.uninos.NodeNet;
|
||||
|
||||
public class FluidNet extends NodeNet { // yeah i don't feel like it, gonna do that shit tomorrow or sth
|
||||
|
||||
public long tracker = 0L;
|
||||
|
||||
protected static int timeout = 3_000;
|
||||
|
||||
@Override public void resetTrackers() { this.tracker = 0; }
|
||||
|
||||
@Override
|
||||
public void update() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -2,21 +2,28 @@ package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.Random;
|
||||
|
||||
import api.hbm.fluid.IFluidStandardSender;
|
||||
import com.hbm.blocks.IBlockMultiPass;
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.FluidType;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.render.block.RenderBlockMultipass;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockContainer;
|
||||
import net.minecraft.block.material.Material;
|
||||
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class BlockFissure extends Block implements IBlockMultiPass {
|
||||
public class BlockFissure extends BlockContainer implements IBlockMultiPass {
|
||||
|
||||
private IIcon overlay;
|
||||
|
||||
@ -65,4 +72,31 @@ public class BlockFissure extends Block implements IBlockMultiPass {
|
||||
public int getRenderType(){
|
||||
return IBlockMultiPass.getRenderType();
|
||||
}
|
||||
|
||||
@Override
|
||||
public TileEntity createNewTileEntity(World p_149915_1_, int p_149915_2_) {
|
||||
return new TileEntityFissure();
|
||||
}
|
||||
|
||||
public static class TileEntityFissure extends TileEntityLoadedBase implements IFluidStandardSender {
|
||||
|
||||
public FluidTank lava = new FluidTank(Fluids.LAVA, 1_000);
|
||||
|
||||
@Override
|
||||
public void updateEntity() {
|
||||
|
||||
if(!worldObj.isRemote) {
|
||||
lava.setFill(1_000);
|
||||
this.sendFluid(lava, worldObj, xCoord, yCoord + 1, zCoord, ForgeDirection.UP);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canConnect(FluidType type, ForgeDirection dir) {
|
||||
return dir == ForgeDirection.DOWN && type == Fluids.LAVA;
|
||||
}
|
||||
|
||||
@Override public FluidTank[] getAllTanks() { return new FluidTank[] {lava}; }
|
||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {lava}; }
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,8 +1,11 @@
|
||||
package com.hbm.blocks.generic;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.inventory.recipes.PedestalRecipes;
|
||||
import com.hbm.inventory.recipes.PedestalRecipes.PedestalRecipe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.particle.helper.ExplosionSmallCreator;
|
||||
import com.hbm.util.Compat;
|
||||
|
||||
@ -21,6 +24,7 @@ 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.AxisAlignedBB;
|
||||
import net.minecraft.util.IIcon;
|
||||
import net.minecraft.world.IBlockAccess;
|
||||
import net.minecraft.world.World;
|
||||
@ -169,6 +173,9 @@ public class BlockPedestal extends BlockContainer {
|
||||
world.markBlockForUpdate(x, y, z);
|
||||
ExplosionSmallCreator.composeEffect(world, x + 0.5, y + 1.5, z + 0.5, 10, 2.5F, 1F);
|
||||
|
||||
List<EntityPlayer> players = world.getEntitiesWithinAABB(EntityPlayer.class, AxisAlignedBB.getBoundingBox(x + 0.5, y, z + 0.5, x + 0.5, y, z + 0.5).expand(50, 50, 50));
|
||||
for(EntityPlayer player : players) player.addStat(MainRegistry.statLegendary, 1);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
@ -174,8 +174,8 @@ public abstract class RBMKBase extends BlockDummyable implements IToolable, ILoo
|
||||
|
||||
if(rbmk.hasLid() && rbmk.isLidRemovable()) {
|
||||
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(new BlockPos(te));
|
||||
if (node != null)
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(world, new BlockPos(te));
|
||||
if(node != null)
|
||||
node.removeLid();
|
||||
|
||||
if(!world.isRemote) {
|
||||
@ -186,7 +186,7 @@ public abstract class RBMKBase extends BlockDummyable implements IToolable, ILoo
|
||||
world.spawnEntityInWorld(new EntityItem(world, pos[0] + 0.5, pos[1] + 0.5 + RBMKDials.getColumnHeight(world), pos[2] + 0.5, new ItemStack(ModItems.rbmk_lid_glass)));
|
||||
}
|
||||
|
||||
world.setBlockMetadataWithNotify(pos[0], pos[1], pos[2], DIR_NO_LID.ordinal() + this.offset, 3);
|
||||
world.setBlockMetadataWithNotify(pos[0], pos[1], pos[2], DIR_NO_LID.ordinal() + offset, 3);
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
@ -26,10 +26,10 @@ public class CommandReloadRecipes extends CommandBase {
|
||||
@Override
|
||||
public void processCommand(ICommandSender sender, String[] args) {
|
||||
try {
|
||||
Fluids.reloadFluids();
|
||||
SerializableRecipe.initialize();
|
||||
ItemPoolConfigJSON.initialize();
|
||||
DamageResistanceHandler.init();
|
||||
Fluids.reloadFluids();
|
||||
|
||||
sender.addChatMessage(new ChatComponentText(EnumChatFormatting.YELLOW + "Reload complete :)"));
|
||||
} catch(Exception ex) {
|
||||
|
||||
@ -74,6 +74,13 @@ public class WorldConfig {
|
||||
|
||||
public static int endTikiteSpawn = 8;
|
||||
|
||||
public static boolean enableHematite = true;
|
||||
public static boolean enableMalachite = true;
|
||||
public static boolean enableBauxite = true;
|
||||
|
||||
public static boolean enableSulfurCave = true;
|
||||
public static boolean enableAsbestosCave = true;
|
||||
|
||||
public static int radioStructure = 500;
|
||||
public static int antennaStructure = 250;
|
||||
public static int atomStructure = 500;
|
||||
@ -189,6 +196,13 @@ public class WorldConfig {
|
||||
|
||||
endTikiteSpawn = CommonConfig.createConfigInt(config, CATEGORY_OREGEN, "2.E00_tikiteSpawnrate", "Amount of end trixite per chunk", 8);
|
||||
|
||||
enableHematite = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.L00_enableHematite", "Toggles hematite deposits", true);
|
||||
enableMalachite = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.L01_enableMalachite", "Toggles malachite deposits", true);
|
||||
enableBauxite = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.L02_enableBauxite", "Toggles bauxite deposits", true);
|
||||
|
||||
enableSulfurCave = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.C00_enableSulfurCave", "Toggles sulfur caves", true);
|
||||
enableAsbestosCave = CommonConfig.createConfigBool(config, CATEGORY_OREGEN, "2.C01_enableAsbestosCave", "Toggles asbestos caves", true);
|
||||
|
||||
final String CATEGORY_DUNGEON = CommonConfig.CATEGORY_DUNGEONS;
|
||||
radioStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.00_radioSpawn", "Spawn radio station on every nTH chunk", 500);
|
||||
antennaStructure = CommonConfig.createConfigInt(config, CATEGORY_DUNGEON, "4.01_antennaSpawn", "Spawn antenna on every nTH chunk", 250);
|
||||
|
||||
@ -94,7 +94,7 @@ public class CasingEjector implements Cloneable {
|
||||
@SideOnly(Side.CLIENT)
|
||||
public void spawnCasing(TextureManager textureManager, SpentCasing config, World world, double x, double y, double z, float pitch, float yaw, boolean crouched) {
|
||||
Vec3 rotatedMotionVec = rotateVector(getMotion(), pitch + (float) rand.nextGaussian() * getPitchFactor(), yaw + (float) rand.nextGaussian() * getPitchFactor(), getPitchFactor(), getPitchFactor());
|
||||
ParticleSpentCasing casing = new ParticleSpentCasing(textureManager, world, x, y, z, rotatedMotionVec.xCoord, rotatedMotionVec.yCoord, rotatedMotionVec.zCoord, (float) (getPitchFactor() * rand.nextGaussian()), (float) (getYawFactor() * rand.nextGaussian()), config, false, 0, 0, 0);
|
||||
ParticleSpentCasing casing = new ParticleSpentCasing(textureManager, world, x, y, z, rotatedMotionVec.xCoord, rotatedMotionVec.yCoord, rotatedMotionVec.zCoord, (float) (world.rand.nextGaussian() * 5F), (float) (world.rand.nextGaussian() * 10F), config, false, 0, 0, 0);
|
||||
|
||||
offsetCasing(casing, getOffset(), pitch, yaw, crouched);
|
||||
|
||||
|
||||
@ -13,7 +13,7 @@ public class GunCannonFactory {
|
||||
protected static SpentCasing CASINNG240MM;
|
||||
|
||||
static {
|
||||
CASINNG240MM = new SpentCasing(CasingType.BOTTLENECK).setScale(7.5F).setBounceMotion(0.02F, 0.05F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(1F, 0.5D, 60, 20);
|
||||
CASINNG240MM = new SpentCasing(CasingType.BOTTLENECK).setScale(7.5F).setBounceMotion(0.5F, 0.5F).setColor(SpentCasing.COLOR_CASE_BRASS).setupSmoke(1F, 0.5D, 60, 20);
|
||||
}
|
||||
|
||||
public static BulletConfiguration getShellConfig() {
|
||||
|
||||
@ -8,7 +8,7 @@ public class GunDGKFactory {
|
||||
public static final SpentCasing CASINGDGK;
|
||||
|
||||
static {
|
||||
CASINGDGK = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F).setBounceMotion(0.05F, 0.02F).setColor(SpentCasing.COLOR_CASE_BRASS).register("DGK").setupSmoke(0.02F, 0.5D, 60, 20).setMaxAge(60); //3 instead of 12 seconds
|
||||
CASINGDGK = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F).setBounceMotion(1F, 0.5F).setColor(SpentCasing.COLOR_CASE_BRASS).register("DGK").setupSmoke(0.02F, 0.5D, 60, 20).setMaxAge(60); //3 instead of 12 seconds
|
||||
}
|
||||
|
||||
/*public static BulletConfiguration getDGKConfig() {
|
||||
|
||||
@ -3,8 +3,13 @@ package com.hbm.handler.nei;
|
||||
import java.awt.Rectangle;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.inventory.fluid.Fluids;
|
||||
import com.hbm.inventory.gui.GUICrystallizer;
|
||||
import com.hbm.inventory.recipes.CrystallizerRecipes;
|
||||
import com.hbm.inventory.recipes.CrystallizerRecipes.CrystallizerRecipe;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class CrystallizerRecipeHandler extends NEIUniversalHandler {
|
||||
|
||||
@ -24,4 +29,19 @@ public class CrystallizerRecipeHandler extends NEIUniversalHandler {
|
||||
guiGui.add(GUICrystallizer.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
|
||||
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
|
||||
|
||||
CrystallizerRecipe cRecipe = CrystallizerRecipes.getOutput(rec.input[1].item, Fluids.fromID(rec.input[0].item.getItemDamage()));
|
||||
|
||||
if(cRecipe != null && cRecipe.productivity > 0) {
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
String momentum = "Effectiveness: +" + Math.min((int) (cRecipe.productivity * 100), 99) + "% per level";
|
||||
int side = 8;
|
||||
fontRenderer.drawString(momentum, side, 52, 0x404040);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,164 +0,0 @@
|
||||
package com.hbm.handler.nei;
|
||||
|
||||
import static codechicken.lib.gui.GuiDraw.drawTexturedModalRect;
|
||||
|
||||
import java.awt.Rectangle;
|
||||
import java.util.Arrays;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.blocks.ModBlocks;
|
||||
import com.hbm.handler.imc.ICompatNHNEI;
|
||||
import com.hbm.inventory.gui.GUIHadron;
|
||||
import com.hbm.inventory.recipes.HadronRecipes;
|
||||
import com.hbm.inventory.recipes.HadronRecipes.HadronRecipe;
|
||||
import com.hbm.lib.RefStrings;
|
||||
|
||||
import codechicken.nei.NEIServerUtils;
|
||||
import codechicken.nei.PositionedStack;
|
||||
import codechicken.nei.recipe.TemplateRecipeHandler;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
import net.minecraft.client.gui.inventory.GuiContainer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class HadronRecipeHandler extends TemplateRecipeHandler implements ICompatNHNEI {
|
||||
|
||||
@Override
|
||||
public ItemStack[] getMachinesForRecipe() {
|
||||
return new ItemStack[]{
|
||||
new ItemStack(ModBlocks.hadron_core)};
|
||||
}
|
||||
@Override
|
||||
public String getRecipeID() {
|
||||
return "hadron";
|
||||
}
|
||||
public LinkedList<RecipeTransferRect> transferRectsRec = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<RecipeTransferRect> transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiRec = new LinkedList<Class<? extends GuiContainer>>();
|
||||
public LinkedList<Class<? extends GuiContainer>> guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
public class RecipeSet extends TemplateRecipeHandler.CachedRecipe {
|
||||
|
||||
PositionedStack input1;
|
||||
PositionedStack input2;
|
||||
PositionedStack output1;
|
||||
PositionedStack output2;
|
||||
int momentum;
|
||||
boolean analysisOnly;
|
||||
|
||||
public RecipeSet(HadronRecipe recipe) {
|
||||
|
||||
this.input1 = new PositionedStack(recipe.in1.toStack(), 12, 24);
|
||||
this.input2 = new PositionedStack(recipe.in2.toStack(), 30, 24);
|
||||
this.output1 = new PositionedStack(recipe.out1, 84, 24);
|
||||
this.output2 = new PositionedStack(recipe.out2, 102, 24);
|
||||
this.momentum = recipe.momentum;
|
||||
this.analysisOnly = recipe.analysisOnly;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getIngredients() {
|
||||
return Arrays.asList(new PositionedStack[] { input1, input2 });
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PositionedStack> getOtherStacks() {
|
||||
return Arrays.asList(new PositionedStack[] { output1, output2 });
|
||||
}
|
||||
|
||||
@Override
|
||||
public PositionedStack getResult() {
|
||||
return output1;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRecipeName() {
|
||||
return "Particle Accelerator";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(String outputId, Object... results) {
|
||||
|
||||
if(outputId.equals("hadron") && getClass() == HadronRecipeHandler.class) {
|
||||
|
||||
List<HadronRecipe> recipes = HadronRecipes.getRecipes();
|
||||
|
||||
for(HadronRecipe recipe : recipes) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
}
|
||||
|
||||
} else {
|
||||
super.loadCraftingRecipes(outputId, results);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadCraftingRecipes(ItemStack result) {
|
||||
|
||||
List<HadronRecipe> recipes = HadronRecipes.getRecipes();
|
||||
|
||||
for(HadronRecipe recipe : recipes) {
|
||||
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.out1, result) || NEIServerUtils.areStacksSameTypeCrafting(recipe.out2, result)) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(String inputId, Object... ingredients) {
|
||||
|
||||
if(inputId.equals("hadron") && getClass() == HadronRecipeHandler.class) {
|
||||
loadCraftingRecipes("hadron", new Object[0]);
|
||||
} else {
|
||||
super.loadUsageRecipes(inputId, ingredients);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadUsageRecipes(ItemStack ingredient) {
|
||||
|
||||
List<HadronRecipe> recipes = HadronRecipes.getRecipes();
|
||||
|
||||
for(HadronRecipe recipe : recipes) {
|
||||
|
||||
if(NEIServerUtils.areStacksSameTypeCrafting(recipe.in1.toStack(), ingredient) || NEIServerUtils.areStacksSameTypeCrafting(recipe.in2.toStack(), ingredient)) {
|
||||
this.arecipes.add(new RecipeSet(recipe));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void loadTransferRects() {
|
||||
transferRectsGui = new LinkedList<RecipeTransferRect>();
|
||||
guiGui = new LinkedList<Class<? extends GuiContainer>>();
|
||||
|
||||
transferRects.add(new RecipeTransferRect(new Rectangle(58 - 5, 34 - 11, 24, 18), "hadron"));
|
||||
transferRectsGui.add(new RecipeTransferRect(new Rectangle(72 - 5, 28 - 11, 30, 30), "hadron"));
|
||||
guiGui.add(GUIHadron.class);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(getRecipeTransferRectGuis(), transferRects);
|
||||
RecipeTransferRectHandler.registerRectsToGuis(guiGui, transferRectsGui);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawExtras(int recipe) {
|
||||
|
||||
RecipeSet rec = (RecipeSet) this.arecipes.get(recipe);
|
||||
|
||||
if(rec.analysisOnly)
|
||||
drawTexturedModalRect(128, 23, 0, 86, 18, 18);
|
||||
|
||||
FontRenderer fontRenderer = Minecraft.getMinecraft().fontRenderer;
|
||||
|
||||
String mom = String.format(Locale.US, "%,d", rec.momentum);
|
||||
fontRenderer.drawString(mom, -fontRenderer.getStringWidth(mom) / 2 + 30, 42, 0x404040);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getGuiTexture() {
|
||||
return RefStrings.MODID + ":textures/gui/nei/gui_nei_hadron.png";
|
||||
}
|
||||
}
|
||||
@ -1,13 +1,10 @@
|
||||
package com.hbm.handler.neutron;
|
||||
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
|
||||
import cpw.mods.fml.common.gameevent.TickEvent;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
|
||||
@ -21,20 +18,16 @@ public class NeutronHandler {
|
||||
if(event.phase != TickEvent.Phase.START)
|
||||
return;
|
||||
|
||||
// Freshen the node cache every `cacheTime` ticks to prevent huge RAM usage from idle nodes.
|
||||
int cacheTime = 20;
|
||||
boolean cacheClear = ticks >= cacheTime;
|
||||
if(cacheClear) ticks = 0;
|
||||
ticks++;
|
||||
|
||||
// Remove `StreamWorld` objects if they have no streams.
|
||||
{ // aflghdkljghlkbhfjkghgilurbhlkfjghkffdjgn
|
||||
List<World> toRemove = new ArrayList<>();
|
||||
NeutronNodeWorld.streamWorlds.forEach((world, streamWorld) -> {
|
||||
if (streamWorld.streams.isEmpty())
|
||||
toRemove.add(world);
|
||||
});
|
||||
NeutronNodeWorld.removeEmptyWorlds();
|
||||
|
||||
for (World world : toRemove) {
|
||||
NeutronNodeWorld.streamWorlds.remove(world);
|
||||
}
|
||||
}
|
||||
|
||||
for (Map.Entry<World, NeutronNodeWorld.StreamWorld> world : NeutronNodeWorld.streamWorlds.entrySet()) {
|
||||
for(Map.Entry<World, NeutronNodeWorld.StreamWorld> world : NeutronNodeWorld.streamWorlds.entrySet()) {
|
||||
|
||||
// Gamerule caching because this apparently is kinda slow?
|
||||
// meh, good enough
|
||||
@ -48,33 +41,10 @@ public class NeutronHandler {
|
||||
RBMKNeutronHandler.columnHeight = RBMKDials.getColumnHeight(world.getKey()) + 1;
|
||||
RBMKNeutronHandler.fluxRange = RBMKDials.getFluxRange(world.getKey());
|
||||
|
||||
for (NeutronStream stream : world.getValue().streams) {
|
||||
stream.runStreamInteraction(world.getKey());
|
||||
}
|
||||
world.getValue().runStreamInteractions(world.getKey());
|
||||
world.getValue().removeAllStreams();
|
||||
|
||||
if(cacheClear) world.getValue().cleanNodes();
|
||||
}
|
||||
|
||||
// Freshen the node cache every `cacheTime` ticks to prevent huge RAM usage from idle nodes.
|
||||
int cacheTime = 20;
|
||||
if (ticks >= cacheTime) {
|
||||
ticks = 0;
|
||||
List<BlockPos> toRemove = new ArrayList<>();
|
||||
for (NeutronNode cachedNode : NeutronNodeWorld.nodeCache.values()) {
|
||||
if (cachedNode.type == NeutronStream.NeutronType.RBMK) {
|
||||
RBMKNeutronHandler.RBMKNeutronNode node = (RBMKNeutronHandler.RBMKNeutronNode) cachedNode;
|
||||
toRemove.addAll(node.checkNode());
|
||||
}
|
||||
/* TODO: actually do this and uncache pile nodes
|
||||
if (cachedNode.type == NeutronStream.NeutronType.PILE) {
|
||||
PileNeutronNode node = (PileNeutronNode) cachedNode;
|
||||
toRemove.addAll(node.checkNode());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
toRemove.forEach(NeutronNodeWorld::removeNode);
|
||||
|
||||
}
|
||||
ticks++;
|
||||
}
|
||||
}
|
||||
|
||||
@ -8,55 +8,94 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
||||
public class NeutronNodeWorld {
|
||||
// HashMap of all neutron nodes and their positions.
|
||||
protected static HashMap<BlockPos, NeutronNode> nodeCache = new HashMap<>();
|
||||
|
||||
public static void addNode(NeutronNode node) {
|
||||
nodeCache.put(node.pos, node);
|
||||
}
|
||||
|
||||
public static void removeNode(BlockPos position) {
|
||||
nodeCache.remove(position);
|
||||
}
|
||||
|
||||
public static NeutronNode getNode(BlockPos position) {
|
||||
return nodeCache.get(position);
|
||||
}
|
||||
|
||||
public static void removeAllNodes() {
|
||||
nodeCache.clear();
|
||||
}
|
||||
|
||||
// List of all stream worlds.
|
||||
public static HashMap<World, StreamWorld> streamWorlds = new HashMap<>();
|
||||
|
||||
public static class StreamWorld {
|
||||
public static NeutronNode getNode(World world, BlockPos pos) {
|
||||
StreamWorld streamWorld = streamWorlds.get(world);
|
||||
return streamWorld != null ? streamWorld.nodeCache.get(pos) : null;
|
||||
}
|
||||
|
||||
List<NeutronStream> streams;
|
||||
public static void addNode(World world, NeutronNode node) {
|
||||
StreamWorld streamWorld = getOrAddWorld(world);
|
||||
streamWorld.nodeCache.put(node.pos, node);
|
||||
}
|
||||
|
||||
public StreamWorld() {
|
||||
streams = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void addStream(NeutronStream stream) {
|
||||
this.streams.add(stream);
|
||||
}
|
||||
|
||||
public void removeAllStreams() {
|
||||
this.streams.clear();
|
||||
}
|
||||
|
||||
public void removeAllStreamsOfType(NeutronStream.NeutronType type) {
|
||||
List<NeutronStream> toRemove = new ArrayList<>();
|
||||
for (NeutronStream stream : streams) {
|
||||
if (stream.type == type)
|
||||
toRemove.add(stream);
|
||||
}
|
||||
toRemove.forEach((stream) -> streams.remove(stream));
|
||||
public static void removeNode(World world, BlockPos pos) {
|
||||
StreamWorld streamWorld = streamWorlds.get(world);
|
||||
if(streamWorld == null) return;
|
||||
streamWorld.removeNode(pos);
|
||||
}
|
||||
|
||||
public static StreamWorld getOrAddWorld(World world) {
|
||||
StreamWorld streamWorld = streamWorlds.get(world);
|
||||
if(streamWorld == null) {
|
||||
streamWorld = new StreamWorld();
|
||||
streamWorlds.put(world, streamWorld);
|
||||
}
|
||||
return streamWorld;
|
||||
}
|
||||
|
||||
public static void removeAllWorlds() {
|
||||
streamWorlds.clear();
|
||||
}
|
||||
|
||||
public static void removeEmptyWorlds() {
|
||||
streamWorlds.values().removeIf((streamWorld) -> {
|
||||
return streamWorld.streams.isEmpty();
|
||||
});
|
||||
}
|
||||
|
||||
public static class StreamWorld {
|
||||
|
||||
private List<NeutronStream> streams;
|
||||
private HashMap<BlockPos, NeutronNode> nodeCache = new HashMap<>();
|
||||
|
||||
public StreamWorld() {
|
||||
streams = new ArrayList<>();
|
||||
}
|
||||
|
||||
public void runStreamInteractions(World world) {
|
||||
for(NeutronStream stream : streams) {
|
||||
stream.runStreamInteraction(world);
|
||||
}
|
||||
}
|
||||
|
||||
public void addStream(NeutronStream stream) {
|
||||
streams.add(stream);
|
||||
}
|
||||
|
||||
public void removeAllStreams() {
|
||||
streams.clear();
|
||||
}
|
||||
|
||||
public void cleanNodes() {
|
||||
List<BlockPos> toRemove = new ArrayList<>();
|
||||
for(NeutronNode cachedNode : nodeCache.values()) {
|
||||
if(cachedNode.type == NeutronStream.NeutronType.RBMK) {
|
||||
RBMKNeutronHandler.RBMKNeutronNode node = (RBMKNeutronHandler.RBMKNeutronNode) cachedNode;
|
||||
toRemove.addAll(node.checkNode());
|
||||
}
|
||||
/* TODO: actually do this and uncache pile nodes
|
||||
if(cachedNode.type == NeutronStream.NeutronType.PILE) {
|
||||
PileNeutronNode node = (PileNeutronNode) cachedNode;
|
||||
toRemove.addAll(node.checkNode());
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
for(BlockPos pos : toRemove) {
|
||||
nodeCache.remove(pos);
|
||||
}
|
||||
}
|
||||
|
||||
public void removeNode(BlockPos pos) {
|
||||
nodeCache.remove(pos);
|
||||
}
|
||||
|
||||
public void removeAllStreamsOfType(NeutronStream.NeutronType type) {
|
||||
streams.removeIf(stream -> stream.type == type);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -3,7 +3,6 @@ package com.hbm.handler.neutron;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
import com.hbm.handler.neutron.NeutronNodeWorld.StreamWorld;
|
||||
|
||||
import java.util.Iterator;
|
||||
|
||||
@ -43,13 +42,8 @@ public abstract class NeutronStream {
|
||||
this.fluxQuantity = flux;
|
||||
this.fluxRatio = ratio;
|
||||
this.type = type;
|
||||
World worldObj = origin.tile.getWorldObj();
|
||||
if (NeutronNodeWorld.streamWorlds.get(worldObj) == null) {
|
||||
StreamWorld world = new StreamWorld();
|
||||
world.addStream(this);
|
||||
NeutronNodeWorld.streamWorlds.put(worldObj, world);
|
||||
} else
|
||||
NeutronNodeWorld.streamWorlds.get(worldObj).addStream(this);
|
||||
|
||||
NeutronNodeWorld.getOrAddWorld(origin.tile.getWorldObj()).addStream(this);
|
||||
}
|
||||
|
||||
protected BlockPos posInstance;
|
||||
|
||||
@ -28,9 +28,8 @@ public class PileNeutronHandler {
|
||||
|
||||
public static PileNeutronNode makeNode(TileEntityPileBase tile) {
|
||||
BlockPos pos = new BlockPos(tile);
|
||||
if (NeutronNodeWorld.nodeCache.containsKey(pos))
|
||||
return (PileNeutronNode) NeutronNodeWorld.getNode(pos);
|
||||
return new PileNeutronNode(tile);
|
||||
PileNeutronNode node = (PileNeutronNode) NeutronNodeWorld.getNode(tile.getWorldObj(), pos);
|
||||
return node != null ? node : new PileNeutronNode(tile);
|
||||
}
|
||||
|
||||
private static TileEntity blockPosToTE(World worldObj, BlockPos pos) {
|
||||
@ -43,6 +42,7 @@ public class PileNeutronHandler {
|
||||
super(origin, vector, flux, 0D, NeutronType.PILE);
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@Override
|
||||
public void runStreamInteraction(World worldObj) {
|
||||
|
||||
@ -51,27 +51,29 @@ public class PileNeutronHandler {
|
||||
|
||||
for(float i = 1; i <= range; i += 0.5F) {
|
||||
|
||||
BlockPos node = new BlockPos(
|
||||
BlockPos nodePos = new BlockPos(
|
||||
(int)Math.floor(pos.getX() + 0.5 + vector.xCoord * i),
|
||||
(int)Math.floor(pos.getY() + 0.5 + vector.yCoord * i),
|
||||
(int)Math.floor(pos.getZ() + 0.5 + vector.zCoord * i)
|
||||
);
|
||||
|
||||
if(node.equals(pos))
|
||||
if(nodePos.equals(pos))
|
||||
continue; // don't interact with itself!
|
||||
|
||||
pos.mutate(node.getX(), node.getY(), node.getZ());
|
||||
pos.mutate(nodePos.getX(), nodePos.getY(), nodePos.getZ());
|
||||
|
||||
TileEntity tile;
|
||||
|
||||
if (NeutronNodeWorld.nodeCache.containsKey(node))
|
||||
tile = NeutronNodeWorld.nodeCache.get(node).tile;
|
||||
else {
|
||||
tile = blockPosToTE(worldObj, node);
|
||||
if (tile == null)
|
||||
return; // Doesn't exist!
|
||||
if (tile instanceof TileEntityPileBase)
|
||||
NeutronNodeWorld.addNode(new PileNeutronNode((TileEntityPileBase) tile));
|
||||
NeutronNode node = NeutronNodeWorld.getNode(worldObj, nodePos);
|
||||
if(node != null && node instanceof PileNeutronNode) {
|
||||
tile = node.tile;
|
||||
} else {
|
||||
tile = blockPosToTE(worldObj, nodePos);
|
||||
if(tile == null) return;
|
||||
|
||||
if(tile instanceof TileEntityPileBase) {
|
||||
NeutronNodeWorld.addNode(worldObj, new PileNeutronNode((TileEntityPileBase) tile));
|
||||
}
|
||||
}
|
||||
|
||||
Block block = tile.getBlockType();
|
||||
@ -79,17 +81,17 @@ public class PileNeutronHandler {
|
||||
if(!(tile instanceof TileEntityPileBase)) {
|
||||
|
||||
// Return when a boron block is hit
|
||||
if (block == ModBlocks.block_boron)
|
||||
if(block == ModBlocks.block_boron)
|
||||
return;
|
||||
|
||||
else if (block == ModBlocks.concrete ||
|
||||
else if(block == ModBlocks.concrete ||
|
||||
block == ModBlocks.concrete_smooth ||
|
||||
block == ModBlocks.concrete_asbestos ||
|
||||
block == ModBlocks.concrete_colored ||
|
||||
block == ModBlocks.brick_concrete)
|
||||
fluxQuantity *= 0.25;
|
||||
|
||||
if (block == ModBlocks.block_graphite_rod && (meta & 8) == 0)
|
||||
if(block == ModBlocks.block_graphite_rod && (meta & 8) == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
@ -102,9 +104,9 @@ public class PileNeutronHandler {
|
||||
return;
|
||||
}
|
||||
|
||||
int x = (int) (node.getX() + 0.5);
|
||||
int y = (int) (node.getY() + 0.5);
|
||||
int z = (int) (node.getZ() + 0.5);
|
||||
int x = (int) (nodePos.getX() + 0.5);
|
||||
int y = (int) (nodePos.getY() + 0.5);
|
||||
int z = (int) (nodePos.getZ() + 0.5);
|
||||
List<EntityLivingBase> entities = worldObj.getEntitiesWithinAABB(EntityLivingBase.class, AxisAlignedBB.getBoundingBox(x, y, z, x, y, z));
|
||||
|
||||
if(entities != null)
|
||||
|
||||
@ -39,9 +39,8 @@ public class RBMKNeutronHandler {
|
||||
|
||||
public static RBMKNeutronNode makeNode(TileEntityRBMKBase tile) {
|
||||
BlockPos pos = new BlockPos(tile);
|
||||
if (NeutronNodeWorld.nodeCache.containsKey(pos))
|
||||
return (RBMKNeutronNode) NeutronNodeWorld.getNode(pos);
|
||||
return new RBMKNeutronNode(tile, tile.getRBMKType(), tile.hasLid());
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(tile.getWorldObj(), pos);
|
||||
return node != null ? node : new RBMKNeutronNode(tile, tile.getRBMKType(), tile.hasLid());
|
||||
}
|
||||
|
||||
public static class RBMKNeutronNode extends NeutronNode {
|
||||
@ -79,16 +78,16 @@ public class RBMKNeutronHandler {
|
||||
|
||||
@Override
|
||||
public BlockPos next() {
|
||||
if (Math.pow(x, 2) + Math.pow(z, 2) <= fluxRange * fluxRange) {
|
||||
if(Math.pow(x, 2) + Math.pow(z, 2) <= fluxRange * fluxRange) {
|
||||
z++;
|
||||
if (z > fluxRange) {
|
||||
if(z > fluxRange) {
|
||||
z = -fluxRange;
|
||||
x++;
|
||||
}
|
||||
return posInstance.mutate(tile.xCoord + x, tile.yCoord, tile.zCoord + z);
|
||||
} else {
|
||||
z++;
|
||||
if (z > fluxRange) {
|
||||
if(z > fluxRange) {
|
||||
z = -fluxRange;
|
||||
x++;
|
||||
}
|
||||
@ -102,23 +101,24 @@ public class RBMKNeutronHandler {
|
||||
List<BlockPos> list = new ArrayList<>();
|
||||
|
||||
BlockPos pos = new BlockPos(this.tile);
|
||||
World world = tile.getWorldObj();
|
||||
|
||||
RBMKNeutronStream[] streams = new RBMKNeutronStream[TileEntityRBMKRod.fluxDirs.length];
|
||||
|
||||
// Simulate streams coming out of the RBMK rod.
|
||||
ForgeDirection[] fluxDirs = TileEntityRBMKRod.fluxDirs;
|
||||
for (int i = 0; i < fluxDirs.length; i++) {
|
||||
for(int i = 0; i < fluxDirs.length; i++) {
|
||||
streams[i] = (new RBMKNeutronStream(this, Vec3.createVectorHelper(fluxDirs[i].offsetX, 0, fluxDirs[i].offsetZ)));
|
||||
}
|
||||
|
||||
// Check if the rod should uncache nodes.
|
||||
if (tile instanceof TileEntityRBMKRod && !(tile instanceof TileEntityRBMKRodReaSim)) {
|
||||
if(tile instanceof TileEntityRBMKRod && !(tile instanceof TileEntityRBMKRodReaSim)) {
|
||||
TileEntityRBMKRod rod = (TileEntityRBMKRod) tile;
|
||||
if (!rod.hasRod || rod.lastFluxQuantity == 0) {
|
||||
if(!rod.hasRod || rod.lastFluxQuantity == 0) {
|
||||
|
||||
for (RBMKNeutronStream stream : streams) {
|
||||
for(RBMKNeutronNode node : stream.getNodes(false))
|
||||
if (node != null)
|
||||
for(RBMKNeutronStream stream : streams) {
|
||||
for(NeutronNode node : stream.getNodes(false))
|
||||
if(node != null)
|
||||
list.add(new BlockPos(node.tile));
|
||||
}
|
||||
|
||||
@ -130,11 +130,11 @@ public class RBMKNeutronHandler {
|
||||
Iterator<BlockPos> reaSimNodes = getReaSimNodes();
|
||||
|
||||
// Check if the ReaSim rod should be culled from the cache due to no rod or no flux.
|
||||
if (tile instanceof TileEntityRBMKRodReaSim) { // fuckkkkkkk
|
||||
if(tile instanceof TileEntityRBMKRodReaSim) { // fuckkkkkkk
|
||||
TileEntityRBMKRodReaSim rod = (TileEntityRBMKRodReaSim) tile;
|
||||
if (!rod.hasRod || rod.lastFluxQuantity == 0) {
|
||||
if(!rod.hasRod || rod.lastFluxQuantity == 0) {
|
||||
reaSimNodes.forEachRemaining((a) -> {
|
||||
if (a != null)
|
||||
if(a != null)
|
||||
list.add(a.clone()); // ae The RAM usage will be really high here but hopefully the GC can take care of it :pray:
|
||||
});
|
||||
return list;
|
||||
@ -155,32 +155,32 @@ public class RBMKNeutronHandler {
|
||||
if(nodePos == null)
|
||||
continue;
|
||||
|
||||
NeutronNode node = NeutronNodeWorld.nodeCache.get(nodePos);
|
||||
NeutronNode node = NeutronNodeWorld.getNode(world, nodePos);
|
||||
|
||||
if (node != null && node.tile instanceof TileEntityRBMKRod) {
|
||||
if(node != null && node.tile instanceof TileEntityRBMKRod) {
|
||||
|
||||
TileEntityRBMKRod rod = (TileEntityRBMKRod) node.tile;
|
||||
|
||||
if (rod.hasRod && rod.lastFluxQuantity > 0) {
|
||||
if(rod.hasRod && rod.lastFluxQuantity > 0) {
|
||||
hasRod = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!hasRod) {
|
||||
if(!hasRod) {
|
||||
list.add(pos);
|
||||
return list;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if non-rod nodes should be uncached due to no rod in range.
|
||||
for (RBMKNeutronStream stream : streams) {
|
||||
for(RBMKNeutronStream stream : streams) {
|
||||
|
||||
RBMKNeutronNode[] nodes = stream.getNodes(false);
|
||||
NeutronNode[] nodes = stream.getNodes(false);
|
||||
|
||||
for (RBMKNeutronNode node : nodes) {
|
||||
if (!(node == null) && node.tile instanceof TileEntityRBMKRod)
|
||||
for(NeutronNode node : nodes) {
|
||||
if(!(node == null) && node.tile instanceof TileEntityRBMKRod)
|
||||
return list;
|
||||
}
|
||||
}
|
||||
@ -209,28 +209,28 @@ public class RBMKNeutronHandler {
|
||||
|
||||
// Does NOT include the origin node
|
||||
// USES THE CACHE!!!
|
||||
public RBMKNeutronNode[] getNodes(boolean addNode) {
|
||||
RBMKNeutronNode[] positions = new RBMKNeutronNode[fluxRange];
|
||||
public NeutronNode[] getNodes(boolean addNode) {
|
||||
NeutronNode[] positions = new RBMKNeutronNode[fluxRange];
|
||||
|
||||
BlockPos pos = new BlockPos(origin.tile);
|
||||
World world = origin.tile.getWorldObj();
|
||||
|
||||
for (int i = 1; i <= fluxRange; i++) {
|
||||
for(int i = 1; i <= fluxRange; i++) {
|
||||
int x = (int) Math.floor(0.5 + vector.xCoord * i);
|
||||
int z = (int) Math.floor(0.5 + vector.zCoord * i);
|
||||
|
||||
pos.mutate(origin.tile.xCoord + x, origin.tile.yCoord, origin.tile.zCoord + z);
|
||||
|
||||
if (NeutronNodeWorld.nodeCache.containsKey(pos))
|
||||
positions[i - 1] = (RBMKNeutronNode) NeutronNodeWorld.getNode(pos);
|
||||
|
||||
else if (this.origin.tile.getBlockType() instanceof RBMKBase) {
|
||||
TileEntity te = blockPosToTE(this.origin.tile.getWorldObj(), pos);
|
||||
if (te instanceof TileEntityRBMKBase) {
|
||||
NeutronNode node = NeutronNodeWorld.getNode(world, pos);
|
||||
if(node != null && node instanceof RBMKNeutronNode) {
|
||||
positions[i - 1] = node;
|
||||
} else if(this.origin.tile.getBlockType() instanceof RBMKBase) {
|
||||
TileEntity te = blockPosToTE(world, pos);
|
||||
if(te instanceof TileEntityRBMKBase) {
|
||||
TileEntityRBMKBase rbmkBase = (TileEntityRBMKBase) te;
|
||||
RBMKNeutronNode node = makeNode(rbmkBase);
|
||||
node = makeNode(rbmkBase);
|
||||
positions[i - 1] = node;
|
||||
if (addNode)
|
||||
NeutronNodeWorld.addNode(node);
|
||||
if(addNode) NeutronNodeWorld.addNode(world, node);
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -241,20 +241,21 @@ public class RBMKNeutronHandler {
|
||||
public void runStreamInteraction(World worldObj) {
|
||||
|
||||
// do nothing if there's nothing to do lmao
|
||||
if (fluxQuantity == 0D)
|
||||
if(fluxQuantity == 0D)
|
||||
return;
|
||||
|
||||
BlockPos pos = new BlockPos(origin.tile);
|
||||
|
||||
TileEntityRBMKBase originTE;
|
||||
|
||||
if (NeutronNodeWorld.nodeCache.containsKey(pos))
|
||||
originTE = (TileEntityRBMKBase) NeutronNodeWorld.nodeCache.get(pos).tile;
|
||||
else {
|
||||
NeutronNode node = NeutronNodeWorld.getNode(worldObj, pos);
|
||||
if(node != null) {
|
||||
originTE = (TileEntityRBMKBase) node.tile;
|
||||
} else {
|
||||
originTE = (TileEntityRBMKBase) blockPosToTE(worldObj, pos);
|
||||
if (originTE == null)
|
||||
return; // Doesn't exist anymore!
|
||||
NeutronNodeWorld.addNode(new RBMKNeutronNode(originTE, originTE.getRBMKType(), originTE.hasLid()));
|
||||
if(originTE == null) return; // Doesn't exist anymore!
|
||||
|
||||
NeutronNodeWorld.addNode(worldObj, new RBMKNeutronNode(originTE, originTE.getRBMKType(), originTE.hasLid()));
|
||||
}
|
||||
|
||||
int moderatedCount = 0;
|
||||
@ -263,23 +264,22 @@ public class RBMKNeutronHandler {
|
||||
|
||||
while(iterator.hasNext()) {
|
||||
|
||||
BlockPos nodePos = iterator.next();
|
||||
BlockPos targetPos = iterator.next();
|
||||
|
||||
if (fluxQuantity == 0D) // Whoops, used it all up!
|
||||
if(fluxQuantity == 0D) // Whoops, used it all up!
|
||||
return;
|
||||
|
||||
RBMKNeutronNode node;
|
||||
|
||||
if (!NeutronNodeWorld.nodeCache.containsKey(nodePos)) {
|
||||
TileEntity te = blockPosToTE(worldObj, nodePos); // ok, maybe it didn't get added to the list somehow??
|
||||
if (te instanceof TileEntityRBMKBase) {
|
||||
node = makeNode((TileEntityRBMKBase) te);
|
||||
NeutronNodeWorld.addNode(node); // whoops!
|
||||
NeutronNode targetNode = NeutronNodeWorld.getNode(worldObj, targetPos);
|
||||
if(targetNode == null) {
|
||||
TileEntity te = blockPosToTE(worldObj, targetPos); // ok, maybe it didn't get added to the list somehow??
|
||||
if(te instanceof TileEntityRBMKBase) {
|
||||
targetNode = makeNode((TileEntityRBMKBase) te);
|
||||
NeutronNodeWorld.addNode(worldObj, targetNode); // whoops!
|
||||
} else {
|
||||
int hits = getHits(nodePos); // Get the amount of hits on blocks.
|
||||
if (hits == columnHeight) // If stream is fully blocked.
|
||||
int hits = getHits(targetPos); // Get the amount of hits on blocks.
|
||||
if(hits == columnHeight) // If stream is fully blocked.
|
||||
return;
|
||||
else if (hits > 0) { // If stream is partially blocked.
|
||||
else if(hits > 0) { // If stream is partially blocked.
|
||||
irradiateFromFlux(pos, hits);
|
||||
fluxQuantity *= 1 - ((double) hits / columnHeight); // Inverse to get partial blocking by blocks.
|
||||
continue;
|
||||
@ -290,81 +290,79 @@ public class RBMKNeutronHandler {
|
||||
}
|
||||
}
|
||||
|
||||
node = (RBMKNeutronNode) NeutronNodeWorld.nodeCache.get(nodePos);
|
||||
RBMKType type = (RBMKType) targetNode.data.get("type");
|
||||
|
||||
RBMKType type = (RBMKType) node.data.get("type");
|
||||
|
||||
if (type == RBMKType.OTHER) // pass right on by!
|
||||
if(type == RBMKType.OTHER || type == null) // pass right on by!
|
||||
continue;
|
||||
|
||||
// we established earlier during `getNodes()` that they should all be RBMKBase TEs
|
||||
// no issue with casting here!
|
||||
TileEntityRBMKBase nodeTE = (TileEntityRBMKBase) node.tile;
|
||||
TileEntityRBMKBase nodeTE = (TileEntityRBMKBase) targetNode.tile;
|
||||
|
||||
if (!(boolean) node.data.get("hasLid"))
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, nodePos.getX(), nodePos.getY(), nodePos.getZ(), (float) (this.fluxQuantity * 0.05F));
|
||||
if(!(boolean) targetNode.data.get("hasLid"))
|
||||
ChunkRadiationManager.proxy.incrementRad(worldObj, targetPos.getX(), targetPos.getY(), targetPos.getZ(), (float) (this.fluxQuantity * 0.05F));
|
||||
|
||||
if (type == RBMKType.MODERATOR || nodeTE.isModerated()) {
|
||||
if(type == RBMKType.MODERATOR || nodeTE.isModerated()) {
|
||||
moderatedCount++;
|
||||
moderateStream();
|
||||
}
|
||||
|
||||
if (nodeTE instanceof IRBMKFluxReceiver) {
|
||||
if(nodeTE instanceof IRBMKFluxReceiver) {
|
||||
IRBMKFluxReceiver column = (IRBMKFluxReceiver) nodeTE;
|
||||
|
||||
if (type == RBMKType.ROD) {
|
||||
if(type == RBMKType.ROD) {
|
||||
TileEntityRBMKRod rod = (TileEntityRBMKRod) column;
|
||||
|
||||
if (rod.hasRod) {
|
||||
if(rod.hasRod) {
|
||||
rod.receiveFlux(this);
|
||||
return;
|
||||
}
|
||||
|
||||
} else if (type == RBMKType.OUTGASSER) {
|
||||
} else if(type == RBMKType.OUTGASSER) {
|
||||
TileEntityRBMKOutgasser outgasser = ((TileEntityRBMKOutgasser) column);
|
||||
|
||||
if (outgasser.canProcess()) {
|
||||
if(outgasser.canProcess()) {
|
||||
column.receiveFlux(this);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
} else if (type == RBMKType.CONTROL_ROD) {
|
||||
} else if(type == RBMKType.CONTROL_ROD) {
|
||||
TileEntityRBMKControl rod = (TileEntityRBMKControl) nodeTE;
|
||||
|
||||
if (rod.level > 0.0D) {
|
||||
if(rod.level > 0.0D) {
|
||||
|
||||
this.fluxQuantity *= rod.getMult();
|
||||
continue;
|
||||
}
|
||||
return;
|
||||
} else if (type == RBMKType.REFLECTOR) {
|
||||
} else if(type == RBMKType.REFLECTOR) {
|
||||
|
||||
if (((TileEntityRBMKBase) this.origin.tile).isModerated())
|
||||
if(((TileEntityRBMKBase) this.origin.tile).isModerated())
|
||||
moderatedCount++;
|
||||
|
||||
if (this.fluxRatio > 0 && moderatedCount > 0)
|
||||
for (int i = 0; i < moderatedCount; i++)
|
||||
if(this.fluxRatio > 0 && moderatedCount > 0)
|
||||
for(int i = 0; i < moderatedCount; i++)
|
||||
moderateStream();
|
||||
|
||||
if (reflectorEfficiency != 1.0D) {
|
||||
if(reflectorEfficiency != 1.0D) {
|
||||
this.fluxQuantity *= reflectorEfficiency;
|
||||
continue;
|
||||
}
|
||||
|
||||
((TileEntityRBMKRod) originTE).receiveFlux(this);
|
||||
return;
|
||||
} else if (type == RBMKType.ABSORBER) {
|
||||
if (absorberEfficiency == 1)
|
||||
} else if(type == RBMKType.ABSORBER) {
|
||||
if(absorberEfficiency == 1)
|
||||
return;
|
||||
|
||||
this.fluxQuantity *= absorberEfficiency;
|
||||
}
|
||||
}
|
||||
|
||||
RBMKNeutronNode[] nodes = getNodes(true);
|
||||
NeutronNode[] nodes = getNodes(true);
|
||||
|
||||
RBMKNeutronNode lastNode = nodes[(nodes.length - 1)];
|
||||
NeutronNode lastNode = nodes[(nodes.length - 1)];
|
||||
|
||||
if(lastNode == null) { // This implies that there was *no* last node, meaning either way it was never caught.
|
||||
// There is really no good way to figure out where exactly it should irradiate, so just irradiate at the origin tile.
|
||||
@ -374,9 +372,9 @@ public class RBMKNeutronHandler {
|
||||
|
||||
RBMKType lastNodeType = (RBMKType) lastNode.data.get("type");
|
||||
|
||||
if (lastNodeType == RBMKType.CONTROL_ROD) {
|
||||
if(lastNodeType == RBMKType.CONTROL_ROD) {
|
||||
TileEntityRBMKControl rod = (TileEntityRBMKControl) lastNode.tile;
|
||||
if (rod.getMult() > 0.0D) {
|
||||
if(rod.getMult() > 0.0D) {
|
||||
this.fluxQuantity *= rod.getMult();
|
||||
irradiateFromFlux(new BlockPos(lastNode.tile.xCoord + this.vector.xCoord, lastNode.tile.yCoord, lastNode.tile.zCoord + this.vector.zCoord));
|
||||
}
|
||||
@ -392,7 +390,7 @@ public class RBMKNeutronHandler {
|
||||
// I FUCKING HATE THIS
|
||||
// total count of bugs fixed attributed to this function: 13
|
||||
Block block = origin.tile.getWorldObj().getBlock(pos.getX(), pos.getY() + h, pos.getZ());
|
||||
if (block.isOpaqueCube())
|
||||
if(block.isOpaqueCube())
|
||||
hits += 1;
|
||||
}
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
makeRecipe(new ComparableStack(ModItems.rtg_unit, 1), new AStack[] {new ComparableStack(ModItems.thermo_element, 2), new OreDictStack(CU.plateCast(), 1), new OreDictStack(PB.ingot(), 2), new OreDictStack(STEEL.plate(), 2), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.CAPACITOR.ordinal()), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.levitation_unit, 1), new AStack[] {new ComparableStack(ModItems.coil_copper, 4), new ComparableStack(ModItems.coil_tungsten, 2), new OreDictStack(TI.plate(), 6), new ComparableStack(ModItems.nugget_schrabidium, 2), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.drill_titanium, 1), new AStack[] {new OreDictStack(STEEL.ingot(), 2), new OreDictStack(DURA.ingot(), 2), new OreDictStack(DURA.bolt(), 4), new OreDictStack(TI.plate(), 6), },100);
|
||||
makeRecipe(new ComparableStack(ModItems.entanglement_kit, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new OreDictStack(DURA.ingot(), 4), new OreDictStack(CU.plate(), 24), new ComparableStack(ModBlocks.hadron_coil_gold, 4), new OreDictStack(Fluids.XENON.getDict(1_000))},200);
|
||||
makeRecipe(new ComparableStack(ModItems.entanglement_kit, 1), new AStack[] {new OreDictStack(STEEL.plate(), 8), new OreDictStack(DURA.ingot(), 4), new OreDictStack(CU.plate(), 24), new OreDictStack(GOLD.wireDense(), 16), new OreDictStack(Fluids.XENON.getDict(1_000))},200);
|
||||
makeRecipe(new ComparableStack(ModItems.dysfunctional_reactor, 1), new AStack[] {new OreDictStack(STEEL.plate(), 15), new OreDictStack(PB.ingot(), 5), new ComparableStack(ModItems.rod_quad_empty, 10), new OreDictStack("dyeBrown", 3), },200);
|
||||
makeRecipe(new ComparableStack(ModItems.missile_assembly, 1), new AStack[] {new OreDictStack(STEEL.shell(), 2), new OreDictStack(AL.shell(), 2), new OreDictStack(TI.plate(), 8), new OreDictStack(ANY_PLASTIC.ingot(), 8), new ComparableStack(ModItems.rocket_fuel, 8), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.BASIC), }, 200);
|
||||
makeRecipe(new ComparableStack(ModItems.warhead_generic_small, 1), new AStack[] {new OreDictStack(TI.plate(), 5), new OreDictStack(STEEL.plate(), 3), new ComparableStack(ModItems.ball_dynamite, 2), new ComparableStack(ModItems.circuit, 1, EnumCircuitType.CHIP) },100);
|
||||
@ -552,8 +552,7 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.machine_cyclotron, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_lithium_battery, 3),
|
||||
new ComparableStack(ModBlocks.hadron_coil_neodymium, 8),
|
||||
new OreDictStack(ALLOY.wireDense(), 16),
|
||||
new OreDictStack(ND.wireDense(), 32),
|
||||
!exp ? new OreDictStack(STEEL.ingot(), 16) : new OreDictStack(STEEL.heavyComp(), 3),
|
||||
new OreDictStack(STEEL.plate528(), 32),
|
||||
new OreDictStack(AL.plate528(), 32),
|
||||
@ -1149,16 +1148,6 @@ public class AssemblerRecipes extends SerializableRecipe {
|
||||
new ComparableStack(ModItems.circuit, 10, EnumCircuitType.CAPACITOR_BOARD),
|
||||
}, 300);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.hadron_core, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.hadron_coil_alloy, 24),
|
||||
new OreDictStack(STEEL.ingot(), 8),
|
||||
new OreDictStack(ANY_PLASTIC.ingot(), 16),
|
||||
new OreDictStack(ANY_RESISTANTALLOY.ingot(), 8),
|
||||
new ComparableStack(ModItems.circuit, 16, EnumCircuitType.BISMOID),
|
||||
new ComparableStack(ModItems.circuit, 192, EnumCircuitType.CAPACITOR_BOARD),
|
||||
new ComparableStack(ModItems.crt_display, 1),
|
||||
}, 300);
|
||||
|
||||
makeRecipe(new ComparableStack(ModBlocks.struct_launcher_core, 1), new AStack[] {
|
||||
new ComparableStack(ModBlocks.machine_battery, 3),
|
||||
new ComparableStack(ModBlocks.steel_scaffold, 10),
|
||||
|
||||
@ -61,57 +61,56 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
final int mixingTime = 20;
|
||||
FluidStack sulfur = new FluidStack(Fluids.SULFURIC_ACID, 500);
|
||||
|
||||
registerRecipe(COAL.ore(), new CrystallizerRecipe(ModItems.crystal_coal, baseTime));
|
||||
registerRecipe(IRON.ore(), new CrystallizerRecipe(ModItems.crystal_iron, baseTime));
|
||||
registerRecipe(GOLD.ore(), new CrystallizerRecipe(ModItems.crystal_gold, baseTime));
|
||||
registerRecipe(REDSTONE.ore(), new CrystallizerRecipe(ModItems.crystal_redstone, baseTime));
|
||||
registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime));
|
||||
registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime));
|
||||
registerRecipe(U.ore(), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime), sulfur);
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ONLY_ORE)) registerRecipe(ore, new CrystallizerRecipe(ModItems.crystal_thorium, baseTime), sulfur);
|
||||
registerRecipe(PU.ore(), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime), sulfur);
|
||||
registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime), sulfur);
|
||||
registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime));
|
||||
registerRecipe(KNO.ore(), new CrystallizerRecipe(ModItems.crystal_niter, baseTime));
|
||||
registerRecipe(CU.ore(), new CrystallizerRecipe(ModItems.crystal_copper, baseTime));
|
||||
registerRecipe(W.ore(), new CrystallizerRecipe(ModItems.crystal_tungsten, baseTime), sulfur);
|
||||
registerRecipe(AL.ore(), new CrystallizerRecipe(ModItems.crystal_aluminium, baseTime));
|
||||
registerRecipe(F.ore(), new CrystallizerRecipe(ModItems.crystal_fluorite, baseTime));
|
||||
registerRecipe(BE.ore(), new CrystallizerRecipe(ModItems.crystal_beryllium, baseTime));
|
||||
registerRecipe(PB.ore(), new CrystallizerRecipe(ModItems.crystal_lead, baseTime));
|
||||
registerRecipe(SA326.ore(), new CrystallizerRecipe(ModItems.crystal_schrabidium, baseTime), sulfur);
|
||||
registerRecipe(LI.ore(), new CrystallizerRecipe(ModItems.crystal_lithium, baseTime), sulfur);
|
||||
//registerRecipe(STAR.ore(), new CrystallizerRecipe(ModItems.crystal_starmetal, baseTime), sulfur);
|
||||
registerRecipe(CO.ore(), new CrystallizerRecipe(ModItems.crystal_cobalt, baseTime), sulfur);
|
||||
registerRecipe(COAL.ore(), new CrystallizerRecipe(ModItems.crystal_coal, baseTime).prod(0.05F));
|
||||
registerRecipe(IRON.ore(), new CrystallizerRecipe(ModItems.crystal_iron, baseTime).prod(0.05F));
|
||||
registerRecipe(GOLD.ore(), new CrystallizerRecipe(ModItems.crystal_gold, baseTime).prod(0.05F));
|
||||
registerRecipe(REDSTONE.ore(), new CrystallizerRecipe(ModItems.crystal_redstone, baseTime).prod(0.05F));
|
||||
registerRecipe(LAPIS.ore(), new CrystallizerRecipe(ModItems.crystal_lapis, baseTime).prod(0.05F));
|
||||
registerRecipe(DIAMOND.ore(), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime).prod(0.05F));
|
||||
registerRecipe(U.ore(), new CrystallizerRecipe(ModItems.crystal_uranium, baseTime).prod(0.05F), sulfur);
|
||||
for(String ore : OreDictManager.TH232.all(MaterialShapes.ONLY_ORE)) registerRecipe(ore, new CrystallizerRecipe(ModItems.crystal_thorium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(PU.ore(), new CrystallizerRecipe(ModItems.crystal_plutonium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(TI.ore(), new CrystallizerRecipe(ModItems.crystal_titanium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(S.ore(), new CrystallizerRecipe(ModItems.crystal_sulfur, baseTime).prod(0.05F));
|
||||
registerRecipe(KNO.ore(), new CrystallizerRecipe(ModItems.crystal_niter, baseTime).prod(0.05F));
|
||||
registerRecipe(CU.ore(), new CrystallizerRecipe(ModItems.crystal_copper, baseTime).prod(0.05F));
|
||||
registerRecipe(W.ore(), new CrystallizerRecipe(ModItems.crystal_tungsten, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(AL.ore(), new CrystallizerRecipe(ModItems.crystal_aluminium, baseTime).prod(0.05F));
|
||||
registerRecipe(F.ore(), new CrystallizerRecipe(ModItems.crystal_fluorite, baseTime).prod(0.05F));
|
||||
registerRecipe(BE.ore(), new CrystallizerRecipe(ModItems.crystal_beryllium, baseTime).prod(0.05F));
|
||||
registerRecipe(PB.ore(), new CrystallizerRecipe(ModItems.crystal_lead, baseTime).prod(0.05F));
|
||||
registerRecipe(SA326.ore(), new CrystallizerRecipe(ModItems.crystal_schrabidium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(LI.ore(), new CrystallizerRecipe(ModItems.crystal_lithium, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(CO.ore(), new CrystallizerRecipe(ModItems.crystal_cobalt, baseTime).prod(0.05F), sulfur);
|
||||
|
||||
registerRecipe(new ComparableStack(ModItems.powder_calcium), new CrystallizerRecipe(new ItemStack(ModItems.powder_cement, 8), utilityTime), new FluidStack(Fluids.REDMUD, 75));
|
||||
registerRecipe(MALACHITE.ingot(), new CrystallizerRecipe(ItemScraps.create(new MaterialStack(Mats.MAT_COPPER, MaterialShapes.INGOT.q(1))), 300), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_calcium), new CrystallizerRecipe(new ItemStack(ModItems.powder_cement, 8), utilityTime).prod(0.1F), new FluidStack(Fluids.REDMUD, 75));
|
||||
registerRecipe(MALACHITE.ingot(), new CrystallizerRecipe(ItemScraps.create(new MaterialStack(Mats.MAT_COPPER, MaterialShapes.INGOT.q(1))), 300).prod(0.1F), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
|
||||
registerRecipe("oreRareEarth", new CrystallizerRecipe(ModItems.crystal_rare, baseTime), sulfur);
|
||||
registerRecipe("oreCinnabar", new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime));
|
||||
registerRecipe("oreRareEarth", new CrystallizerRecipe(ModItems.crystal_rare, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe("oreCinnabar", new CrystallizerRecipe(ModItems.crystal_cinnebar, baseTime).prod(0.05F));
|
||||
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_nether_fire), new CrystallizerRecipe(ModItems.crystal_phosphorus, baseTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_tikite), new CrystallizerRecipe(ModItems.crystal_trixite, baseTime), sulfur);
|
||||
registerRecipe(new ComparableStack(ModBlocks.gravel_diamond), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime));
|
||||
registerRecipe(SRN.ingot(), new CrystallizerRecipe(ModItems.crystal_schraranium, baseTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_nether_fire), new CrystallizerRecipe(ModItems.crystal_phosphorus, baseTime).prod(0.05F));
|
||||
registerRecipe(new ComparableStack(ModBlocks.ore_tikite), new CrystallizerRecipe(ModItems.crystal_trixite, baseTime).prod(0.05F), sulfur);
|
||||
registerRecipe(new ComparableStack(ModBlocks.gravel_diamond), new CrystallizerRecipe(ModItems.crystal_diamond, baseTime).prod(0.05F));
|
||||
registerRecipe(SRN.ingot(), new CrystallizerRecipe(ModItems.crystal_schraranium, baseTime).prod(0.05F));
|
||||
|
||||
registerRecipe(KEY_SAND, new CrystallizerRecipe(ModItems.ingot_fiberglass, utilityTime));
|
||||
registerRecipe(SI.ingot(), new CrystallizerRecipe(new ItemStack(Items.quartz, 2), utilityTime), new FluidStack(Fluids.OXYGEN, 250));
|
||||
registerRecipe(REDSTONE.block(), new CrystallizerRecipe(ModItems.ingot_mercury, baseTime));
|
||||
registerRecipe(CINNABAR.crystal(), new CrystallizerRecipe(new ItemStack(ModItems.ingot_mercury, 3), baseTime));
|
||||
registerRecipe(BORAX.dust(), new CrystallizerRecipe(new ItemStack(ModItems.powder_boron_tiny, 3), baseTime), sulfur);
|
||||
registerRecipe(KEY_SAND, new CrystallizerRecipe(ModItems.ingot_fiberglass, utilityTime).prod(0.15F));
|
||||
registerRecipe(SI.ingot(), new CrystallizerRecipe(new ItemStack(Items.quartz, 2), utilityTime).prod(0.1F), new FluidStack(Fluids.OXYGEN, 250));
|
||||
registerRecipe(REDSTONE.block(), new CrystallizerRecipe(ModItems.ingot_mercury, baseTime).prod(0.25F));
|
||||
registerRecipe(CINNABAR.crystal(), new CrystallizerRecipe(new ItemStack(ModItems.ingot_mercury, 3), baseTime).prod(0.25F));
|
||||
registerRecipe(BORAX.dust(), new CrystallizerRecipe(new ItemStack(ModItems.powder_boron_tiny, 3), baseTime).prod(0.25F), sulfur);
|
||||
registerRecipe(COAL.block(), new CrystallizerRecipe(ModBlocks.block_graphite, baseTime));
|
||||
|
||||
registerRecipe(new ComparableStack(Blocks.cobblestone), new CrystallizerRecipe(ModBlocks.reinforced_stone, utilityTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.gravel_obsidian), new CrystallizerRecipe(ModBlocks.brick_obsidian, utilityTime));
|
||||
registerRecipe(new ComparableStack(Items.rotten_flesh), new CrystallizerRecipe(Items.leather, utilityTime));
|
||||
registerRecipe(new ComparableStack(Items.rotten_flesh), new CrystallizerRecipe(Items.leather, utilityTime).prod(0.25F));
|
||||
registerRecipe(new ComparableStack(ModItems.coal_infernal), new CrystallizerRecipe(ModItems.solid_fuel, utilityTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.stone_gneiss), new CrystallizerRecipe(ModItems.powder_lithium, utilityTime));
|
||||
registerRecipe(new ComparableStack(ModBlocks.stone_gneiss), new CrystallizerRecipe(ModItems.powder_lithium, utilityTime).prod(0.25F));
|
||||
registerRecipe(new ComparableStack(Items.dye, 1, 15), new CrystallizerRecipe(new ItemStack(Items.slime_ball, 4), mixingTime), new FluidStack(Fluids.SULFURIC_ACID, 250));
|
||||
registerRecipe(new ComparableStack(Items.bone), new CrystallizerRecipe(new ItemStack(Items.slime_ball, 16), mixingTime), new FluidStack(Fluids.SULFURIC_ACID, 1_000));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.plant_item, EnumPlantType.MUSTARDWILLOW)), new CrystallizerRecipe(new ItemStack(ModItems.powder_cadmium), 100).setReq(10), new FluidStack(Fluids.RADIOSOLVENT, 250));
|
||||
registerRecipe(new ComparableStack(ModItems.scrap_oil), new CrystallizerRecipe(new ItemStack(ModItems.nugget_arsenic), 100).setReq(16), new FluidStack(Fluids.RADIOSOLVENT, 100));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.FULLERENE)), new CrystallizerRecipe(new ItemStack(ModItems.ingot_cft), baseTime).setReq(4), new FluidStack(Fluids.XYLENE, 1_000));
|
||||
registerRecipe(new ComparableStack(ModItems.scrap_oil), new CrystallizerRecipe(new ItemStack(ModItems.nugget_arsenic), 100).prod(0.3F).setReq(16), new FluidStack(Fluids.RADIOSOLVENT, 100));
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.powder_ash, EnumAshType.FULLERENE)), new CrystallizerRecipe(new ItemStack(ModItems.ingot_cft), baseTime).prod(0.1F).setReq(4), new FluidStack(Fluids.XYLENE, 1_000));
|
||||
|
||||
registerRecipe(DIAMOND.dust(), new CrystallizerRecipe(Items.diamond, utilityTime));
|
||||
registerRecipe(EMERALD.dust(), new CrystallizerRecipe(Items.emerald, utilityTime));
|
||||
@ -120,8 +119,8 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(new ComparableStack(ModItems.powder_desh_ready), new CrystallizerRecipe(ModItems.ingot_desh, baseTime));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_meteorite), new CrystallizerRecipe(ModItems.fragment_meteorite, utilityTime));
|
||||
registerRecipe(CD.dust(), new CrystallizerRecipe(ModItems.ingot_rubber, utilityTime), new FluidStack(Fluids.FISHOIL, 250));
|
||||
registerRecipe(LATEX.ingot(), new CrystallizerRecipe(ModItems.ingot_rubber, mixingTime), new FluidStack(Fluids.SOURGAS, 25));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_sawdust), new CrystallizerRecipe(ModItems.cordite, mixingTime), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
registerRecipe(LATEX.ingot(), new CrystallizerRecipe(ModItems.ingot_rubber, mixingTime).prod(0.15F), new FluidStack(Fluids.SOURGAS, 25));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_sawdust), new CrystallizerRecipe(ModItems.cordite, mixingTime).prod(0.25F), new FluidStack(Fluids.NITROGLYCERIN, 250));
|
||||
|
||||
registerRecipe(new ComparableStack(ModItems.meteorite_sword_treated), new CrystallizerRecipe(ModItems.meteorite_sword_etched, baseTime));
|
||||
registerRecipe(new ComparableStack(ModItems.powder_impure_osmiridium), new CrystallizerRecipe(ModItems.crystal_osmiridium, baseTime), new FluidStack(Fluids.SCHRABIDIC, 1_000));
|
||||
@ -202,14 +201,14 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
registerRecipe(new ComparableStack(ItemBedrockOreNew.make(BedrockOreGrade.CRUMBS, type)), new CrystallizerRecipe(ItemBedrockOreNew.make(BedrockOreGrade.BASE, type), bedrock).setReq(64), new FluidStack(Fluids.NITRIC_ACID, 1000));
|
||||
}
|
||||
|
||||
FluidStack[] dyes = new FluidStack[] {new FluidStack(Fluids.WOODOIL, 100), new FluidStack(Fluids.FISHOIL, 100)};
|
||||
FluidStack[] dyes = new FluidStack[] {new FluidStack(Fluids.WOODOIL, 100), new FluidStack(Fluids.FISHOIL, 100), new FluidStack(Fluids.LIGHTOIL, 100)};
|
||||
for(FluidStack dye : dyes) {
|
||||
registerRecipe(COAL.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLACK, 4), mixingTime), dye);
|
||||
registerRecipe(TI.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.WHITE, 4), mixingTime), dye);
|
||||
registerRecipe(IRON.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.RED, 4), mixingTime), dye);
|
||||
registerRecipe(W.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.YELLOW, 4), mixingTime), dye);
|
||||
registerRecipe(CU.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 4), mixingTime), dye);
|
||||
registerRecipe(CO.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE, 4), mixingTime), dye);
|
||||
registerRecipe(COAL.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLACK, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(TI.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.WHITE, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(IRON.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.RED, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(W.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.YELLOW, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(CU.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.GREEN, 4), mixingTime).prod(0.15F), dye);
|
||||
registerRecipe(CO.dust(), new CrystallizerRecipe(DictFrame.fromOne(ModItems.chemical_dye, EnumChemDye.BLUE, 4), mixingTime).prod(0.15F), dye);
|
||||
}
|
||||
|
||||
registerRecipe(new ComparableStack(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.CRUDE)), new CrystallizerRecipe(DictFrame.fromOne(ModItems.oil_tar, EnumTarType.WAX), 20), new FluidStack(Fluids.CHLORINE, 250));
|
||||
@ -327,6 +326,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
public int acidAmount;
|
||||
public int itemAmount = 1;
|
||||
public int duration;
|
||||
public float productivity = 0F;
|
||||
public ItemStack output;
|
||||
|
||||
public CrystallizerRecipe(Block output, int duration) { this(new ItemStack(output), duration); }
|
||||
@ -342,6 +342,11 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
this.duration = duration;
|
||||
this.acidAmount = 500;
|
||||
}
|
||||
|
||||
public CrystallizerRecipe prod(float productivity) {
|
||||
this.productivity = productivity;
|
||||
return this;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -371,6 +376,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
} else if(input instanceof OreDictStack) {
|
||||
recipes.put(new Pair(((OreDictStack) input).name, fluid.type), cRecipe);
|
||||
}
|
||||
if(obj.has("productivity")) cRecipe.prod(obj.get("productivity").getAsFloat());
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -389,6 +395,7 @@ public class CrystallizerRecipes extends SerializableRecipe {
|
||||
this.writeAStack(input, writer);
|
||||
writer.name("output");
|
||||
this.writeItemStack(cRecipe.output, writer);
|
||||
writer.name("productivity").value(cRecipe.productivity);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -5,7 +5,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.stream.JsonWriter;
|
||||
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
@ -183,45 +182,10 @@ public class HadronRecipes extends SerializableRecipe {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void readRecipe(JsonElement recipe) {
|
||||
JsonObject obj = (JsonObject) recipe;
|
||||
int momentum = obj.get("momentum").getAsInt();
|
||||
boolean lineMode = obj.get("lineMode").getAsBoolean();
|
||||
ItemStack[] in = this.readItemStackArray(obj.get("inputs").getAsJsonArray());
|
||||
ItemStack[] out = this.readItemStackArray(obj.get("outputs").getAsJsonArray());
|
||||
|
||||
this.recipes.add(new HadronRecipe(
|
||||
in[0],
|
||||
in[1],
|
||||
momentum,
|
||||
out[0],
|
||||
out[1],
|
||||
lineMode
|
||||
));
|
||||
}
|
||||
public void readRecipe(JsonElement recipe) { }
|
||||
|
||||
@Override
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException {
|
||||
HadronRecipe rec = (HadronRecipe) recipe;
|
||||
|
||||
writer.name("momentum").value(rec.momentum);
|
||||
writer.name("lineMode").value(rec.analysisOnly);
|
||||
|
||||
writer.name("inputs").beginArray();
|
||||
this.writeItemStack(rec.in1.toStack(), writer);
|
||||
this.writeItemStack(rec.in2.toStack(), writer);
|
||||
writer.endArray();
|
||||
|
||||
writer.name("outputs").beginArray();
|
||||
this.writeItemStack(rec.out1, writer);
|
||||
this.writeItemStack(rec.out2, writer);
|
||||
writer.endArray();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getComment() {
|
||||
return "Rules: Both in- and output stacks cannot be null. Stacksizes are set to 1 for all stacks.";
|
||||
}
|
||||
public void writeRecipe(Object recipe, JsonWriter writer) throws IOException { }
|
||||
|
||||
@Override
|
||||
public void deleteRecipes() {
|
||||
|
||||
@ -56,18 +56,6 @@ public class MagicRecipes {
|
||||
new ComparableStack(ModItems.powder_dineutronium),
|
||||
new ComparableStack(ModItems.blades_desh),
|
||||
new ComparableStack(ModItems.diamond_gavel)));
|
||||
|
||||
recipes.add(new MagicRecipe(new ItemStack(ModBlocks.hadron_coil_mese),
|
||||
new ComparableStack(ModBlocks.hadron_coil_chlorophyte),
|
||||
new ComparableStack(ModItems.powder_dineutronium),
|
||||
new ComparableStack(ModItems.plate_desh),
|
||||
new OreDictStack(GOLD.dust())));
|
||||
|
||||
recipes.add(new MagicRecipe(new ItemStack(ModBlocks.hadron_coil_mese),
|
||||
new ComparableStack(ModBlocks.hadron_coil_chlorophyte),
|
||||
new OreDictStack(DNT.wireDense()),
|
||||
new OreDictStack(W.wireDense()),
|
||||
new OreDictStack(GOLD.wireDense())));
|
||||
}
|
||||
|
||||
public static List<MagicRecipe> getRecipes() {
|
||||
|
||||
@ -147,7 +147,7 @@ public class PedestalRecipes extends SerializableRecipe {
|
||||
}
|
||||
|
||||
public static enum PedestalExtraCondition {
|
||||
NONE, FULL_MOON, NEW_MOON, SUN
|
||||
NONE, FULL_MOON, NEW_MOON, SUN, GOOD_KARMA, BAD_KARMA
|
||||
}
|
||||
|
||||
public static class PedestalRecipe {
|
||||
|
||||
@ -118,6 +118,10 @@ public class PyroOvenRecipes extends SerializableRecipe {
|
||||
recipes.add(new PyroOvenRecipe(60)
|
||||
.in(new FluidStack(GAS_COKER, 4_000))
|
||||
.out(new FluidStack(Fluids.REFORMGAS, 100)));
|
||||
//hydrogen and carbon from natgas
|
||||
recipes.add(new PyroOvenRecipe(60)
|
||||
.in(new FluidStack(Fluids.GAS, 12_000))
|
||||
.out(new FluidStack(Fluids.HYDROGEN, 8_000)).out(new ItemStack(ModItems.ingot_graphite, 1)));
|
||||
}
|
||||
|
||||
private static void registerSFAuto(FluidType fluid) {
|
||||
|
||||
@ -47,6 +47,7 @@ public class RotaryFurnaceRecipes extends SerializableRecipe {
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_GUNMETAL, INGOT.q(4)), 200, 100, new OreDictStack(CU.ingot(), 3), new OreDictStack(AL.ingot(), 1)));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_WEAPONSTEEL, INGOT.q(1)), 200, 400, new FluidStack(Fluids.GAS_COKER, 100), new OreDictStack(STEEL.ingot(), 1), new ComparableStack(ModItems.powder_flux, 2)));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_SATURN, INGOT.q(2)), 200, 400, new FluidStack(Fluids.REFORMGAS, 250), new OreDictStack(DURA.dust(), 4), new OreDictStack(CU.dust())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_SATURN, INGOT.q(4)), 200, 300, new FluidStack(Fluids.REFORMGAS, 250), new OreDictStack(DURA.dust(), 4), new OreDictStack(CU.dust()), new OreDictStack(BORAX.dust())));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_ALUMINIUM, INGOT.q(2)), 100, 400, new FluidStack(Fluids.SODIUM_ALUMINATE, 150)));
|
||||
recipes.add(new RotaryFurnaceRecipe(new MaterialStack(MAT_ALUMINIUM, INGOT.q(3)), 40, 200, new FluidStack(Fluids.SODIUM_ALUMINATE, 150), new ComparableStack(ModItems.powder_flux, 2)));
|
||||
}
|
||||
|
||||
@ -1417,7 +1417,6 @@ public class ModItems {
|
||||
|
||||
public static Item missile_custom;
|
||||
|
||||
public static Item missile_carrier;
|
||||
public static Item missile_soyuz;
|
||||
public static Item missile_soyuz_lander;
|
||||
public static Item sat_mapper;
|
||||
@ -2893,7 +2892,7 @@ public class ModItems {
|
||||
demon_core_open = new ItemDemonCore().setUnlocalizedName("demon_core_open").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":demon_core_open");
|
||||
demon_core_closed = new Item().setUnlocalizedName("demon_core_closed").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":demon_core_closed");
|
||||
|
||||
pa_coil = new ItemPACoil().setUnlocalizedName("pa_coil").setCreativeTab(MainRegistry.nukeTab).setTextureName(RefStrings.MODID + ":pa_coil");
|
||||
pa_coil = new ItemPACoil().setUnlocalizedName("pa_coil").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":pa_coil");
|
||||
|
||||
particle_empty = new Item().setUnlocalizedName("particle_empty").setCreativeTab(MainRegistry.controlTab).setTextureName(RefStrings.MODID + ":particle_empty");
|
||||
particle_hydrogen = new Item().setUnlocalizedName("particle_hydrogen").setCreativeTab(MainRegistry.controlTab).setContainerItem(ModItems.particle_empty).setTextureName(RefStrings.MODID + ":particle_hydrogen");
|
||||
@ -3649,7 +3648,6 @@ public class ModItems {
|
||||
missile_shuttle = new ItemMissile(MissileFormFactor.OTHER, MissileTier.TIER3, MissileFuel.KEROSENE_PEROXIDE).setUnlocalizedName("missile_shuttle").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_shuttle");
|
||||
missile_stealth = new ItemMissile(MissileFormFactor.STRONG, MissileTier.TIER1).setUnlocalizedName("missile_stealth").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":missile_stealth");
|
||||
missile_test = new ItemMissile(MissileFormFactor.MICRO, MissileTier.TIER0).setUnlocalizedName("missile_test").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":missile_micro");
|
||||
missile_carrier = new Item().setUnlocalizedName("missile_carrier").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":missile_carrier");
|
||||
missile_soyuz = new ItemSoyuz().setUnlocalizedName("missile_soyuz").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":soyuz");
|
||||
missile_soyuz_lander = new ItemCustomLore().setUnlocalizedName("missile_soyuz_lander").setMaxStackSize(1).setCreativeTab(MainRegistry.missileTab).setTextureName(RefStrings.MODID + ":soyuz_lander");
|
||||
missile_custom = new ItemCustomMissile().setUnlocalizedName("missile_custom").setMaxStackSize(1).setCreativeTab(null).setTextureName(RefStrings.MODID + ":missile_custom");
|
||||
@ -6273,7 +6271,6 @@ public class ModItems {
|
||||
GameRegistry.registerItem(missile_doomsday, missile_doomsday.getUnlocalizedName());
|
||||
GameRegistry.registerItem(missile_doomsday_rusted, missile_doomsday_rusted.getUnlocalizedName());
|
||||
//Rockets
|
||||
GameRegistry.registerItem(missile_carrier, missile_carrier.getUnlocalizedName());
|
||||
GameRegistry.registerItem(missile_soyuz, missile_soyuz.getUnlocalizedName());
|
||||
GameRegistry.registerItem(missile_soyuz_lander, missile_soyuz_lander.getUnlocalizedName());
|
||||
GameRegistry.registerItem(missile_custom, missile_custom.getUnlocalizedName());
|
||||
|
||||
@ -168,14 +168,11 @@ public class ItemAssemblyTemplate extends Item {
|
||||
return;
|
||||
}
|
||||
|
||||
boolean nbtType = true;
|
||||
|
||||
//NEW
|
||||
ComparableStack out = readType(stack);
|
||||
//LEGACY
|
||||
if(out == null) {
|
||||
out = AssemblerRecipes.recipeList.get(i);
|
||||
nbtType = false;
|
||||
}
|
||||
|
||||
AssemblerRecipe recipe = AssemblerRecipes.recipes.get(out);
|
||||
@ -202,13 +199,6 @@ public class ItemAssemblyTemplate extends Item {
|
||||
}
|
||||
|
||||
list.add(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("info.templatefolder", String.join(" / ", names)));
|
||||
|
||||
if(nbtType) {
|
||||
list.add(EnumChatFormatting.GREEN + "Persistent template");
|
||||
} else {
|
||||
list.add(EnumChatFormatting.RED + "Volatile template");
|
||||
}
|
||||
|
||||
list.add("");
|
||||
|
||||
if(out == null) {
|
||||
|
||||
@ -41,8 +41,8 @@ public class ItemRBMKLid extends Item {
|
||||
if(tile.hasLid())
|
||||
return false;
|
||||
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(new BlockPos(te));
|
||||
if (node != null)
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(world, new BlockPos(te));
|
||||
if(node != null)
|
||||
node.addLid();
|
||||
|
||||
int meta = RBMKBase.DIR_NORMAL_LID.ordinal();
|
||||
|
||||
@ -6,6 +6,7 @@ import com.hbm.inventory.gui.GUIScreenTemplateFolder;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.I18nUtil;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -14,6 +15,7 @@ import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.EnumChatFormatting;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class ItemTemplateFolder extends Item implements IGUIProvider {
|
||||
@ -31,8 +33,9 @@ public class ItemTemplateFolder extends Item implements IGUIProvider {
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
|
||||
String[] lang = I18nUtil.resolveKeyArray(ModItems.template_folder.getUnlocalizedName() + ".desc");
|
||||
EnumChatFormatting color = BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.YELLOW;
|
||||
for(String line : lang) {
|
||||
list.add(line);
|
||||
list.add(color + line);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -184,7 +184,7 @@ public class ItemAmmoArty extends Item {
|
||||
return "item." + itemTypes[Math.abs(stack.getItemDamage()) % itemTypes.length].name;
|
||||
}
|
||||
|
||||
protected static SpentCasing SIXTEEN_INCH_CASE = new SpentCasing(CasingType.STRAIGHT).setScale(15F, 15F, 10F).setupSmoke(1F, 1D, 200, 60).setMaxAge(300);
|
||||
protected static SpentCasing SIXTEEN_INCH_CASE = new SpentCasing(CasingType.STRAIGHT).setScale(15F, 15F, 10F).setupSmoke(1F, 1D, 200, 60).setMaxAge(300).setBounceMotion(1F, 0.5F);
|
||||
|
||||
public abstract class ArtilleryShell {
|
||||
|
||||
|
||||
@ -2,6 +2,7 @@ package com.hbm.items.weapon.sedna.factory;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import com.hbm.entity.mob.*;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.particle.helper.AshesCreator;
|
||||
@ -10,6 +11,8 @@ import com.hbm.util.DamageResistanceHandler.DamageClass;
|
||||
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import net.minecraft.entity.EntityLivingBase;
|
||||
import net.minecraft.entity.monster.EntitySkeleton;
|
||||
import net.minecraft.entity.monster.EntitySlime;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.util.DamageSource;
|
||||
import net.minecraft.util.MathHelper;
|
||||
@ -39,6 +42,12 @@ public class ConfettiUtil {
|
||||
}
|
||||
|
||||
public static void gib(EntityLivingBase entity) {
|
||||
if(entity instanceof EntityCyberCrab) return;
|
||||
if(entity instanceof EntityTeslaCrab) return;
|
||||
if(entity instanceof EntityTaintCrab) return;
|
||||
if(entity instanceof EntitySkeleton) return;
|
||||
if(entity instanceof EntitySlime) return;
|
||||
|
||||
NBTTagCompound vdat = new NBTTagCompound();
|
||||
vdat.setString("type", "giblets");
|
||||
vdat.setInteger("ent", entity.getEntityId());
|
||||
|
||||
@ -21,7 +21,7 @@ public class GunFactory {
|
||||
|
||||
public static BulletConfig ammo_debug;
|
||||
|
||||
public static SpentCasing CASING44 = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F, 1.0F, 1.5F).setBounceMotion(0.01F, 0.05F).setColor(SpentCasing.COLOR_CASE_44);
|
||||
public static SpentCasing CASING44 = new SpentCasing(CasingType.STRAIGHT).setScale(1.5F, 1.0F, 1.5F).setColor(SpentCasing.COLOR_CASE_44);
|
||||
|
||||
public static void init() {
|
||||
|
||||
|
||||
@ -193,7 +193,7 @@ public class GunFactoryClient {
|
||||
folly_sm.setRendererBeam(LegoClient.RENDER_FOLLY);
|
||||
folly_nuke.setRenderer(LegoClient.RENDER_BIG_NUKE);
|
||||
|
||||
p35800.setRendererBeam(LegoClient.RENDER_LASER_WHITE);
|
||||
p35800.setRendererBeam(LegoClient.RENDER_CRACKLE);
|
||||
|
||||
setRendererBulk(LegoClient.RENDER_GRENADE, shell_normal, shell_explosive, shell_ap, shell_du, shell_w9); //TODO: change the sabots
|
||||
|
||||
|
||||
@ -22,6 +22,7 @@ import com.hbm.items.weapon.sedna.ItemGunBaseNT.LambdaContext;
|
||||
import com.hbm.items.weapon.sedna.ItemGunBaseNT.SmokeNode;
|
||||
import com.hbm.items.weapon.sedna.Receiver;
|
||||
import com.hbm.items.weapon.sedna.mags.IMagazine;
|
||||
import com.hbm.main.MainRegistry;
|
||||
import com.hbm.particle.helper.BlackPowderCreator;
|
||||
import com.hbm.render.anim.BusAnimation;
|
||||
import com.hbm.render.anim.BusAnimationSequence;
|
||||
@ -238,6 +239,7 @@ public class Lego {
|
||||
}
|
||||
}
|
||||
|
||||
if(player != null) player.addStat(MainRegistry.statBullets, 1);
|
||||
mag.useUpAmmo(stack, ctx.inventory, 1);
|
||||
if(calcWear) ItemGunBaseNT.setWear(stack, index, Math.min(ItemGunBaseNT.getWear(stack, index) + config.wear, ctx.config.getDurability(stack)));
|
||||
}
|
||||
|
||||
@ -319,6 +319,25 @@ public class LegoClient {
|
||||
RenderArcFurnace.fullbright(false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_CRACKLE = (bullet, interp) -> {
|
||||
|
||||
RenderArcFurnace.fullbright(true);
|
||||
double age = MathHelper.clamp_double(1D - ((double) bullet.ticksExisted - 2 + interp) / (double) bullet.getBulletConfig().expires, 0, 1);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glRotatef(180 - bullet.rotationYaw, 0, 1F, 0);
|
||||
GL11.glRotatef(-bullet.rotationPitch - 90, 1F, 0, 0);
|
||||
|
||||
double scale = 5D;
|
||||
GL11.glScaled(age * scale, 1, age * scale);
|
||||
GL11.glTranslated(0, bullet.beamLength, 0);
|
||||
GL11.glRotatef(-90, 0, 0, 1);
|
||||
renderBulletStandard(Tessellator.instance, 0xE3D692, 0xffffff, bullet.beamLength, true);
|
||||
|
||||
GL11.glPopMatrix();
|
||||
RenderArcFurnace.fullbright(false);
|
||||
};
|
||||
|
||||
public static BiConsumer<EntityBulletBeamBase, Float> RENDER_LASER_RED = (bullet, interp) -> {
|
||||
renderStandardLaser(bullet, interp, 0x80, 0x15, 0x15);
|
||||
};
|
||||
|
||||
@ -173,7 +173,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 14) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, -0.125, aiming ? -0.125 : -0.375D, 0, 0.12, -0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, -0.125, aiming ? -0.125 : -0.375D, 0, 0.12, -0.12, 0.01, -7.5F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 1.5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
if(timer == 12) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 1F);
|
||||
}
|
||||
@ -196,7 +196,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 2) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.55, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -7.5F + (float)entity.getRNG().nextGaussian() * 5F, 12F + (float)entity.getRNG().nextGaussian() * 5F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -244,7 +244,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 14) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, 0.18, -0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, 0.18, -0.12, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 2.5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
}
|
||||
@ -279,7 +279,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 14) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, -0.08, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 : -0.375D, 0, -0.08, 0, 0.01, -15F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 2.5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
}
|
||||
@ -300,7 +300,7 @@ public class Orchestras {
|
||||
if(timer == 14) {
|
||||
int offset = ctx.configIndex == 0 ? -1 : 1;
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 * offset : -0.375D * offset, 0, -0.08, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, -0.125, aiming ? -0.125 * offset : -0.375D * offset, 0, -0.08, 0, 0.01, -15F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 2.5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.leverCock", 1F, 0.8F);
|
||||
return;
|
||||
@ -322,7 +322,7 @@ public class Orchestras {
|
||||
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
|
||||
if(mag.getAmountAfterReload(stack) > 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, -0.125, aiming ? -0.125 : -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, -0.125, aiming ? -0.125 : -0.375D, -0.12, 0.18, 0, 0.01, -15F + (float)entity.getRNG().nextGaussian() * 7.5F, (float)entity.getRNG().nextGaussian() * 5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
mag.setAmountBeforeReload(stack, 0);
|
||||
}
|
||||
}
|
||||
@ -358,7 +358,7 @@ public class Orchestras {
|
||||
Receiver rec = ctx.config.getReceivers(stack)[0];
|
||||
IMagazine mag = rec.getMagazine(stack);
|
||||
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
|
||||
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.25, -0.125, -0.125, -0.05, 0, 0, 0.01, casing.getName());
|
||||
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.25, -0.125, -0.125, -0.05, 0, 0, 0.01, -6.5F + (float)entity.getRNG().nextGaussian() * 3F, (float)entity.getRNG().nextGaussian() * 5F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE) {
|
||||
@ -382,9 +382,9 @@ public class Orchestras {
|
||||
boolean aiming = ItemGunBaseNT.getIsAiming(stack);
|
||||
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 2) {
|
||||
if(timer == 1) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.06, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.3125, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.21, -0.06, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 2.5F, 2.5F + (float)entity.getRNG().nextGaussian() * 2F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -419,7 +419,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 10F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -443,7 +443,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.4375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, -0.06, 0, 0.01, (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 10F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -479,7 +479,7 @@ public class Orchestras {
|
||||
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
|
||||
int toEject = mag.getAmountAfterReload(stack) - mag.getAmount(stack, ctx.inventory);
|
||||
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
|
||||
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, -15F + (float)entity.getRNG().nextGaussian() * 7.5F, (float)entity.getRNG().nextGaussian() * 5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
if(timer == 15) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.magSmallInsert", 1F, 1F);
|
||||
}
|
||||
@ -503,7 +503,7 @@ public class Orchestras {
|
||||
int toEject = mag.getAmountAfterReload(stack) - mag.getAmount(stack, ctx.inventory);
|
||||
if(timer == 4 && toEject > 0) {
|
||||
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
|
||||
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, -15F * (float)entity.getRNG().nextGaussian() * 7.5F, (float)entity.getRNG().nextGaussian() * 5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
mag.setAmountAfterReload(stack, 0);
|
||||
}
|
||||
if(timer == 20) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverClose", 1F, 0.9F);
|
||||
@ -521,7 +521,7 @@ public class Orchestras {
|
||||
if(timer == 15) {
|
||||
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
|
||||
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, aiming ? -0.0625 : -0.25, aiming ? 0 : -0.375D, 0, 0.18, 0.12, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.625, aiming ? -0.0625 : -0.25, aiming ? 0 : -0.375D, 0, 0.18, 0.12, 0.01, -5F + (float)entity.getRNG().nextGaussian() * 3.5F, -10F + entity.getRNG().nextFloat() * 5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
}
|
||||
if(type == AnimType.RELOAD || type == AnimType.RELOAD_CYCLE) {
|
||||
@ -599,7 +599,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 1) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.0625, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.0625, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 5F, 10F + entity.getRNG().nextFloat() * 10F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -632,7 +632,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 1) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -2.5F + (float)entity.getRNG().nextGaussian() * 5F, 10F + (float)entity.getRNG().nextFloat() * 15F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -664,7 +664,7 @@ public class Orchestras {
|
||||
if(timer == 1) {
|
||||
int mult = ctx.configIndex == 0 ? -1 : 1;
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, -0.125, -0.375D * mult, 0, 0.18, -0.12 * mult, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, -0.125, -0.375D * mult, 0, 0.18, -0.12 * mult, 0.01, -2.5F + (float)entity.getRNG().nextGaussian() * 5F, (10F + (float)entity.getRNG().nextFloat() * 15F) * mult, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -693,8 +693,8 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE || type == AnimType.ALT_CYCLE) {
|
||||
if(timer == 8) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.shotgunCock", 1F, 1F);
|
||||
if(timer == 10) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory); //turns out there's a reason why stovepipes look like that
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, -3F + (float)entity.getRNG().nextGaussian() * 2.5F, -15F + entity.getRNG().nextFloat() * -5F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -744,7 +744,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, aiming ? 0 : -0.125, aiming ? 0 : -0.25D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 12.5F + (float)entity.getRNG().nextFloat() * 5F, casing.getName());
|
||||
}
|
||||
}
|
||||
if(type == AnimType.CYCLE_DRY) {
|
||||
@ -846,7 +846,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.3125D, 0, 0.06, -0.18, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? 0 : -0.3125D, 0, 0.06, -0.18, 0.01, (float)entity.getRNG().nextGaussian() * 20F, 12.5F + (float)entity.getRNG().nextGaussian() * 7.5F, casing.getName());
|
||||
}
|
||||
}
|
||||
};
|
||||
@ -920,7 +920,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.5, aiming ? -0.125 : -0.25, aiming ? -0.25 : -0.5D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.5, aiming ? -0.125 : -0.25, aiming ? -0.25 : -0.5D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 15F, (float)entity.getRNG().nextGaussian() * 15F, casing.getName());
|
||||
}
|
||||
if(timer == 1) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.revolverSpin", 1F, 0.75F);
|
||||
}
|
||||
@ -986,7 +986,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.125, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.125, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 7.5F + entity.getRNG().nextFloat() * 5F, casing.getName());
|
||||
}
|
||||
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
|
||||
}
|
||||
@ -1012,7 +1012,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 0) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.25, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, aiming ? 0.125 : 0.25, aiming ? -0.125 : -0.25, aiming ? -0.125 : -0.25D, 0, 0.18, -0.12, 0.01, (float)entity.getRNG().nextGaussian() * 5F, 7.5F + entity.getRNG().nextFloat() * 5F, casing.getName());
|
||||
}
|
||||
if(timer == 40) entity.worldObj.playSoundAtEntity(entity, "hbm:weapon.reload.dryFireClick", 0.25F, 1.25F);
|
||||
}
|
||||
@ -1187,7 +1187,7 @@ public class Orchestras {
|
||||
Receiver rec = ctx.config.getReceivers(stack)[0];
|
||||
IMagazine mag = rec.getMagazine(stack);
|
||||
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
|
||||
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.25, -0.25, -0.125, -0.05, 0, 0, 0.01, casing.getName());
|
||||
if(casing != null) for(int i = 0; i < mag.getCapacity(stack); i++) CasingCreator.composeEffect(entity.worldObj, entity, 0.25, -0.25, -0.125, -0.05, 0, 0, 0.01, -6.5F + (float)entity.getRNG().nextGaussian() * 3F, (float)entity.getRNG().nextGaussian() * 5F, casing.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1228,7 +1228,7 @@ public class Orchestras {
|
||||
if(type == AnimType.CYCLE) {
|
||||
if(timer == 1) {
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D, 0, 0.18, -0.12, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.5, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D, 0, 0.18, -0.12, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 5F, 10F + entity.getRNG().nextFloat() * 10F, casing.getName());
|
||||
}
|
||||
}
|
||||
|
||||
@ -1266,7 +1266,7 @@ public class Orchestras {
|
||||
IMagazine mag = ctx.config.getReceivers(stack)[0].getMagazine(stack);
|
||||
int toEject = mag.getAmountAfterReload(stack) - mag.getAmount(stack, ctx.inventory);
|
||||
SpentCasing casing = mag.getCasing(stack, ctx.inventory);
|
||||
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(entity.worldObj, entity, 0, -0.1875, -0.375D, -0.12, 0.18, 0, 0.01, casing.getName(), true, 60, 0.5D, 20);
|
||||
if(casing != null) for(int i = 0; i < toEject; i++) CasingCreator.composeEffect(entity.worldObj, entity, 0, -0.1875, -0.375D, -0.24, 0.18, 0, 0.01, -20F + (float)entity.getRNG().nextGaussian() * 5F, (float)entity.getRNG().nextGaussian() * 2.5F, casing.getName(), true, 60, 0.5D, 20);
|
||||
}
|
||||
}
|
||||
|
||||
@ -1297,7 +1297,7 @@ public class Orchestras {
|
||||
if(timer == 1) {
|
||||
int cba = (stack.getItem() == ModItems.gun_aberrator_eott && ctx.configIndex == 0) ? -1 : 1;
|
||||
SpentCasing casing = ctx.config.getReceivers(stack)[0].getMagazine(stack).getCasing(stack, ctx.inventory);
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D * cba, -0.075, 0.25, 0, 0.01, casing.getName());
|
||||
if(casing != null) CasingCreator.composeEffect(entity.worldObj, entity, 0.375, aiming ? 0 : -0.125, aiming ? -0.0625 : -0.25D * cba, -0.05, 0.25, -0.05 * cba, 0.01, -10F + (float)entity.getRNG().nextGaussian() * 10F, (float)entity.getRNG().nextGaussian() * 12.5F, casing.getName());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -32,9 +32,10 @@ public class XFactory10ga {
|
||||
|
||||
public static void init() {
|
||||
|
||||
g10 = new BulletConfig().setItem(EnumAmmo.G10).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/10F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GA"));
|
||||
g10_shrapnel = new BulletConfig().setItem(EnumAmmo.G10_SHRAPNEL).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/10F).setSpread(0.05F).setRicochetAngle(90).setRicochetCount(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xE5DD00, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GAShrapnel"));
|
||||
g10_du = new BulletConfig().setItem(EnumAmmo.G10_DU).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/4F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.2F).setDoesPenetrate(true).setDamageFalloutByPen(false).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x538D53, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GADU"));
|
||||
float buckshotSpread = 0.035F;
|
||||
g10 = new BulletConfig().setItem(EnumAmmo.G10).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/10F).setSpread(buckshotSpread).setRicochetAngle(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GA"));
|
||||
g10_shrapnel = new BulletConfig().setItem(EnumAmmo.G10_SHRAPNEL).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/10F).setSpread(buckshotSpread).setRicochetAngle(90).setRicochetCount(15).setThresholdNegation(5F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xE5DD00, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GAShrapnel"));
|
||||
g10_du = new BulletConfig().setItem(EnumAmmo.G10_DU).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setProjectiles(10).setDamage(1F/4F).setSpread(buckshotSpread).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.2F).setDoesPenetrate(true).setDamageFalloutByPen(false).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x538D53, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GADU"));
|
||||
g10_slug = new BulletConfig().setItem(EnumAmmo.G10_SLUG).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 4).setRicochetAngle(15).setThresholdNegation(10F).setArmorPiercing(0.1F).setDoesPenetrate(true).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x808080, SpentCasing.COLOR_CASE_12GA).setScale(1F).register("10GASlug"));
|
||||
|
||||
ModItems.gun_double_barrel = new ItemGunBaseNT(WeaponQuality.SPECIAL, new GunConfig()
|
||||
|
||||
@ -256,15 +256,17 @@ public class XFactory12ga {
|
||||
|
||||
public static void init() {
|
||||
|
||||
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setProjectiles(8).setDamage(0.75F/8F).setSpread(0.05F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
|
||||
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setProjectiles(4).setDamage(0.75F/4F).setSpread(0.05F).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
|
||||
float buckshotSpread = 0.035F;
|
||||
float magnumSpread = 0.015F;
|
||||
g12_bp = new BulletConfig().setItem(EnumAmmo.G12_BP).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setProjectiles(8).setDamage(0.75F/8F).setSpread(buckshotSpread).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP"));
|
||||
g12_bp_magnum = new BulletConfig().setItem(EnumAmmo.G12_BP_MAGNUM).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setProjectiles(4).setDamage(0.75F/4F).setSpread(buckshotSpread).setRicochetAngle(25).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_MAGNUM"));
|
||||
g12_bp_slug = new BulletConfig().setItem(EnumAmmo.G12_BP_SLUG).setCasing(EnumCasingType.SHOTSHELL, 12).setBlackPowder(true).setDamage(0.75F).setSpread(0.01F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_BRASS, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_BP_SLUG"));
|
||||
g12 = new BulletConfig().setItem(EnumAmmo.G12).setCasing(EnumCasingType.BUCKSHOT, 6).setProjectiles(8).setDamage(1F/8F).setSpread(0.05F).setRicochetAngle(15).setThresholdNegation(2F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
|
||||
g12 = new BulletConfig().setItem(EnumAmmo.G12).setCasing(EnumCasingType.BUCKSHOT, 6).setProjectiles(8).setDamage(1F/8F).setSpread(buckshotSpread).setRicochetAngle(15).setThresholdNegation(2F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xB52B2B, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA"));
|
||||
g12_slug = new BulletConfig().setItem(EnumAmmo.G12_SLUG).setCasing(EnumCasingType.BUCKSHOT, 6).setHeadshot(1.5F).setSpread(0.0F).setRicochetAngle(25).setThresholdNegation(4F).setArmorPiercing(0.15F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x393939, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_SLUG"));
|
||||
g12_flechette = new BulletConfig().setItem(EnumAmmo.G12_FLECHETTE).setCasing(EnumCasingType.BUCKSHOT, 6).setProjectiles(8).setDamage(1F/8F).setThresholdNegation(5F).setThresholdNegation(3F).setArmorPiercing(0.2F).setSpread(0.025F).setRicochetAngle(5).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x3C80F0, SpentCasing.COLOR_CASE_BRASS).setScale(0.75F).register("12GA_FLECHETTE"));
|
||||
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setProjectiles(4).setDamage(2F/4F).setSpread(0.015F).setRicochetAngle(15).setThresholdNegation(4F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
|
||||
g12_magnum = new BulletConfig().setItem(EnumAmmo.G12_MAGNUM).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setProjectiles(4).setDamage(2F/4F).setSpread(magnumSpread).setRicochetAngle(15).setThresholdNegation(4F).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x278400, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_MAGNUM"));
|
||||
g12_explosive = new BulletConfig().setItem(EnumAmmo.G12_EXPLOSIVE).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setDamage(2.5F).setOnImpact(LAMBDA_STANDARD_EXPLODE).setSpread(0F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0xDA4127, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_EXPLOSIVE"));
|
||||
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"))
|
||||
g12_phosphorus = new BulletConfig().setItem(EnumAmmo.G12_PHOSPHORUS).setCasing(EnumCasingType.BUCKSHOT_ADVANCED, 6).setProjectiles(8).setDamage(1F/8F).setSpread(magnumSpread).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x910001, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_PHOSPHORUS"))
|
||||
.setOnImpact((bullet, mop) -> { if(mop.entityHit != null && mop.entityHit instanceof EntityLivingBase) { HbmLivingProps data = HbmLivingProps.getData((EntityLivingBase) mop.entityHit); if(data.phosphorus < 300) data.phosphorus = 300; } });
|
||||
//g12_anthrax = new BulletConfig().setItem(EnumAmmo.G12_ANTHRAX).setProjectiles(8).setDamage(1F/8F).setSpread(0.015F).setRicochetAngle(15).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(0x749300, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12GA_ANTHRAX"));
|
||||
g12_equestrian_bj = new BulletConfig().setItem(EnumAmmoSecret.G12_EQUESTRIAN).setDamage(0F).setOnImpact(LAMBDA_BOAT).setCasing(new SpentCasing(CasingType.SHOTGUN).setColor(SpentCasing.COLOR_CASE_EQUESTRIAN, SpentCasing.COLOR_CASE_12GA).setScale(0.75F).register("12gaEquestrianBJ"));
|
||||
@ -318,7 +320,7 @@ public class XFactory12ga {
|
||||
ModItems.gun_maresleg_broken = new ItemGunBaseNT(WeaponQuality.LEGENDARY, new GunConfig()
|
||||
.dura(0).draw(5).inspect(39).reloadSequential(true).crosshair(Crosshair.L_CIRCLE).smoke(Lego.LAMBDA_STANDARD_SMOKE)
|
||||
.rec(new Receiver(0)
|
||||
.dmg(32F).spreadAmmo(1.35F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
|
||||
.dmg(32F).spreadAmmo(1.15F).delay(20).reload(22, 10, 13, 0).jam(24).sound("hbm:weapon.fire.shotgun", 1.0F, 1.0F)
|
||||
.mag(new MagazineSingleReload(0, 6).addConfigs(g12_equestrian_tkr, g12_bp, g12_bp_magnum, g12_bp_slug, g12, g12_slug, g12_flechette, g12_magnum, g12_explosive, g12_phosphorus))
|
||||
.offset(0.75, -0.0625, -0.1875)
|
||||
.canFire(Lego.LAMBDA_STANDARD_CAN_FIRE).fire(Lego.LAMBDA_NOWEAR_FIRE).recoil(LAMBDA_RECOIL_MARESLEG))
|
||||
|
||||
@ -168,7 +168,7 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
int colZ = (int) (colRand.nextGaussian() * 1500);
|
||||
int colRange = 750;
|
||||
|
||||
if((GeneralConfig.enable528BedrockSpawn || GeneralConfig.enable528BedrockDeposit) && rand.nextInt(GeneralConfig.bedrockRate) != 0) {
|
||||
if((GeneralConfig.enable528BedrockSpawn || GeneralConfig.enable528BedrockDeposit) && rand.nextInt(GeneralConfig.bedrockRate) == 0) {
|
||||
int x = i + rand.nextInt(16) + 8;
|
||||
int z = j + rand.nextInt(16) + 8;
|
||||
|
||||
@ -302,14 +302,6 @@ public class HbmWorldGen implements IWorldGenerator {
|
||||
}
|
||||
}
|
||||
|
||||
/*if(WorldConfig.siloStructure > 0 && rand.nextInt(WorldConfig.siloStructure) == 0) {
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
int y = world.getHeightValue(x, z);
|
||||
|
||||
new Silo().generate(world, rand, x, y, z);
|
||||
}*/
|
||||
|
||||
if(WorldConfig.factoryStructure > 0 && rand.nextInt(WorldConfig.factoryStructure) == 0) {
|
||||
int x = i + rand.nextInt(16);
|
||||
int z = j + rand.nextInt(16);
|
||||
|
||||
@ -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 (5230)";
|
||||
public static final String VERSION = "1.0.27 BETA (5243)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -447,7 +447,7 @@ public class ClientProxy extends ServerProxy {
|
||||
double[] sfp = new double[] {1.36, 1.36, 0.68};
|
||||
double[] rir = new double[] {0, 0, 0};
|
||||
double[] tir = new double[] {0, 0, 0};
|
||||
double[] sir = new double[] {1.1, 1.1, 1.1};
|
||||
double[] sir = new double[] {1, 1, 1};
|
||||
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.titanium_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.alloy_sword, new ItemRenderTransformer(rtp, ttp_high, stp, rfp, tfp, sfp, rir, tir, sir));
|
||||
@ -500,7 +500,6 @@ public class ClientProxy extends ServerProxy {
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.missile_volcano, new ItemRenderMissileGeneric(RenderMissileType.TYPE_NUCLEAR));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.missile_doomsday, new ItemRenderMissileGeneric(RenderMissileType.TYPE_NUCLEAR));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.missile_doomsday_rusted, new ItemRenderMissileGeneric(RenderMissileType.TYPE_NUCLEAR));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.missile_carrier, new ItemRenderMissileGeneric(RenderMissileType.TYPE_CARRIER));
|
||||
MinecraftForgeClient.registerItemRenderer(ModItems.missile_shuttle, new ItemRenderMissileGeneric(RenderMissileType.TYPE_ROBIN));
|
||||
|
||||
//templates
|
||||
|
||||
@ -271,9 +271,9 @@ public class CraftingManager {
|
||||
// Note: voids the last few slots when placed, because a safe's inventory is smaller than a crate's one
|
||||
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.safe, 1), new Object[] { "LAL", "ACA", "LAL", 'L', PB.plate(), 'A', ALLOY.plate(), 'C', ModBlocks.crate_steel }));
|
||||
// Note: doesn't preserve storage because a crate's contents are different items, but a mass storage's is just one
|
||||
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 0), new Object[] { "ICI", "CLC", "ICI", 'I', TI.ingot(), 'C', ModBlocks.crate_steel, 'L', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE) });
|
||||
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 1), new Object[] { "PCP", "PMP", "PPP", 'P', DESH.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'M', new ItemStack(ModBlocks.mass_storage, 1, 0) }));
|
||||
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 2), new Object[] { "PCP", "PMP", "PPP", 'P', ANY_RESISTANTALLOY.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', new ItemStack(ModBlocks.mass_storage, 1, 1) }));
|
||||
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 0), new Object[] { " L ", "ICI", " I ", 'I', TI.ingot(), 'C', ModBlocks.crate_steel, 'L', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE) });
|
||||
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 1), new Object[] { " C ", "PMP", " P ", 'P', DESH.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CHIP), 'M', new ItemStack(ModBlocks.mass_storage, 1, 0) }));
|
||||
GameRegistry.addRecipe(new ContainerUpgradeCraftingHandler(new ItemStack(ModBlocks.mass_storage, 1, 2), new Object[] { " C ", "PMP", " P ", 'P', ANY_RESISTANTALLOY.ingot(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), 'M', new ItemStack(ModBlocks.mass_storage, 1, 1) }));
|
||||
addRecipeAuto(new ItemStack(ModBlocks.mass_storage, 1, 3), new Object[] { "PPP", "PIP", "PPP", 'P', KEY_PLANKS, 'I', IRON.plate() });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.machine_autocrafter, 1), new Object[] { "SCS", "MWM", "SCS", 'S', STEEL.plate(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE), 'M', ModItems.motor, 'W', Blocks.crafting_table });
|
||||
@ -775,39 +775,50 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModItems.mech_key, 1), new Object[] { "MCM", "MKM", "MMM", 'M', ModItems.ingot_meteorite_forged, 'C', ModItems.coin_maskman, 'K', ModItems.key });
|
||||
addRecipeAuto(new ItemStack(ModItems.spawn_ufo, 1), new Object[] { "MMM", "DCD", "MMM", 'M', ModItems.ingot_meteorite, 'D', DNT.ingot(), 'C', ModItems.coin_worm });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_alloy, 1), new Object[] { "WWW", "WCW", "WWW", 'W', ALLOY.wireFine(), 'C', ModBlocks.fusion_conductor });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 4, Mats.MAT_GOLD.id), new Object[] { ModBlocks.hadron_coil_gold });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 4, Mats.MAT_NEODYMIUM.id), new Object[] { ModBlocks.hadron_coil_neodymium });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 4, Mats.MAT_MAGTUNG.id), new Object[] { ModBlocks.hadron_coil_magtung });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 2, Mats.MAT_SCHRABIDIUM.id), new Object[] { ModBlocks.hadron_coil_schrabidium });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 2, Mats.MAT_SCHRABIDATE.id), new Object[] { ModBlocks.hadron_coil_schrabidate });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 2, Mats.MAT_STAR.id), new Object[] { ModBlocks.hadron_coil_starmetal });
|
||||
addShapelessAuto(new ItemStack(ModItems.powder_chlorophyte, 2), new Object[] { ModBlocks.hadron_coil_chlorophyte });
|
||||
addShapelessAuto(new ItemStack(ModItems.wire_dense, 1, Mats.MAT_DNT.id), new Object[] { ModBlocks.hadron_coil_mese });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating_blue });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating_black });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating_yellow });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating_striped });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating_glass });
|
||||
addShapelessAuto(new ItemStack(ModItems.plate_cast, 1, Mats.MAT_STEEL.id), new Object[] { ModBlocks.hadron_plating_voltz });
|
||||
addShapelessAuto(DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), new Object[] { ModBlocks.hadron_analysis });
|
||||
addShapelessAuto(DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED), new Object[] { ModBlocks.hadron_analysis_glass });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_alloy, 1), new Object[] { "WW", "WW", 'W', ALLOY.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_gold, 1), new Object[] { "PGP", "PCP", "PGP", 'G', GOLD.dust(), 'C', ModBlocks.hadron_coil_alloy, 'P', IRON.plate() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_gold, 1), new Object[] { "WG", "GW", 'W', ALLOY.wireDense(), 'G', GOLD.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_neodymium, 1), new Object[] { "G", "C", "G", 'G', ND.dust(), 'C', ModBlocks.hadron_coil_gold });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_neodymium, 1), new Object[] { "WG", "GW", 'W', ND.wireDense(), 'G', GOLD.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_magtung, 1), new Object[] { "WW", "WW", 'W', MAGTUNG.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_schrabidium, 1), new Object[] { "WWW", "WCW", "WWW", 'W', SA326.wireFine(), 'C', ModBlocks.hadron_coil_magtung });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_schrabidium, 1), new Object[] { "WS", "SW", 'W', MAGTUNG.wireDense(), 'S', SA326.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_schrabidate, 1), new Object[] { " S ", "SCS", " S ", 'S', SBD.dust(), 'C', ModBlocks.hadron_coil_schrabidium });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_schrabidate, 1), new Object[] { "WS", "SW", 'W', SBD.wireDense(), 'S', SA326.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_starmetal, 1), new Object[] { "SNS", "SCS", "SNS", 'S', STAR.ingot(), 'N', ModBlocks.hadron_coil_neodymium, 'C', ModBlocks.hadron_coil_schrabidate });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_starmetal, 1), new Object[] { "SW", "WS", 'W', SBD.wireDense(), 'S', STAR.wireDense() });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_chlorophyte, 1), new Object[] { "TCT", "TST", "TCT", 'T', ModItems.coil_tungsten, 'C', ModItems.powder_chlorophyte, 'S', ModBlocks.hadron_coil_starmetal });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_chlorophyte, 1), new Object[] { "TC", "CT", 'T', W.wireDense(), 'C', ModItems.powder_chlorophyte });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_diode, 1), new Object[] { "CIC", "ISI", "CIC", 'C', ModBlocks.hadron_coil_alloy, 'I', STEEL.ingot(), 'S', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_plating, 16), new Object[] { "CC", "CC", 'C', STEEL.plateCast()});
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_blue, 1), new Object[] { ModBlocks.hadron_plating, KEY_BLUE });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_black, 1), new Object[] { ModBlocks.hadron_plating, KEY_BLACK });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_yellow, 1), new Object[] { ModBlocks.hadron_plating, KEY_YELLOW });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_striped, 1), new Object[] { ModBlocks.hadron_plating, KEY_BLACK, KEY_YELLOW });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_glass, 1), new Object[] { ModBlocks.hadron_plating, KEY_ANYGLASS });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_voltz, 1), new Object[] { ModBlocks.hadron_plating, KEY_RED });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_power, 1), new Object[] { "SFS", "FTF", "SFS", 'S', BIGMT.ingot(), 'T', ModBlocks.machine_transformer, 'F', ModItems.fuse });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_power_10m, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power, 'F', ModItems.fuse });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_power_100m, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_10m, 'F', ModItems.fuse });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_power_1g, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_100m, 'F', ModItems.fuse });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_power_10g, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_1g, 'F', ModItems.fuse });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_analysis, 1), new Object[] { "IPI", "PCP", "IPI", 'I', TI.ingot(), 'P', getReflector(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
|
||||
addShapelessAuto(new ItemStack(ModBlocks.hadron_analysis_glass, 1), new Object[] { ModBlocks.hadron_analysis, KEY_ANYGLASS });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_access, 1), new Object[] { "IGI", "CRC", "IPI", 'I', ModItems.plate_polymer, 'G', KEY_ANYPANE, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'R', REDSTONE.block(), 'P', ModBlocks.hadron_plating_blue });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_cooler, 1, 0), new Object[] { "PCP", "CHC", "PCP", 'P', ANY_RESISTANTALLOY.plateCast(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'H', Fluids.HELIUM4.getDict(16_000) });
|
||||
addRecipeAuto(new ItemStack(ModBlocks.hadron_cooler, 1, 1), new Object[] { "PCP", "CHC", "PCP", 'P', GOLD.plateCast(), 'C', ModItems.motor_bismuth, 'H', new ItemStack(ModBlocks.hadron_cooler, 1, 0) });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_gold, 1), new Object[] { "WG", "GW", 'W', ALLOY.wireDense(), 'G', GOLD.wireDense() });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_neodymium, 1), new Object[] { "WG", "GW", 'W', ND.wireDense(), 'G', GOLD.wireDense() });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_magtung, 1), new Object[] { "WW", "WW", 'W', MAGTUNG.wireDense() });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_schrabidium, 1), new Object[] { "WS", "SW", 'W', MAGTUNG.wireDense(), 'S', SA326.wireDense() });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_schrabidate, 1), new Object[] { "WS", "SW", 'W', SBD.wireDense(), 'S', SA326.wireDense() });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_starmetal, 1), new Object[] { "SW", "WS", 'W', SBD.wireDense(), 'S', STAR.wireDense() });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_coil_chlorophyte, 1), new Object[] { "TC", "CT", 'T', CU.wireDense(), 'C', ModItems.powder_chlorophyte });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_diode, 1), new Object[] { "CIC", "ISI", "CIC", 'C', ModBlocks.hadron_coil_alloy, 'I', STEEL.ingot(), 'S', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_plating, 16), new Object[] { "CC", "CC", 'C', STEEL.plateCast()});
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_blue, 1), new Object[] { ModBlocks.hadron_plating, KEY_BLUE });
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_black, 1), new Object[] { ModBlocks.hadron_plating, KEY_BLACK });
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_yellow, 1), new Object[] { ModBlocks.hadron_plating, KEY_YELLOW });
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_striped, 1), new Object[] { ModBlocks.hadron_plating, KEY_BLACK, KEY_YELLOW });
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_glass, 1), new Object[] { ModBlocks.hadron_plating, KEY_ANYGLASS });
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_plating_voltz, 1), new Object[] { ModBlocks.hadron_plating, KEY_RED });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_power, 1), new Object[] { "SFS", "FTF", "SFS", 'S', BIGMT.ingot(), 'T', ModBlocks.machine_transformer, 'F', ModItems.fuse });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_power_10m, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power, 'F', ModItems.fuse });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_power_100m, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_10m, 'F', ModItems.fuse });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_power_1g, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_100m, 'F', ModItems.fuse });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_power_10g, 1), new Object[] { "HF", 'H', ModBlocks.hadron_power_1g, 'F', ModItems.fuse });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_analysis, 1), new Object[] { "IPI", "PCP", "IPI", 'I', TI.ingot(), 'P', getReflector(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.ADVANCED) });
|
||||
//addShapelessAuto(new ItemStack(ModBlocks.hadron_analysis_glass, 1), new Object[] { ModBlocks.hadron_analysis, KEY_ANYGLASS });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_access, 1), new Object[] { "IGI", "CRC", "IPI", 'I', ModItems.plate_polymer, 'G', KEY_ANYPANE, 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'R', REDSTONE.block(), 'P', ModBlocks.hadron_plating_blue });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_cooler, 1, 0), new Object[] { "PCP", "CHC", "PCP", 'P', ANY_RESISTANTALLOY.plateCast(), 'C', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.BASIC), 'H', Fluids.HELIUM4.getDict(16_000) });
|
||||
//addRecipeAuto(new ItemStack(ModBlocks.hadron_cooler, 1, 1), new Object[] { "PCP", "CHC", "PCP", 'P', GOLD.plateCast(), 'C', ModItems.motor_bismuth, 'H', new ItemStack(ModBlocks.hadron_cooler, 1, 0) });
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.fireworks, 1), new Object[] { "PPP", "PPP", "WIW", 'P', Items.paper, 'W', KEY_PLANKS, 'I', IRON.ingot() });
|
||||
addRecipeAuto(new ItemStack(ModItems.safety_fuse, 8), new Object[] { "SSS", "SGS", "SSS", 'S', Items.string, 'G', Items.gunpowder });
|
||||
@ -1140,8 +1151,6 @@ public class CraftingManager {
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cm_flux, 1, 0), "NNN", "ZCZ", "NNN", 'Z', ZR.plateCast(), 'N', ModItems.neutron_reflector, 'C', ModItems.reactor_core);
|
||||
addRecipeAuto(new ItemStack(ModBlocks.cm_heat, 1, 0), "PCP", "PCP", "PCP", 'P', ModItems.plate_polymer, 'C', CU.ingot());
|
||||
|
||||
addShapelessAuto(new ItemStack(ModItems.missile_soyuz), new ItemStack(ModItems.missile_carrier));
|
||||
|
||||
addRecipeAuto(new ItemStack(ModBlocks.plushie, 1, PlushieType.YOMI.ordinal()), "LCR", 'L', "cropCarrot", 'C', ModItems.rag, 'R', DictFrame.fromOne(ModItems.circuit, EnumCircuitType.VACUUM_TUBE));
|
||||
addRecipeAuto(new ItemStack(ModBlocks.plushie, 1, PlushieType.NUMBERNINE.ordinal()), " C ", "LCR", " C ", 'L', ModItems.cigarette, 'C', ModItems.rag, 'R', COAL.gem());
|
||||
}
|
||||
|
||||
@ -73,7 +73,10 @@ import net.minecraft.item.Item.ToolMaterial;
|
||||
import net.minecraft.item.ItemArmor.ArmorMaterial;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.stats.Achievement;
|
||||
import net.minecraft.stats.StatBase;
|
||||
import net.minecraft.stats.StatBasic;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
import net.minecraft.util.ChatComponentTranslation;
|
||||
import net.minecraft.util.EnumFacing;
|
||||
import net.minecraft.util.WeightedRandomChestContent;
|
||||
import net.minecraft.world.World;
|
||||
@ -164,6 +167,11 @@ public class MainRegistry {
|
||||
public static CreativeTabs weaponTab = new WeaponTab(CreativeTabs.getNextID(), "tabWeapon"); // turrets, weapons, ammo
|
||||
public static CreativeTabs consumableTab = new ConsumableTab(CreativeTabs.getNextID(), "tabConsumable"); // drinks, kits, tools
|
||||
|
||||
// Statistics
|
||||
public static StatBase statLegendary;
|
||||
public static StatBase statMines;
|
||||
public static StatBase statBullets;
|
||||
|
||||
// Achievements
|
||||
public static Achievement achSacrifice;
|
||||
public static Achievement achImpossible;
|
||||
@ -656,6 +664,10 @@ public class MainRegistry {
|
||||
|
||||
RodRecipes.registerInit();
|
||||
|
||||
statLegendary = new StatBasic("stat.ntmLegendary", new ChatComponentTranslation("stat.ntmLegendary")).registerStat();
|
||||
statMines = new StatBasic("stat.ntmMines", new ChatComponentTranslation("stat.ntmMines")).registerStat();
|
||||
statBullets = new StatBasic("stat.ntmBullets", new ChatComponentTranslation("stat.ntmBullets")).registerStat();
|
||||
|
||||
achSacrifice = new Achievement("achievement.sacrifice", "sacrifice", -3, 1, ModItems.burnt_bark, null).initIndependentStat().setSpecial().registerStat();
|
||||
achImpossible = new Achievement("achievement.impossible", "impossible", 18, 10, ModItems.nothing, null).initIndependentStat().setSpecial().registerStat();
|
||||
achTOB = new Achievement("achievement.tasteofblood", "tasteofblood", 3, 10, new ItemStack(ModItems.fluid_icon, 1, Fluids.ASCHRAB.getID()), null).initIndependentStat().setSpecial().registerStat();
|
||||
@ -710,7 +722,7 @@ public class MainRegistry {
|
||||
achCentrifuge = new Achievement("achievement.centrifuge", "centrifuge", 12, -2, new ItemStack(ModBlocks.machine_centrifuge), achPolymer).initIndependentStat().registerStat();
|
||||
achFOEQ = new Achievement("achievement.FOEQ", "FOEQ", 5, 5, ModItems.sat_foeq, achDesh).initIndependentStat().setSpecial().registerStat();
|
||||
achSoyuz = new Achievement("achievement.soyuz", "soyuz", 7, 6, Items.baked_potato, achDesh).initIndependentStat().setSpecial().registerStat();
|
||||
achSpace = new Achievement("achievement.space", "space", 9, 7, ModItems.missile_carrier, achDesh).initIndependentStat().setSpecial().registerStat();
|
||||
achSpace = new Achievement("achievement.space", "space", 9, 7, ModItems.missile_soyuz, achDesh).initIndependentStat().setSpecial().registerStat();
|
||||
achSchrab = new Achievement("achievement.schrab", "schrab", 11, 3, ModItems.ingot_schrabidium, achDesh).initIndependentStat().registerStat();
|
||||
achAcidizer = new Achievement("achievement.acidizer", "acidizer", 11, 5, new ItemStack(ModBlocks.machine_crystallizer), achDesh).initIndependentStat().registerStat();
|
||||
achRadium = new Achievement("achievement.radium", "radium", 13, -4, ModItems.coffee_radium, achCentrifuge).initIndependentStat().setSpecial().registerStat();
|
||||
@ -870,11 +882,11 @@ public class MainRegistry {
|
||||
MinecraftForge.EVENT_BUS.register(new SchistStratum()); //DecorateBiomeEvent.Pre
|
||||
//MinecraftForge.EVENT_BUS.register(new DeepLayer()); //DecorateBiomeEvent.Pre
|
||||
|
||||
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 OreLayer3D(ModBlocks.stone_resource, EnumStoneType.HEMATITE.ordinal()).setScaleH(0.04D).setScaleV(0.25D).setThreshold(230);
|
||||
new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.BAUXITE.ordinal()).setScaleH(0.03D).setScaleV(0.15D).setThreshold(300);
|
||||
new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.MALACHITE.ordinal()).setScaleH(0.1D).setScaleV(0.15D).setThreshold(275);
|
||||
if(WorldConfig.enableSulfurCave) new OreCave(ModBlocks.stone_resource, 0).setThreshold(1.5D).setRangeMult(20).setYLevel(30).setMaxRange(20).withFluid(ModBlocks.sulfuric_acid_block); //sulfur
|
||||
if(WorldConfig.enableAsbestosCave) new OreCave(ModBlocks.stone_resource, 1).setThreshold(1.75D).setRangeMult(20).setYLevel(25).setMaxRange(20); //asbestos
|
||||
if(WorldConfig.enableHematite) new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.HEMATITE.ordinal()).setScaleH(0.04D).setScaleV(0.25D).setThreshold(230);
|
||||
if(WorldConfig.enableMalachite) new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.BAUXITE.ordinal()).setScaleH(0.03D).setScaleV(0.15D).setThreshold(300);
|
||||
if(WorldConfig.enableBauxite) new OreLayer3D(ModBlocks.stone_resource, EnumStoneType.MALACHITE.ordinal()).setScaleH(0.1D).setScaleV(0.15D).setThreshold(275);
|
||||
//new BiomeCave().setThreshold(1.5D).setRangeMult(20).setYLevel(40).setMaxRange(20);
|
||||
//new OreLayer(Blocks.coal_ore, 0.2F).setThreshold(4).setRangeMult(3).setYLevel(70);
|
||||
BedrockOre.init();
|
||||
@ -1647,6 +1659,7 @@ public class MainRegistry {
|
||||
ignoreMappings.add("hbm:item.bobmazon_machines");
|
||||
ignoreMappings.add("hbm:item.bobmazon_weapons");
|
||||
ignoreMappings.add("hbm:item.bobmazon_tools");
|
||||
ignoreMappings.add("hbm:item.missile_carrier");
|
||||
|
||||
/// REMAP ///
|
||||
remapItems.put("hbm:item.gadget_explosive8", ModItems.early_explosive_lenses);
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
package com.hbm.main;
|
||||
|
||||
import api.hbm.energymk2.Nodespace;
|
||||
import com.google.common.collect.HashMultimap;
|
||||
import com.google.common.collect.Multimap;
|
||||
import com.hbm.blocks.IStepTickReceiver;
|
||||
@ -50,6 +49,7 @@ import com.hbm.tileentity.machine.TileEntityMachineRadarNT;
|
||||
import com.hbm.tileentity.machine.rbmk.RBMKDials;
|
||||
import com.hbm.tileentity.network.RTTYSystem;
|
||||
import com.hbm.tileentity.network.RequestNetwork;
|
||||
import com.hbm.uninos.UniNodespace;
|
||||
import com.hbm.util.*;
|
||||
import com.hbm.util.ArmorRegistry.HazardClass;
|
||||
import com.hbm.world.generator.TimedGenerator;
|
||||
@ -566,8 +566,7 @@ public class ModEventHandler {
|
||||
|
||||
@SubscribeEvent
|
||||
public void onUnload(WorldEvent.Unload event) {
|
||||
NeutronNodeWorld.removeAllWorlds(); // Remove world from worlds when unloaded to avoid world issues.
|
||||
NeutronNodeWorld.removeAllNodes(); // Remove all nodes.
|
||||
NeutronNodeWorld.streamWorlds.remove(event.world);
|
||||
}
|
||||
|
||||
public static boolean didSit = false;
|
||||
@ -1185,8 +1184,8 @@ public class ModEventHandler {
|
||||
RTTYSystem.updateBroadcastQueue();
|
||||
RequestNetwork.updateEntries();
|
||||
TileEntityMachineRadarNT.updateSystem();
|
||||
Nodespace.updateNodespace();
|
||||
// bob i beg of you i need fluid nodespace :pray:
|
||||
//Nodespace.updateNodespace();
|
||||
UniNodespace.updateNodespace();
|
||||
}
|
||||
|
||||
// There is an issue here somewhere...
|
||||
|
||||
@ -368,6 +368,11 @@ public class ModEventHandlerClient {
|
||||
}
|
||||
}
|
||||
|
||||
//prevents NBT changes (read: every fucking tick) on guns from bringing up the item's name over the hotbar
|
||||
if(held != null && held.getItem() instanceof ItemGunBaseNT && Minecraft.getMinecraft().ingameGUI.highlightingItemStack != null && Minecraft.getMinecraft().ingameGUI.highlightingItemStack.getItem() == held.getItem()) {
|
||||
Minecraft.getMinecraft().ingameGUI.highlightingItemStack = held;
|
||||
}
|
||||
|
||||
/// HANDLE FSB HUD ///
|
||||
ItemStack helmet = player.inventory.armorInventory[3];
|
||||
|
||||
|
||||
@ -36,7 +36,6 @@ public class NEIRegistry {
|
||||
handlers.add(new CrystallizerRecipeHandler());
|
||||
handlers.add(new BookRecipeHandler());
|
||||
handlers.add(new FusionRecipeHandler());
|
||||
handlers.add(new HadronRecipeHandler());
|
||||
handlers.add(new SILEXRecipeHandler());
|
||||
handlers.add(new FuelPoolHandler());
|
||||
handlers.add(new CrucibleSmeltingHandler());
|
||||
|
||||
@ -1151,7 +1151,7 @@ public class ResourceManager {
|
||||
//Projectiles
|
||||
public static final IModelCustom projectiles = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/projectiles/projectiles.obj"));
|
||||
public static final IModelCustom leadburster = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/projectiles/leadburster.obj"));
|
||||
public static final IModelCustom casings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/effect/casings.obj"));
|
||||
public static final IModelCustom casings = new HFRWavefrontObject(new ResourceLocation(RefStrings.MODID, "models/effect/casings.obj")).asVBO();
|
||||
|
||||
//Bomber
|
||||
public static final IModelCustom dornier = AdvancedModelLoader.loadModel(new ResourceLocation(RefStrings.MODID, "models/dornier.obj"));
|
||||
|
||||
@ -21,8 +21,8 @@ import net.minecraft.world.World;
|
||||
public class ParticleHaze extends EntityFX {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/haze.png");
|
||||
private TextureManager theRenderEngine;
|
||||
private int maxAge;
|
||||
private final TextureManager theRenderEngine;
|
||||
private final int maxAge;
|
||||
|
||||
public ParticleHaze(TextureManager p_i1213_1_, World p_i1218_1_, double p_i1218_2_, double p_i1218_4_, double p_i1218_6_) {
|
||||
super(p_i1218_1_, p_i1218_2_, p_i1218_4_, p_i1218_6_);
|
||||
@ -94,6 +94,7 @@ public class ParticleHaze extends EntityFX {
|
||||
|
||||
Random rand = new Random(50);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < 25; i++) {
|
||||
|
||||
double dX = rand.nextGaussian() * 2.5D;
|
||||
@ -115,9 +116,8 @@ public class ParticleHaze extends EntityFX {
|
||||
tess.addVertexWithUV((double) (pX + p_70539_3_ * size + p_70539_6_ * size), (double) (pY + p_70539_4_ * size), (double) (pZ + p_70539_5_ * size + p_70539_7_ * size), 0, 0);
|
||||
tess.addVertexWithUV((double) (pX + p_70539_3_ * size - p_70539_6_ * size), (double) (pY - p_70539_4_ * size), (double) (pZ + p_70539_5_ * size - p_70539_7_ * size), 0, 1);
|
||||
tess.draw();
|
||||
|
||||
GL11.glTranslatef((float) -dX, (float) -dY, (float) -dZ);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
|
||||
@ -21,7 +21,7 @@ import net.minecraft.world.World;
|
||||
public class ParticleRadiationFog extends EntityFX {
|
||||
|
||||
private static final ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/particle/fog.png");
|
||||
private TextureManager theRenderEngine;
|
||||
private final TextureManager theRenderEngine;
|
||||
private int maxAge;
|
||||
|
||||
public ParticleRadiationFog(TextureManager p_i1213_1_, World p_i1218_1_, double p_i1218_2_, double p_i1218_4_, double p_i1218_6_) {
|
||||
@ -95,6 +95,7 @@ public class ParticleRadiationFog extends EntityFX {
|
||||
|
||||
Random rand = new Random(50);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
for(int i = 0; i < 25; i++) {
|
||||
|
||||
double dX = (rand.nextGaussian() - 1D) * 2.5D;
|
||||
@ -116,9 +117,8 @@ public class ParticleRadiationFog extends EntityFX {
|
||||
tess.addVertexWithUV((double)(pX + p_70539_3_ * size + p_70539_6_ * size), (double)(pY + p_70539_4_ * size), (double)(pZ + p_70539_5_ * size + p_70539_7_ * size), 0, 0);
|
||||
tess.addVertexWithUV((double)(pX + p_70539_3_ * size - p_70539_6_ * size), (double)(pY - p_70539_4_ * size), (double)(pZ + p_70539_5_ * size - p_70539_7_ * size), 0, 1);
|
||||
tess.draw();
|
||||
|
||||
GL11.glTranslatef((float) -dX, (float) -dY, (float) -dZ);
|
||||
}
|
||||
GL11.glPopMatrix();
|
||||
|
||||
GL11.glDisable(GL12.GL_RESCALE_NORMAL);
|
||||
GL11.glEnable(GL11.GL_LIGHTING);
|
||||
|
||||
@ -9,6 +9,7 @@ import org.lwjgl.opengl.GL11;
|
||||
import org.lwjgl.opengl.GL12;
|
||||
|
||||
import com.hbm.main.ResourceManager;
|
||||
import com.hbm.util.BobMathUtil;
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
@ -20,6 +21,7 @@ import net.minecraft.client.renderer.RenderHelper;
|
||||
import net.minecraft.client.renderer.Tessellator;
|
||||
import net.minecraft.client.renderer.texture.TextureManager;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.util.AxisAlignedBB;
|
||||
import net.minecraft.util.MathHelper;
|
||||
import net.minecraft.util.Vec3;
|
||||
import net.minecraft.world.World;
|
||||
@ -51,6 +53,8 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
this.config = config;
|
||||
|
||||
this.particleMaxAge = config.getMaxAge();
|
||||
this.setSize(2 * dScale * Math.max(config.getScaleX(), config.getScaleZ()), dScale * config.getScaleY());
|
||||
this.yOffset = this.height / 2F;
|
||||
|
||||
this.isSmoking = smoking;
|
||||
this.maxSmokeGen = smokeLife;
|
||||
@ -85,7 +89,6 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
}
|
||||
|
||||
this.motionY -= 0.04D * (double) this.particleGravity;
|
||||
double prevMotionY = this.motionY;
|
||||
this.moveEntity(this.motionX, this.motionY, this.motionZ);
|
||||
this.motionX *= 0.98D;
|
||||
this.motionY *= 0.98D;
|
||||
@ -94,15 +97,10 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
if(this.onGround) {
|
||||
this.motionX *= 0.7D;
|
||||
this.motionZ *= 0.7D;
|
||||
}
|
||||
|
||||
if(onGround) {
|
||||
this.rotationPitch = (float) (Math.floor(this.rotationPitch / 180F + 0.5F)) * 180F;
|
||||
this.momentumYaw *= 0.7F;
|
||||
this.onGround = false;
|
||||
motionY = prevMotionY * -0.5;
|
||||
this.rotationPitch = 0;
|
||||
//momentumPitch = (float) rand.nextGaussian() * config.getBouncePitch();
|
||||
//momentumYaw = (float) rand.nextGaussian() * config.getBounceYaw();
|
||||
|
||||
}
|
||||
|
||||
if(particleAge > maxSmokeGen && !smokeNodes.isEmpty())
|
||||
@ -128,12 +126,97 @@ public class ParticleSpentCasing extends EntityFX {
|
||||
prevRotationPitch = rotationPitch;
|
||||
prevRotationYaw = rotationYaw;
|
||||
|
||||
if(onGround) {
|
||||
rotationPitch = 0;
|
||||
} else {
|
||||
rotationPitch += momentumPitch;
|
||||
rotationYaw += momentumYaw;
|
||||
rotationPitch += momentumPitch;
|
||||
rotationYaw += momentumYaw;
|
||||
}
|
||||
|
||||
public void moveEntity(double motionX, double motionY, double motionZ) {
|
||||
this.worldObj.theProfiler.startSection("move");
|
||||
this.ySize *= 0.4F;
|
||||
|
||||
if (this.isInWeb) {
|
||||
this.isInWeb = false;
|
||||
motionX *= 0.25D;
|
||||
motionY *= 0.05000000074505806D;
|
||||
motionZ *= 0.25D;
|
||||
this.motionX = 0.0D;
|
||||
this.motionY = 0.0D;
|
||||
this.motionZ = 0.0D;
|
||||
}
|
||||
|
||||
//Handle block collision
|
||||
double initMoX = motionX;
|
||||
double initMoY = motionY;
|
||||
double initMoZ = motionZ;
|
||||
AxisAlignedBB axisalignedbb = this.boundingBox.copy();
|
||||
|
||||
List list = this.worldObj.getCollidingBoundingBoxes(this, this.boundingBox.addCoord(motionX, motionY, motionZ));
|
||||
|
||||
for (int i = 0; i < list.size(); ++i) {
|
||||
motionY = ((AxisAlignedBB)list.get(i)).calculateYOffset(this.boundingBox, motionY);
|
||||
}
|
||||
|
||||
this.boundingBox.offset(0.0D, motionY, 0.0D);
|
||||
|
||||
int j;
|
||||
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
motionX = ((AxisAlignedBB)list.get(j)).calculateXOffset(this.boundingBox, motionX);
|
||||
}
|
||||
|
||||
this.boundingBox.offset(motionX, 0.0D, 0.0D);
|
||||
|
||||
for (j = 0; j < list.size(); ++j) {
|
||||
motionZ = ((AxisAlignedBB)list.get(j)).calculateZOffset(this.boundingBox, motionZ);
|
||||
}
|
||||
|
||||
this.boundingBox.offset(0.0D, 0.0D, motionZ);
|
||||
|
||||
this.worldObj.theProfiler.endSection();
|
||||
this.worldObj.theProfiler.startSection("rest");
|
||||
this.posX = (this.boundingBox.minX + this.boundingBox.maxX) / 2.0D;
|
||||
this.posY = this.boundingBox.minY + (double)this.yOffset - (double)this.ySize;
|
||||
this.posZ = (this.boundingBox.minZ + this.boundingBox.maxZ) / 2.0D;
|
||||
this.isCollidedHorizontally = initMoX != motionX || initMoZ != motionZ;
|
||||
this.isCollidedVertically = initMoY != motionY;
|
||||
this.onGround = initMoY != motionY && initMoY < 0.0D;
|
||||
this.isCollided = this.isCollidedHorizontally || this.isCollidedVertically;
|
||||
this.updateFallState(motionY, this.onGround);
|
||||
|
||||
//Handles bounces
|
||||
if (initMoX != motionX) {
|
||||
this.motionX *= -0.25D;
|
||||
|
||||
if(Math.abs(momentumYaw) > 1e-7)
|
||||
momentumYaw *= -0.75F;
|
||||
else
|
||||
momentumYaw = (float) rand.nextGaussian() * 10F * this.config.getBounceYaw();
|
||||
}
|
||||
|
||||
if (initMoY != motionY) {
|
||||
this.motionY *= -0.5D;
|
||||
|
||||
boolean rotFromSpeed = Math.abs(this.motionY) > 0.04;
|
||||
if(rotFromSpeed || Math.abs(momentumPitch) > 1e-7) {
|
||||
momentumPitch *= -0.75F;
|
||||
if(rotFromSpeed) {
|
||||
float mult = (float) BobMathUtil.safeClamp(initMoY / 0.2F, -1F, 1F);
|
||||
momentumPitch += rand.nextGaussian() * 10F * this.config.getBouncePitch() * mult;
|
||||
momentumYaw += (float) rand.nextGaussian() * 10F * this.config.getBounceYaw() * mult;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (initMoZ != motionZ) {
|
||||
this.motionZ *= -0.25D;
|
||||
|
||||
if(Math.abs(momentumYaw) > 1e-7)
|
||||
momentumYaw *= -0.75F;
|
||||
else
|
||||
momentumYaw = (float) rand.nextGaussian() * 10F * this.config.getBounceYaw();
|
||||
}
|
||||
|
||||
this.worldObj.theProfiler.endSection();
|
||||
}
|
||||
|
||||
/** Used for frame-perfect translation of smoke */
|
||||
|
||||
@ -40,8 +40,8 @@ public class SpentCasing implements Cloneable {
|
||||
private int[] colors;
|
||||
private CasingType type;
|
||||
private String bounceSound;
|
||||
private float bounceYaw = 0F;
|
||||
private float bouncePitch = 0F;
|
||||
private float bounceYaw = 1F;
|
||||
private float bouncePitch = 1F;
|
||||
private int maxAge = 240;
|
||||
|
||||
public SpentCasing(CasingType type) {
|
||||
@ -86,6 +86,7 @@ public class SpentCasing implements Cloneable {
|
||||
return casingMap.get(name);
|
||||
}
|
||||
|
||||
/** Multiplier for default standard deviation of 10deg per tick, per bounce w/ full y speed */
|
||||
public SpentCasing setBounceMotion(float yaw, float pitch) {
|
||||
this.bounceYaw = yaw;
|
||||
this.bouncePitch = pitch;
|
||||
|
||||
@ -17,12 +17,22 @@ import net.minecraft.world.World;
|
||||
|
||||
public class CasingCreator implements IParticleCreator {
|
||||
|
||||
/** Casing without smoke */
|
||||
/** Default casing without smoke */
|
||||
public static void composeEffect(World world, EntityLivingBase player, double frontOffset, double heightOffset, double sideOffset, double frontMotion, double heightMotion, double sideMotion, double motionVariance, String casing) {
|
||||
composeEffect(world, player, frontOffset, heightOffset, sideOffset, frontMotion, heightMotion, sideMotion, motionVariance, casing, false, 0, 0, 0);
|
||||
composeEffect(world, player, frontOffset, heightOffset, sideOffset, frontMotion, heightMotion, sideMotion, motionVariance, 5F, 10F, casing, false, 0, 0, 0);
|
||||
}
|
||||
|
||||
/** Casing without smoke */
|
||||
public static void composeEffect(World world, EntityLivingBase player, double frontOffset, double heightOffset, double sideOffset, double frontMotion, double heightMotion, double sideMotion, double motionVariance, float multPitch, float multYaw, String casing) {
|
||||
composeEffect(world, player, frontOffset, heightOffset, sideOffset, frontMotion, heightMotion, sideMotion, motionVariance, multPitch, multYaw, casing, false, 0, 0, 0);
|
||||
}
|
||||
|
||||
/** Default casing, but with smoke*/
|
||||
public static void composeEffect(World world, EntityLivingBase player, double frontOffset, double heightOffset, double sideOffset, double frontMotion, double heightMotion, double sideMotion, double motionVariance, String casing, boolean smoking, int smokeLife, double smokeLift, int nodeLife) {
|
||||
composeEffect(world, player, frontOffset, heightOffset, sideOffset, frontMotion, heightMotion, sideMotion, motionVariance, 5F, 10F, casing, false, 0, 0, 0);
|
||||
}
|
||||
|
||||
public static void composeEffect(World world, EntityLivingBase player, double frontOffset, double heightOffset, double sideOffset, double frontMotion, double heightMotion, double sideMotion, double motionVariance, float mPitch, float mYaw, String casing, boolean smoking, int smokeLife, double smokeLift, int nodeLife) {
|
||||
|
||||
if(player.isSneaking()) heightOffset -= 0.075F;
|
||||
|
||||
@ -51,6 +61,8 @@ public class CasingCreator implements IParticleCreator {
|
||||
data.setDouble("mZ", mZ);
|
||||
data.setFloat("yaw", player.rotationYaw);
|
||||
data.setFloat("pitch", player.rotationPitch);
|
||||
data.setFloat("mPitch", mPitch);
|
||||
data.setFloat("mYaw", mYaw);
|
||||
data.setString("name", casing);
|
||||
data.setBoolean("smoking", smoking);
|
||||
data.setInteger("smokeLife", smokeLife);
|
||||
@ -71,11 +83,13 @@ public class CasingCreator implements IParticleCreator {
|
||||
double mZ = data.getDouble("mZ");
|
||||
float yaw = data.getFloat("yaw");
|
||||
float pitch = data.getFloat("pitch");
|
||||
float mPitch = data.getFloat("mPitch");
|
||||
float mYaw = data.getFloat("mYaw");
|
||||
boolean smoking = data.getBoolean("smoking");
|
||||
int smokeLife = data.getInteger("smokeLife");
|
||||
double smokeLift = data.getDouble("smokeLift");
|
||||
int nodeLife = data.getInteger("nodeLife");
|
||||
ParticleSpentCasing casing = new ParticleSpentCasing(texman, world, x, y, z, mX, mY, mZ, 0, 0, casingConfig, smoking, smokeLife, smokeLift, nodeLife);
|
||||
ParticleSpentCasing casing = new ParticleSpentCasing(texman, world, x, y, z, mX, mY, mZ, mPitch, mYaw, casingConfig, smoking, smokeLife, smokeLift, nodeLife);
|
||||
casing.prevRotationYaw = casing.rotationYaw = yaw;
|
||||
casing.prevRotationPitch = casing.rotationPitch = pitch;
|
||||
Minecraft.getMinecraft().effectRenderer.addEffect(casing);
|
||||
|
||||
@ -1,9 +0,0 @@
|
||||
package com.hbm.qmaw;
|
||||
|
||||
public interface IManualElement {
|
||||
|
||||
public int getWidth();
|
||||
public int getHeight();
|
||||
public void render(boolean isMouseOver, int mouseX, int mouseY);
|
||||
public void onClick();
|
||||
}
|
||||
12
src/main/java/com/hbm/qmaw/ManualElement.java
Normal file
@ -0,0 +1,12 @@
|
||||
package com.hbm.qmaw;
|
||||
|
||||
public abstract class ManualElement {
|
||||
|
||||
public int x;
|
||||
public int y;
|
||||
|
||||
public abstract int getWidth();
|
||||
public abstract int getHeight();
|
||||
public abstract void render(boolean isMouseOver, int mouseX, int mouseY);
|
||||
public abstract void onClick();
|
||||
}
|
||||
44
src/main/java/com/hbm/qmaw/components/QComponentText.java
Normal file
@ -0,0 +1,44 @@
|
||||
package com.hbm.qmaw.components;
|
||||
|
||||
import com.hbm.qmaw.ManualElement;
|
||||
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.FontRenderer;
|
||||
|
||||
public class QComponentText extends ManualElement {
|
||||
|
||||
protected String text;
|
||||
protected FontRenderer font;
|
||||
protected int color = 0xFFFFFF;
|
||||
|
||||
public QComponentText(String text) {
|
||||
this(text, Minecraft.getMinecraft().fontRenderer);
|
||||
}
|
||||
|
||||
public QComponentText(String text, FontRenderer font) {
|
||||
this.text = text;
|
||||
this.font = font;
|
||||
}
|
||||
|
||||
public QComponentText setColor(int color) {
|
||||
this.color = color;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getWidth() {
|
||||
return font.getStringWidth(text);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getHeight() {
|
||||
return font.FONT_HEIGHT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void render(boolean isMouseOver, int mouseX, int mouseY) {
|
||||
font.drawString(text, x, y, color);
|
||||
}
|
||||
|
||||
@Override public void onClick() { }
|
||||
}
|
||||
@ -31,7 +31,6 @@ public class ItemRenderMissileGeneric implements IItemRenderer {
|
||||
TYPE_STEALTH,
|
||||
TYPE_ABM,
|
||||
TYPE_NUCLEAR,
|
||||
TYPE_CARRIER,
|
||||
TYPE_ROBIN
|
||||
}
|
||||
|
||||
@ -75,7 +74,6 @@ public class ItemRenderMissileGeneric implements IItemRenderer {
|
||||
case TYPE_STEALTH: guiScale = 1.75D; guiOffset = 4.75D; break;
|
||||
case TYPE_ABM: guiScale = 2.25D; guiOffset = 7D; break;
|
||||
case TYPE_NUCLEAR: guiScale = 1.375D; guiOffset = 1.5D; break;
|
||||
case TYPE_CARRIER: guiScale = 0.625D; guiOffset = -17D; break;
|
||||
case TYPE_ROBIN: guiScale = 1.25D; guiOffset = 2D; break;
|
||||
}
|
||||
|
||||
|
||||
@ -219,6 +219,7 @@ public class ItemRenderAberrator extends ItemRenderWeaponBase {
|
||||
double lengthOffset = -1.125;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(flash_plume);
|
||||
tess.startDrawingQuads();
|
||||
tess.setBrightness(240);
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||
|
||||
|
||||
@ -260,6 +260,7 @@ public class ItemRenderEOTT extends ItemRenderWeaponBase {
|
||||
double lengthOffset = -1.125;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(flash_plume);
|
||||
tess.startDrawingQuads();
|
||||
tess.setBrightness(240);
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||
|
||||
|
||||
@ -331,6 +331,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
|
||||
double inset = 2;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(flash_plume);
|
||||
tess.startDrawingQuads();
|
||||
tess.setBrightness(240);
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||
|
||||
@ -379,6 +380,7 @@ public abstract class ItemRenderWeaponBase implements IItemRenderer {
|
||||
double lengthOffset = 0.125;
|
||||
Minecraft.getMinecraft().renderEngine.bindTexture(flash_plume);
|
||||
tess.startDrawingQuads();
|
||||
tess.setBrightness(240);
|
||||
tess.setNormal(0F, 1F, 0F);
|
||||
tess.setColorRGBA_F(1F, 1F, 1F, 1F);
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ public interface IUpgradeInfoProvider {
|
||||
public static final String KEY_COOLANT_CONSUMPTION = "upgrade.coolantConsumption";
|
||||
public static final String KEY_DELAY = "upgrade.delay";
|
||||
public static final String KEY_EFFICIENCY = "upgrade.efficiency";
|
||||
public static final String KEY_PRODUCTIVITY = "upgrade.productivity";
|
||||
public static final String KEY_FORTUNE = "upgrade.fortune";
|
||||
public static final String KEY_RANGE = "upgrade.range";
|
||||
}
|
||||
|
||||
@ -9,6 +9,7 @@ import com.hbm.blocks.generic.BlockBedrockOreTE.TileEntityBedrockOre;
|
||||
import com.hbm.blocks.generic.BlockBobble.TileEntityBobble;
|
||||
import com.hbm.blocks.generic.BlockDynamicSlag.TileEntitySlag;
|
||||
import com.hbm.blocks.generic.BlockEmitter.TileEntityEmitter;
|
||||
import com.hbm.blocks.generic.BlockFissure.TileEntityFissure;
|
||||
import com.hbm.blocks.generic.BlockGlyphidSpawner.TileEntityGlpyhidSpawner;
|
||||
import com.hbm.blocks.generic.BlockLoot.TileEntityLoot;
|
||||
import com.hbm.blocks.generic.BlockPedestal.TileEntityPedestal;
|
||||
@ -229,6 +230,7 @@ public class TileMappings {
|
||||
put(TileEntityProxyConductor.class, "tileentity_proxy_conductor");
|
||||
|
||||
put(TileEntityBedrockOre.class, "tileentity_bedrock_ore");
|
||||
put(TileEntityFissure.class, "tileentity_fissure");
|
||||
|
||||
put(TileEntityBlockPWR.class, "tileentity_block_pwr");
|
||||
put(TileEntityPWRController.class, "tileentity_pwr_controller");
|
||||
|
||||
@ -3,6 +3,7 @@ package com.hbm.tileentity.bomb;
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.blocks.bomb.Landmine;
|
||||
import com.hbm.main.MainRegistry;
|
||||
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
@ -57,6 +58,7 @@ public class TileEntityLandmine extends TileEntity {
|
||||
if(isPrimed) {
|
||||
//the explosion is part of the mine block so that the IBomb interface works, i remember now
|
||||
landmine.explode(worldObj, xCoord, yCoord, zCoord);
|
||||
if(o instanceof EntityPlayer) ((EntityPlayer) o).addStat(MainRegistry.statMines, 1);
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.packet.toclient.TEVaultPacket;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -289,7 +290,8 @@ public class TileEntityBlastDoor extends TileEntityLockableBase {
|
||||
|
||||
public boolean placeDummy(int x, int y, int z) {
|
||||
|
||||
if(!worldObj.getBlock(x, y, z).isReplaceable(worldObj, x, y, z)) worldObj.func_147480_a(x, y, z, false);
|
||||
Block present = worldObj.getBlock(x, y, z);
|
||||
if(!present.isReplaceable(worldObj, x, y, z) && present != ModBlocks.dummy_block_blast) worldObj.func_147480_a(x, y, z, false);
|
||||
|
||||
worldObj.setBlock(x, y, z, ModBlocks.dummy_block_blast);
|
||||
|
||||
|
||||
@ -185,7 +185,7 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
|
||||
tank.setFill(tank.getFill() - getRequiredAcid(result.acidAmount));
|
||||
|
||||
float freeChance = this.getFreeChance();
|
||||
float freeChance = this.getFreeChance(result);
|
||||
|
||||
if(freeChance == 0 || freeChance < worldObj.rand.nextFloat())
|
||||
this.decrStackSize(0, result.itemAmount);
|
||||
@ -226,17 +226,13 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
}
|
||||
|
||||
public int getRequiredAcid(int base) {
|
||||
int efficiency = upgradeManager.getLevel(UpgradeType.EFFECT);
|
||||
if(efficiency > 0) {
|
||||
return base * (efficiency + 2);
|
||||
}
|
||||
return base;
|
||||
}
|
||||
|
||||
public float getFreeChance() {
|
||||
public float getFreeChance(CrystallizerRecipe recipe) {
|
||||
int efficiency = upgradeManager.getLevel(UpgradeType.EFFECT);
|
||||
if(efficiency > 0) {
|
||||
return Math.min(efficiency * 0.05F, 0.15F);
|
||||
return Math.min(efficiency * recipe.productivity, 0.99F);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
@ -253,7 +249,8 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
|
||||
public int getPowerRequired() {
|
||||
int speed = upgradeManager.getLevel(UpgradeType.SPEED);
|
||||
return (int) (demand + Math.min(speed * 1000, 3000));
|
||||
int effect = upgradeManager.getLevel(UpgradeType.EFFECT);
|
||||
return (int) (demand + speed * demand + effect * demand * 2);
|
||||
}
|
||||
|
||||
public float getCycleCount() {
|
||||
@ -379,8 +376,8 @@ public class TileEntityMachineCrystallizer extends TileEntityMachineBase impleme
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 100) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.EFFECT) {
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_EFFICIENCY, "+" + (level * 5) + "%"));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_ACID, "+" + (level * 100 + 100) + "%"));
|
||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(this.KEY_EFFICIENCY, "x" + level));
|
||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(this.KEY_CONSUMPTION, "+" + (level * 200) + "%"));
|
||||
}
|
||||
if(type == UpgradeType.OVERDRIVE) {
|
||||
info.add((BobMathUtil.getBlink() ? EnumChatFormatting.RED : EnumChatFormatting.DARK_GRAY) + "YES");
|
||||
|
||||
@ -332,7 +332,10 @@ public class TileEntityMachineRadarNT extends TileEntityMachineBase implements I
|
||||
this.entries.clear();
|
||||
|
||||
if(this.yCoord < radarAltitude) return;
|
||||
if(this.power < consumption) return;
|
||||
if(this.power < consumption) {
|
||||
this.power = 0;
|
||||
return;
|
||||
}
|
||||
this.power -= consumption;
|
||||
|
||||
int scan = this.getRange();
|
||||
|
||||
@ -15,6 +15,7 @@ import com.hbm.inventory.gui.GUIMachineRotaryFurnace;
|
||||
import com.hbm.inventory.material.MaterialShapes;
|
||||
import com.hbm.inventory.material.Mats;
|
||||
import com.hbm.inventory.material.Mats.MaterialStack;
|
||||
import com.hbm.inventory.material.NTMMaterial;
|
||||
import com.hbm.inventory.recipes.RotaryFurnaceRecipes;
|
||||
import com.hbm.inventory.recipes.RotaryFurnaceRecipes.RotaryFurnaceRecipe;
|
||||
import com.hbm.lib.Library;
|
||||
@ -49,6 +50,7 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
|
||||
public float progress;
|
||||
public int burnTime;
|
||||
public int maxBurnTime;
|
||||
public int steamUsed = 0;
|
||||
public boolean isVenting;
|
||||
public MaterialStack output;
|
||||
public ItemStack lastFuel;
|
||||
@ -159,6 +161,15 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
|
||||
if(this.steamUsed >= 100) {
|
||||
int steamReturn = this.steamUsed / 100;
|
||||
int canReturn = tanks[2].getMaxFill() - tanks[2].getFill();
|
||||
int doesReturn = Math.min(steamReturn, canReturn);
|
||||
this.steamUsed -= doesReturn * 100;
|
||||
tanks[2].setFill(tanks[2].getFill() + doesReturn);
|
||||
}
|
||||
|
||||
} else {
|
||||
this.progress = 0;
|
||||
}
|
||||
@ -246,6 +257,10 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
|
||||
this.progress = nbt.getFloat("prog");
|
||||
this.burnTime = nbt.getInteger("burn");
|
||||
this.maxBurnTime = nbt.getInteger("maxBurn");
|
||||
if (nbt.hasKey("outType")) {
|
||||
NTMMaterial mat = Mats.matById.get(nbt.getInteger("outType"));
|
||||
this.output = new MaterialStack(mat, nbt.getInteger("outAmount"));
|
||||
}
|
||||
ItemStack nbtFuel = ItemStack.loadItemStackFromNBT(nbt.getCompoundTag("lastFuel"));
|
||||
if(nbtFuel != null)
|
||||
this.lastFuel = nbtFuel;
|
||||
@ -261,6 +276,10 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
|
||||
nbt.setInteger("burn", burnTime);
|
||||
nbt.setInteger("maxBurn", maxBurnTime);
|
||||
nbt.setTag("lastFuel", lastFuel.writeToNBT(new NBTTagCompound()));
|
||||
if (this.output != null) {
|
||||
nbt.setInteger("outType", this.output.material.id);
|
||||
nbt.setInteger("outAmount", this.output.amount);
|
||||
}
|
||||
}
|
||||
|
||||
public DirPos[] getSteamPos() {
|
||||
@ -294,6 +313,7 @@ public class TileEntityMachineRotaryFurnace extends TileEntityMachinePolluting i
|
||||
|
||||
if(tanks[1].getFill() < recipe.steam) return false;
|
||||
if(tanks[2].getMaxFill() - tanks[2].getFill() < recipe.steam / 100) return false;
|
||||
if(this.steamUsed > 100) return false;
|
||||
|
||||
if(this.output != null) {
|
||||
if(this.output.material != recipe.output.material) return false;
|
||||
|
||||
@ -60,14 +60,14 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
this.lastAmount = this.amount;
|
||||
}
|
||||
|
||||
if (this.amount >= this.getCapacity()) {
|
||||
//In case of overfill problems, spit out the excess as scrap
|
||||
if (amount > getCapacity()) {
|
||||
ItemStack scrap = ItemScraps.create(new Mats.MaterialStack(type, Math.max(amount - getCapacity(), 0)));
|
||||
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 2, zCoord + 0.5, scrap);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
this.amount = this.getCapacity();
|
||||
if(this.amount >= this.getCapacity()) {
|
||||
// In case of overfill problems, spit out the excess as scrap
|
||||
if(amount > getCapacity()) {
|
||||
ItemStack scrap = ItemScraps.create(new Mats.MaterialStack(type, Math.max(amount - getCapacity(), 0)));
|
||||
EntityItem item = new EntityItem(worldObj, xCoord + 0.5, yCoord + 2, zCoord + 0.5, scrap);
|
||||
worldObj.spawnEntityInWorld(item);
|
||||
}
|
||||
this.amount = this.getCapacity();
|
||||
}
|
||||
|
||||
if(this.amount == 0) {
|
||||
@ -78,56 +78,58 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
|
||||
ItemMold.Mold mold = this.getInstalledMold();
|
||||
|
||||
if(canProcess()) {
|
||||
int minAmount = mold.getCost() * 9;
|
||||
if(mold != null) {
|
||||
|
||||
// Makes it flush the buffers after 10 seconds of inactivity
|
||||
if(worldObj.getWorldTime() >= lastCastTick + 200) {
|
||||
minAmount = mold.getCost();
|
||||
}
|
||||
int itemsCasted = amount / mold.getCost();
|
||||
|
||||
if(this.amount >= minAmount) {
|
||||
int itemsCasted = amount / mold.getCost();
|
||||
if(canProcess(itemsCasted)) {
|
||||
int minAmount = mold.getCost() * 9;
|
||||
|
||||
for(int j = 0; j < itemsCasted; j++) {
|
||||
this.amount -= mold.getCost();
|
||||
|
||||
ItemStack out = mold.getOutput(type);
|
||||
|
||||
for(int i = 1; i < 7; i++) {
|
||||
if(slots[i] == null) {
|
||||
slots[i] = out.copy();
|
||||
break;
|
||||
}
|
||||
|
||||
if(slots[i].isItemEqual(out) && slots[i].stackSize + out.stackSize <= out.getMaxStackSize()) {
|
||||
slots[i].stackSize += out.stackSize;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
// Makes it flush the buffers after 10 seconds of inactivity
|
||||
if(worldObj.getWorldTime() >= lastCastTick + 200) {
|
||||
minAmount = mold.getCost();
|
||||
}
|
||||
markChanged();
|
||||
|
||||
water.setFill(water.getFill() - getWaterRequired() * itemsCasted);
|
||||
steam.setFill(steam.getFill() + getWaterRequired() * itemsCasted);
|
||||
if(this.amount >= minAmount) {
|
||||
|
||||
lastCastTick = worldObj.getWorldTime();
|
||||
for(int j = 0; j < itemsCasted; j++) {
|
||||
this.amount -= mold.getCost();
|
||||
|
||||
ItemStack out = mold.getOutput(type);
|
||||
|
||||
for(int i = 1; i < 7; i++) {
|
||||
if(slots[i] == null) {
|
||||
slots[i] = out.copy();
|
||||
break;
|
||||
}
|
||||
|
||||
if(slots[i].isItemEqual(out) && slots[i].stackSize + out.stackSize <= out.getMaxStackSize()) {
|
||||
slots[i].stackSize += out.stackSize;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
markChanged();
|
||||
|
||||
water.setFill(water.getFill() - getWaterRequired() * itemsCasted);
|
||||
steam.setFill(steam.getFill() + getWaterRequired() * itemsCasted);
|
||||
|
||||
lastCastTick = worldObj.getWorldTime();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
networkPackNT(150);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public boolean canProcess() {
|
||||
public boolean canProcess(int itemsCasted) {
|
||||
ItemMold.Mold mold = this.getInstalledMold();
|
||||
if(type != null && mold != null && mold.getOutput(type) != null) {
|
||||
for(int i = 1; i < 7; i++) {
|
||||
if(slots[i] == null || slots[i].isItemEqual(mold.getOutput(type)) && slots[i].stackSize + mold.getOutput(type).stackSize <= mold.getOutput(type).getMaxStackSize())
|
||||
return water.getFill() >= getWaterRequired() && steam.getFill() < steam.getMaxFill();
|
||||
return water.getFill() >= getWaterRequired() * itemsCasted && steam.getFill() < steam.getMaxFill();
|
||||
|
||||
}
|
||||
}
|
||||
@ -140,12 +142,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new DirPos[] {
|
||||
new DirPos(xCoord + rot.offsetX * 2 - dir.offsetX, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ, rot),
|
||||
new DirPos(xCoord - rot.offsetX - dir.offsetX, yCoord, zCoord - rot.offsetZ - dir.offsetZ, rot.getOpposite()),
|
||||
new DirPos(xCoord + rot.offsetX * 2 - dir.offsetX * 5, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 5, rot),
|
||||
new DirPos(xCoord - rot.offsetX - dir.offsetX * 5, yCoord, zCoord - rot.offsetZ - dir.offsetZ * 5, rot.getOpposite())
|
||||
};
|
||||
return new DirPos[] { new DirPos(xCoord + rot.offsetX * 2 - dir.offsetX, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ, rot), new DirPos(xCoord - rot.offsetX - dir.offsetX, yCoord, zCoord - rot.offsetZ - dir.offsetZ, rot.getOpposite()), new DirPos(xCoord + rot.offsetX * 2 - dir.offsetX * 5, yCoord, zCoord + rot.offsetZ * 2 - dir.offsetZ * 5, rot), new DirPos(xCoord - rot.offsetX - dir.offsetX * 5, yCoord, zCoord - rot.offsetZ - dir.offsetZ * 5, rot.getOpposite()) };
|
||||
}
|
||||
|
||||
public int[][] getMetalPourPos() {
|
||||
@ -153,12 +150,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - BlockDummyable.offset);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
|
||||
return new int[][] {
|
||||
new int[] { xCoord + rot.offsetX - dir.offsetX, yCoord + 2, zCoord + rot.offsetZ - dir.offsetZ },
|
||||
new int[] { xCoord - dir.offsetX, yCoord + 2, zCoord - dir.offsetZ },
|
||||
new int[] { xCoord + rot.offsetX, yCoord + 2, zCoord + rot.offsetZ },
|
||||
new int[] { xCoord, yCoord + 2, zCoord }
|
||||
};
|
||||
return new int[][] { new int[] { xCoord + rot.offsetX - dir.offsetX, yCoord + 2, zCoord + rot.offsetZ - dir.offsetZ }, new int[] { xCoord - dir.offsetX, yCoord + 2, zCoord - dir.offsetZ }, new int[] { xCoord + rot.offsetX, yCoord + 2, zCoord + rot.offsetZ }, new int[] { xCoord, yCoord + 2, zCoord } };
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -190,11 +182,12 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
}
|
||||
return false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean standardCheck(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
if(this.type != null && this.type != stack.material) return false;
|
||||
if(this.type != null && this.type != stack.material)
|
||||
return false;
|
||||
int limit = this.getInstalledMold() != null ? this.getInstalledMold().getCost() * 9 : this.getCapacity();
|
||||
return !(this.amount >= limit || getInstalledMold() == null);
|
||||
}
|
||||
@ -215,10 +208,11 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
this.sendFluid(steam, worldObj, pos.getX(), pos.getY(), pos.getZ(), pos.getDir());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
|
||||
@Override
|
||||
public Mats.MaterialStack standardAdd(World world, int x, int y, int z, ForgeDirection side, Mats.MaterialStack stack) {
|
||||
this.type = stack.material;
|
||||
int limit = this.getInstalledMold() != null ? this.getInstalledMold().getCost() * 9 : this.getCapacity();
|
||||
int limit = this.getInstalledMold() != null ? this.getInstalledMold().getCost() * 9 : this.getCapacity();
|
||||
if(stack.amount + this.amount <= limit) {
|
||||
this.amount += stack.amount;
|
||||
return null;
|
||||
@ -231,6 +225,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
|
||||
return stack;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FluidTank[] getSendingTanks() {
|
||||
return new FluidTank[] { steam };
|
||||
@ -287,7 +282,8 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
|
||||
@Override
|
||||
public boolean isItemValidForSlot(int i, ItemStack stack) {
|
||||
if(i == 0) return stack.getItem() == ModItems.mold;
|
||||
if(i == 0)
|
||||
return stack.getItem() == ModItems.mold;
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -331,13 +327,7 @@ public class TileEntityMachineStrandCaster extends TileEntityFoundryCastingBase
|
||||
public AxisAlignedBB getRenderBoundingBox() {
|
||||
|
||||
if(bb == null) {
|
||||
bb = AxisAlignedBB.getBoundingBox(
|
||||
xCoord - 7,
|
||||
yCoord,
|
||||
zCoord - 7,
|
||||
xCoord + 7,
|
||||
yCoord + 3,
|
||||
zCoord + 7);
|
||||
bb = AxisAlignedBB.getBoundingBox(xCoord - 7, yCoord, zCoord - 7, xCoord + 7, yCoord + 3, zCoord + 7);
|
||||
}
|
||||
return bb;
|
||||
}
|
||||
|
||||
@ -8,6 +8,7 @@ import com.hbm.packet.toclient.TEVaultPacket;
|
||||
import cpw.mods.fml.common.network.NetworkRegistry.TargetPoint;
|
||||
import cpw.mods.fml.relauncher.Side;
|
||||
import cpw.mods.fml.relauncher.SideOnly;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.nbt.NBTTagCompound;
|
||||
import net.minecraft.tileentity.TileEntity;
|
||||
@ -195,7 +196,8 @@ public class TileEntityVaultDoor extends TileEntityLockableBase {
|
||||
|
||||
public boolean placeDummy(int x, int y, int z) {
|
||||
|
||||
if(!worldObj.getBlock(x, y, z).isReplaceable(worldObj, x, y, z)) worldObj.func_147480_a(x, y, z, false);
|
||||
Block present = worldObj.getBlock(x, y, z);
|
||||
if(!present.isReplaceable(worldObj, x, y, z) && present != ModBlocks.dummy_block_vault) worldObj.func_147480_a(x, y, z, false);
|
||||
|
||||
worldObj.setBlock(x, y, z, ModBlocks.dummy_block_vault);
|
||||
|
||||
|
||||
@ -17,25 +17,30 @@ public abstract class TileEntityPileBase extends TileEntity {
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
NeutronNodeWorld.removeNode(worldObj, new BlockPos(this));
|
||||
}
|
||||
|
||||
NeutronNodeWorld.removeNode(new BlockPos(this));
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
NeutronNodeWorld.removeNode(worldObj, new BlockPos(this));
|
||||
}
|
||||
|
||||
protected void castRay(int flux) {
|
||||
|
||||
BlockPos pos = new BlockPos(this);
|
||||
|
||||
if (flux == 0) {
|
||||
if(flux == 0) {
|
||||
// simple way to remove the node from the cache when no flux is going into it!
|
||||
NeutronNodeWorld.removeNode(pos);
|
||||
NeutronNodeWorld.removeNode(worldObj, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
PileNeutronNode node = (PileNeutronNode) NeutronNodeWorld.getNode(pos);
|
||||
PileNeutronNode node = (PileNeutronNode) NeutronNodeWorld.getNode(worldObj, pos);
|
||||
|
||||
if(node == null) {
|
||||
node = PileNeutronHandler.makeNode(this);
|
||||
NeutronNodeWorld.addNode(node);
|
||||
NeutronNodeWorld.addNode(worldObj, node);
|
||||
}
|
||||
|
||||
Vec3 neutronVector = Vec3.createVectorHelper(1, 0, 0);
|
||||
|
||||
@ -14,7 +14,6 @@ import com.hbm.main.MainRegistry;
|
||||
import com.hbm.packet.PacketDispatcher;
|
||||
import com.hbm.packet.toclient.AuxParticlePacketNT;
|
||||
import com.hbm.saveddata.TomSaveData;
|
||||
import com.hbm.tileentity.IBufPacketReceiver;
|
||||
import com.hbm.tileentity.IOverpressurable;
|
||||
import com.hbm.tileentity.TileEntityLoadedBase;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
@ -54,7 +53,7 @@ import java.util.Iterator;
|
||||
* @author hbm
|
||||
*
|
||||
*/
|
||||
public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements IBufPacketReceiver {
|
||||
public abstract class TileEntityRBMKBase extends TileEntityLoadedBase {
|
||||
|
||||
public double heat;
|
||||
|
||||
@ -133,7 +132,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
double heatConsumption = RBMKDials.getBoilerHeatConsumption(worldObj);
|
||||
double availableHeat = (this.heat - 100) / heatConsumption;
|
||||
double availableWater = this.water;
|
||||
double availableSpace = this.maxSteam - this.steam;
|
||||
double availableSpace = maxSteam - this.steam;
|
||||
|
||||
int processedWater = (int) Math.floor(BobMathUtil.min(availableHeat, availableWater, availableSpace) * MathHelper.clamp_double(RBMKDials.getReaSimBoilerSpeed(worldObj), 0D, 1D));
|
||||
|
||||
@ -161,7 +160,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
if(heat == 20 && RBMKDials.getReasimBoilers(worldObj))
|
||||
return;
|
||||
|
||||
List<TileEntityRBMKBase> rec = new ArrayList();
|
||||
List<TileEntityRBMKBase> rec = new ArrayList<>();
|
||||
rec.add(this);
|
||||
double heatTot = this.heat;
|
||||
int waterTot = this.water;
|
||||
@ -227,8 +226,13 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
@Override
|
||||
public void invalidate() {
|
||||
super.invalidate();
|
||||
NeutronNodeWorld.removeNode(worldObj, new BlockPos(this)); // woo-fucking-hoo!!!
|
||||
}
|
||||
|
||||
NeutronNodeWorld.removeNode(new BlockPos(this)); // woo-fucking-hoo!!!
|
||||
@Override
|
||||
public void onChunkUnload() {
|
||||
super.onChunkUnload();
|
||||
NeutronNodeWorld.removeNode(worldObj, new BlockPos(this)); // woo-fucking-hoo!!!
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -304,6 +308,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
diag = false;
|
||||
}
|
||||
|
||||
@SuppressWarnings("unchecked")
|
||||
@SideOnly(Side.CLIENT)
|
||||
public static void diagnosticPrintHook(RenderGameOverlayEvent.Pre event, World world, int x, int y, int z) {
|
||||
|
||||
@ -326,7 +331,7 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
int pX = resolution.getScaledWidth() / 2 + 8;
|
||||
int pZ = resolution.getScaledHeight() / 2;
|
||||
|
||||
List<String> exceptions = new ArrayList();
|
||||
List<String> exceptions = new ArrayList<>();
|
||||
exceptions.add("x");
|
||||
exceptions.add("y");
|
||||
exceptions.add("z");
|
||||
@ -416,10 +421,11 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
worldObj.spawnEntityInWorld(debris);
|
||||
}
|
||||
|
||||
public static HashSet<TileEntityRBMKBase> columns = new HashSet();
|
||||
public static HashSet<IPipeNet> pipes = new HashSet();
|
||||
public static HashSet<TileEntityRBMKBase> columns = new HashSet<>();
|
||||
public static HashSet<IPipeNet> pipes = new HashSet<>();
|
||||
|
||||
//assumes that !worldObj.isRemote
|
||||
@SuppressWarnings("unchecked")
|
||||
public void meltdown() {
|
||||
|
||||
RBMKBase.dropLids = false;
|
||||
@ -483,8 +489,8 @@ public abstract class TileEntityRBMKBase extends TileEntityLoadedBase implements
|
||||
|
||||
/* Hanlde overpressure event */
|
||||
if(RBMKDials.getOverpressure(worldObj) && !pipes.isEmpty()) {
|
||||
HashSet<IFluidConductor> pipeBlocks = new HashSet();
|
||||
HashSet<IFluidConnector> pipeReceivers = new HashSet();
|
||||
HashSet<IFluidConductor> pipeBlocks = new HashSet<>();
|
||||
HashSet<IFluidConnector> pipeReceivers = new HashSet<>();
|
||||
|
||||
//unify all parts into single sets to prevent redundancy
|
||||
pipes.forEach(x -> {
|
||||
|
||||
@ -557,7 +557,7 @@ public class TileEntityRBMKConsole extends TileEntityMachineBase implements ICon
|
||||
if(te instanceof TileEntityRBMKRod){
|
||||
TileEntityRBMKRod fuelChannel = (TileEntityRBMKRod)te;
|
||||
data_table.put("fluxQuantity", fuelChannel.lastFluxQuantity);
|
||||
data_table.put("fluxRatio", fuelChannel.fluxRatio);
|
||||
data_table.put("fluxRatio", fuelChannel.fluxFastRatio);
|
||||
}
|
||||
|
||||
if(te instanceof TileEntityRBMKBoiler){
|
||||
|
||||
@ -15,6 +15,7 @@ import com.hbm.inventory.gui.GUIRBMKRod;
|
||||
import com.hbm.items.ModItems;
|
||||
import com.hbm.items.machine.ItemRBMKRod;
|
||||
import com.hbm.tileentity.machine.rbmk.TileEntityRBMKConsole.ColumnType;
|
||||
import com.hbm.util.BufferUtil;
|
||||
import com.hbm.util.CompatEnergyControl;
|
||||
import com.hbm.util.ParticleUtil;
|
||||
|
||||
@ -27,7 +28,6 @@ import io.netty.buffer.ByteBuf;
|
||||
import li.cil.oc.api.machine.Arguments;
|
||||
import li.cil.oc.api.machine.Callback;
|
||||
import li.cil.oc.api.machine.Context;
|
||||
import li.cil.oc.api.network.SimpleComponent;
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.inventory.Container;
|
||||
import net.minecraft.item.ItemStack;
|
||||
@ -41,17 +41,22 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||
public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable, SimpleComponent, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBMKFluxReceiver, IRBMKLoadable, IInfoProviderEC, CompatHandler.OCComponent {
|
||||
|
||||
// New system!!
|
||||
// Used for receiving flux (calculating outbound flux/burning rods)
|
||||
public double fluxRatio;
|
||||
public double fluxFastRatio;
|
||||
public double fluxQuantity;
|
||||
public double lastFluxQuantity;
|
||||
public double lastFluxRatio;
|
||||
|
||||
public boolean hasRod;
|
||||
|
||||
// Fuel rod item data client sync
|
||||
private String fuelYield;
|
||||
private String fuelXenon;
|
||||
private String fuelHeat;
|
||||
|
||||
public TileEntityRBMKRod() {
|
||||
super(1);
|
||||
}
|
||||
@ -73,11 +78,11 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
|
||||
@Override
|
||||
public void receiveFlux(NeutronStream stream) {
|
||||
double fastFlux = this.fluxQuantity * this.fluxRatio;
|
||||
double fastFlux = this.fluxQuantity * this.fluxFastRatio;
|
||||
double fastFluxIn = stream.fluxQuantity * stream.fluxRatio;
|
||||
|
||||
this.fluxQuantity += stream.fluxQuantity;
|
||||
fluxRatio = (fastFlux + fastFluxIn) / fluxQuantity;
|
||||
fluxFastRatio = (fastFlux + fastFluxIn) / fluxQuantity;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -94,18 +99,18 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
|
||||
// Experimental flux ratio curve rods!
|
||||
// Again, nothing really uses this so its just idle code at the moment.
|
||||
if (rod.specialFluxCurve) {
|
||||
if(rod.specialFluxCurve) {
|
||||
|
||||
fluxRatioOut = rod.fluxRatioOut(this.fluxRatio, ItemRBMKRod.getEnrichment(slots[0]));
|
||||
fluxRatioOut = rod.fluxRatioOut(this.fluxFastRatio, ItemRBMKRod.getEnrichment(slots[0]));
|
||||
|
||||
double fluxIn;
|
||||
|
||||
fluxIn = rod.fluxFromRatio(this.fluxQuantity, this.fluxRatio);
|
||||
fluxIn = rod.fluxFromRatio(this.fluxQuantity, this.fluxFastRatio);
|
||||
|
||||
fluxQuantityOut = rod.burn(worldObj, slots[0], fluxIn);
|
||||
} else {
|
||||
NType rType = rod.rType;
|
||||
if (rType == NType.SLOW)
|
||||
if(rType == NType.SLOW)
|
||||
fluxRatioOut = 0;
|
||||
else
|
||||
fluxRatioOut = 1;
|
||||
@ -141,10 +146,10 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
//for spreading, we want the buffered flux to be 0 because we want to know exactly how much gets reflected back
|
||||
|
||||
this.lastFluxQuantity = this.fluxQuantity;
|
||||
this.lastFluxRatio = this.fluxRatio;
|
||||
this.lastFluxRatio = this.fluxFastRatio;
|
||||
|
||||
this.fluxQuantity = 0;
|
||||
this.fluxRatio = 0;
|
||||
this.fluxFastRatio = 0;
|
||||
|
||||
spreadFlux(fluxQuantityOut, fluxRatioOut);
|
||||
|
||||
@ -155,7 +160,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
this.lastFluxRatio = 0;
|
||||
this.lastFluxQuantity = 0;
|
||||
this.fluxQuantity = 0;
|
||||
this.fluxRatio = 0;
|
||||
this.fluxFastRatio = 0;
|
||||
|
||||
hasRod = false;
|
||||
|
||||
@ -166,9 +171,12 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
|
||||
private double fluxFromType(NType type) {
|
||||
|
||||
double fastFlux = this.fluxQuantity * this.fluxFastRatio;
|
||||
double slowFlux = this.fluxQuantity * (1 - this.fluxFastRatio);
|
||||
|
||||
switch(type) {
|
||||
case SLOW: return (this.fluxQuantity * (1 - this.fluxRatio) + Math.min(this.fluxRatio * 0.5, 1));
|
||||
case FAST: return (this.fluxQuantity * (1 - this.fluxRatio) + Math.min(this.fluxRatio * 0.3, 1));
|
||||
case SLOW: return slowFlux + fastFlux * 0.5;
|
||||
case FAST: return fastFlux + slowFlux * 0.3;
|
||||
case ANY: return this.fluxQuantity;
|
||||
}
|
||||
|
||||
@ -189,17 +197,17 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
if(pos == null)
|
||||
pos = new BlockPos(this);
|
||||
|
||||
if (flux == 0) {
|
||||
if(flux == 0) {
|
||||
// simple way to remove the node from the cache when no flux is going into it!
|
||||
NeutronNodeWorld.removeNode(pos);
|
||||
NeutronNodeWorld.removeNode(worldObj, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(pos);
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(worldObj, pos);
|
||||
|
||||
if(node == null) {
|
||||
node = RBMKNeutronHandler.makeNode(this);
|
||||
NeutronNodeWorld.addNode(node);
|
||||
NeutronNodeWorld.addNode(worldObj, node);
|
||||
}
|
||||
|
||||
for(ForgeDirection dir : fluxDirs) {
|
||||
@ -215,16 +223,16 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
public void readFromNBT(NBTTagCompound nbt) {
|
||||
super.readFromNBT(nbt);
|
||||
|
||||
if (nbt.hasKey("fluxFast") || nbt.hasKey("fluxSlow")) {
|
||||
if(nbt.hasKey("fluxFast") || nbt.hasKey("fluxSlow")) {
|
||||
// recalculate new values to keep stable operations
|
||||
this.fluxQuantity = nbt.getDouble("fluxFast") + nbt.getDouble("fluxSlow");
|
||||
if (this.fluxQuantity > 0)
|
||||
this.fluxRatio = nbt.getDouble("fluxFast") / fluxQuantity;
|
||||
if(this.fluxQuantity > 0)
|
||||
this.fluxFastRatio = nbt.getDouble("fluxFast") / fluxQuantity;
|
||||
else
|
||||
this.fluxRatio = 0;
|
||||
this.fluxFastRatio = 0;
|
||||
} else {
|
||||
this.fluxQuantity = nbt.getDouble("fluxQuantity");
|
||||
this.fluxRatio = nbt.getDouble("fluxMod");
|
||||
this.fluxFastRatio = nbt.getDouble("fluxMod");
|
||||
}
|
||||
this.hasRod = nbt.getBoolean("hasRod");
|
||||
}
|
||||
@ -233,12 +241,12 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
public void writeToNBT(NBTTagCompound nbt) {
|
||||
super.writeToNBT(nbt);
|
||||
|
||||
if (!diag) {
|
||||
if(!diag) {
|
||||
nbt.setDouble("fluxQuantity", this.lastFluxQuantity);
|
||||
nbt.setDouble("fluxMod", this.lastFluxRatio);
|
||||
} else {
|
||||
nbt.setDouble("fluxSlow", this.fluxQuantity * (1 - fluxRatio));
|
||||
nbt.setDouble("fluxFast", this.fluxQuantity * fluxRatio);
|
||||
nbt.setDouble("fluxSlow", this.fluxQuantity * (1 - fluxFastRatio));
|
||||
nbt.setDouble("fluxFast", this.fluxQuantity * fluxFastRatio);
|
||||
}
|
||||
nbt.setBoolean("hasRod", this.hasRod);
|
||||
}
|
||||
@ -249,14 +257,27 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
buf.writeDouble(this.lastFluxQuantity);
|
||||
buf.writeDouble(this.lastFluxRatio);
|
||||
buf.writeBoolean(this.hasRod);
|
||||
if(this.hasRod) {
|
||||
ItemRBMKRod rod = ((ItemRBMKRod)slots[0].getItem());
|
||||
BufferUtil.writeString(buf, ItemRBMKRod.getYield(slots[0]) + " / " + rod.yield + " (" + (ItemRBMKRod.getEnrichment(slots[0]) * 100) + "%)");
|
||||
BufferUtil.writeString(buf, ItemRBMKRod.getPoison(slots[0]) + "%");
|
||||
BufferUtil.writeString(buf, ItemRBMKRod.getCoreHeat(slots[0]) + " / " + ItemRBMKRod.getHullHeat(slots[0]) + " / " + rod.meltingPoint);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deserialize(ByteBuf buf) {
|
||||
super.deserialize(buf);
|
||||
this.fluxQuantity = buf.readDouble();
|
||||
this.fluxRatio = buf.readDouble();
|
||||
this.fluxFastRatio = buf.readDouble();
|
||||
this.hasRod = buf.readBoolean();
|
||||
if(this.hasRod) {
|
||||
fuelYield = BufferUtil.readString(buf);
|
||||
fuelXenon = BufferUtil.readString(buf);
|
||||
fuelHeat = BufferUtil.readString(buf);
|
||||
} else {
|
||||
fuelYield = fuelXenon = fuelHeat = null;
|
||||
}
|
||||
}
|
||||
|
||||
public void getDiagData(NBTTagCompound nbt) {
|
||||
@ -264,13 +285,10 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
this.writeToNBT(nbt);
|
||||
diag = false;
|
||||
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
|
||||
ItemRBMKRod rod = ((ItemRBMKRod)slots[0].getItem());
|
||||
|
||||
nbt.setString("f_yield", rod.getYield(slots[0]) + " / " + rod.yield + " (" + (rod.getEnrichment(slots[0]) * 100) + "%)");
|
||||
nbt.setString("f_xenon", rod.getPoison(slots[0]) + "%");
|
||||
nbt.setString("f_heat", rod.getCoreHeat(slots[0]) + " / " + rod.getHullHeat(slots[0]) + " / " + rod.meltingPoint);
|
||||
if(fuelYield != null && fuelXenon != null && fuelHeat != null) {
|
||||
nbt.setString("f_yield", fuelYield);
|
||||
nbt.setString("f_xenon", fuelXenon);
|
||||
nbt.setString("f_heat", fuelHeat);
|
||||
}
|
||||
}
|
||||
|
||||
@ -339,10 +357,10 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
if(slots[0] != null && slots[0].getItem() instanceof ItemRBMKRod) {
|
||||
|
||||
ItemRBMKRod rod = ((ItemRBMKRod)slots[0].getItem());
|
||||
data.setDouble("enrichment", rod.getEnrichment(slots[0]));
|
||||
data.setDouble("xenon", rod.getPoison(slots[0]));
|
||||
data.setDouble("c_heat", rod.getHullHeat(slots[0]));
|
||||
data.setDouble("c_coreHeat", rod.getCoreHeat(slots[0]));
|
||||
data.setDouble("enrichment", ItemRBMKRod.getEnrichment(slots[0]));
|
||||
data.setDouble("xenon", ItemRBMKRod.getPoison(slots[0]));
|
||||
data.setDouble("c_heat", ItemRBMKRod.getHullHeat(slots[0]));
|
||||
data.setDouble("c_coreHeat", ItemRBMKRod.getCoreHeat(slots[0]));
|
||||
data.setDouble("c_maxHeat", rod.meltingPoint);
|
||||
}
|
||||
|
||||
@ -398,7 +416,7 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
@Callback(direct = true)
|
||||
@Optional.Method(modid = "OpenComputers")
|
||||
public Object[] getFluxRatio(Context context, Arguments args) {
|
||||
return new Object[] {fluxRatio};
|
||||
return new Object[] {fluxFastRatio};
|
||||
}
|
||||
|
||||
@Callback(direct = true)
|
||||
@ -456,14 +474,15 @@ public class TileEntityRBMKRod extends TileEntityRBMKSlottedBase implements IRBM
|
||||
returnValues.add(ItemRBMKRod.getEnrichment(slots[0]));
|
||||
returnValues.add(ItemRBMKRod.getPoison(slots[0]));
|
||||
returnValues.add(slots[0].getItem().getUnlocalizedName());
|
||||
} else
|
||||
for (int i = 0; i < 5; i++)
|
||||
returnValues.add("N/A");
|
||||
} else {
|
||||
for(int i = 0; i < 5; i++) returnValues.add("N/A");
|
||||
}
|
||||
|
||||
return new Object[] {
|
||||
heat, returnValues.get(0), returnValues.get(1),
|
||||
fluxQuantity, fluxRatio, returnValues.get(2), returnValues.get(3), returnValues.get(4),
|
||||
((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord};
|
||||
heat, returnValues.get(0), returnValues.get(1),
|
||||
fluxQuantity, fluxFastRatio, returnValues.get(2), returnValues.get(3), returnValues.get(4),
|
||||
((RBMKRod)this.getBlockType()).moderated, xCoord, yCoord, zCoord
|
||||
};
|
||||
}
|
||||
|
||||
@Callback(direct = true)
|
||||
|
||||
@ -28,22 +28,22 @@ public class TileEntityRBMKRodReaSim extends TileEntityRBMKRod {
|
||||
if(pos == null)
|
||||
pos = new BlockPos(this);
|
||||
|
||||
if (flux == 0) {
|
||||
if(flux == 0) {
|
||||
// simple way to remove the node from the cache when no flux is going into it!
|
||||
NeutronNodeWorld.removeNode(pos);
|
||||
NeutronNodeWorld.removeNode(worldObj, pos);
|
||||
return;
|
||||
}
|
||||
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(pos);
|
||||
RBMKNeutronNode node = (RBMKNeutronNode) NeutronNodeWorld.getNode(worldObj, pos);
|
||||
|
||||
if(node == null) {
|
||||
node = makeNode(this);
|
||||
NeutronNodeWorld.addNode(node);
|
||||
NeutronNodeWorld.addNode(worldObj, node);
|
||||
}
|
||||
|
||||
int count = RBMKDials.getReaSimCount(worldObj);
|
||||
|
||||
for (int i = 0; i < count; i++) {
|
||||
for(int i = 0; i < count; i++) {
|
||||
Vec3 neutronVector = Vec3.createVectorHelper(1, 0, 0);
|
||||
|
||||
neutronVector.rotateAroundY((float)(Math.PI * 2D * worldObj.rand.nextDouble()));
|
||||
|
||||
@ -3,26 +3,26 @@ package com.hbm.uninos;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
public class GenNode<T extends INetworkProvider> {
|
||||
public class GenNode<N extends NodeNet> {
|
||||
|
||||
public BlockPos[] positions;
|
||||
public DirPos[] connections;
|
||||
public INodeNet<T> net;
|
||||
public N net;
|
||||
public boolean expired = false;
|
||||
public boolean recentlyChanged = true;
|
||||
public T networkProvider;
|
||||
public INetworkProvider networkProvider;
|
||||
|
||||
public GenNode(T provider, BlockPos... positions) {
|
||||
public GenNode(INetworkProvider<N> provider, BlockPos... positions) {
|
||||
this.networkProvider = provider;
|
||||
this.positions = positions;
|
||||
}
|
||||
|
||||
public GenNode<T> setConnections(DirPos... connections) {
|
||||
public GenNode<N> setConnections(DirPos... connections) {
|
||||
this.connections = connections;
|
||||
return this;
|
||||
}
|
||||
|
||||
public GenNode<T> addConnection(DirPos connection) {
|
||||
public GenNode<N> addConnection(DirPos connection) {
|
||||
DirPos[] newCons = new DirPos[this.connections.length + 1];
|
||||
for(int i = 0; i < this.connections.length; i++) newCons[i] = this.connections[i];
|
||||
newCons[newCons.length - 1] = connection;
|
||||
@ -34,7 +34,7 @@ public class GenNode<T extends INetworkProvider> {
|
||||
return this.net != null && this.net.isValid();
|
||||
}
|
||||
|
||||
public void setNet(INodeNet<T> net) {
|
||||
public void setNet(N net) {
|
||||
this.net = net;
|
||||
this.recentlyChanged = true;
|
||||
}
|
||||
|
||||
5
src/main/java/com/hbm/uninos/IGenProvider.java
Normal file
@ -0,0 +1,5 @@
|
||||
package com.hbm.uninos;
|
||||
|
||||
public interface IGenProvider<T extends INetworkProvider> {
|
||||
|
||||
}
|
||||
10
src/main/java/com/hbm/uninos/IGenReceiver.java
Normal file
@ -0,0 +1,10 @@
|
||||
package com.hbm.uninos;
|
||||
|
||||
import api.hbm.energymk2.IEnergyReceiverMK2.ConnectionPriority;
|
||||
|
||||
public interface IGenReceiver<T extends INetworkProvider> {
|
||||
|
||||
public default ConnectionPriority getPriority() {
|
||||
return ConnectionPriority.NORMAL;
|
||||
}
|
||||
}
|
||||
@ -4,7 +4,7 @@ package com.hbm.uninos;
|
||||
* Each instance of a network provider is a valid "type" of node in UNINOS
|
||||
* @author hbm
|
||||
*/
|
||||
public interface INetworkProvider {
|
||||
public interface INetworkProvider<T extends NodeNet> {
|
||||
|
||||
public INodeNet<? extends INetworkProvider> provideNetwork();
|
||||
public T provideNetwork();
|
||||
}
|
||||
|
||||
@ -1,7 +0,0 @@
|
||||
package com.hbm.uninos;
|
||||
|
||||
public interface INodeNet<T extends INetworkProvider> {
|
||||
|
||||
public boolean isValid();
|
||||
public void destroy();
|
||||
}
|
||||
82
src/main/java/com/hbm/uninos/NodeNet.java
Normal file
@ -0,0 +1,82 @@
|
||||
package com.hbm.uninos;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
|
||||
public abstract class NodeNet<R extends IGenReceiver, P extends IGenProvider, L extends GenNode> {
|
||||
|
||||
/** Global random for figuring things out like random leftover distribution */
|
||||
public static Random rand = new Random();
|
||||
|
||||
public boolean valid = true;
|
||||
public Set<L> links = new HashSet();
|
||||
|
||||
public HashMap<R, Long> receiverEntries = new HashMap();
|
||||
public HashMap<P, Long> providerEntries = new HashMap();
|
||||
|
||||
public NodeNet() {
|
||||
UniNodespace.activeNodeNets.add(this);
|
||||
}
|
||||
|
||||
/// SUBSCRIBER HANDLING ///
|
||||
public boolean isSubscribed(R receiver) { return this.receiverEntries.containsKey(receiver); }
|
||||
public void addReceiver(R receiver) { this.receiverEntries.put(receiver, System.currentTimeMillis()); }
|
||||
public void removeReceiver(R receiver) { this.receiverEntries.remove(receiver); }
|
||||
|
||||
/// PROVIDER HANDLING ///
|
||||
public boolean isProvider(P provider) { return this.providerEntries.containsKey(provider); }
|
||||
public void addProvider(P provider) { this.providerEntries.put(provider, System.currentTimeMillis()); }
|
||||
public void removeProvider(P provider) { this.providerEntries.remove(provider); }
|
||||
|
||||
/** Combines two networks into one */
|
||||
public void joinNetworks(NodeNet network) {
|
||||
if(network == this) return;
|
||||
|
||||
List<L> oldNodes = new ArrayList(network.links.size());
|
||||
oldNodes.addAll(network.links);
|
||||
|
||||
for(L conductor : oldNodes) forceJoinLink(conductor);
|
||||
network.links.clear();
|
||||
|
||||
for(Object /*this is bullshit*/ connector : network.receiverEntries.keySet()) this.addReceiver((R) connector);
|
||||
for(Object /*this is bullshit*/ connector : network.providerEntries.keySet()) this.addProvider((P) connector);
|
||||
network.destroy();
|
||||
}
|
||||
|
||||
/** Adds the node as part of this network's links */
|
||||
public NodeNet joinLink(L node) {
|
||||
if(node.net != null) node.net.leaveLink(node);
|
||||
return forceJoinLink(node);
|
||||
}
|
||||
|
||||
/** Adds the node as part of this network's links, skips the part about removing it from existing networks */
|
||||
public NodeNet forceJoinLink(L node) {
|
||||
this.links.add(node);
|
||||
node.setNet(this);
|
||||
return this;
|
||||
}
|
||||
|
||||
/** Removes the specified node */
|
||||
public void leaveLink(L node) {
|
||||
node.setNet(null);
|
||||
this.links.remove(node);
|
||||
}
|
||||
|
||||
/// GENERAL POWER NET CONTROL ///
|
||||
public void invalidate() { this.valid = false; UniNodespace.activeNodeNets.remove(this); }
|
||||
public boolean isValid() { return this.valid; }
|
||||
public void resetTrackers() { }
|
||||
public abstract void update();
|
||||
|
||||
public void destroy() {
|
||||
this.invalidate();
|
||||
for(GenNode link : this.links) if(link.net == this) link.setNet(null);
|
||||
this.links.clear();
|
||||
this.receiverEntries.clear();
|
||||
this.providerEntries.clear();
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,21 @@
|
||||
package com.hbm.uninos;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
import java.util.Set;
|
||||
import java.util.Map.Entry;
|
||||
|
||||
import com.hbm.util.Tuple.Pair;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
public class UniNodespace {
|
||||
|
||||
public static HashMap<World, UniNodeWorld> worlds = new HashMap();
|
||||
public static Set<NodeNet> activeNodeNets = new HashSet<>();
|
||||
|
||||
public static GenNode getNode(World world, int x, int y, int z, INetworkProvider type) {
|
||||
UniNodeWorld nodeWorld = worlds.get(world);
|
||||
@ -33,9 +39,77 @@ public class UniNodespace {
|
||||
}
|
||||
}
|
||||
|
||||
public static void updateNodespace() {
|
||||
|
||||
for(World world : MinecraftServer.getServer().worldServers) {
|
||||
UniNodeWorld nodeWorld = worlds.get(world);
|
||||
|
||||
if(nodeWorld == null) continue;
|
||||
|
||||
for(Entry<Pair<BlockPos, INetworkProvider>, GenNode> entry : nodeWorld.nodes.entrySet()) {
|
||||
GenNode node = entry.getValue();
|
||||
INetworkProvider provider = entry.getKey().getValue();
|
||||
if(!node.hasValidNet() || node.recentlyChanged) {
|
||||
checkNodeConnection(world, node, provider);
|
||||
node.recentlyChanged = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateNetworks();
|
||||
}
|
||||
|
||||
private static void updateNetworks() {
|
||||
|
||||
for(NodeNet net : activeNodeNets) net.resetTrackers(); //reset has to be done before everything else
|
||||
for(NodeNet net : activeNodeNets) net.update();
|
||||
}
|
||||
|
||||
/** Goes over each connection point of the given node, tries to find neighbor nodes and to join networks with them */
|
||||
private static void checkNodeConnection(World world, GenNode node, INetworkProvider provider) {
|
||||
|
||||
for(DirPos con : node.connections) {
|
||||
GenNode conNode = getNode(world, con.getX(), con.getY(), con.getZ(), provider); // get whatever neighbor node intersects with that connection
|
||||
if(conNode != null) { // if there is a node at that place
|
||||
if(conNode.hasValidNet() && conNode.net == node.net) continue; // if the net is valid and both nodes have the same net, skip
|
||||
if(checkConnection(conNode, con, false)) {
|
||||
connectToNode(node, conNode);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(node.net == null || !node.net.isValid()) provider.provideNetwork().joinLink(node);
|
||||
}
|
||||
|
||||
/** Checks if the node can be connected to given the DirPos, skipSideCheck will ignore the DirPos' direction value */
|
||||
public static boolean checkConnection(GenNode connectsTo, DirPos connectFrom, boolean skipSideCheck) {
|
||||
for(DirPos revCon : connectsTo.connections) {
|
||||
if(revCon.getX() - revCon.getDir().offsetX == connectFrom.getX() && revCon.getY() - revCon.getDir().offsetY == connectFrom.getY() && revCon.getZ() - revCon.getDir().offsetZ == connectFrom.getZ() && (revCon.getDir() == connectFrom.getDir().getOpposite() || skipSideCheck)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/** Links two nodes with different or potentially no networks */
|
||||
private static void connectToNode(GenNode origin, GenNode connection) {
|
||||
|
||||
if(origin.hasValidNet() && connection.hasValidNet()) { // both nodes have nets, but the nets are different (previous assumption), join networks
|
||||
if(origin.net.links.size() > connection.net.links.size()) {
|
||||
origin.net.joinNetworks(connection.net);
|
||||
} else {
|
||||
connection.net.joinNetworks(origin.net);
|
||||
}
|
||||
} else if(!origin.hasValidNet() && connection.hasValidNet()) { // origin has no net, connection does, have origin join connection's net
|
||||
connection.net.joinLink(origin);
|
||||
} else if(origin.hasValidNet() && !connection.hasValidNet()) { // ...and vice versa
|
||||
origin.net.joinLink(connection);
|
||||
}
|
||||
}
|
||||
|
||||
public static class UniNodeWorld {
|
||||
|
||||
public HashMap<Pair<BlockPos, INetworkProvider>, GenNode<INetworkProvider>> nodes = new HashMap();
|
||||
public HashMap<Pair<BlockPos, INetworkProvider>, GenNode> nodes = new HashMap();
|
||||
|
||||
/** Adds a node at all its positions to the nodespace */
|
||||
public void pushNode(GenNode node) {
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
package com.hbm.uninos.networkproviders;
|
||||
|
||||
import com.hbm.uninos.INetworkProvider;
|
||||
import com.hbm.uninos.INodeNet;
|
||||
import com.hbm.uninos.networks.PowerNetwork;
|
||||
|
||||
public class PowerProvider implements INetworkProvider {
|
||||
import api.hbm.energymk2.PowerNetMK2;
|
||||
|
||||
public class PowerProvider implements INetworkProvider<PowerNetMK2> {
|
||||
|
||||
@Override
|
||||
public INodeNet<PowerProvider> provideNetwork() {
|
||||
return new PowerNetwork();
|
||||
public PowerNetMK2 provideNetwork() {
|
||||
return new PowerNetMK2();
|
||||
}
|
||||
}
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
package com.hbm.uninos.networks;
|
||||
|
||||
import com.hbm.uninos.INodeNet;
|
||||
|
||||
public class PowerNetwork implements INodeNet {
|
||||
|
||||
@Override
|
||||
public boolean isValid() {
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void destroy() {
|
||||
|
||||
}
|
||||
}
|
||||
@ -40,25 +40,25 @@ public class NTMWorldGenerator implements IWorldGenerator {
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome);
|
||||
start = d -> new MapGenNTMFeatures.Start(d.getW(), d.getX(), d.getY(), d.getZ());
|
||||
spawnWeight = 14;
|
||||
spawnWeight = 14 * 4;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !invalidBiomes.contains(biome);
|
||||
start = d -> new BunkerStart(d.getW(), d.getX(), d.getY(), d.getZ());
|
||||
spawnWeight = 1;
|
||||
spawnWeight = 1 * 4;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !biome.canSpawnLightningBolt() && biome.temperature >= 2F;
|
||||
structure = new JigsawPiece("vertibird", StructureManager.vertibird);
|
||||
spawnWeight = 3;
|
||||
spawnWeight = 3 * 4;
|
||||
}});
|
||||
|
||||
NBTStructure.registerStructure(0, new SpawnCondition() {{
|
||||
canSpawn = biome -> !biome.canSpawnLightningBolt() && biome.temperature >= 2F;
|
||||
structure = new JigsawPiece("crashed_vertibird", StructureManager.crashed_vertibird);
|
||||
spawnWeight = 3;
|
||||
spawnWeight = 3 * 4;
|
||||
}});
|
||||
|
||||
Map<Block, BlockSelector> bricks = new HashMap<Block, BlockSelector>() {{
|
||||
|
||||
@ -46,3 +46,6 @@ public net.minecraft.client.resources.AbstractResourcePack field_110597_b # re
|
||||
|
||||
# Container
|
||||
public net.minecraft.inventory.Container * # fucking everything i hate this class
|
||||
|
||||
# GuiIngame
|
||||
public net.minecraft.client.gui.GuiIngame field_92016_l # highlightingItemStack
|
||||
@ -3887,6 +3887,10 @@ shape.wiresDense=Dichte Drähte
|
||||
|
||||
soundCategory.ntmMachines=NTM Maschinen
|
||||
|
||||
stat.ntmBullets=Schüsse gefeuert
|
||||
stat.ntmLegendary=Legendäre Gegenstände hergestellt
|
||||
stat.ntmMines=Auf Minen getreten
|
||||
|
||||
tile.absorber.name=Strahlungs-Absorber
|
||||
tile.absorber_green.name=Fortgeschrittener Strahlungs-Absorber
|
||||
tile.absorber_pink.name=Elite Strahlungs-Absorber
|
||||
@ -5110,6 +5114,7 @@ turret.on=AN
|
||||
turret.players=Spieler anzielen: %s
|
||||
|
||||
upgrade.consumption=Verbrauch %s
|
||||
upgrade.productivity=Produktivität %s
|
||||
upgrade.speed=Verarbeitungszeit %s
|
||||
|
||||
wavelengths.name.ir=Infrarot
|
||||
|
||||
@ -4862,7 +4862,7 @@ pa.crash_derail.desc=The particle has left the accelerator.$Ensure no parts are
|
||||
pa.crash_cannot_enter=Denied!
|
||||
pa.crash_cannot_enter.desc=The particle tried to enter$part of the accelerator, but couldn't.$Ensure all parts are oriented correctly.
|
||||
pa.crash_nocool=No cooling!
|
||||
pa.crash_nocool.desc=The particle has entered an uncooled$part of the accelerator. Ensure all cooled$parts are connected and filled$with cold perfluoroethyl.
|
||||
pa.crash_nocool.desc=The particle has entered an uncooled$part of the accelerator. Ensure all cooled$parts are connected and filled$with cold perfluoromethyl.
|
||||
pa.crash_nopower=No power!
|
||||
pa.crash_nopower.desc=The particle has entered an unpowered$part of the accelerator. Ensure all parts$receive power, and that the$power supply is sufficient.
|
||||
pa.crash_nocoil=No coils!
|
||||
@ -4970,6 +4970,10 @@ shape.wiresDense=Dense Wires
|
||||
|
||||
soundCategory.ntmMachines=NTM Machines
|
||||
|
||||
stat.ntmBullets=Rounds Fired
|
||||
stat.ntmLegendary=Legendary Items Created
|
||||
stat.ntmMines=Mines Stepped on
|
||||
|
||||
tile.absorber.name=Radiation Absorber
|
||||
tile.absorber_green.name=Advanced Radiation Absorber
|
||||
tile.absorber_pink.name=Elite Radiation Absorber
|
||||
@ -5882,7 +5886,7 @@ tile.pa_beamline.desc=Optional part, connects different accelerator parts.$Also
|
||||
tile.pa_detector.name=Particle Detector
|
||||
tile.pa_detector.desc=Requires cooling!$Accepts particles and performs the recipe.$Recipes may require containers (particle capsules).$Particle needs a defocus of 0 to be accepted.
|
||||
tile.pa_dipole.name=Dipole Magnets
|
||||
tile.pa_dipole.desc=Requires cooling!$Redirects particles based on momentum.$Has outputs for below threshold,$above threshold and above threshold$with restone applied.$Requires large coils to work.
|
||||
tile.pa_dipole.desc=Requires cooling!$Redirects particles based on momentum.$Has outputs for below threshold,$above threshold and above threshold$with redstone applied.$Requires large coils to work.
|
||||
tile.pa_quadrupole.name=Quadrupole Magnets
|
||||
tile.pa_quadrupole.desc=Requires cooling!$Reduces particle defocus by 100 points.$Requires large coils to work.
|
||||
tile.pa_rfc.name=RF Cavity
|
||||
@ -6276,6 +6280,7 @@ upgrade.delay=Process time %s
|
||||
upgrade.efficiency=Efficiency %s
|
||||
upgrade.fortune=Fortune %s
|
||||
upgrade.overheatChance=Overheat chance %s
|
||||
upgrade.productivity=Productivity %s
|
||||
upgrade.range=Range %s
|
||||
|
||||
upgrade.gui.title=§lAcceptable Upgrades:§r
|
||||
|
||||
@ -6171,7 +6171,7 @@ pa.idle.desc=空闲
|
||||
pa.running.desc=正在运行
|
||||
pa.success.desc=成功
|
||||
pa.pause_unloaded.desc=粒子进入了未加载的区块。$在粒子与粒子源均被加载前,运行将暂停。
|
||||
pa.crash_defocus.desc=粒子失去焦距。$请确保加速器含有足够数量的四极磁铁。
|
||||
pa.crash_defocus.desc=粒子失焦。$请确保加速器含有足够数量的四极磁铁。
|
||||
pa.crash_derail.desc=粒子离开加速器。$请确保加速器未缺失部件,$且所有双极磁铁均正确配置。
|
||||
pa.crash_cannot_enter.desc=粒子尝试进入加速器某部件时失败。$请确保所有部件朝向正确。
|
||||
pa.crash_nocool.desc=粒子进入了未冷却的加速器部件。$请确保所有需冷却的部件正常连接,且内部含有冷四氟甲烷。
|
||||
@ -6184,3 +6184,16 @@ tile.pa_dipole.desc=需要冷却!$根据粒子动量使其转向$具有“低
|
||||
tile.pa_quadrupole.desc=需要冷却!$使粒子失焦程度减少100$需要大型线圈才能工作
|
||||
tile.pa_rfc.desc=需要冷却!$使粒子动量增加100,并使粒子失焦程度增加100$粒子失焦程度到达1000时会坍毁
|
||||
tile.pa_source.desc=需要冷却!$使用两个物品来创造一个粒子
|
||||
item.ammo_secret.p35_800.name=.35-800 V9
|
||||
item.bobmazon.name=Bobmazon
|
||||
item.gun_aberrator.name=离散者
|
||||
item.gun_aberrator_eott.name=暴风之眼
|
||||
pa.crash_norecipe=没有配方!
|
||||
pa.crash_norecipe.desc=粒子进入了检测器,但输入的粒子不与任何配方匹配。$请确保向粒子源输入的粒子符合正确的配方。
|
||||
pa.crash_underspeed=粒子速度过低!
|
||||
pa.crash_underspeed.desc=粒子进入了检测器,但其速度不足以进行此配方。$请确保加速器已为该配方正确配置。
|
||||
tile.deco_loot.name=战利品堆
|
||||
tile.refueler.name=燃料装填站
|
||||
tile.wand_air.name=结构魔杖方块(空气)
|
||||
tile.wand_loot.name=结构魔杖方块(战利品)
|
||||
tile.wand_jigsaw.name=结构魔杖方块(拼图)
|
||||
|
||||
4915
src/main/resources/assets/hbm/models/machines/oilburner_hp.obj
Normal file
7272
src/main/resources/assets/hbm/models/weapons/mas36.obj
Normal file
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 2.4 KiB |
|
After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 1.6 KiB |
|
After Width: | Height: | Size: 6.0 KiB |
|
After Width: | Height: | Size: 211 B |
|
After Width: | Height: | Size: 1.7 KiB |