mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
the escape plan
This commit is contained in:
parent
bc3e643f97
commit
a074a4a249
@ -6,6 +6,7 @@
|
||||
* Standard coolant will be removed soon in favor of perfloromethyl, however for now it continues to function just the same
|
||||
# Particle accelerator
|
||||
* A new and improved version of the old one
|
||||
* Still a work in progress, the recipes will likely not work, the parts have no recipes and the coil balancing is still not done
|
||||
* Instead of being assembled block by block with weird rules, the new PA is assembled from six different machine parts, similar to how RBMKs work
|
||||
* Ammo casing bag
|
||||
* Can be carried around in the inventory, will fill with empty casings when guns are fired
|
||||
@ -43,6 +44,7 @@
|
||||
* This means there is no more ambiguity in the NEI handler over what item smelts into what
|
||||
* As a consequence, the arc furnace's recipe generator no longer accepts wildcard meta, in practice this likely doesn't matter since ores and ingots generally don't use wildcard recipes anyway
|
||||
* Recipe lookups should be a tad faster due to a type change
|
||||
* Foundry outlets will no longer pour material into a channel if any connected channel contains a different material. This means that it's not much harder to clog foundry channels with different materials, as the output (e.g. a crucible) will wait until the channel is clear before the next type of metal is being poured
|
||||
|
||||
## Fixed
|
||||
* Fixed incorrect tooltip in the automatic control rod's GUI
|
||||
@ -58,4 +60,4 @@
|
||||
* Hotkey shortcuts may return, but this requires a substantial rewrite of the container base code because vanilla's implementation is atrocious
|
||||
* Fixed legendary crafting causing disconnects on servers
|
||||
* Fixed a dupe caused by shift clicking
|
||||
* Added more safeguards and range checks to ReaSim water calculation which might fix the issue of ReaSim water breaking completely
|
||||
* Added more safeguards and range checks to ReaSim water calculation which might fix the issue of ReaSim water breaking completely
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
mod_version=1.0.27
|
||||
# Empty build number makes a release type
|
||||
mod_build_number=5209
|
||||
mod_build_number=5224
|
||||
|
||||
credits=HbMinecraft,\
|
||||
\ rodolphito (explosion algorithms),\
|
||||
|
||||
@ -58,6 +58,7 @@ public class GUIPADetector extends GuiInfoContainer {
|
||||
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 8, 8, 8);
|
||||
if(source.power >= source.usage) drawTexturedModalRect(guiLeft + 44, guiTop + 43, 176, 8, 8, 8);
|
||||
|
||||
source.tanks[0].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
source.tanks[1].renderTank(guiLeft + 152, guiTop + 88, this.zLevel, 16, 52);
|
||||
|
||||
@ -117,6 +117,7 @@ public class GUIPADipole extends GuiInfoContainer {
|
||||
int heat = (int) Math.ceil(dipole.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 93, guiTop + 54, 176, 8, 8, 8);
|
||||
if(dipole.slots[1] != null && dipole.slots[1].getItem() == ModItems.pa_coil) drawTexturedModalRect(guiLeft + 103, guiTop + 54, 176, 8, 8, 8);
|
||||
if(dipole.power >= dipole.usage) drawTexturedModalRect(guiLeft + 83, guiTop + 54, 176, 8, 8, 8);
|
||||
|
||||
GL11.glPushMatrix();
|
||||
GL11.glDisable(GL11.GL_TEXTURE_2D);
|
||||
|
||||
@ -60,6 +60,7 @@ public class GUIPAQuadrupole extends GuiInfoContainer {
|
||||
int heat = (int) Math.ceil(quadrupole.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 75, guiTop + 64, 176, 8, 8, 8);
|
||||
if(quadrupole.slots[1] != null && quadrupole.slots[1].getItem() == ModItems.pa_coil) drawTexturedModalRect(guiLeft + 85, guiTop + 64, 176, 8, 8, 8);
|
||||
if(quadrupole.power >= quadrupole.usage) drawTexturedModalRect(guiLeft + 65, guiTop + 64, 176, 8, 8, 8);
|
||||
|
||||
quadrupole.tanks[0].renderTank(guiLeft + 116, guiTop + 88, this.zLevel, 16, 52);
|
||||
quadrupole.tanks[1].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package com.hbm.inventory.gui;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
|
||||
import com.hbm.inventory.container.ContainerPASource;
|
||||
@ -36,6 +38,9 @@ public class GUIPASource extends GuiInfoContainer {
|
||||
source.tanks[0].renderTankInfo(this, mouseX, mouseY, guiLeft + 134, guiTop + 36, 16, 52);
|
||||
source.tanks[1].renderTankInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 36, 16, 52);
|
||||
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 18, 16, 52, source.power, source.getMaxPower());
|
||||
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 105, guiTop + 18, 10, 10, mouseX, mouseY, "Last momentum: " + source.lastSpeed);
|
||||
this.drawCustomInfoStat(mouseX, mouseY, guiLeft + 105, guiTop + 30, 10, 10, mouseX, mouseY, EnumChatFormatting.RED + "Cancel operation");
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -61,6 +66,9 @@ public class GUIPASource extends GuiInfoContainer {
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
String label = (heat > 123 ? EnumChatFormatting.RED : EnumChatFormatting.AQUA) + "" + heat + "K";
|
||||
this.fontRendererObj.drawString(label, 166 - this.fontRendererObj.getStringWidth(label), 12, 4210752);
|
||||
|
||||
String state = I18n.format("pa." + this.source.state.name().toLowerCase(Locale.US));
|
||||
this.fontRendererObj.drawString(state, 79 - this.fontRendererObj.getStringWidth(state) / 2, 76, this.source.state.color);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -74,6 +82,16 @@ public class GUIPASource extends GuiInfoContainer {
|
||||
|
||||
int heat = (int) Math.ceil(source.temperature);
|
||||
if(heat <= 123) drawTexturedModalRect(guiLeft + 44, guiTop + 18, 176, 8, 8, 8);
|
||||
if(source.power >= source.usage) drawTexturedModalRect(guiLeft + 44, guiTop + 43, 176, 8, 8, 8);
|
||||
|
||||
int color = source.state.color;
|
||||
float red = (color & 0xff0000) >> 16;
|
||||
float green = (color & 0x00ff00) >> 8;
|
||||
float blue = (color & 0x0000ff);
|
||||
|
||||
GL11.glColor4f(red, green, blue, 1.0F);
|
||||
drawTexturedModalRect(guiLeft + 45, guiTop + 73, 176, 52, 68, 14);
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
|
||||
source.tanks[0].renderTank(guiLeft + 134, guiTop + 88, this.zLevel, 16, 52);
|
||||
source.tanks[1].renderTank(guiLeft + 152, guiTop + 88, this.zLevel, 16, 52);
|
||||
|
||||
@ -12,6 +12,7 @@ import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||
import com.hbm.inventory.recipes.loader.SerializableRecipe;
|
||||
import com.hbm.items.ModItems;
|
||||
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.init.Items;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
@ -92,6 +93,13 @@ public class ParticleAcceleratorRecipes extends SerializableRecipe {
|
||||
new ItemStack(ModItems.nugget),
|
||||
new ItemStack(ModItems.nugget)
|
||||
));
|
||||
recipes.add(new ParticleAcceleratorRecipe(
|
||||
new ComparableStack(Blocks.sand),
|
||||
new ComparableStack(Blocks.sand),
|
||||
10,
|
||||
new ItemStack(ModItems.static_sandwich),
|
||||
new ItemStack(ModItems.static_sandwich)
|
||||
));
|
||||
}
|
||||
|
||||
public ParticleAcceleratorRecipe getOutput(ItemStack input1, ItemStack input2, int momentum) {
|
||||
|
||||
@ -74,6 +74,7 @@ public abstract class SerializableRecipe {
|
||||
recipeHandlers.add(new ArcWelderRecipes());
|
||||
recipeHandlers.add(new RotaryFurnaceRecipes());
|
||||
recipeHandlers.add(new ExposureChamberRecipes());
|
||||
recipeHandlers.add(new ParticleAcceleratorRecipes());
|
||||
recipeHandlers.add(new AmmoPressRecipes());
|
||||
recipeHandlers.add(new AssemblerRecipes());
|
||||
//AFTER Assembler
|
||||
|
||||
@ -1,6 +1,12 @@
|
||||
package com.hbm.items.machine;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.hbm.items.ItemEnumMulti;
|
||||
import com.hbm.util.EnumUtil;
|
||||
|
||||
import net.minecraft.entity.player.EntityPlayer;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
||||
public class ItemPACoil extends ItemEnumMulti {
|
||||
|
||||
@ -10,9 +16,9 @@ public class ItemPACoil extends ItemEnumMulti {
|
||||
}
|
||||
|
||||
public static enum EnumCoilType {
|
||||
GOLD(0, 10_000, 0, 10_000, 0.01D),
|
||||
NIOBIUM(5_000, 100_000, 5_000, 100_000, 0.001D),
|
||||
BSCCO(50_000, 500_000, 50_000, 500_000, 0.00025D);
|
||||
GOLD(0, 10_000, 0, 10_000, 0.99D),
|
||||
NIOBIUM(5_000, 100_000, 5_000, 100_000, 0.999D),
|
||||
BSCCO(50_000, 500_000, 50_000, 500_000, 0.99975D);
|
||||
|
||||
public int quadMin;
|
||||
public int quadMax;
|
||||
@ -28,4 +34,12 @@ public class ItemPACoil extends ItemEnumMulti {
|
||||
this.diMult = diMult;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||
EnumCoilType type = EnumUtil.grabEnumSafely(theEnum, stack.getItemDamage());
|
||||
list.add("Quadrupole operational range: " + type.quadMin + " - " + type.quadMax);
|
||||
list.add("Dipole operational range: " + type.diMin + " - " + type.diMax);
|
||||
list.add("Dipole momentum multiplier: x" + type.diMult);
|
||||
}
|
||||
}
|
||||
|
||||
@ -75,7 +75,7 @@ public class ItemCasingBag extends Item implements IGUIProvider {
|
||||
int am = Math.min(toAdd.stackSize, slot.getMaxStackSize() - slot.stackSize);
|
||||
toAdd.stackSize -= am;
|
||||
slot.stackSize += am;
|
||||
didSomething = true;
|
||||
if(am > 0) didSomething = true;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,10 +88,9 @@ public class ItemCasingBag extends Item implements IGUIProvider {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
bag.stackTagCompound.setFloat(name, bag.stackTagCompound.getFloat(name) - 1F);
|
||||
|
||||
if(didSomething) {
|
||||
bag.stackTagCompound.setFloat(name, bag.stackTagCompound.getFloat(name) - 1F);
|
||||
ret = true;
|
||||
} else {
|
||||
break;
|
||||
|
||||
@ -110,13 +110,13 @@ public class XFactoryFlamer {
|
||||
}
|
||||
|
||||
public static void init() {
|
||||
flame_diesel = new BulletConfig().setItem(EnumAmmo.FLAME_DIESEL).setCasing(new ItemStack(ModItems.plate_steel, 2), 1).setupDamageClass(DamageClass.FIRE).setLife(100).setVel(1F).setGrav(0.02D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
flame_diesel = new BulletConfig().setItem(EnumAmmo.FLAME_DIESEL).setCasing(new ItemStack(ModItems.plate_steel, 2), 500).setupDamageClass(DamageClass.FIRE).setLife(100).setVel(1F).setGrav(0.02D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
.setOnUpdate(LAMBDA_FIRE).setOnRicochet(LAMBDA_LINGER_DIESEL);
|
||||
flame_gas = new BulletConfig().setItem(EnumAmmo.FLAME_GAS).setCasing(new ItemStack(ModItems.plate_steel, 2), 1).setupDamageClass(DamageClass.FIRE).setLife(10).setSpread(0.05F).setVel(1F).setGrav(0.0D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
flame_gas = new BulletConfig().setItem(EnumAmmo.FLAME_GAS).setCasing(new ItemStack(ModItems.plate_steel, 2), 500).setupDamageClass(DamageClass.FIRE).setLife(10).setSpread(0.05F).setVel(1F).setGrav(0.0D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
.setOnUpdate(LAMBDA_FIRE).setOnRicochet(LAMBDA_LINGER_GAS);
|
||||
flame_napalm = new BulletConfig().setItem(EnumAmmo.FLAME_NAPALM).setCasing(new ItemStack(ModItems.plate_steel, 2), 1).setupDamageClass(DamageClass.FIRE).setLife(200).setVel(1F).setGrav(0.02D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
flame_napalm = new BulletConfig().setItem(EnumAmmo.FLAME_NAPALM).setCasing(new ItemStack(ModItems.plate_steel, 2), 500).setupDamageClass(DamageClass.FIRE).setLife(200).setVel(1F).setGrav(0.02D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
.setOnUpdate(LAMBDA_FIRE).setOnRicochet(LAMBDA_LINGER_NAPALM);
|
||||
flame_balefire = new BulletConfig().setItem(EnumAmmo.FLAME_BALEFIRE).setCasing(new ItemStack(ModItems.plate_steel, 2), 1).setupDamageClass(DamageClass.FIRE).setLife(200).setVel(1F).setGrav(0.02D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
flame_balefire = new BulletConfig().setItem(EnumAmmo.FLAME_BALEFIRE).setCasing(new ItemStack(ModItems.plate_steel, 2), 500).setupDamageClass(DamageClass.FIRE).setLife(200).setVel(1F).setGrav(0.02D).setReloadCount(500).setSelfDamageDelay(20).setKnockback(0F)
|
||||
.setOnUpdate(LAMBDA_BALEFIRE).setOnRicochet(LAMBDA_LINGER_BALEFIRE);
|
||||
|
||||
flame_nograv = flame_diesel.clone().setGrav(0);
|
||||
|
||||
@ -28,7 +28,7 @@ public interface IMagazine<T> {
|
||||
public int getAmount(ItemStack stack, IInventory inventory);
|
||||
/** Sets the mag's ammo level */
|
||||
public void setAmount(ItemStack stack, int amount);
|
||||
/** removes the specified amount fro mthe magazine */
|
||||
/** removes the specified amount from the magazine */
|
||||
public void useUpAmmo(ItemStack stack, IInventory inventory, int amount);
|
||||
/** If a reload can even be initiated, i.e. the player even has bullets to load, inventory can be null */
|
||||
public boolean canReload(ItemStack stack, IInventory inventory);
|
||||
@ -53,9 +53,8 @@ public interface IMagazine<T> {
|
||||
public static void handleAmmoBag(IInventory inventory, BulletConfig config, int shotsFired) {
|
||||
if(config.casingItem != null && config.casingAmount > 0 && inventory instanceof InventoryPlayer) {
|
||||
InventoryPlayer inv = (InventoryPlayer) inventory;
|
||||
EntityPlayer player = inv.player;
|
||||
for(ItemStack stack : inv.mainInventory) {
|
||||
if(stack != null && stack.getItem() == ModItems.casing_bag && ItemCasingBag.pushCasing(stack, config.casingItem, 1F / config.casingAmount * 0.5F)) return;
|
||||
if(stack != null && stack.getItem() == ModItems.casing_bag && ItemCasingBag.pushCasing(stack, config.casingItem, 1F / config.casingAmount * 0.5F * shotsFired)) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -40,6 +40,7 @@ public class MagazineBelt implements IMagazine<BulletConfig> {
|
||||
amount -= toRemove;
|
||||
inventory.decrStackSize(i, toRemove);
|
||||
IMagazine.handleAmmoBag(inventory, first, toRemove);
|
||||
if(amount <= 0) return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 (5209)";
|
||||
public static final String VERSION = "1.0.27 BETA (5224)";
|
||||
//HBM's Beta Naming Convention:
|
||||
//V T (X)
|
||||
//V -> next release version
|
||||
|
||||
@ -1323,8 +1323,8 @@ public class ModEventHandler {
|
||||
public void onClickSign(PlayerInteractEvent event) {
|
||||
|
||||
int x = event.x;
|
||||
int y = event.y;
|
||||
int z = event.z;
|
||||
int y = event.z;
|
||||
int z = event.y;
|
||||
World world = event.world;
|
||||
|
||||
if(!world.isRemote && event.action == Action.RIGHT_CLICK_BLOCK && world.getTileEntity(x, y, z) instanceof TileEntitySign) {
|
||||
|
||||
@ -27,8 +27,8 @@ public abstract class TileEntityCooledBase extends TileEntityMachineBase impleme
|
||||
public TileEntityCooledBase(int slotCount) {
|
||||
super(slotCount);
|
||||
tanks = new FluidTank[2];
|
||||
tanks[0] = new FluidTank(Fluids.PERFLUOROMETHYL_COLD, 16_000);
|
||||
tanks[1] = new FluidTank(Fluids.PERFLUOROMETHYL, 16_000);
|
||||
tanks[0] = new FluidTank(Fluids.PERFLUOROMETHYL_COLD, 4_000);
|
||||
tanks[1] = new FluidTank(Fluids.PERFLUOROMETHYL, 4_000);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -5,6 +5,7 @@ import com.hbm.inventory.gui.GUIPADetector;
|
||||
import com.hbm.inventory.recipes.ParticleAcceleratorRecipes;
|
||||
import com.hbm.inventory.recipes.ParticleAcceleratorRecipes.ParticleAcceleratorRecipe;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.PAState;
|
||||
import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||
@ -19,6 +20,8 @@ import net.minecraft.world.World;
|
||||
import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPADetector extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
||||
|
||||
public static final long usage = 100_000;
|
||||
|
||||
public TileEntityPADetector() {
|
||||
super(5);
|
||||
@ -44,7 +47,7 @@ public class TileEntityPADetector extends TileEntityCooledBase implements IGUIPr
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 10_000_000;
|
||||
return 1_000_000;
|
||||
}
|
||||
|
||||
AxisAlignedBB bb = null;
|
||||
@ -93,8 +96,10 @@ public class TileEntityPADetector extends TileEntityCooledBase implements IGUIPr
|
||||
public void onEnter(Particle particle, ForgeDirection dir) {
|
||||
particle.invalid = true;
|
||||
//particle will crash if not perfectly focused
|
||||
if(particle.defocus > 0) return;
|
||||
|
||||
if(particle.defocus > 0) { particle.crash(PAState.CRASH_DEFOCUS); return; }
|
||||
if(this.power < this.usage) { particle.crash(PAState.CRASH_NOPOWER); return; }
|
||||
if(!isCool()) { particle.crash(PAState.CRASH_NOCOOL); return; }
|
||||
|
||||
for(ParticleAcceleratorRecipe recipe : ParticleAcceleratorRecipes.recipes) {
|
||||
|
||||
if(particle.momentum >= recipe.momentum &&
|
||||
@ -116,6 +121,7 @@ public class TileEntityPADetector extends TileEntityCooledBase implements IGUIPr
|
||||
slots[4].stackSize += recipe.output2.stackSize;
|
||||
}
|
||||
}
|
||||
particle.crash(PAState.SUCCESS);
|
||||
return;
|
||||
}
|
||||
}
|
||||
@ -131,8 +137,8 @@ public class TileEntityPADetector extends TileEntityCooledBase implements IGUIPr
|
||||
//cancel if: output item does not match, meta does not match, resulting stacksize exceeds stack limit
|
||||
if(slots[outputSlot].getItem() != output.getItem() || slots[outputSlot].getItemDamage() != output.getItemDamage() || slots[outputSlot].stackSize + output.stackSize > output.getMaxStackSize()) return false;
|
||||
}
|
||||
if(slots[outputSlot].getItem().hasContainerItem(slots[outputSlot])) {
|
||||
ItemStack container = slots[outputSlot].getItem().getContainerItem(slots[outputSlot]);
|
||||
if(output.getItem().hasContainerItem(output)) {
|
||||
ItemStack container = output.getItem().getContainerItem(output);
|
||||
//cancel if: container slot is empty, container item does not match, meta does not match
|
||||
if(slots[containerSlot] == null || slots[containerSlot].getItem() != container.getItem() || slots[containerSlot].getItemDamage() != container.getItemDamage()) return false;
|
||||
}
|
||||
|
||||
@ -32,7 +32,7 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
||||
public int dirRedstone;
|
||||
public int threshold;
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public static final long usage = 100_000;
|
||||
|
||||
public TileEntityPADipole() {
|
||||
super(2);
|
||||
@ -40,7 +40,7 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 10_000_000;
|
||||
return 1_000_000;
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -79,7 +79,8 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
||||
if(type != null && type.diMax < particle.momentum) particle.crash(PAState.CRASH_OVERSPEED);
|
||||
|
||||
if(particle.invalid) return;
|
||||
|
||||
|
||||
particle.momentum *= type.diMult;
|
||||
this.power -= this.usage * mult;
|
||||
}
|
||||
|
||||
|
||||
@ -22,7 +22,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public static final long usage = 100_000;
|
||||
public static final int focusGain = 100;
|
||||
|
||||
public TileEntityPAQuadrupole() {
|
||||
@ -31,7 +31,7 @@ public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUI
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 10_000_000;
|
||||
return 1_000_000;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -19,7 +19,7 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public static final long usage = 100_000;
|
||||
public static final int momentumGain = 100;
|
||||
public static final int defocusGain = 100;
|
||||
|
||||
@ -29,7 +29,7 @@ public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvide
|
||||
|
||||
@Override
|
||||
public long getMaxPower() {
|
||||
return 10_000_000;
|
||||
return 1_000_000;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@ -5,7 +5,6 @@ import com.hbm.interfaces.IControlReceiver;
|
||||
import com.hbm.inventory.container.ContainerPASource;
|
||||
import com.hbm.inventory.gui.GUIPASource;
|
||||
import com.hbm.lib.Library;
|
||||
import com.hbm.particle.helper.ExplosionSmallCreator;
|
||||
import com.hbm.tileentity.IConditionalInvAccess;
|
||||
import com.hbm.tileentity.IGUIProvider;
|
||||
import com.hbm.util.EnumUtil;
|
||||
@ -27,23 +26,32 @@ import net.minecraftforge.common.util.ForgeDirection;
|
||||
|
||||
public class TileEntityPASource extends TileEntityCooledBase implements IGUIProvider, IConditionalInvAccess, IControlReceiver {
|
||||
|
||||
public static final long usage = 1_000_000;
|
||||
public static final long usage = 100_000;
|
||||
public Particle particle;
|
||||
public PAState state;
|
||||
public PAState state = PAState.IDLE;
|
||||
|
||||
public int lastSpeed;
|
||||
|
||||
public int debugSpeed;
|
||||
|
||||
public static enum PAState {
|
||||
IDLE, //no particle active
|
||||
RUNNING, //running without further issue
|
||||
PAUSE_UNLOADED, //particle suspended because it entered unloaded chunks
|
||||
CRASH_DEFOCUS, //crash from excessive defocus
|
||||
CRASH_DERAIL, //crash due to leaving the beamline
|
||||
CRASH_CANNOT_ENTER, //crash due to hitting PA component from invalid side
|
||||
CRASH_NOCOOL, //crash due to lack of cooling
|
||||
CRASH_NOPOWER, //crash due to power outage
|
||||
CRASH_NOCOIL, //crash due to no coil installed (QP, DP)
|
||||
CRASH_OVERSPEED //crash due to coil max speed exceeded (QP, DP)
|
||||
IDLE(0x8080ff), //no particle active
|
||||
RUNNING(0xffff00), //running without further issue
|
||||
SUCCESS(0x00ff00), //completed recipe
|
||||
PAUSE_UNLOADED(0x808080), //particle suspended because it entered unloaded chunks
|
||||
CRASH_DEFOCUS(0xff0000), //crash from excessive defocus
|
||||
CRASH_DERAIL(0xff0000), //crash due to leaving the beamline
|
||||
CRASH_CANNOT_ENTER(0xff0000), //crash due to hitting PA component from invalid side
|
||||
CRASH_NOCOOL(0xff0000), //crash due to lack of cooling
|
||||
CRASH_NOPOWER(0xff0000), //crash due to power outage
|
||||
CRASH_NOCOIL(0xff0000), //crash due to no coil installed (QP, DP)
|
||||
CRASH_OVERSPEED(0xff0000); //crash due to coil max speed exceeded (QP, DP)
|
||||
|
||||
public int color;
|
||||
|
||||
private PAState(int color) {
|
||||
this.color = color;
|
||||
}
|
||||
}
|
||||
|
||||
public void updateState(PAState state) { this.state = state; }
|
||||
@ -61,12 +69,16 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
if(!worldObj.isRemote) {
|
||||
this.power = Library.chargeTEFromItems(slots, 0, power, this.getMaxPower());
|
||||
|
||||
if(particle != null) {
|
||||
steppy();
|
||||
this.debugSpeed = particle.momentum;
|
||||
if(particle.invalid) this.particle = null;
|
||||
} else if(this.power >= this.usage && slots[1] != null && slots[2] != null) {
|
||||
tryRun();
|
||||
for(int i = 0; i < 10; i++) {
|
||||
if(particle != null) {
|
||||
this.state = PAState.RUNNING;
|
||||
steppy();
|
||||
this.debugSpeed = particle.momentum;
|
||||
if(particle.invalid) this.particle = null;
|
||||
} else if(this.power >= this.usage && slots[1] != null && slots[2] != null) {
|
||||
tryRun();
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -74,8 +86,8 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
}
|
||||
|
||||
public void steppy() {
|
||||
if(!worldObj.getChunkProvider().chunkExists(particle.x >> 4, particle.z >> 4)) return; //halt if we reach unloaded areas
|
||||
ExplosionSmallCreator.composeEffect(worldObj, particle.x + 0.5, particle.y + 0.5, particle.z + 0.5, 10, 1, 1);
|
||||
if(!worldObj.getChunkProvider().chunkExists(particle.x >> 4, particle.z >> 4)) { this.state = PAState.PAUSE_UNLOADED; return; } //halt if we reach unloaded areas
|
||||
//ExplosionSmallCreator.composeEffect(worldObj, particle.x + 0.5, particle.y + 0.5, particle.z + 0.5, 10, 1, 1);
|
||||
|
||||
Block b = worldObj.getBlock(particle.x, particle.y, particle.z);
|
||||
if(b instanceof BlockDummyable) {
|
||||
@ -88,7 +100,7 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
pa.onEnter(particle, particle.dir);
|
||||
BlockPos exit = pa.getExitPos(particle);
|
||||
if(exit != null) particle.move(exit);
|
||||
} else { particle.crash(PAState.CRASH_CANNOT_ENTER); worldObj.createExplosion(null, particle.x + 0.5, particle.y + 0.5, particle.z + 0.5, 5, false); return; }
|
||||
} else { particle.crash(PAState.CRASH_CANNOT_ENTER); return; }
|
||||
} else {
|
||||
particle.crash(PAState.CRASH_DERAIL);
|
||||
}
|
||||
@ -97,10 +109,13 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
public void tryRun() {
|
||||
if(slots[1].getItem().hasContainerItem(slots[1]) && slots[3] != null) return;
|
||||
if(slots[2].getItem().hasContainerItem(slots[2]) && slots[4] != null) return;
|
||||
|
||||
if(slots[1].getItem().hasContainerItem(slots[1])) slots[3] = slots[1].getItem().getContainerItem(slots[1]).copy();
|
||||
if(slots[2].getItem().hasContainerItem(slots[2])) slots[4] = slots[2].getItem().getContainerItem(slots[2]).copy();
|
||||
|
||||
this.power -= usage;
|
||||
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||
ForgeDirection rot = dir.getRotation(ForgeDirection.DOWN);
|
||||
this.particle = new Particle(this, xCoord + rot.offsetX * 5, yCoord, zCoord + rot.offsetZ * 5, rot, slots[1], slots[2]);
|
||||
this.slots[1] = null;
|
||||
this.slots[2] = null;
|
||||
@ -112,6 +127,7 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
super.serialize(buf);
|
||||
buf.writeInt(debugSpeed);
|
||||
buf.writeByte((byte) this.state.ordinal());
|
||||
buf.writeInt(particle != null ? particle.momentum : 0);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -119,6 +135,10 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
super.deserialize(buf);
|
||||
debugSpeed = buf.readInt();
|
||||
state = EnumUtil.grabEnumSafely(PAState.class, buf.readByte());
|
||||
int lastSpeed = buf.readInt();
|
||||
if(lastSpeed != 0) {
|
||||
this.lastSpeed = lastSpeed;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -208,7 +228,10 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
||||
|
||||
@Override
|
||||
public void receiveControl(NBTTagCompound data) {
|
||||
if(data.hasKey("cancel")) this.particle = null;
|
||||
if(data.hasKey("cancel")) {
|
||||
this.particle = null;
|
||||
this.state = PAState.IDLE;
|
||||
}
|
||||
}
|
||||
|
||||
public static class Particle {
|
||||
|
||||
@ -3786,6 +3786,9 @@ item.ore_separated.name=Separated %s Ore
|
||||
item.overfuse.name=Singularity Screwdriver
|
||||
item.overfuse.desc=Say what?
|
||||
item.oxy_mask.name=Oxygen Mask
|
||||
item.pa_coil.bscco.name=Large BSCCO Coil
|
||||
item.pa_coil.gold.name=Large Gold Coil
|
||||
item.pa_coil.niobium.name=Large NbTi Coil
|
||||
item.paa_boots.name=PaA "good ol' shoes"
|
||||
item.paa_legs.name=PaA Leg Reinforcements
|
||||
item.paa_plate.name=PaA Chest Protection Plate
|
||||
@ -4828,6 +4831,18 @@ itemGroup.tabTemplate=NTM Templates
|
||||
itemGroup.tabTest=Nuclear Tech Mod Test Tab
|
||||
itemGroup.tabWeapon=NTM Weapons and Turrets
|
||||
|
||||
pa.idle=Idle
|
||||
pa.running=Running
|
||||
pa.success=Success
|
||||
pa.pause_unloaded=Paused
|
||||
pa.crash_defocus=Defocus!
|
||||
pa.crash_derail=Derail!
|
||||
pa.crash_cannot_enter=Denied!
|
||||
pa.crash_nocool=No cooling!
|
||||
pa.crash_nopower=No power!
|
||||
pa.crash_nocoil=No coils!
|
||||
pa.crash_overspeed=Overspeed!
|
||||
|
||||
potion.hbm_bang=! ! !
|
||||
potion.hbm_death=Astolfization
|
||||
potion.hbm_lead=Lead Poisoning
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.7 KiB |
Loading…
x
Reference in New Issue
Block a user