mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Merge branch 'HbmMods:master' into master
This commit is contained in:
commit
99b19cd022
@ -1,2 +1,11 @@
|
|||||||
|
## Changed
|
||||||
|
* Removed a ton of unused projectile entities
|
||||||
|
* Removed the old ZOMG beams, negative energy type explosions now use DFC-like effects instead
|
||||||
|
* Removed the old multitool (it sucked)
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed ore acidizer recipe config just straight up not working with ore dictionary keys
|
* Fixed ore acidizer recipe config just straight up not working with ore dictionary keys
|
||||||
|
* Fixed logistic network nodes disabled via redstone not re-enabling when redstone is cut
|
||||||
|
* Added provisional emergency brake to drone pathfinding, pathfinding will simply fail if it goes on for too long
|
||||||
|
* Fixed ore acidizer partitioner freezing the game
|
||||||
|
* Fixed ore acidizer partitioner trash slots not being accessible via automation
|
||||||
@ -1,6 +1,6 @@
|
|||||||
mod_version=1.0.27
|
mod_version=1.0.27
|
||||||
# Empty build number makes a release type
|
# Empty build number makes a release type
|
||||||
mod_build_number=5523
|
mod_build_number=5526
|
||||||
|
|
||||||
credits=HbMinecraft,\
|
credits=HbMinecraft,\
|
||||||
\ rodolphito (explosion algorithms),\
|
\ rodolphito (explosion algorithms),\
|
||||||
|
|||||||
@ -201,8 +201,8 @@ public class CranePartitioner extends BlockContainer implements IConveyorBelt, I
|
|||||||
public int[] getAccessibleSlotsFromSide(int side) {
|
public int[] getAccessibleSlotsFromSide(int side) {
|
||||||
|
|
||||||
if(access == null) {
|
if(access == null) {
|
||||||
access = new int[SLOT_COUNT]; // writing this by hand is for chumps
|
access = new int[SLOT_COUNT * 2]; // writing this by hand is for chumps
|
||||||
for(int i = 0; i < SLOT_COUNT; i++) access[i] = i;
|
for(int i = 0; i < SLOT_COUNT * 2; i++) access[i] = i;
|
||||||
}
|
}
|
||||||
|
|
||||||
return access;
|
return access;
|
||||||
|
|||||||
@ -110,12 +110,12 @@ public abstract class NEIGenericRecipeHandler extends TemplateRecipeHandler impl
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public List<PositionedStack> getIngredients() { return getCycledIngredients(cycleticks / 20, Arrays.asList(this.input)); }
|
@Override public List<PositionedStack> getIngredients() { return getCycledIngredients(cycleticks / 20, Arrays.asList(this.input)); }
|
||||||
@Override public PositionedStack getResult() { return this.output[0]; }
|
@Override public PositionedStack getResult() { return null; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<PositionedStack> getOtherStacks() {
|
public List<PositionedStack> getOtherStacks() {
|
||||||
List<PositionedStack> other = new ArrayList();
|
List<PositionedStack> other = new ArrayList();
|
||||||
for(int i = 1; i < this.output.length; i++) other.add(this.output[i]);
|
for(int i = 0; i < this.output.length; i++) other.add(this.output[i]);
|
||||||
other.add(this.machine);
|
other.add(this.machine);
|
||||||
if(this.template != null) other.add(this.template);
|
if(this.template != null) other.add(this.template);
|
||||||
return getCycledIngredients(cycleticks / 20, other);
|
return getCycledIngredients(cycleticks / 20, other);
|
||||||
|
|||||||
13
src/main/java/com/hbm/handler/nei/PrecAssRecipeHandler.java
Normal file
13
src/main/java/com/hbm/handler/nei/PrecAssRecipeHandler.java
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package com.hbm.handler.nei;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.inventory.recipes.PrecAssRecipes;
|
||||||
|
|
||||||
|
public class PrecAssRecipeHandler extends NEIGenericRecipeHandler {
|
||||||
|
|
||||||
|
public PrecAssRecipeHandler() {
|
||||||
|
super(ModBlocks.machine_precass.getLocalizedName(), PrecAssRecipes.INSTANCE, ModBlocks.machine_precass);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public String getRecipeID() { return "ntmPrecAss"; }
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
|
import com.hbm.inventory.SlotCraftingOutput;
|
||||||
|
import com.hbm.inventory.SlotNonRetarded;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||||
|
import com.hbm.util.InventoryUtil;
|
||||||
|
|
||||||
|
import api.hbm.energymk2.IBatteryItem;
|
||||||
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.IInventory;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class ContainerMachinePrecAss extends ContainerBase {
|
||||||
|
|
||||||
|
public ContainerMachinePrecAss(InventoryPlayer invPlayer, IInventory assembler) {
|
||||||
|
super(invPlayer, assembler);
|
||||||
|
|
||||||
|
// Battery
|
||||||
|
this.addSlotToContainer(new SlotNonRetarded(assembler, 0, 152, 81));
|
||||||
|
// Schematic
|
||||||
|
this.addSlotToContainer(new SlotNonRetarded(assembler, 1, 35, 126));
|
||||||
|
// Upgrades
|
||||||
|
this.addSlots(assembler, 2, 152, 108, 2, 1);
|
||||||
|
// Input
|
||||||
|
this.addSlots(assembler, 4, 8, 27, 3, 3);
|
||||||
|
// Output
|
||||||
|
this.addOutputSlots(invPlayer.player, assembler, 13, 80, 27, 3, 3);
|
||||||
|
|
||||||
|
this.playerInv(invPlayer, 8, 174);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemStack transferStackInSlot(EntityPlayer player, int index) {
|
||||||
|
ItemStack slotOriginal = null;
|
||||||
|
Slot slot = (Slot) this.inventorySlots.get(index);
|
||||||
|
|
||||||
|
if(slot != null && slot.getHasStack()) {
|
||||||
|
ItemStack slotStack = slot.getStack();
|
||||||
|
slotOriginal = slotStack.copy();
|
||||||
|
|
||||||
|
if(index <= tile.getSizeInventory() - 1) {
|
||||||
|
SlotCraftingOutput.checkAchievements(player, slotStack);
|
||||||
|
if(!this.mergeItemStack(slotStack, tile.getSizeInventory(), this.inventorySlots.size(), true)) {
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
|
||||||
|
if(slotOriginal.getItem() instanceof IBatteryItem || slotOriginal.getItem() == ModItems.battery_creative) {
|
||||||
|
if(!this.mergeItemStack(slotStack, 0, 1, false)) return null;
|
||||||
|
} else if(slotOriginal.getItem() == ModItems.blueprints) {
|
||||||
|
if(!this.mergeItemStack(slotStack, 1, 2, false)) return null;
|
||||||
|
} else if(slotOriginal.getItem() instanceof ItemMachineUpgrade) {
|
||||||
|
if(!this.mergeItemStack(slotStack, 2, 4, false)) return null;
|
||||||
|
} else {
|
||||||
|
if(!InventoryUtil.mergeItemStack(this.inventorySlots, slotStack, 4, 22, false)) return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slotStack.stackSize == 0) {
|
||||||
|
slot.putStack(null);
|
||||||
|
} else {
|
||||||
|
slot.onSlotChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
slot.onPickupFromSlot(player, slotStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
return slotOriginal;
|
||||||
|
}
|
||||||
|
}
|
||||||
123
src/main/java/com/hbm/inventory/gui/GUIMachinePrecAss.java
Normal file
123
src/main/java/com/hbm/inventory/gui/GUIMachinePrecAss.java
Normal file
@ -0,0 +1,123 @@
|
|||||||
|
package com.hbm.inventory.gui;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.inventory.container.ContainerMachinePrecAss;
|
||||||
|
import com.hbm.inventory.recipes.PrecAssRecipes;
|
||||||
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
|
import com.hbm.items.machine.ItemBlueprints;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.tileentity.machine.TileEntityMachinePrecAss;
|
||||||
|
import com.hbm.util.i18n.I18nUtil;
|
||||||
|
|
||||||
|
import net.minecraft.client.Minecraft;
|
||||||
|
import net.minecraft.client.renderer.OpenGlHelper;
|
||||||
|
import net.minecraft.client.resources.I18n;
|
||||||
|
import net.minecraft.entity.player.InventoryPlayer;
|
||||||
|
import net.minecraft.inventory.Slot;
|
||||||
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
|
public class GUIMachinePrecAss extends GuiInfoContainer {
|
||||||
|
|
||||||
|
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/processing/gui_precass.png");
|
||||||
|
private TileEntityMachinePrecAss assembler;
|
||||||
|
|
||||||
|
public GUIMachinePrecAss(InventoryPlayer invPlayer, TileEntityMachinePrecAss tedf) {
|
||||||
|
super(new ContainerMachinePrecAss(invPlayer, tedf));
|
||||||
|
assembler = tedf;
|
||||||
|
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 256;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
|
super.drawScreen(mouseX, mouseY, f);
|
||||||
|
|
||||||
|
assembler.inputTank.renderTankInfo(this, mouseX, mouseY, guiLeft + 8, guiTop + 99, 52, 16);
|
||||||
|
assembler.outputTank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 99, 52, 16);
|
||||||
|
|
||||||
|
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 61, assembler.power, assembler.maxPower);
|
||||||
|
|
||||||
|
if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 125 < mouseY && guiTop + 125 + 18 >= mouseY) {
|
||||||
|
if(this.assembler.assemblerModule.recipe != null && PrecAssRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.assemblerModule.recipe)) {
|
||||||
|
GenericRecipe recipe = (GenericRecipe) PrecAssRecipes.INSTANCE.recipeNameMap.get(this.assembler.assemblerModule.recipe);
|
||||||
|
this.func_146283_a(recipe.print(), mouseX, mouseY);
|
||||||
|
} else {
|
||||||
|
this.drawCreativeTabHoveringText(EnumChatFormatting.YELLOW + I18nUtil.resolveKey("gui.recipe.setRecipe"), mouseX, mouseY);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void mouseClicked(int x, int y, int button) {
|
||||||
|
super.mouseClicked(x, y, button);
|
||||||
|
|
||||||
|
if(this.checkClick(x, y, 7, 125, 18, 18)) GUIScreenRecipeSelector.openSelector(PrecAssRecipes.INSTANCE, assembler, assembler.assemblerModule.recipe, 0, ItemBlueprints.grabPool(assembler.slots[1]), this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerForegroundLayer(int i, int j) {
|
||||||
|
String name = this.assembler.hasCustomInventoryName() ? this.assembler.getInventoryName() : I18n.format(this.assembler.getInventoryName());
|
||||||
|
|
||||||
|
this.fontRendererObj.drawString(name, 70 - this.fontRendererObj.getStringWidth(name) / 2, 6, 4210752);
|
||||||
|
this.fontRendererObj.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2, 4210752);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
protected void drawGuiContainerBackgroundLayer(float p_146976_1_, int p_146976_2_, int p_146976_3_) {
|
||||||
|
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
|
drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize);
|
||||||
|
|
||||||
|
int p = (int) (assembler.power * 61 / assembler.maxPower);
|
||||||
|
drawTexturedModalRect(guiLeft + 152, guiTop + 79 - p, 176, 61 - p, 16, p);
|
||||||
|
|
||||||
|
if(assembler.assemblerModule.progress > 0) {
|
||||||
|
int j = (int) Math.ceil(70 * assembler.assemblerModule.progress);
|
||||||
|
drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericRecipe recipe = PrecAssRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe);
|
||||||
|
|
||||||
|
/// LEFT LED
|
||||||
|
if(assembler.didProcess) {
|
||||||
|
drawTexturedModalRect(guiLeft + 51, guiTop + 121, 195, 0, 3, 6);
|
||||||
|
} else if(recipe != null) {
|
||||||
|
drawTexturedModalRect(guiLeft + 51, guiTop + 121, 192, 0, 3, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// RIGHT LED
|
||||||
|
if(assembler.didProcess) {
|
||||||
|
drawTexturedModalRect(guiLeft + 56, guiTop + 121, 195, 0, 3, 6);
|
||||||
|
} else if(recipe != null && assembler.power >= recipe.power) {
|
||||||
|
drawTexturedModalRect(guiLeft + 56, guiTop + 121, 192, 0, 3, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 8, 126);
|
||||||
|
|
||||||
|
if(recipe != null && recipe.inputItem != null) {
|
||||||
|
for(int i = 0; i < recipe.inputItem.length; i++) {
|
||||||
|
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(assembler.assemblerModule.inputSlots[i]);
|
||||||
|
if(!slot.getHasStack()) this.renderItem(recipe.inputItem[i].extractForCyclingDisplay(20), slot.xDisplayPosition, slot.yDisplayPosition, 10F);
|
||||||
|
}
|
||||||
|
|
||||||
|
Minecraft.getMinecraft().getTextureManager().bindTexture(texture);
|
||||||
|
OpenGlHelper.glBlendFunc(770, 771, 1, 0);
|
||||||
|
GL11.glColor4f(1F, 1F, 1F, 0.5F);
|
||||||
|
GL11.glEnable(GL11.GL_BLEND);
|
||||||
|
this.zLevel = 300F;
|
||||||
|
for(int i = 0; i < recipe.inputItem.length; i++) {
|
||||||
|
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(assembler.assemblerModule.inputSlots[i]);
|
||||||
|
if(!slot.getHasStack()) drawTexturedModalRect(guiLeft + slot.xDisplayPosition, guiTop + slot.yDisplayPosition, slot.xDisplayPosition, slot.yDisplayPosition, 16, 16);
|
||||||
|
}
|
||||||
|
this.zLevel = 0F;
|
||||||
|
GL11.glColor4f(1F, 1F, 1F, 1F);
|
||||||
|
GL11.glDisable(GL11.GL_BLEND);
|
||||||
|
}
|
||||||
|
|
||||||
|
assembler.inputTank.renderTank(guiLeft + 8, guiTop + 115, this.zLevel, 52, 16, 1);
|
||||||
|
assembler.outputTank.renderTank(guiLeft + 80, guiTop + 115, this.zLevel, 52, 16, 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
80
src/main/java/com/hbm/inventory/recipes/PrecAssRecipes.java
Normal file
80
src/main/java/com/hbm/inventory/recipes/PrecAssRecipes.java
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
package com.hbm.inventory.recipes;
|
||||||
|
|
||||||
|
import static com.hbm.inventory.OreDictManager.*;
|
||||||
|
|
||||||
|
import com.hbm.inventory.FluidStack;
|
||||||
|
import com.hbm.inventory.OreDictManager.DictFrame;
|
||||||
|
import com.hbm.inventory.RecipesCommon.ComparableStack;
|
||||||
|
import com.hbm.inventory.RecipesCommon.NBTStack;
|
||||||
|
import com.hbm.inventory.RecipesCommon.OreDictStack;
|
||||||
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
|
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
||||||
|
import com.hbm.items.BrokenItem;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
import com.hbm.items.machine.ItemCircuit.EnumCircuitType;
|
||||||
|
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
public class PrecAssRecipes extends GenericRecipes<GenericRecipe> {
|
||||||
|
|
||||||
|
public static final PrecAssRecipes INSTANCE = new PrecAssRecipes();
|
||||||
|
|
||||||
|
@Override public int inputItemLimit() { return 9; }
|
||||||
|
@Override public int inputFluidLimit() { return 1; }
|
||||||
|
@Override public int outputItemLimit() { return 9; }
|
||||||
|
@Override public int outputFluidLimit() { return 1; }
|
||||||
|
|
||||||
|
@Override public String getFileName() { return "hbmPrecisionAssembly.json"; }
|
||||||
|
@Override public GenericRecipe instantiateRecipe(String name) { return new GenericRecipe(name); }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void registerDefaults() {
|
||||||
|
|
||||||
|
registerPair(new GenericRecipe("precass.controller").setup(400, 15_000L)
|
||||||
|
.inputItems(new ComparableStack(ModItems.circuit, 32, EnumCircuitType.CHIP),
|
||||||
|
new ComparableStack(ModItems.circuit, 32, EnumCircuitType.CAPACITOR),
|
||||||
|
new ComparableStack(ModItems.circuit, 16, EnumCircuitType.CAPACITOR_TANTALIUM),
|
||||||
|
new ComparableStack(ModItems.circuit, 1, EnumCircuitType.CONTROLLER_CHASSIS),
|
||||||
|
new ComparableStack(ModItems.upgrade_speed_1),
|
||||||
|
new OreDictStack(PB.wireFine(), 16))
|
||||||
|
.inputFluids(new FluidStack(Fluids.PERFLUOROMETHYL, 1_000)),
|
||||||
|
DictFrame.fromOne(ModItems.circuit, EnumCircuitType.CONTROLLER), 10, 25);
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Registers a generic pair of faulty product and recycling of broken items. */
|
||||||
|
public void registerPair(GenericRecipe recipe, ItemStack output, int chance, int reclaim) {
|
||||||
|
recipe.outputItems(new ChanceOutputMulti(
|
||||||
|
new ChanceOutput(output, chance),
|
||||||
|
new ChanceOutput(BrokenItem.make(output), 100 - chance)
|
||||||
|
));
|
||||||
|
|
||||||
|
this.register(recipe);
|
||||||
|
|
||||||
|
float fReclaim = reclaim / 100F;
|
||||||
|
|
||||||
|
IOutput[] recycle = new IOutput[recipe.inputItem.length];
|
||||||
|
for(int i = 0; i < recycle.length; i++) {
|
||||||
|
ItemStack stack = recipe.inputItem[i].extractForNEI().get(0).copy();
|
||||||
|
int stackSize = (int) (recipe.inputItem[i].stacksize * fReclaim);
|
||||||
|
// if the resulting stack size is >= 1, use that, otherwise use the original stack size but a chance output percentage
|
||||||
|
if(stackSize > 0) {
|
||||||
|
stack.stackSize = stackSize;
|
||||||
|
recycle[i] = new ChanceOutput(stack);
|
||||||
|
} else {
|
||||||
|
recycle[i] = new ChanceOutput(stack, fReclaim);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
FluidStack[] fluid = recipe.inputFluid != null ? new FluidStack[1] : null;
|
||||||
|
if(fluid != null) {
|
||||||
|
fluid[0] = new FluidStack(recipe.inputFluid[0].type, (int) Math.round(recipe.inputFluid[0].fill * fReclaim));
|
||||||
|
}
|
||||||
|
|
||||||
|
this.register(new GenericRecipe(recipe.getInternalName() + ".recycle").setup(recipe.duration, recipe.power).setNameWrapper("precass.recycle")
|
||||||
|
.setIcon(BrokenItem.make(output))
|
||||||
|
.inputItems(new NBTStack(BrokenItem.make(output)))
|
||||||
|
.outputItems(recycle)
|
||||||
|
.outputFluids(fluid));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,6 +12,7 @@ import com.google.gson.JsonObject;
|
|||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
import com.hbm.inventory.FluidStack;
|
import com.hbm.inventory.FluidStack;
|
||||||
import com.hbm.inventory.RecipesCommon.AStack;
|
import com.hbm.inventory.RecipesCommon.AStack;
|
||||||
|
import com.hbm.util.ItemStackUtil;
|
||||||
|
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
@ -38,6 +39,8 @@ public abstract class GenericRecipes<T extends GenericRecipe> extends Serializab
|
|||||||
public static final String POOL_PREFIX_DISCOVER = "discover.";
|
public static final String POOL_PREFIX_DISCOVER = "discover.";
|
||||||
/** Secret recipes, self-explantory. Why even have this comment? */
|
/** Secret recipes, self-explantory. Why even have this comment? */
|
||||||
public static final String POOL_PREFIX_SECRET = "secret.";
|
public static final String POOL_PREFIX_SECRET = "secret.";
|
||||||
|
/** 528 greyprints */
|
||||||
|
public static final String POOL_PREFIX_528 = "528.";
|
||||||
|
|
||||||
public List<T> recipeOrderedList = new ArrayList();
|
public List<T> recipeOrderedList = new ArrayList();
|
||||||
public HashMap<String, T> recipeNameMap = new HashMap();
|
public HashMap<String, T> recipeNameMap = new HashMap();
|
||||||
@ -235,13 +238,14 @@ public abstract class GenericRecipes<T extends GenericRecipe> extends Serializab
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ItemStack collapse() {
|
public ItemStack collapse() {
|
||||||
if(this.chance >= 1F) return getSingle().copy();
|
if(this.chance >= 1F) return getSingle();
|
||||||
return RNG.nextFloat() <= chance ? getSingle().copy() : null;
|
return RNG.nextFloat() <= chance ? getSingle() : null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override public ItemStack getSingle() { return this.stack; }
|
@Override public ItemStack getSingle() { return this.stack.copy(); }
|
||||||
@Override public boolean possibleMultiOutput() { return false; }
|
@Override public boolean possibleMultiOutput() { return false; }
|
||||||
@Override public ItemStack[] getAllPossibilities() { return new ItemStack[] {getSingle()}; }
|
/** For NEI, includes tooltip labels */
|
||||||
|
@Override public ItemStack[] getAllPossibilities() { return new ItemStack[] {this.chance >= 1F ? getSingle() : ItemStackUtil.addTooltipToStack(getSingle(), EnumChatFormatting.RED + "" + (int)(this.chance * 1000) / 10F + "%")}; }
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void serialize(JsonWriter writer) throws IOException {
|
public void serialize(JsonWriter writer) throws IOException {
|
||||||
@ -287,13 +291,23 @@ public abstract class GenericRecipes<T extends GenericRecipe> extends Serializab
|
|||||||
|
|
||||||
public List<ChanceOutput> pool = new ArrayList();
|
public List<ChanceOutput> pool = new ArrayList();
|
||||||
|
|
||||||
|
public ChanceOutputMulti(ChanceOutput... out) {
|
||||||
|
for(ChanceOutput output : out) pool.add(output);
|
||||||
|
}
|
||||||
|
|
||||||
@Override public ItemStack collapse() { return ((ChanceOutput) WeightedRandom.getRandomItem(RNG, pool)).collapse(); }
|
@Override public ItemStack collapse() { return ((ChanceOutput) WeightedRandom.getRandomItem(RNG, pool)).collapse(); }
|
||||||
@Override public boolean possibleMultiOutput() { return pool.size() > 1; }
|
@Override public boolean possibleMultiOutput() { return pool.size() > 1; }
|
||||||
@Override public ItemStack getSingle() { return possibleMultiOutput() ? null : pool.get(0).getSingle(); }
|
@Override public ItemStack getSingle() { return possibleMultiOutput() ? null : pool.get(0).getSingle(); }
|
||||||
|
|
||||||
@Override public ItemStack[] getAllPossibilities() {
|
@Override public ItemStack[] getAllPossibilities() {
|
||||||
ItemStack[] outputs = new ItemStack[pool.size()];
|
ItemStack[] outputs = new ItemStack[pool.size()];
|
||||||
for(int i = 0; i < outputs.length; i++) outputs[i] = pool.get(i).getAllPossibilities()[0];
|
int totalWeight = WeightedRandom.getTotalWeight(pool);
|
||||||
|
for(int i = 0; i < outputs.length; i++) {
|
||||||
|
ChanceOutput out = pool.get(i);
|
||||||
|
float chance = (float) out.itemWeight / (float) totalWeight;
|
||||||
|
outputs[i] = chance >= 1 ? out.getAllPossibilities()[0] :
|
||||||
|
ItemStackUtil.addTooltipToStack(out.getAllPossibilities()[0], EnumChatFormatting.RED + "" + (int)(chance * 1000) / 10F + "%");
|
||||||
|
}
|
||||||
return outputs;
|
return outputs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -92,6 +92,7 @@ public abstract class SerializableRecipe {
|
|||||||
recipeHandlers.add(ChemicalPlantRecipes.INSTANCE);
|
recipeHandlers.add(ChemicalPlantRecipes.INSTANCE);
|
||||||
recipeHandlers.add(PUREXRecipes.INSTANCE);
|
recipeHandlers.add(PUREXRecipes.INSTANCE);
|
||||||
recipeHandlers.add(FusionRecipes.INSTANCE);
|
recipeHandlers.add(FusionRecipes.INSTANCE);
|
||||||
|
recipeHandlers.add(PrecAssRecipes.INSTANCE);
|
||||||
|
|
||||||
recipeHandlers.add(new MatDistribution());
|
recipeHandlers.add(new MatDistribution());
|
||||||
recipeHandlers.add(new CustomMachineRecipes());
|
recipeHandlers.add(new CustomMachineRecipes());
|
||||||
|
|||||||
@ -24,6 +24,7 @@ public class ItemBlueprints extends Item {
|
|||||||
|
|
||||||
@SideOnly(Side.CLIENT) protected IIcon iconDiscover;
|
@SideOnly(Side.CLIENT) protected IIcon iconDiscover;
|
||||||
@SideOnly(Side.CLIENT) protected IIcon iconSecret;
|
@SideOnly(Side.CLIENT) protected IIcon iconSecret;
|
||||||
|
@SideOnly(Side.CLIENT) protected IIcon icon528;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
@ -31,6 +32,7 @@ public class ItemBlueprints extends Item {
|
|||||||
super.registerIcons(reg);
|
super.registerIcons(reg);
|
||||||
this.iconDiscover = reg.registerIcon(this.getIconString() + "_discover");
|
this.iconDiscover = reg.registerIcon(this.getIconString() + "_discover");
|
||||||
this.iconSecret = reg.registerIcon(this.getIconString() + "_secret");
|
this.iconSecret = reg.registerIcon(this.getIconString() + "_secret");
|
||||||
|
this.icon528 = reg.registerIcon(this.getIconString() + "_528");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -45,11 +47,12 @@ public class ItemBlueprints extends Item {
|
|||||||
if(stack.hasTagCompound()) {
|
if(stack.hasTagCompound()) {
|
||||||
String poolName = stack.stackTagCompound.getString("pool");
|
String poolName = stack.stackTagCompound.getString("pool");
|
||||||
if(poolName == null) return this.itemIcon;
|
if(poolName == null) return this.itemIcon;
|
||||||
if(poolName.startsWith(GenericRecipes.POOL_PREFIX_DISCOVER)) return this.iconDiscover;
|
if(poolName.startsWith(GenericRecipes.POOL_PREFIX_DISCOVER)) return this.iconDiscover; // beige
|
||||||
if(poolName.startsWith(GenericRecipes.POOL_PREFIX_SECRET)) return this.iconSecret;
|
if(poolName.startsWith(GenericRecipes.POOL_PREFIX_SECRET)) return this.iconSecret; // black
|
||||||
|
if(poolName.startsWith(GenericRecipes.POOL_PREFIX_528)) return this.icon528; // grey
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.itemIcon;
|
return this.itemIcon; // blue
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.hbm.lib;
|
|||||||
public class RefStrings {
|
public class RefStrings {
|
||||||
public static final String MODID = "hbm";
|
public static final String MODID = "hbm";
|
||||||
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
public static final String NAME = "Hbm's Nuclear Tech Mod";
|
||||||
public static final String VERSION = "1.0.27 BETA (5523)";
|
public static final String VERSION = "1.0.27 BETA (5526)";
|
||||||
//HBM's Beta Naming Convention:
|
//HBM's Beta Naming Convention:
|
||||||
//V T (X)
|
//V T (X)
|
||||||
//V -> next release version
|
//V -> next release version
|
||||||
|
|||||||
@ -17,21 +17,25 @@ public class NEIRegistry {
|
|||||||
|
|
||||||
handlers.add(new AnvilRecipeHandler());
|
handlers.add(new AnvilRecipeHandler());
|
||||||
handlers.add(new SmithingRecipeHandler());
|
handlers.add(new SmithingRecipeHandler());
|
||||||
|
handlers.add(new PressRecipeHandler());
|
||||||
handlers.add(new AlloyFurnaceRecipeHandler());
|
handlers.add(new AlloyFurnaceRecipeHandler());
|
||||||
handlers.add(new ShredderRecipeHandler());
|
handlers.add(new ShredderRecipeHandler());
|
||||||
handlers.add(new PressRecipeHandler());
|
handlers.add(new CrucibleSmeltingHandler());
|
||||||
|
handlers.add(new CrucibleAlloyingHandler());
|
||||||
|
handlers.add(new CrucibleCastingHandler());
|
||||||
|
handlers.add(new AssemblyMachineRecipeHandler());
|
||||||
|
handlers.add(new PrecAssRecipeHandler());
|
||||||
|
handlers.add(new ChemicalPlantRecipeHandler());
|
||||||
|
handlers.add(new RefineryRecipeHandler());
|
||||||
handlers.add(new CentrifugeRecipeHandler());
|
handlers.add(new CentrifugeRecipeHandler());
|
||||||
handlers.add(new GasCentrifugeRecipeHandler());
|
handlers.add(new GasCentrifugeRecipeHandler());
|
||||||
handlers.add(new BreederRecipeHandler());
|
handlers.add(new BreederRecipeHandler());
|
||||||
handlers.add(new CyclotronRecipeHandler());
|
handlers.add(new CyclotronRecipeHandler());
|
||||||
handlers.add(new AssemblyMachineRecipeHandler());
|
|
||||||
handlers.add(new RefineryRecipeHandler());
|
|
||||||
handlers.add(new VacuumRecipeHandler());
|
handlers.add(new VacuumRecipeHandler());
|
||||||
handlers.add(new CrackingHandler());
|
handlers.add(new CrackingHandler());
|
||||||
handlers.add(new RadiolysisRecipeHandler());
|
handlers.add(new RadiolysisRecipeHandler());
|
||||||
handlers.add(new ReformingHandler());
|
handlers.add(new ReformingHandler());
|
||||||
handlers.add(new HydrotreatingHandler());
|
handlers.add(new HydrotreatingHandler());
|
||||||
handlers.add(new ChemicalPlantRecipeHandler());
|
|
||||||
handlers.add(new PUREXRecipeHandler());
|
handlers.add(new PUREXRecipeHandler());
|
||||||
handlers.add(new OreSlopperHandler()); //before acidizing
|
handlers.add(new OreSlopperHandler()); //before acidizing
|
||||||
handlers.add(new CrystallizerRecipeHandler());
|
handlers.add(new CrystallizerRecipeHandler());
|
||||||
@ -41,9 +45,6 @@ public class NEIRegistry {
|
|||||||
handlers.add(new FuelPoolHandler());
|
handlers.add(new FuelPoolHandler());
|
||||||
handlers.add(new RBMKRodDisassemblyHandler());
|
handlers.add(new RBMKRodDisassemblyHandler());
|
||||||
handlers.add(new RBMKWasteDecayHandler());
|
handlers.add(new RBMKWasteDecayHandler());
|
||||||
handlers.add(new CrucibleSmeltingHandler());
|
|
||||||
handlers.add(new CrucibleAlloyingHandler());
|
|
||||||
handlers.add(new CrucibleCastingHandler());
|
|
||||||
handlers.add(new ToolingHandler());
|
handlers.add(new ToolingHandler());
|
||||||
handlers.add(new ConstructionHandler());
|
handlers.add(new ConstructionHandler());
|
||||||
handlers.add(new SatelliteHandler());
|
handlers.add(new SatelliteHandler());
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
package com.hbm.module.machine;
|
package com.hbm.module.machine;
|
||||||
|
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.inventory.recipes.AssemblyMachineRecipes;
|
import com.hbm.inventory.recipes.PrecAssRecipes;
|
||||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
||||||
import com.hbm.util.BobMathUtil;
|
import com.hbm.util.BobMathUtil;
|
||||||
@ -21,7 +21,7 @@ public class ModuleMachinePrecAss extends ModuleMachineBase {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public GenericRecipes getRecipeSet() {
|
public GenericRecipes getRecipeSet() {
|
||||||
return AssemblyMachineRecipes.INSTANCE;
|
return PrecAssRecipes.INSTANCE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@ -54,8 +54,6 @@ public class RenderAssemblyMachine extends TileEntitySpecialRenderer implements
|
|||||||
double[] arm1 = assembler.arms[0].getPositions(interp);
|
double[] arm1 = assembler.arms[0].getPositions(interp);
|
||||||
double[] arm2 = assembler.arms[1].getPositions(interp);
|
double[] arm2 = assembler.arms[1].getPositions(interp);
|
||||||
|
|
||||||
// arm1 = arm2 = new double[] {60, -15, 15, -0.25}; // heart
|
|
||||||
|
|
||||||
GL11.glRotated(spin, 0, 1, 0);
|
GL11.glRotated(spin, 0, 1, 0);
|
||||||
ResourceManager.assembly_machine.renderPart("Ring");
|
ResourceManager.assembly_machine.renderPart("Ring");
|
||||||
|
|
||||||
|
|||||||
@ -4,13 +4,22 @@ import org.lwjgl.opengl.GL11;
|
|||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.inventory.recipes.PrecAssRecipes;
|
||||||
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.main.ResourceManager;
|
import com.hbm.main.ResourceManager;
|
||||||
import com.hbm.render.item.ItemRenderBase;
|
import com.hbm.render.item.ItemRenderBase;
|
||||||
import com.hbm.tileentity.machine.TileEntityMachinePrecAss;
|
import com.hbm.tileentity.machine.TileEntityMachinePrecAss;
|
||||||
|
import com.hbm.util.BobMathUtil;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
import net.minecraft.client.renderer.RenderBlocks;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderItem;
|
||||||
|
import net.minecraft.client.renderer.entity.RenderManager;
|
||||||
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
import net.minecraft.client.renderer.tileentity.TileEntitySpecialRenderer;
|
||||||
import net.minecraft.entity.item.EntityItem;
|
import net.minecraft.entity.item.EntityItem;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemBlock;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.tileentity.TileEntity;
|
import net.minecraft.tileentity.TileEntity;
|
||||||
import net.minecraftforge.client.IItemRenderer;
|
import net.minecraftforge.client.IItemRenderer;
|
||||||
@ -37,29 +46,32 @@ public class RenderPrecAss extends TileEntitySpecialRenderer implements IItemRen
|
|||||||
|
|
||||||
bindTexture(ResourceManager.precass_tex);
|
bindTexture(ResourceManager.precass_tex);
|
||||||
ResourceManager.assembly_machine.renderPart("Base");
|
ResourceManager.assembly_machine.renderPart("Base");
|
||||||
//if(assembler.frame) ResourceManager.assembly_machine.renderPart("Frame");
|
if(assembler.frame) ResourceManager.assembly_machine.renderPart("Frame");
|
||||||
|
|
||||||
GL11.glPushMatrix();
|
GL11.glPushMatrix();
|
||||||
|
|
||||||
//double spin = BobMathUtil.interp(assembler.prevRing, assembler.ring, interp);
|
double spin = BobMathUtil.interp(assembler.prevRing, assembler.ring, interp);
|
||||||
double[] arm1 = new double[] {45, -15, -5, -0.75};
|
|
||||||
|
|
||||||
// arm1 = arm2 = new double[] {60, -15, 15, -0.25}; // heart
|
double[] arm = new double[] {
|
||||||
|
BobMathUtil.interp(assembler.prevArmAngles[0], assembler.armAngles[0], interp),
|
||||||
|
BobMathUtil.interp(assembler.prevArmAngles[1], assembler.armAngles[1], interp),
|
||||||
|
BobMathUtil.interp(assembler.prevArmAngles[2], assembler.armAngles[2], interp)
|
||||||
|
};
|
||||||
|
|
||||||
//GL11.glRotated(spin, 0, 1, 0);
|
GL11.glRotated(spin, 0, 1, 0);
|
||||||
ResourceManager.assembly_machine.renderPart("Ring");
|
ResourceManager.assembly_machine.renderPart("Ring");
|
||||||
ResourceManager.assembly_machine.renderPart("Ring2");
|
ResourceManager.assembly_machine.renderPart("Ring2");
|
||||||
|
|
||||||
for(int i = 0; i < 4; i++) {
|
for(int i = 0; i < 4; i++) {
|
||||||
renderArm(arm1);
|
renderArm(arm, BobMathUtil.interp(assembler.prevStrikers[i], assembler.strikers[i], interp));
|
||||||
GL11.glRotated(90, 0, 1, 0);
|
GL11.glRotated(-90, 0, 1, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
|
|
||||||
GL11.glShadeModel(GL11.GL_FLAT);
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
|
||||||
/*GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe);
|
GenericRecipe recipe = PrecAssRecipes.INSTANCE.recipeNameMap.get(assembler.assemblerModule.recipe);
|
||||||
if(recipe != null && MainRegistry.proxy.me().getDistanceSq(tileEntity.xCoord + 0.5, tileEntity.yCoord + 1, tileEntity.zCoord + 0.5) < 35 * 35) {
|
if(recipe != null && MainRegistry.proxy.me().getDistanceSq(tileEntity.xCoord + 0.5, tileEntity.yCoord + 1, tileEntity.zCoord + 0.5) < 35 * 35) {
|
||||||
|
|
||||||
GL11.glRotated(90, 0, 1, 0);
|
GL11.glRotated(90, 0, 1, 0);
|
||||||
@ -89,12 +101,12 @@ public class RenderPrecAss extends TileEntitySpecialRenderer implements IItemRen
|
|||||||
RenderItem.renderInFrame = true;
|
RenderItem.renderInFrame = true;
|
||||||
RenderManager.instance.renderEntityWithPosYaw(dummy, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
RenderManager.instance.renderEntityWithPosYaw(dummy, 0.0D, 0.0D, 0.0D, 0.0F, 0.0F);
|
||||||
RenderItem.renderInFrame = false;
|
RenderItem.renderInFrame = false;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
GL11.glPopMatrix();
|
GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void renderArm(double[] arm) {
|
public static void renderArm(double[] arm, double striker) {
|
||||||
|
|
||||||
GL11.glPushMatrix(); {
|
GL11.glPushMatrix(); {
|
||||||
GL11.glTranslated(0, 1.625, 0.9375);
|
GL11.glTranslated(0, 1.625, 0.9375);
|
||||||
@ -111,7 +123,7 @@ public class RenderPrecAss extends TileEntitySpecialRenderer implements IItemRen
|
|||||||
GL11.glRotated(arm[2], 1, 0, 0);
|
GL11.glRotated(arm[2], 1, 0, 0);
|
||||||
GL11.glTranslated(0, -2.375, -0.4375);
|
GL11.glTranslated(0, -2.375, -0.4375);
|
||||||
ResourceManager.assembly_machine.renderPart("Head1");
|
ResourceManager.assembly_machine.renderPart("Head1");
|
||||||
GL11.glTranslated(0, arm[3], 0);
|
GL11.glTranslated(0, striker, 0);
|
||||||
ResourceManager.assembly_machine.renderPart("Spike1");
|
ResourceManager.assembly_machine.renderPart("Spike1");
|
||||||
} GL11.glPopMatrix();
|
} GL11.glPopMatrix();
|
||||||
}
|
}
|
||||||
@ -139,9 +151,9 @@ public class RenderPrecAss extends TileEntitySpecialRenderer implements IItemRen
|
|||||||
ResourceManager.assembly_machine.renderPart("Frame");
|
ResourceManager.assembly_machine.renderPart("Frame");
|
||||||
ResourceManager.assembly_machine.renderPart("Ring");
|
ResourceManager.assembly_machine.renderPart("Ring");
|
||||||
ResourceManager.assembly_machine.renderPart("Ring2");
|
ResourceManager.assembly_machine.renderPart("Ring2");
|
||||||
double[] arm = new double[] {45, -15, -5, -0.75};
|
double[] arm = new double[] {45, -30, 45};
|
||||||
for(int i = 0; i < 4; i++) {
|
for(int i = 0; i < 4; i++) {
|
||||||
renderArm(arm);
|
renderArm(arm, 0);
|
||||||
GL11.glRotated(90, 0, 1, 0);
|
GL11.glRotated(90, 0, 1, 0);
|
||||||
}
|
}
|
||||||
GL11.glShadeModel(GL11.GL_FLAT);
|
GL11.glShadeModel(GL11.GL_FLAT);
|
||||||
|
|||||||
@ -169,18 +169,11 @@ public class TileEntityMachineAssemblyMachine extends TileEntityMachineBase impl
|
|||||||
if(this.ringTarget > this.ring) this.ring += this.ringSpeed;
|
if(this.ringTarget > this.ring) this.ring += this.ringSpeed;
|
||||||
if(this.ringTarget < this.ring) this.ring -= this.ringSpeed;
|
if(this.ringTarget < this.ring) this.ring -= this.ringSpeed;
|
||||||
if(this.ringTarget == this.ring) {
|
if(this.ringTarget == this.ring) {
|
||||||
if(ringTarget >= 360) {
|
double sub = ringTarget >= 360 ? -360D : 360D;
|
||||||
this.ringTarget -= 360D;
|
this.ringTarget += sub;
|
||||||
this.ring -= 360D;
|
this.ring += sub;
|
||||||
this.prevRing -= 360D;
|
this.prevRing += sub;
|
||||||
}
|
|
||||||
if(ringTarget <= -360) {
|
|
||||||
this.ringTarget += 360D;
|
|
||||||
this.ring += 360D;
|
|
||||||
this.prevRing += 360D;
|
|
||||||
}
|
|
||||||
this.ringDelay = 20 + worldObj.rand.nextInt(21);
|
this.ringDelay = 20 + worldObj.rand.nextInt(21);
|
||||||
//MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStop", this.getVolume(0.25F), 1.5F);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if(this.ringDelay > 0) this.ringDelay--;
|
if(this.ringDelay > 0) this.ringDelay--;
|
||||||
|
|||||||
@ -6,9 +6,11 @@ import java.util.List;
|
|||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.UpgradeManagerNT;
|
import com.hbm.inventory.UpgradeManagerNT;
|
||||||
|
import com.hbm.inventory.container.ContainerMachinePrecAss;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.inventory.recipes.AssemblyMachineRecipes;
|
import com.hbm.inventory.gui.GUIMachinePrecAss;
|
||||||
|
import com.hbm.inventory.recipes.PrecAssRecipes;
|
||||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemMachineUpgrade;
|
import com.hbm.items.machine.ItemMachineUpgrade;
|
||||||
@ -17,6 +19,7 @@ import com.hbm.lib.Library;
|
|||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.module.machine.ModuleMachinePrecAss;
|
import com.hbm.module.machine.ModuleMachinePrecAss;
|
||||||
import com.hbm.sound.AudioWrapper;
|
import com.hbm.sound.AudioWrapper;
|
||||||
|
import com.hbm.tileentity.IGUIProvider;
|
||||||
import com.hbm.tileentity.IUpgradeInfoProvider;
|
import com.hbm.tileentity.IUpgradeInfoProvider;
|
||||||
import com.hbm.tileentity.TileEntityMachineBase;
|
import com.hbm.tileentity.TileEntityMachineBase;
|
||||||
import com.hbm.util.BobMathUtil;
|
import com.hbm.util.BobMathUtil;
|
||||||
@ -29,13 +32,16 @@ import cpw.mods.fml.relauncher.Side;
|
|||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
import net.minecraft.util.EnumChatFormatting;
|
||||||
|
import net.minecraft.util.MathHelper;
|
||||||
|
import net.minecraft.world.World;
|
||||||
|
|
||||||
// horribly copy-pasted crap device
|
// horribly copy-pasted crap device
|
||||||
public class TileEntityMachinePrecAss extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver/*, IGUIProvider*/ {
|
public class TileEntityMachinePrecAss extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardTransceiverMK2, IUpgradeInfoProvider, IControlReceiver, IGUIProvider {
|
||||||
|
|
||||||
public FluidTank inputTank;
|
public FluidTank inputTank;
|
||||||
public FluidTank outputTank;
|
public FluidTank outputTank;
|
||||||
@ -55,6 +61,14 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I
|
|||||||
public double ringTarget;
|
public double ringTarget;
|
||||||
public int ringDelay;
|
public int ringDelay;
|
||||||
|
|
||||||
|
public double[] armAngles = new double[] {45, -15, -5};
|
||||||
|
public double[] prevArmAngles = new double[] {45, -15, -5};
|
||||||
|
public double[] strikers = new double[4];
|
||||||
|
public double[] prevStrikers = new double[4];
|
||||||
|
public boolean[] strikerDir = new boolean[4];
|
||||||
|
protected int strikerIndex;
|
||||||
|
protected int strikerDelay;
|
||||||
|
|
||||||
public UpgradeManagerNT upgradeManager = new UpgradeManagerNT(this);
|
public UpgradeManagerNT upgradeManager = new UpgradeManagerNT(this);
|
||||||
|
|
||||||
public TileEntityMachinePrecAss() {
|
public TileEntityMachinePrecAss() {
|
||||||
@ -79,7 +93,7 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
if(!worldObj.isRemote) {
|
if(!worldObj.isRemote) {
|
||||||
|
|
||||||
GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assemblerModule.recipe);
|
GenericRecipe recipe = PrecAssRecipes.INSTANCE.recipeNameMap.get(assemblerModule.recipe);
|
||||||
if(recipe != null) {
|
if(recipe != null) {
|
||||||
this.maxPower = recipe.power * 100;
|
this.maxPower = recipe.power * 100;
|
||||||
}
|
}
|
||||||
@ -134,52 +148,100 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*for(AssemblerArm arm : arms) {
|
for(int i = 0; i < 3; i++) this.prevArmAngles[i] = this.armAngles[i];
|
||||||
arm.updateInterp();
|
for(int i = 0; i < 4; i++) this.prevStrikers[i] = this.strikers[i];
|
||||||
if(didProcess) {
|
|
||||||
arm.updateArm();
|
|
||||||
} else{
|
|
||||||
arm.returnToNullPos();
|
|
||||||
}
|
|
||||||
|
|
||||||
if(!this.muffled && arm.prevAngles[3] != arm.angles[3] && arm.angles[3] == -0.75) {
|
|
||||||
MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStrike", this.getVolume(0.5F), 1F);
|
|
||||||
}
|
|
||||||
}*/
|
|
||||||
|
|
||||||
this.prevRing = this.ring;
|
this.prevRing = this.ring;
|
||||||
|
|
||||||
if(didProcess) {
|
for(int i = 0; i < 4; i++) {
|
||||||
if(this.ring != this.ringTarget) {
|
if(this.strikerDir[i]) {
|
||||||
double ringDelta = Math.abs(this.ringTarget - this.ring);
|
this.strikers[i] = -0.75D;
|
||||||
if(ringDelta <= this.ringSpeed) this.ring = this.ringTarget;
|
this.strikerDir[i] = false;
|
||||||
if(this.ringTarget > this.ring) this.ring += this.ringSpeed;
|
if(!this.muffled) MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStrike", this.getVolume(0.5F), 1.25F);
|
||||||
if(this.ringTarget < this.ring) this.ring -= this.ringSpeed;
|
|
||||||
if(this.ringTarget == this.ring) {
|
|
||||||
if(ringTarget >= 360) {
|
|
||||||
this.ringTarget -= 360D;
|
|
||||||
this.ring -= 360D;
|
|
||||||
this.prevRing -= 360D;
|
|
||||||
}
|
|
||||||
if(ringTarget <= -360) {
|
|
||||||
this.ringTarget += 360D;
|
|
||||||
this.ring += 360D;
|
|
||||||
this.prevRing += 360D;
|
|
||||||
}
|
|
||||||
this.ringDelay = 20 + worldObj.rand.nextInt(21);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
this.strikers[i] = MathHelper.clamp_double(this.strikers[i] + 0.5D, -0.75D, 0D);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.ring != this.ringTarget) {
|
||||||
|
double ringDelta = Math.abs(this.ringTarget - this.ring);
|
||||||
|
if(ringDelta <= this.ringSpeed) this.ring = this.ringTarget;
|
||||||
|
if(this.ringTarget > this.ring) this.ring += this.ringSpeed;
|
||||||
|
if(this.ringTarget < this.ring) this.ring -= this.ringSpeed;
|
||||||
|
if(this.ringTarget == this.ring) {
|
||||||
|
double sub = ringTarget >= 360 ? -360D : 360D;
|
||||||
|
this.ringTarget += sub;
|
||||||
|
this.ring += sub;
|
||||||
|
this.prevRing += sub;
|
||||||
|
this.ringDelay = 100 + worldObj.rand.nextInt(21);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(didProcess) {
|
||||||
|
if(this.ring == this.ringTarget) {
|
||||||
if(this.ringDelay > 0) this.ringDelay--;
|
if(this.ringDelay > 0) this.ringDelay--;
|
||||||
if(this.ringDelay <= 0) {
|
if(this.ringDelay <= 0) {
|
||||||
this.ringTarget += (worldObj.rand.nextDouble() * 2 - 1) * 135;
|
this.ringTarget += 45 * (worldObj.rand.nextBoolean() ? -1 : 1);
|
||||||
this.ringSpeed = 10D + worldObj.rand.nextDouble() * 5D;
|
this.ringSpeed = 10D + worldObj.rand.nextDouble() * 5D;
|
||||||
if(!this.muffled) MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStart", this.getVolume(0.25F), 1.25F + worldObj.rand.nextFloat() * 0.25F);
|
if(!this.muffled) MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStart", this.getVolume(0.25F), 1.25F + worldObj.rand.nextFloat() * 0.25F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(!isInWorkingPosition(this.armAngles) && canArmsMove()) {
|
||||||
|
move(WORKING_POSITION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(isInWorkingPosition(this.armAngles)) {
|
||||||
|
this.strikerDelay--;
|
||||||
|
if(this.strikerDelay <= 0) {
|
||||||
|
this.strikerDir[this.strikerIndex] = true;
|
||||||
|
this.strikerIndex = (this.strikerIndex + 1) % this.strikers.length;
|
||||||
|
this.strikerDelay = this.strikerIndex == 3 ? (10 + worldObj.rand.nextInt(3)) : 2;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
} else {
|
||||||
|
for(int i = 0; i < 4; i++) this.strikerDir[i] = false; // set all strikers to retract
|
||||||
|
if(canArmsMove()) move(NULL_POSITION);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(this.isInWorkingPosition(prevArmAngles) && !this.isInWorkingPosition(armAngles)) {
|
||||||
|
if(!this.muffled) MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStop", this.getVolume(0.25F), 1.25F + worldObj.rand.nextFloat() * 0.25F);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public double[] NULL_POSITION = new double[] {45, -30, 45};
|
||||||
|
public double[] WORKING_POSITION = new double[] {45, -15, -5};
|
||||||
|
|
||||||
|
private boolean canArmsMove() {
|
||||||
|
for(int i = 0; i < 4; i++) if(this.strikers[i] != 0) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean isInWorkingPosition(double[] arms) {
|
||||||
|
for(int i = 0; i < 3; i++) if(arms[i] != WORKING_POSITION[i]) return false;
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private boolean move(double[] targetAngles) {
|
||||||
|
boolean didMove = false;
|
||||||
|
|
||||||
|
for(int i = 0; i < armAngles.length; i++) {
|
||||||
|
if(armAngles[i] == targetAngles[i]) continue;
|
||||||
|
didMove = true;
|
||||||
|
double angle = armAngles[i];
|
||||||
|
double target = targetAngles[i];
|
||||||
|
double turn = 15D;
|
||||||
|
double delta = Math.abs(angle - target);
|
||||||
|
|
||||||
|
if(delta <= turn) { armAngles[i] = targetAngles[i]; continue; }
|
||||||
|
if(angle < target) armAngles[i] += turn;
|
||||||
|
else armAngles[i] -= turn;
|
||||||
|
}
|
||||||
|
return !didMove;
|
||||||
|
}
|
||||||
|
|
||||||
@Override public AudioWrapper createAudioLoop() {
|
@Override public AudioWrapper createAudioLoop() {
|
||||||
return MainRegistry.proxy.getLoopedSound("hbm:block.motor", xCoord, yCoord, zCoord, 0.5F, 15F, 0.75F, 20);
|
return MainRegistry.proxy.getLoopedSound("hbm:block.motor", xCoord, yCoord, zCoord, 0.5F, 15F, 0.75F, 20);
|
||||||
}
|
}
|
||||||
@ -224,17 +286,12 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I
|
|||||||
@Override
|
@Override
|
||||||
public void deserialize(ByteBuf buf) {
|
public void deserialize(ByteBuf buf) {
|
||||||
super.deserialize(buf);
|
super.deserialize(buf);
|
||||||
boolean wasProcessing = this.didProcess;
|
|
||||||
this.inputTank.deserialize(buf);
|
this.inputTank.deserialize(buf);
|
||||||
this.outputTank.deserialize(buf);
|
this.outputTank.deserialize(buf);
|
||||||
this.power = buf.readLong();
|
this.power = buf.readLong();
|
||||||
this.maxPower = buf.readLong();
|
this.maxPower = buf.readLong();
|
||||||
this.didProcess = buf.readBoolean();
|
this.didProcess = buf.readBoolean();
|
||||||
this.assemblerModule.deserialize(buf);
|
this.assemblerModule.deserialize(buf);
|
||||||
|
|
||||||
if(wasProcessing && !didProcess) {
|
|
||||||
MainRegistry.proxy.playSoundClient(xCoord, yCoord, zCoord, "hbm:block.assemblerStop", this.getVolume(0.25F), 1.5F);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -284,8 +341,8 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I
|
|||||||
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {outputTank}; }
|
@Override public FluidTank[] getSendingTanks() { return new FluidTank[] {outputTank}; }
|
||||||
@Override public FluidTank[] getAllTanks() { return new FluidTank[] {inputTank, outputTank}; }
|
@Override public FluidTank[] getAllTanks() { return new FluidTank[] {inputTank, outputTank}; }
|
||||||
|
|
||||||
//@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerMachineAssemblyMachine(player.inventory, this); }
|
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerMachinePrecAss(player.inventory, this); }
|
||||||
//@Override @SideOnly(Side.CLIENT) public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachineAssemblyMachine(player.inventory, this); }
|
@Override @SideOnly(Side.CLIENT) public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachinePrecAss(player.inventory, this); }
|
||||||
|
|
||||||
@Override public boolean hasPermission(EntityPlayer player) { return this.isUseableByPlayer(player); }
|
@Override public boolean hasPermission(EntityPlayer player) { return this.isUseableByPlayer(player); }
|
||||||
|
|
||||||
@ -322,7 +379,7 @@ public class TileEntityMachinePrecAss extends TileEntityMachineBase implements I
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
public void provideInfo(UpgradeType type, int level, List<String> info, boolean extendedInfo) {
|
||||||
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_assembly_machine));
|
info.add(IUpgradeInfoProvider.getStandardLabel(ModBlocks.machine_precass));
|
||||||
if(type == UpgradeType.SPEED) {
|
if(type == UpgradeType.SPEED) {
|
||||||
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(KEY_SPEED, "+" + (level * 100 / 3) + "%"));
|
info.add(EnumChatFormatting.GREEN + I18nUtil.resolveKey(KEY_SPEED, "+" + (level * 100 / 3) + "%"));
|
||||||
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(KEY_CONSUMPTION, "+" + (level * 50) + "%"));
|
info.add(EnumChatFormatting.RED + I18nUtil.resolveKey(KEY_CONSUMPTION, "+" + (level * 50) + "%"));
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.albion;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.container.ContainerPADetector;
|
import com.hbm.inventory.container.ContainerPADetector;
|
||||||
import com.hbm.inventory.gui.GUIPADetector;
|
import com.hbm.inventory.gui.GUIPADetector;
|
||||||
import com.hbm.inventory.recipes.ParticleAcceleratorRecipes;
|
import com.hbm.inventory.recipes.ParticleAcceleratorRecipes;
|
||||||
@ -15,8 +16,13 @@ import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import 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.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -24,7 +30,8 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityPADetector extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityPADetector extends TileEntityCooledBase implements IGUIProvider, IParticleUser, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
public static final long usage = 100_000;
|
public static final long usage = 100_000;
|
||||||
|
|
||||||
@ -183,4 +190,85 @@ public class TileEntityPADetector extends TileEntityCooledBase implements IGUIPr
|
|||||||
public BlockPos getExitPos(Particle particle) {
|
public BlockPos getExitPos(Particle particle) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_pa_detector";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCrafting(Context context, Arguments args) {
|
||||||
|
Object[] items = new Object[] {"", 0, "", 0, "", 0, "", 0};
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
ItemStack slot = slots[i+1];
|
||||||
|
if (slot != null) {
|
||||||
|
items[i*2] = slot.getUnlocalizedName();
|
||||||
|
items[(i*2)+1] = slot.stackSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
Object[] items = new Object[] {"", 0, "", 0, "", 0, "", 0};
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
ItemStack slot = slots[i+1];
|
||||||
|
if (slot != null) {
|
||||||
|
items[i*2] = slot.getUnlocalizedName();
|
||||||
|
items[(i*2)+1] = slot.stackSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
|
||||||
|
items[0], items[1], items[2], items[3],
|
||||||
|
items[4], items[5], items[6], items[7]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getCoolant",
|
||||||
|
"getCrafting",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
case "getCrafting": return getCrafting(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -266,6 +266,21 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
return "ntm_pa_dipole";
|
return "ntm_pa_dipole";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Callback(direct = true)
|
@Callback(direct = true)
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public Object[] getDirLower(Context context, Arguments args) {
|
public Object[] getDirLower(Context context, Arguments args) {
|
||||||
@ -321,10 +336,25 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
return new Object[] {};
|
return new Object[] {};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
|
||||||
|
dirToName(dirLower), dirToName(dirUpper), dirToName(dirRedstone), threshold
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public String[] methods() {
|
public String[] methods() {
|
||||||
return new String[] {
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getCoolant",
|
||||||
"getDirLower",
|
"getDirLower",
|
||||||
"setDirLower",
|
"setDirLower",
|
||||||
"getDirUpper",
|
"getDirUpper",
|
||||||
@ -333,6 +363,7 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
"setDirRedstone",
|
"setDirRedstone",
|
||||||
"getThreshold",
|
"getThreshold",
|
||||||
"setThreshold",
|
"setThreshold",
|
||||||
|
"getInfo",
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -340,6 +371,9 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
@Optional.Method(modid = "OpenComputers")
|
@Optional.Method(modid = "OpenComputers")
|
||||||
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
switch (method) {
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
|
||||||
case "getDirLower": return getDirLower(context, args);
|
case "getDirLower": return getDirLower(context, args);
|
||||||
case "setDirLower": return setDirLower(context, args);
|
case "setDirLower": return setDirLower(context, args);
|
||||||
case "getDirUpper": return getDirUpper(context, args);
|
case "getDirUpper": return getDirUpper(context, args);
|
||||||
@ -348,6 +382,8 @@ public class TileEntityPADipole extends TileEntityCooledBase implements IGUIProv
|
|||||||
case "setDirRedstone": return setDirRedstone(context, args);
|
case "setDirRedstone": return setDirRedstone(context, args);
|
||||||
case "getThreshold": return getThreshold(context, args);
|
case "getThreshold": return getThreshold(context, args);
|
||||||
case "setThreshold": return setThreshold(context, args);
|
case "setThreshold": return setThreshold(context, args);
|
||||||
|
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
}
|
}
|
||||||
throw new NoSuchMethodException();
|
throw new NoSuchMethodException();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.hbm.tileentity.machine.albion;
|
package com.hbm.tileentity.machine.albion;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.container.ContainerPAQuadrupole;
|
import com.hbm.inventory.container.ContainerPAQuadrupole;
|
||||||
import com.hbm.inventory.gui.GUIPAQuadrupole;
|
import com.hbm.inventory.gui.GUIPAQuadrupole;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
@ -12,15 +13,21 @@ import com.hbm.util.EnumUtil;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import 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.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUIProvider, IParticleUser, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
public static final long usage = 100_000;
|
public static final long usage = 100_000;
|
||||||
public static final int focusGain = 100;
|
public static final int focusGain = 100;
|
||||||
@ -129,4 +136,57 @@ public class TileEntityPAQuadrupole extends TileEntityCooledBase implements IGUI
|
|||||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
return new GUIPAQuadrupole(player.inventory, this);
|
return new GUIPAQuadrupole(player.inventory, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_pa_quad";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getCoolant",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.hbm.tileentity.machine.albion;
|
package com.hbm.tileentity.machine.albion;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.container.ContainerPARFC;
|
import com.hbm.inventory.container.ContainerPARFC;
|
||||||
import com.hbm.inventory.gui.GUIPARFC;
|
import com.hbm.inventory.gui.GUIPARFC;
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
@ -9,15 +10,21 @@ import com.hbm.tileentity.machine.albion.TileEntityPASource.Particle;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
|
import 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.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvider, IParticleUser {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvider, IParticleUser, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
public static final long usage = 250_000;
|
public static final long usage = 250_000;
|
||||||
public static final int momentumGain = 100;
|
public static final int momentumGain = 100;
|
||||||
@ -121,4 +128,57 @@ public class TileEntityPARFC extends TileEntityCooledBase implements IGUIProvide
|
|||||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
||||||
return new GUIPARFC(player.inventory, this);
|
return new GUIPARFC(player.inventory, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_pa_rfc";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getCoolant",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.hbm.tileentity.machine.albion;
|
package com.hbm.tileentity.machine.albion;
|
||||||
|
|
||||||
import com.hbm.blocks.BlockDummyable;
|
import com.hbm.blocks.BlockDummyable;
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.container.ContainerPASource;
|
import com.hbm.inventory.container.ContainerPASource;
|
||||||
import com.hbm.inventory.gui.GUIPASource;
|
import com.hbm.inventory.gui.GUIPASource;
|
||||||
@ -11,9 +12,14 @@ import com.hbm.util.EnumUtil;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
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.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
@ -24,7 +30,8 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityPASource extends TileEntityCooledBase implements IGUIProvider, IConditionalInvAccess, IControlReceiver {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityPASource extends TileEntityCooledBase implements IGUIProvider, IConditionalInvAccess, IControlReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
public static final long usage = 100_000;
|
public static final long usage = 100_000;
|
||||||
public Particle particle;
|
public Particle particle;
|
||||||
@ -278,6 +285,114 @@ public class TileEntityPASource extends TileEntityCooledBase implements IGUIProv
|
|||||||
this.particle.distanceTraveled = particleTag.getInteger("dist");
|
this.particle.distanceTraveled = particleTag.getInteger("dist");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_pa_source";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getMomentum(Context context, Arguments args) {
|
||||||
|
return new Object[] {lastSpeed};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getState(Context context, Arguments args) {
|
||||||
|
return new Object[] {state.name()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCrafting(Context context, Arguments args) {
|
||||||
|
Object[] items = new Object[] {"", 0, "", 0, "", 0, "", 0};
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
ItemStack slot = slots[i+1];
|
||||||
|
if (slot != null) {
|
||||||
|
items[i*2] = slot.getUnlocalizedName();
|
||||||
|
items[(i*2)+1] = slot.stackSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return items;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] cancelOperation(Context context, Arguments args) {
|
||||||
|
particle = null;
|
||||||
|
state = PAState.IDLE;
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
Object[] items = new Object[] {"", 0, "", 0, "", 0, "", 0};
|
||||||
|
for (int i = 0; i < 4; i++) {
|
||||||
|
ItemStack slot = slots[i+1];
|
||||||
|
if (slot != null) {
|
||||||
|
items[i*2] = slot.getUnlocalizedName();
|
||||||
|
items[(i*2)+1] = slot.stackSize;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
|
||||||
|
items[0], items[1], items[2], items[3],
|
||||||
|
items[4], items[5], items[6], items[7],
|
||||||
|
lastSpeed, state.name()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getCoolant",
|
||||||
|
"getMomentum",
|
||||||
|
"getState",
|
||||||
|
"getCrafting",
|
||||||
|
"cancelOperation",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
case "getMomentum": return getMomentum(context, args);
|
||||||
|
case "getState": return getState(context, args);
|
||||||
|
case "getCrafting": return getCrafting(context, args);
|
||||||
|
case "cancelOperation": return cancelOperation(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
|
|
||||||
public static class Particle {
|
public static class Particle {
|
||||||
|
|
||||||
private TileEntityPASource source;
|
private TileEntityPASource source;
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.hbm.tileentity.machine.fusion;
|
package com.hbm.tileentity.machine.fusion;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
import com.hbm.inventory.fluid.trait.FT_Heatable;
|
||||||
@ -11,14 +12,20 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
|
|||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
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.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityFusionBoiler extends TileEntityLoadedBase implements IFluidStandardTransceiverMK2, IFusionPowerReceiver {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityFusionBoiler extends TileEntityLoadedBase implements IFluidStandardTransceiverMK2, IFusionPowerReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
protected GenNode plasmaNode;
|
protected GenNode plasmaNode;
|
||||||
|
|
||||||
@ -170,4 +177,57 @@ public class TileEntityFusionBoiler extends TileEntityLoadedBase implements IFlu
|
|||||||
public double getMaxRenderDistanceSquared() {
|
public double getMaxRenderDistanceSquared() {
|
||||||
return 65536.0D;
|
return 65536.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_fusion_boiler";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getPlasmaEnergy(Context context, Arguments args) {
|
||||||
|
return new Object[] {plasmaEnergySync};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getFluid(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
plasmaEnergySync,
|
||||||
|
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getPlasmaEnergy",
|
||||||
|
"getFluid",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getPlasmaEnergy": return getPlasmaEnergy(context, args);
|
||||||
|
case "getFluid": return getFluid(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
package com.hbm.tileentity.machine.fusion;
|
package com.hbm.tileentity.machine.fusion;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.FluidStack;
|
import com.hbm.inventory.FluidStack;
|
||||||
import com.hbm.inventory.container.ContainerFusionBreeder;
|
import com.hbm.inventory.container.ContainerFusionBreeder;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
@ -18,9 +19,14 @@ import com.hbm.util.fauxpointtwelve.BlockPos;
|
|||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
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.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -29,7 +35,8 @@ import net.minecraft.util.AxisAlignedBB;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityFusionBreeder extends TileEntityMachineBase implements IFluidStandardTransceiverMK2, IFusionPowerReceiver, IGUIProvider {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityFusionBreeder extends TileEntityMachineBase implements IFluidStandardTransceiverMK2, IFusionPowerReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
protected GenNode plasmaNode;
|
protected GenNode plasmaNode;
|
||||||
|
|
||||||
@ -289,4 +296,111 @@ public class TileEntityFusionBreeder extends TileEntityMachineBase implements IF
|
|||||||
public double getMaxRenderDistanceSquared() {
|
public double getMaxRenderDistanceSquared() {
|
||||||
return 65536.0D;
|
return 65536.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_fusion_breeder";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getNeutronEnergy(Context context, Arguments args) {
|
||||||
|
return new Object[] {neutronEnergySync};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getProgress(Context context, Arguments args) {
|
||||||
|
return new Object[] {progress / capacity};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getFluid(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(), tanks[0].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill(), tanks[1].getTankType().getUnlocalizedName()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCrafting(Context context, Arguments args) {
|
||||||
|
ItemStack input = slots[1];
|
||||||
|
String inputName = "";
|
||||||
|
int inputSize = 0;
|
||||||
|
if (input != null) {
|
||||||
|
inputName = input.getUnlocalizedName();
|
||||||
|
inputSize = input.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack output = slots[2];
|
||||||
|
String outputName = "";
|
||||||
|
int outputSize = 0;
|
||||||
|
if (output != null) {
|
||||||
|
outputName = output.getUnlocalizedName();
|
||||||
|
outputSize = output.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Object[] {
|
||||||
|
inputName, inputSize,
|
||||||
|
outputName, outputSize
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
ItemStack input = slots[1];
|
||||||
|
String inputName = "";
|
||||||
|
int inputSize = 0;
|
||||||
|
if (input != null) {
|
||||||
|
inputName = input.getUnlocalizedName();
|
||||||
|
inputSize = input.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
ItemStack output = slots[2];
|
||||||
|
String outputName = "";
|
||||||
|
int outputSize = 0;
|
||||||
|
if (output != null) {
|
||||||
|
outputName = output.getUnlocalizedName();
|
||||||
|
outputSize = output.stackSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Object[] {
|
||||||
|
neutronEnergySync, progress / capacity,
|
||||||
|
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(), tanks[0].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill(), tanks[1].getTankType().getUnlocalizedName(),
|
||||||
|
|
||||||
|
inputName, inputSize,
|
||||||
|
outputName, outputSize
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getNeutronEnergy",
|
||||||
|
"getProgress",
|
||||||
|
"getFluid",
|
||||||
|
"getCrafting",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getNeutronEnergy": return getNeutronEnergy(context, args);
|
||||||
|
case "getProgress": return getProgress(context, args);
|
||||||
|
case "getFluid": return getFluid(context, args);
|
||||||
|
case "getCrafting": return getCrafting(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.fusion;
|
|||||||
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.container.ContainerFusionKlystron;
|
import com.hbm.inventory.container.ContainerFusionKlystron;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
@ -21,9 +22,14 @@ import com.hbm.util.fauxpointtwelve.DirPos;
|
|||||||
|
|
||||||
import api.hbm.energymk2.IEnergyReceiverMK2;
|
import api.hbm.energymk2.IEnergyReceiverMK2;
|
||||||
import api.hbm.fluidmk2.IFluidStandardReceiverMK2;
|
import api.hbm.fluidmk2.IFluidStandardReceiverMK2;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
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.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -33,7 +39,8 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityFusionKlystron extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityFusionKlystron extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
protected GenNode klystronNode;
|
protected GenNode klystronNode;
|
||||||
public static final long MAX_OUTPUT = 1_000_000;
|
public static final long MAX_OUTPUT = 1_000_000;
|
||||||
@ -306,4 +313,70 @@ public class TileEntityFusionKlystron extends TileEntityMachineBase implements I
|
|||||||
if(this.outputTarget > MAX_OUTPUT) this.outputTarget = MAX_OUTPUT;
|
if(this.outputTarget > MAX_OUTPUT) this.outputTarget = MAX_OUTPUT;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_fusion_klystron";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getAir(Context context, Arguments args) {
|
||||||
|
return new Object[] {compair.getFill(), compair.getMaxFill()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getOutput(Context context, Arguments args) {
|
||||||
|
return new Object[] {output, outputTarget};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true, limit = 4)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] setOutput(Context context, Arguments args) {
|
||||||
|
outputTarget = (long) MathHelper.clamp_double(args.checkDouble(0), 0.0, MAX_OUTPUT);
|
||||||
|
return new Object[] {};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
compair.getFill(), compair.getMaxFill(),
|
||||||
|
output, outputTarget
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getAir",
|
||||||
|
"getOutput",
|
||||||
|
"setOutput",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getAir": return getAir(context, args);
|
||||||
|
case "getOutput": return getOutput(context, args);
|
||||||
|
case "setOutput": return setOutput(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,6 +4,7 @@ import java.io.IOException;
|
|||||||
|
|
||||||
import com.google.gson.JsonObject;
|
import com.google.gson.JsonObject;
|
||||||
import com.google.gson.stream.JsonWriter;
|
import com.google.gson.stream.JsonWriter;
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.inventory.fluid.tank.FluidTank;
|
import com.hbm.inventory.fluid.tank.FluidTank;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
@ -18,15 +19,21 @@ import com.hbm.util.fauxpointtwelve.DirPos;
|
|||||||
|
|
||||||
import api.hbm.energymk2.IEnergyProviderMK2;
|
import api.hbm.energymk2.IEnergyProviderMK2;
|
||||||
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
import api.hbm.fluidmk2.IFluidStandardTransceiverMK2;
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
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.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
import net.minecraft.util.AxisAlignedBB;
|
import net.minecraft.util.AxisAlignedBB;
|
||||||
import net.minecraft.util.MathHelper;
|
import net.minecraft.util.MathHelper;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IFusionPowerReceiver, IConfigurableMachine {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnergyProviderMK2, IFluidStandardTransceiverMK2, IFusionPowerReceiver, IConfigurableMachine, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
protected GenNode plasmaNode;
|
protected GenNode plasmaNode;
|
||||||
|
|
||||||
@ -244,4 +251,65 @@ public class TileEntityFusionMHDT extends TileEntityLoadedBase implements IEnerg
|
|||||||
public double getMaxRenderDistanceSquared() {
|
public double getMaxRenderDistanceSquared() {
|
||||||
return 65536.0D;
|
return 65536.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_fusion_mhdt";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {power};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getPlasmaEnergy(Context context, Arguments args) {
|
||||||
|
return new Object[] {plasmaEnergySync};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
power, plasmaEnergySync,
|
||||||
|
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getPlasmaEnergy",
|
||||||
|
"getCoolant",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getPlasmaEnergy": return getPlasmaEnergy(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,6 +2,7 @@ package com.hbm.tileentity.machine.fusion;
|
|||||||
|
|
||||||
import java.util.Map.Entry;
|
import java.util.Map.Entry;
|
||||||
|
|
||||||
|
import com.hbm.handler.CompatHandler;
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
import com.hbm.inventory.container.ContainerFusionTorus;
|
import com.hbm.inventory.container.ContainerFusionTorus;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
@ -25,9 +26,14 @@ import com.hbm.util.BobMathUtil;
|
|||||||
import com.hbm.util.fauxpointtwelve.BlockPos;
|
import com.hbm.util.fauxpointtwelve.BlockPos;
|
||||||
import com.hbm.util.fauxpointtwelve.DirPos;
|
import com.hbm.util.fauxpointtwelve.DirPos;
|
||||||
|
|
||||||
|
import cpw.mods.fml.common.Optional;
|
||||||
import cpw.mods.fml.relauncher.Side;
|
import cpw.mods.fml.relauncher.Side;
|
||||||
import cpw.mods.fml.relauncher.SideOnly;
|
import cpw.mods.fml.relauncher.SideOnly;
|
||||||
import io.netty.buffer.ByteBuf;
|
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.entity.player.EntityPlayer;
|
||||||
import net.minecraft.inventory.Container;
|
import net.minecraft.inventory.Container;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
@ -37,7 +43,8 @@ import net.minecraft.util.MathHelper;
|
|||||||
import net.minecraft.world.World;
|
import net.minecraft.world.World;
|
||||||
import net.minecraftforge.common.util.ForgeDirection;
|
import net.minecraftforge.common.util.ForgeDirection;
|
||||||
|
|
||||||
public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIProvider, IControlReceiver {
|
@Optional.InterfaceList({@Optional.Interface(iface = "li.cil.oc.api.network.SimpleComponent", modid = "OpenComputers")})
|
||||||
|
public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIProvider, IControlReceiver, SimpleComponent, CompatHandler.OCComponent {
|
||||||
|
|
||||||
public boolean didProcess = false;
|
public boolean didProcess = false;
|
||||||
|
|
||||||
@ -453,4 +460,110 @@ public class TileEntityFusionTorus extends TileEntityCooledBase implements IGUIP
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String getComponentName() {
|
||||||
|
return "ntm_fusion_torus";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getEnergyInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {getPower(), getMaxPower()};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getFluid(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(), tanks[0].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill(), tanks[1].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[2].getFill(), tanks[2].getMaxFill(), tanks[2].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[3].getFill(), tanks[3].getMaxFill(), tanks[3].getTankType().getUnlocalizedName(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getCoolant(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getKlystronEnergy(Context context, Arguments args) {
|
||||||
|
return new Object[] {klystronEnergy};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getPlasmaEnergy(Context context, Arguments args) {
|
||||||
|
return new Object[] {plasmaEnergy};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getFuelConsumption(Context context, Arguments args) {
|
||||||
|
return new Object[] {fuelConsumption};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getRecipeProgress(Context context, Arguments args) {
|
||||||
|
return new Object[] {fusionModule.progress, fusionModule.bonus};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Callback(direct = true)
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] getInfo(Context context, Arguments args) {
|
||||||
|
return new Object[] {
|
||||||
|
getPower(), getMaxPower(),
|
||||||
|
|
||||||
|
tanks[0].getFill(), tanks[0].getMaxFill(), tanks[0].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[1].getFill(), tanks[1].getMaxFill(), tanks[1].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[2].getFill(), tanks[2].getMaxFill(), tanks[2].getTankType().getUnlocalizedName(),
|
||||||
|
tanks[3].getFill(), tanks[3].getMaxFill(), tanks[3].getTankType().getUnlocalizedName(),
|
||||||
|
|
||||||
|
coolantTanks[0].getFill(), coolantTanks[0].getMaxFill(),
|
||||||
|
coolantTanks[1].getFill(), coolantTanks[1].getMaxFill(),
|
||||||
|
|
||||||
|
klystronEnergy, plasmaEnergy, fuelConsumption,
|
||||||
|
fusionModule.progress, fusionModule.bonus
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public String[] methods() {
|
||||||
|
return new String[] {
|
||||||
|
"getEnergyInfo",
|
||||||
|
"getFluid",
|
||||||
|
"getCoolant",
|
||||||
|
"getKlystronEnergy",
|
||||||
|
"getPlasmaEnergy",
|
||||||
|
"getFuelConsumption",
|
||||||
|
"getRecipeProgress",
|
||||||
|
"getInfo"
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
@Optional.Method(modid = "OpenComputers")
|
||||||
|
public Object[] invoke(String method, Context context, Arguments args) throws Exception {
|
||||||
|
switch (method) {
|
||||||
|
case "getEnergyInfo": return getEnergyInfo(context, args);
|
||||||
|
case "getFluid": return getFluid(context, args);
|
||||||
|
case "getCoolant": return getCoolant(context, args);
|
||||||
|
case "getKlystronEnergy": return getKlystronEnergy(context, args);
|
||||||
|
case "getPlasmaEnergy": return getPlasmaEnergy(context, args);
|
||||||
|
case "getFuelConsumption": return getFuelConsumption(context, args);
|
||||||
|
case "getRecipeProgress": return getRecipeProgress(context, args);
|
||||||
|
case "getInfo": return getInfo(context, args);
|
||||||
|
}
|
||||||
|
throw new NoSuchMethodException();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -134,7 +134,9 @@ public class TileEntityDroneDock extends TileEntityRequestNetworkContainer imple
|
|||||||
paths.add(init);
|
paths.add(init);
|
||||||
|
|
||||||
// breadth-first search
|
// breadth-first search
|
||||||
for(int i = 0; i < pathingDepth; i++) {
|
outer: for(int i = 0; i < pathingDepth; i++) {
|
||||||
|
|
||||||
|
int iterationBrake = 1000;
|
||||||
|
|
||||||
List<List<PathNode>> newPaths = new ArrayList();
|
List<List<PathNode>> newPaths = new ArrayList();
|
||||||
|
|
||||||
@ -155,6 +157,11 @@ public class TileEntityDroneDock extends TileEntityRequestNetworkContainer imple
|
|||||||
newPath.add(connectedSafe);
|
newPath.add(connectedSafe);
|
||||||
newPaths.add(newPath);
|
newPaths.add(newPath);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// emergency halt after 1000 iterations, forces pathing depth to proceed
|
||||||
|
// theoretical maximum is therefore 10k iterations
|
||||||
|
iterationBrake--;
|
||||||
|
if(iterationBrake <= 0) continue outer;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ public abstract class TileEntityRequestNetwork extends TileEntityLoadedBase {
|
|||||||
|
|
||||||
PathNode newNode = createNode(pos);
|
PathNode newNode = createNode(pos);
|
||||||
if(this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) newNode.active = false;
|
if(this.worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)) newNode.active = false;
|
||||||
|
else newNode.active = true;
|
||||||
// push new node
|
// push new node
|
||||||
push(worldObj, newNode);
|
push(worldObj, newNode);
|
||||||
|
|
||||||
|
|||||||
@ -411,6 +411,7 @@ container.machineLargeTurbine=Industrielle Dampfturbine
|
|||||||
container.machineLiquefactor=Verflüssiger
|
container.machineLiquefactor=Verflüssiger
|
||||||
container.machineMixer=Industrieller Mixer
|
container.machineMixer=Industrieller Mixer
|
||||||
container.machineOreSlopper=B.E.M.
|
container.machineOreSlopper=B.E.M.
|
||||||
|
container.machinePrecAss=Präzisions-Montagemaschine
|
||||||
container.machinePUREX=PUREX
|
container.machinePUREX=PUREX
|
||||||
container.machinePyroOven=Pyrolyseofen
|
container.machinePyroOven=Pyrolyseofen
|
||||||
container.machineRefinery=Ölraffinerie
|
container.machineRefinery=Ölraffinerie
|
||||||
@ -3767,6 +3768,8 @@ potion.hbm_stability=Stabilität
|
|||||||
potion.hbm_taint=Verdorben
|
potion.hbm_taint=Verdorben
|
||||||
potion.hbm_telekinesis=! ! !
|
potion.hbm_telekinesis=! ! !
|
||||||
|
|
||||||
|
precass.recycle=Recyclen von %s
|
||||||
|
|
||||||
purex.recycle=Wiederanreicherung von %s
|
purex.recycle=Wiederanreicherung von %s
|
||||||
purex.schrab=Schrabidium extrahieren aus %s
|
purex.schrab=Schrabidium extrahieren aus %s
|
||||||
|
|
||||||
@ -4537,6 +4540,7 @@ tile.machine_nuke_furnace_on.name=Atombetriebener Ofen
|
|||||||
tile.machine_orbus.name=Schwerer Magnetischer Lagerbehälter
|
tile.machine_orbus.name=Schwerer Magnetischer Lagerbehälter
|
||||||
tile.machine_ore_slopper.name=Bedrockerzmaschine
|
tile.machine_ore_slopper.name=Bedrockerzmaschine
|
||||||
tile.machine_powerrtg.name=PT-Isotopenzelle
|
tile.machine_powerrtg.name=PT-Isotopenzelle
|
||||||
|
tile.machine_precass.name=Präzisions-Montagemaschine
|
||||||
tile.machine_press.name=Befeuerte Presse
|
tile.machine_press.name=Befeuerte Presse
|
||||||
tile.machine_puf6_tank.name=Plutoniumhexafluorid-Tank
|
tile.machine_puf6_tank.name=Plutoniumhexafluorid-Tank
|
||||||
tile.machine_pumpjack.name=Pferdekopfpumpe
|
tile.machine_pumpjack.name=Pferdekopfpumpe
|
||||||
|
|||||||
@ -816,6 +816,7 @@ container.machineLargeTurbine=Industrial Steam Turbine
|
|||||||
container.machineLiquefactor=Liquefactor
|
container.machineLiquefactor=Liquefactor
|
||||||
container.machineMixer=Industrial Mixer
|
container.machineMixer=Industrial Mixer
|
||||||
container.machineOreSlopper=B.O.P.
|
container.machineOreSlopper=B.O.P.
|
||||||
|
container.machinePrecAss=Precision Assembly Machine
|
||||||
container.machinePUREX=PUREX
|
container.machinePUREX=PUREX
|
||||||
container.machinePyroOven=Pyrolysis Oven
|
container.machinePyroOven=Pyrolysis Oven
|
||||||
container.machineRefinery=Oil Refinery
|
container.machineRefinery=Oil Refinery
|
||||||
@ -4943,6 +4944,8 @@ potion.hbm_stability=Stability
|
|||||||
potion.hbm_taint=Tainted
|
potion.hbm_taint=Tainted
|
||||||
potion.hbm_telekinesis=! ! !
|
potion.hbm_telekinesis=! ! !
|
||||||
|
|
||||||
|
precass.recycle=Recycling of %s
|
||||||
|
|
||||||
purex.recycle=Reprocessing of %s
|
purex.recycle=Reprocessing of %s
|
||||||
purex.schrab=Schrabidium extraction from %s
|
purex.schrab=Schrabidium extraction from %s
|
||||||
|
|
||||||
@ -5804,6 +5807,7 @@ tile.machine_nuke_furnace_on.name=Nuclear Furnace
|
|||||||
tile.machine_orbus.name=Heavy Magnetic Storage Tank
|
tile.machine_orbus.name=Heavy Magnetic Storage Tank
|
||||||
tile.machine_ore_slopper.name=Bedrock Ore Processor
|
tile.machine_ore_slopper.name=Bedrock Ore Processor
|
||||||
tile.machine_powerrtg.name=PT Isotope Cell
|
tile.machine_powerrtg.name=PT Isotope Cell
|
||||||
|
tile.machine_precass.name=Precision Assembly Machine
|
||||||
tile.machine_press.name=Burner Press
|
tile.machine_press.name=Burner Press
|
||||||
tile.machine_puf6_tank.name=Plutonium Hexafluoride Tank
|
tile.machine_puf6_tank.name=Plutonium Hexafluoride Tank
|
||||||
tile.machine_pumpjack.name=Pumpjack
|
tile.machine_pumpjack.name=Pumpjack
|
||||||
|
|||||||
BIN
src/main/resources/assets/hbm/textures/items/blueprints_528.png
Normal file
BIN
src/main/resources/assets/hbm/textures/items/blueprints_528.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 344 B |
Loading…
x
Reference in New Issue
Block a user