mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-03-24 02:44:34 +00:00
homosexual garfield be like: "i love lasagna.....and cock!"
This commit is contained in:
parent
94d37e3910
commit
da0d355565
@ -1,10 +1,17 @@
|
|||||||
|
## Added
|
||||||
|
* Plasma forge
|
||||||
|
* Plasma-powered assembly machine
|
||||||
|
* Used to produce lategame items that until now were regular assembler recipes
|
||||||
|
|
||||||
## Changed
|
## Changed
|
||||||
* Doubled bismuth and tantalum yields from high-performance solvent bedrock ore processing
|
* Doubled bismuth and tantalum yields from high-performance solvent bedrock ore processing
|
||||||
* Hoppers and buckets can now be made out of steel
|
* Hoppers and buckets can now be made out of steel
|
||||||
* RoR gauges now show the lowest and highest configured value on the actual gauge
|
* RoR gauges now show the lowest and highest configured value on the actual gauge
|
||||||
* The steel sword now looks like a medival broad sword with the appropriate scale
|
* The steel sword now looks like a medival broad sword with the appropriate scale
|
||||||
* All remaining items have been removed from the template folder, siren tracks and plate stamps are now made in th
|
* All remaining items have been removed from the template folder, siren tracks and plate stamps are now made in th
|
||||||
|
* Gerald assembly now requires stellar flux
|
||||||
|
|
||||||
## Fixed
|
## Fixed
|
||||||
* Fixed size 15 dual kerosene thruster not rendering at all
|
* Fixed size 15 dual kerosene thruster not rendering at all
|
||||||
* Fixed HUD/jetpack toggle popup not working at all on multiplayer servers
|
* Fixed HUD/jetpack toggle popup not working at all on multiplayer servers
|
||||||
|
* Fixed assembly machine NEI handler not being able to handle all thirteen inputs at once
|
||||||
@ -3,6 +3,9 @@ package com.hbm.handler.nei;
|
|||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.inventory.recipes.AssemblyMachineRecipes;
|
import com.hbm.inventory.recipes.AssemblyMachineRecipes;
|
||||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
|
import com.hbm.inventory.recipes.loader.GenericRecipes;
|
||||||
|
|
||||||
|
import net.minecraft.block.Block;
|
||||||
|
|
||||||
public class AssemblyMachineRecipeHandler extends NEIGenericRecipeHandler {
|
public class AssemblyMachineRecipeHandler extends NEIGenericRecipeHandler {
|
||||||
|
|
||||||
@ -10,9 +13,20 @@ public class AssemblyMachineRecipeHandler extends NEIGenericRecipeHandler {
|
|||||||
super(ModBlocks.machine_assembly_machine.getLocalizedName(), AssemblyMachineRecipes.INSTANCE, ModBlocks.machine_assembly_machine);
|
super(ModBlocks.machine_assembly_machine.getLocalizedName(), AssemblyMachineRecipes.INSTANCE, ModBlocks.machine_assembly_machine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public AssemblyMachineRecipeHandler(String displayName, GenericRecipes recipeSet, Block... machines) { super(displayName, recipeSet, machines); }
|
||||||
|
|
||||||
@Override public String getRecipeID() { return "ntmAssemblyMachine"; }
|
@Override public String getRecipeID() { return "ntmAssemblyMachine"; }
|
||||||
|
|
||||||
@Override public int getInputXOffset(GenericRecipe recipe, int inputCount) { return recipe.inputItem != null && recipe.inputItem.length > 9 ? 18 : 0; }
|
@Override public int getInputXOffset(GenericRecipe recipe, int inputCount) { return inputCount > 12 ? -9 : inputCount > 9 ? 18 : 0; }
|
||||||
@Override public int getOutputXOffset(GenericRecipe recipe, int outputCount) { return recipe.inputItem != null && recipe.inputItem.length > 9 ? 18 : 0; }
|
@Override public int getOutputXOffset(GenericRecipe recipe, int outputCount) { return getOffset(recipe); }
|
||||||
@Override public int getMachineXOffset(GenericRecipe recipe) { return recipe.inputItem != null && recipe.inputItem.length > 9 ? 18 : 0; }
|
@Override public int getMachineXOffset(GenericRecipe recipe) { return getOffset(recipe); }
|
||||||
|
|
||||||
|
public int getOffset(GenericRecipe recipe) {
|
||||||
|
int length = 0;
|
||||||
|
if(recipe.inputItem != null) length += recipe.inputItem.length;
|
||||||
|
if(recipe.inputFluid != null) length += recipe.inputFluid.length;
|
||||||
|
if(length > 12) return 27;
|
||||||
|
if(length > 9) return 18;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -0,0 +1,13 @@
|
|||||||
|
package com.hbm.handler.nei;
|
||||||
|
|
||||||
|
import com.hbm.blocks.ModBlocks;
|
||||||
|
import com.hbm.inventory.recipes.PlasmaForgeRecipes;
|
||||||
|
|
||||||
|
public class PlasmaForgeRecipeHandler extends AssemblyMachineRecipeHandler {
|
||||||
|
|
||||||
|
public PlasmaForgeRecipeHandler() {
|
||||||
|
super(ModBlocks.fusion_plasma_forge.getLocalizedName(), PlasmaForgeRecipes.INSTANCE, ModBlocks.fusion_plasma_forge);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override public String getRecipeID() { return "ntmPlasmaForge"; }
|
||||||
|
}
|
||||||
@ -0,0 +1,70 @@
|
|||||||
|
package com.hbm.inventory.container;
|
||||||
|
|
||||||
|
import com.hbm.inventory.SlotCraftingOutput;
|
||||||
|
import com.hbm.inventory.SlotNonRetarded;
|
||||||
|
import com.hbm.items.ModItems;
|
||||||
|
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 ContainerMachinePlasmaForge extends ContainerBase {
|
||||||
|
|
||||||
|
public ContainerMachinePlasmaForge(InventoryPlayer invPlayer, IInventory assembler) {
|
||||||
|
super(invPlayer, assembler);
|
||||||
|
|
||||||
|
// Battery
|
||||||
|
this.addSlotToContainer(new SlotNonRetarded(assembler, 0, 152, 82));
|
||||||
|
// Schematic
|
||||||
|
this.addSlotToContainer(new SlotNonRetarded(assembler, 1, 35, 81));
|
||||||
|
// Booster
|
||||||
|
this.addSlotToContainer(new SlotNonRetarded(assembler, 2, 98, 116));
|
||||||
|
// Input
|
||||||
|
this.addSlots(assembler, 3, 8, 18, 3, 4);
|
||||||
|
// Output
|
||||||
|
this.addSlotToContainer(new SlotCraftingOutput(invPlayer.player, assembler, 15, 116, 36));
|
||||||
|
|
||||||
|
this.playerInv(invPlayer, 8, 162);
|
||||||
|
}
|
||||||
|
|
||||||
|
@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(!InventoryUtil.mergeItemStack(this.inventorySlots, slotStack, 2, 15, false)) return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(slotStack.stackSize == 0) {
|
||||||
|
slot.putStack(null);
|
||||||
|
} else {
|
||||||
|
slot.onSlotChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
slot.onPickupFromSlot(player, slotStack);
|
||||||
|
}
|
||||||
|
|
||||||
|
return slotOriginal;
|
||||||
|
}
|
||||||
|
}
|
||||||
122
src/main/java/com/hbm/inventory/gui/GUIMachinePlasmaForge.java
Normal file
122
src/main/java/com/hbm/inventory/gui/GUIMachinePlasmaForge.java
Normal file
@ -0,0 +1,122 @@
|
|||||||
|
package com.hbm.inventory.gui;
|
||||||
|
|
||||||
|
import org.lwjgl.opengl.GL11;
|
||||||
|
|
||||||
|
import com.hbm.inventory.container.ContainerMachinePlasmaForge;
|
||||||
|
import com.hbm.inventory.recipes.AssemblyMachineRecipes;
|
||||||
|
import com.hbm.inventory.recipes.PlasmaForgeRecipes;
|
||||||
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
|
import com.hbm.items.machine.ItemBlueprints;
|
||||||
|
import com.hbm.lib.RefStrings;
|
||||||
|
import com.hbm.tileentity.machine.fusion.TileEntityFusionPlasmaForge;
|
||||||
|
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 GUIMachinePlasmaForge extends GuiInfoContainer {
|
||||||
|
|
||||||
|
private static ResourceLocation texture = new ResourceLocation(RefStrings.MODID + ":textures/gui/reactors/gui_fusion_plasmaforge.png");
|
||||||
|
private TileEntityFusionPlasmaForge assembler;
|
||||||
|
|
||||||
|
public GUIMachinePlasmaForge(InventoryPlayer invPlayer, TileEntityFusionPlasmaForge tedf) {
|
||||||
|
super(new ContainerMachinePlasmaForge(invPlayer, tedf));
|
||||||
|
assembler = tedf;
|
||||||
|
|
||||||
|
this.xSize = 176;
|
||||||
|
this.ySize = 244;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void drawScreen(int mouseX, int mouseY, float f) {
|
||||||
|
super.drawScreen(mouseX, mouseY, f);
|
||||||
|
|
||||||
|
assembler.inputTank.renderTankInfo(this, mouseX, mouseY, guiLeft + 80, guiTop + 18, 16, 52);
|
||||||
|
|
||||||
|
this.drawElectricityInfo(this, mouseX, mouseY, guiLeft + 152, guiTop + 18, 16, 62, assembler.power, assembler.maxPower);
|
||||||
|
|
||||||
|
if(guiLeft + 7 <= mouseX && guiLeft + 7 + 18 > mouseX && guiTop + 80 < mouseY && guiTop + 80 + 18 >= mouseY) {
|
||||||
|
if(this.assembler.plasmaModule.recipe != null && PlasmaForgeRecipes.INSTANCE.recipeNameMap.containsKey(this.assembler.plasmaModule.recipe)) {
|
||||||
|
GenericRecipe recipe = (GenericRecipe) PlasmaForgeRecipes.INSTANCE.recipeNameMap.get(this.assembler.plasmaModule.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, 80, 18, 18)) GUIScreenRecipeSelector.openSelector(PlasmaForgeRecipes.INSTANCE, assembler, assembler.plasmaModule.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.plasmaModule.progress > 0) {
|
||||||
|
int j = (int) Math.ceil(70 * assembler.plasmaModule.progress);
|
||||||
|
drawTexturedModalRect(guiLeft + 62, guiTop + 126, 176, 61, j, 16);
|
||||||
|
}
|
||||||
|
|
||||||
|
GenericRecipe recipe = AssemblyMachineRecipes.INSTANCE.recipeNameMap.get(assembler.plasmaModule.recipe);
|
||||||
|
|
||||||
|
/// LEFT LED
|
||||||
|
if(assembler.didProcess) {
|
||||||
|
drawTexturedModalRect(guiLeft + 51, guiTop + 76, 195, 0, 3, 6);
|
||||||
|
} else if(recipe != null) {
|
||||||
|
drawTexturedModalRect(guiLeft + 51, guiTop + 76, 192, 0, 3, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// RIGHT LED
|
||||||
|
if(assembler.didProcess) {
|
||||||
|
drawTexturedModalRect(guiLeft + 56, guiTop + 76, 195, 0, 3, 6);
|
||||||
|
} else if(recipe != null && assembler.power >= recipe.power) {
|
||||||
|
drawTexturedModalRect(guiLeft + 56, guiTop + 76, 192, 0, 3, 6);
|
||||||
|
}
|
||||||
|
|
||||||
|
this.renderItem(recipe != null ? recipe.getIcon() : TEMPLATE_FOLDER, 8, 80);
|
||||||
|
|
||||||
|
if(recipe != null && recipe.inputItem != null) {
|
||||||
|
for(int i = 0; i < recipe.inputItem.length; i++) {
|
||||||
|
Slot slot = (Slot) this.inventorySlots.inventorySlots.get(assembler.plasmaModule.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.plasmaModule.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 + 80, guiTop + 70, this.zLevel, 16, 52);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -12,9 +12,6 @@ import org.lwjgl.opengl.GL12;
|
|||||||
|
|
||||||
import com.hbm.inventory.recipes.CrucibleRecipes;
|
import com.hbm.inventory.recipes.CrucibleRecipes;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemCassette;
|
|
||||||
import com.hbm.items.machine.ItemStamp;
|
|
||||||
import com.hbm.items.machine.ItemStamp.StampType;
|
|
||||||
import com.hbm.lib.RefStrings;
|
import com.hbm.lib.RefStrings;
|
||||||
import com.hbm.main.MainRegistry;
|
import com.hbm.main.MainRegistry;
|
||||||
import com.hbm.packet.PacketDispatcher;
|
import com.hbm.packet.PacketDispatcher;
|
||||||
|
|||||||
@ -1102,7 +1102,7 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
|||||||
new ComparableStack(ModItems.thruster_small, 1),
|
new ComparableStack(ModItems.thruster_small, 1),
|
||||||
new ComparableStack(ModItems.photo_panel, 12),
|
new ComparableStack(ModItems.photo_panel, 12),
|
||||||
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LITHIUM)));
|
new ComparableStack(ModItems.battery_pack, 1, EnumBatteryPack.BATTERY_LITHIUM)));
|
||||||
this.register(new GenericRecipe("ass.gerald").setup(6_000, 100).outputItems(new ItemStack(ModItems.sat_gerald, 1))
|
this.register(new GenericRecipe("ass.gerald").setup(6_000, 100).outputItems(new ItemStack(ModItems.sat_gerald, 1)).inputFluids(new FluidStack(Fluids.STELLAR_FLUX, 16_000))
|
||||||
.inputItems(new OreDictStack(SBD.plateCast(), 64),
|
.inputItems(new OreDictStack(SBD.plateCast(), 64),
|
||||||
new OreDictStack(SBD.plateCast(), 64),
|
new OreDictStack(SBD.plateCast(), 64),
|
||||||
new OreDictStack(BSCCO.wireDense(), 64),
|
new OreDictStack(BSCCO.wireDense(), 64),
|
||||||
@ -1112,6 +1112,7 @@ public class AssemblyMachineRecipes extends GenericRecipes<GenericRecipe> {
|
|||||||
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
||||||
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
||||||
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
||||||
|
new ComparableStack(ModItems.part_generic, 64, EnumPartType.HDE),
|
||||||
new ComparableStack(ModItems.circuit, 64, EnumCircuitType.CONTROLLER_QUANTUM),
|
new ComparableStack(ModItems.circuit, 64, EnumCircuitType.CONTROLLER_QUANTUM),
|
||||||
new ComparableStack(ModItems.coin_ufo, 1))
|
new ComparableStack(ModItems.coin_ufo, 1))
|
||||||
.inputItemsEx(new OreDictStack(SBD.plateCast(), 64),
|
.inputItemsEx(new OreDictStack(SBD.plateCast(), 64),
|
||||||
|
|||||||
@ -94,6 +94,7 @@ public abstract class SerializableRecipe {
|
|||||||
recipeHandlers.add(PUREXRecipes.INSTANCE);
|
recipeHandlers.add(PUREXRecipes.INSTANCE);
|
||||||
recipeHandlers.add(FusionRecipes.INSTANCE);
|
recipeHandlers.add(FusionRecipes.INSTANCE);
|
||||||
recipeHandlers.add(PrecAssRecipes.INSTANCE);
|
recipeHandlers.add(PrecAssRecipes.INSTANCE);
|
||||||
|
recipeHandlers.add(PlasmaForgeRecipes.INSTANCE);
|
||||||
|
|
||||||
recipeHandlers.add(new MatDistribution());
|
recipeHandlers.add(new MatDistribution());
|
||||||
recipeHandlers.add(new CustomMachineRecipes());
|
recipeHandlers.add(new CustomMachineRecipes());
|
||||||
|
|||||||
@ -2,9 +2,6 @@ package com.hbm.items.machine;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
import com.hbm.util.i18n.I18nUtil;
|
|
||||||
|
|
||||||
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 net.minecraft.client.renderer.texture.IIconRegister;
|
import net.minecraft.client.renderer.texture.IIconRegister;
|
||||||
@ -12,7 +9,6 @@ import net.minecraft.creativetab.CreativeTabs;
|
|||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.EnumChatFormatting;
|
|
||||||
import net.minecraft.util.IIcon;
|
import net.minecraft.util.IIcon;
|
||||||
import net.minecraft.util.ResourceLocation;
|
import net.minecraft.util.ResourceLocation;
|
||||||
|
|
||||||
@ -97,34 +93,27 @@ public class ItemCassette extends Item {
|
|||||||
SOUND;
|
SOUND;
|
||||||
};
|
};
|
||||||
|
|
||||||
public ItemCassette()
|
public ItemCassette() {
|
||||||
{
|
this.setHasSubtypes(true);
|
||||||
this.setHasSubtypes(true);
|
this.setMaxDamage(0);
|
||||||
this.setMaxDamage(0);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
|
||||||
public void getSubItems(Item item, CreativeTabs tabs, List list)
|
|
||||||
{
|
|
||||||
for (int i = 1; i < TrackType.values().length; ++i)
|
|
||||||
{
|
|
||||||
list.add(new ItemStack(item, 1, i));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool)
|
@SideOnly(Side.CLIENT)
|
||||||
{
|
public void getSubItems(Item item, CreativeTabs tabs, List list) {
|
||||||
|
for(int i = 1; i < TrackType.values().length; ++i) {
|
||||||
|
list.add(new ItemStack(item, 1, i));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(!(stack.getItem() instanceof ItemCassette))
|
@Override
|
||||||
return;
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||||
|
if(!(stack.getItem() instanceof ItemCassette)) return;
|
||||||
|
|
||||||
|
list.add("Siren sound cassette:");
|
||||||
list.add("Siren sound cassette:");
|
list.add(" Name: " + TrackType.getEnum(stack.getItemDamage()).getTrackTitle());
|
||||||
list.add(" Name: " + TrackType.getEnum(stack.getItemDamage()).getTrackTitle());
|
list.add(" Type: " + TrackType.getEnum(stack.getItemDamage()).getType().name());
|
||||||
list.add(" Type: " + TrackType.getEnum(stack.getItemDamage()).getType().name());
|
list.add(" Volume: " + TrackType.getEnum(stack.getItemDamage()).getVolume());
|
||||||
list.add(" Volume: " + TrackType.getEnum(stack.getItemDamage()).getVolume());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static TrackType getType(ItemStack stack) {
|
public static TrackType getType(ItemStack stack) {
|
||||||
@ -134,47 +123,31 @@ public class ItemCassette extends Item {
|
|||||||
return TrackType.NULL;
|
return TrackType.NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public boolean requiresMultipleRenderPasses()
|
public boolean requiresMultipleRenderPasses() {
|
||||||
{
|
return true;
|
||||||
return true;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public void registerIcons(IIconRegister p_94581_1_)
|
public void registerIcons(IIconRegister p_94581_1_) {
|
||||||
{
|
super.registerIcons(p_94581_1_);
|
||||||
super.registerIcons(p_94581_1_);
|
this.overlayIcon = p_94581_1_.registerIcon("hbm:cassette_overlay");
|
||||||
|
}
|
||||||
|
|
||||||
this.overlayIcon = p_94581_1_.registerIcon("hbm:cassette_overlay");
|
@Override
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public IIcon getIconFromDamageForRenderPass(int p_77618_1_, int p_77618_2_)
|
public IIcon getIconFromDamageForRenderPass(int meta, int pass) {
|
||||||
{
|
return pass == 1 ? this.overlayIcon : super.getIconFromDamageForRenderPass(meta, pass);
|
||||||
return p_77618_2_ == 1 ? this.overlayIcon : super.getIconFromDamageForRenderPass(p_77618_1_, p_77618_2_);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@SideOnly(Side.CLIENT)
|
@SideOnly(Side.CLIENT)
|
||||||
public int getColorFromItemStack(ItemStack stack, int p_82790_2_)
|
public int getColorFromItemStack(ItemStack stack, int pass) {
|
||||||
{
|
if(pass == 0) return 16777215;
|
||||||
if (p_82790_2_ == 0)
|
int j = TrackType.getEnum(stack.getItemDamage()).getColor();
|
||||||
{
|
if(j < 0) j = 16777215;
|
||||||
return 16777215;
|
return j;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
int j = TrackType.getEnum(stack.getItemDamage()).getColor();
|
|
||||||
|
|
||||||
if (j < 0)
|
|
||||||
{
|
|
||||||
j = 16777215;
|
|
||||||
}
|
|
||||||
|
|
||||||
return j;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -4,7 +4,6 @@ import java.util.ArrayList;
|
|||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
import net.minecraft.item.ItemStack;
|
import net.minecraft.item.ItemStack;
|
||||||
|
|
||||||
|
|||||||
@ -42,6 +42,7 @@ public class NEIRegistry {
|
|||||||
handlers.add(new CrystallizerRecipeHandler());
|
handlers.add(new CrystallizerRecipeHandler());
|
||||||
handlers.add(new BookRecipeHandler());
|
handlers.add(new BookRecipeHandler());
|
||||||
handlers.add(new FusionRecipeHandler());
|
handlers.add(new FusionRecipeHandler());
|
||||||
|
handlers.add(new PlasmaForgeRecipeHandler());
|
||||||
handlers.add(new SILEXRecipeHandler());
|
handlers.add(new SILEXRecipeHandler());
|
||||||
handlers.add(new FuelPoolHandler());
|
handlers.add(new FuelPoolHandler());
|
||||||
handlers.add(new RBMKRodDisassemblyHandler());
|
handlers.add(new RBMKRodDisassemblyHandler());
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
package com.hbm.tileentity.machine.fusion;
|
package com.hbm.tileentity.machine.fusion;
|
||||||
|
|
||||||
import com.hbm.interfaces.IControlReceiver;
|
import com.hbm.interfaces.IControlReceiver;
|
||||||
|
import com.hbm.inventory.container.ContainerMachinePlasmaForge;
|
||||||
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.gui.GUIMachinePlasmaForge;
|
||||||
import com.hbm.inventory.recipes.PlasmaForgeRecipes;
|
import com.hbm.inventory.recipes.PlasmaForgeRecipes;
|
||||||
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
import com.hbm.inventory.recipes.loader.GenericRecipe;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
@ -17,12 +19,14 @@ import api.hbm.energymk2.IEnergyReceiverMK2;
|
|||||||
import api.hbm.fluidmk2.IFluidStandardReceiverMK2;
|
import api.hbm.fluidmk2.IFluidStandardReceiverMK2;
|
||||||
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 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;
|
||||||
import net.minecraft.nbt.NBTTagCompound;
|
import net.minecraft.nbt.NBTTagCompound;
|
||||||
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;
|
||||||
|
|
||||||
public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider {
|
public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implements IEnergyReceiverMK2, IFluidStandardReceiverMK2, IControlReceiver, IGUIProvider {
|
||||||
|
|
||||||
@ -30,6 +34,7 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
|||||||
|
|
||||||
public long power;
|
public long power;
|
||||||
public long maxPower = 10_000_000;
|
public long maxPower = 10_000_000;
|
||||||
|
public boolean didProcess;
|
||||||
|
|
||||||
public ModuleMachinePlasma plasmaModule;
|
public ModuleMachinePlasma plasmaModule;
|
||||||
|
|
||||||
@ -63,15 +68,75 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
|||||||
this.trySubscribe(worldObj, pos);
|
this.trySubscribe(worldObj, pos);
|
||||||
if(inputTank.getTankType() != Fluids.NONE) this.trySubscribe(inputTank.getTankType(), worldObj, pos);
|
if(inputTank.getTankType() != Fluids.NONE) this.trySubscribe(inputTank.getTankType(), worldObj, pos);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double speed = 1D;
|
||||||
|
double pow = 1D;
|
||||||
|
|
||||||
|
this.plasmaModule.update(speed, pow, true, slots[1]);
|
||||||
|
this.didProcess = this.plasmaModule.didProcess;
|
||||||
|
if(this.plasmaModule.markDirty) this.markDirty();
|
||||||
|
|
||||||
|
this.networkPackNT(100);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public DirPos[] getConPos() {
|
public DirPos[] getConPos() {
|
||||||
return new DirPos[] {
|
ForgeDirection dir = ForgeDirection.getOrientation(this.getBlockMetadata() - 10);
|
||||||
|
ForgeDirection rot = dir.getRotation(ForgeDirection.UP);
|
||||||
|
|
||||||
|
return new DirPos[] {
|
||||||
|
new DirPos(xCoord + dir.offsetX * 6 - rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 6 - rot.offsetZ * 2, dir),
|
||||||
|
new DirPos(xCoord + dir.offsetX * 6 - rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 6 - rot.offsetZ * 1, dir),
|
||||||
|
new DirPos(xCoord + dir.offsetX * 6 + rot.offsetX * 0, yCoord, zCoord + dir.offsetZ * 6 + rot.offsetZ * 0, dir),
|
||||||
|
new DirPos(xCoord + dir.offsetX * 6 + rot.offsetX * 1, yCoord, zCoord + dir.offsetZ * 6 + rot.offsetZ * 1, dir),
|
||||||
|
new DirPos(xCoord + dir.offsetX * 6 + rot.offsetX * 2, yCoord, zCoord + dir.offsetZ * 6 + rot.offsetZ * 2, dir),
|
||||||
|
new DirPos(xCoord - dir.offsetX * 6 - rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 6 - rot.offsetZ * 2, dir.getOpposite()),
|
||||||
|
new DirPos(xCoord - dir.offsetX * 6 - rot.offsetX * 1, yCoord, zCoord - dir.offsetZ * 6 - rot.offsetZ * 1, dir.getOpposite()),
|
||||||
|
new DirPos(xCoord - dir.offsetX * 6 + rot.offsetX * 0, yCoord, zCoord - dir.offsetZ * 6 + rot.offsetZ * 0, dir.getOpposite()),
|
||||||
|
new DirPos(xCoord - dir.offsetX * 6 + rot.offsetX * 1, yCoord, zCoord - dir.offsetZ * 6 + rot.offsetZ * 1, dir.getOpposite()),
|
||||||
|
new DirPos(xCoord - dir.offsetX * 6 + rot.offsetX * 2, yCoord, zCoord - dir.offsetZ * 6 + rot.offsetZ * 2, dir.getOpposite()),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void serialize(ByteBuf buf) {
|
||||||
|
super.serialize(buf);
|
||||||
|
this.inputTank.serialize(buf);
|
||||||
|
buf.writeLong(power);
|
||||||
|
buf.writeLong(maxPower);
|
||||||
|
buf.writeBoolean(didProcess);
|
||||||
|
this.plasmaModule.serialize(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deserialize(ByteBuf buf) {
|
||||||
|
super.deserialize(buf);
|
||||||
|
boolean wasProcessing = this.didProcess;
|
||||||
|
this.inputTank.deserialize(buf);
|
||||||
|
this.power = buf.readLong();
|
||||||
|
this.maxPower = buf.readLong();
|
||||||
|
this.didProcess = buf.readBoolean();
|
||||||
|
this.plasmaModule.deserialize(buf);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void readFromNBT(NBTTagCompound nbt) {
|
||||||
|
super.readFromNBT(nbt);
|
||||||
|
this.inputTank.readFromNBT(nbt, "i");
|
||||||
|
this.power = nbt.getLong("power");
|
||||||
|
this.maxPower = nbt.getLong("maxPower");
|
||||||
|
this.plasmaModule.readFromNBT(nbt);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void writeToNBT(NBTTagCompound nbt) {
|
||||||
|
super.writeToNBT(nbt);
|
||||||
|
this.inputTank.writeToNBT(nbt, "i");
|
||||||
|
nbt.setLong("power", power);
|
||||||
|
nbt.setLong("maxPower", maxPower);
|
||||||
|
this.plasmaModule.writeToNBT(nbt);
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
public boolean isItemValidForSlot(int slot, ItemStack stack) {
|
||||||
if(slot == 0) return true; // battery
|
if(slot == 0) return true; // battery
|
||||||
@ -102,7 +167,14 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void receiveControl(NBTTagCompound data) {
|
public void receiveControl(NBTTagCompound data) {
|
||||||
|
if(data.hasKey("index") && data.hasKey("selection")) {
|
||||||
|
int index = data.getInteger("index");
|
||||||
|
String selection = data.getString("selection");
|
||||||
|
if(index == 0) {
|
||||||
|
this.plasmaModule.recipe = selection;
|
||||||
|
this.markChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
AxisAlignedBB bb = null;
|
AxisAlignedBB bb = null;
|
||||||
@ -119,13 +191,6 @@ public class TileEntityFusionPlasmaForge extends TileEntityMachineBase implement
|
|||||||
return 65536.0D;
|
return 65536.0D;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) { return new ContainerMachinePlasmaForge(player.inventory, this); }
|
||||||
public Container provideContainer(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
@Override @SideOnly(Side.CLIENT) public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) { return new GUIMachinePlasmaForge(player.inventory, this); }
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public Object provideGUI(int ID, EntityPlayer player, World world, int x, int y, int z) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 7.1 KiB After Width: | Height: | Size: 7.0 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 282 B |
Binary file not shown.
|
After Width: | Height: | Size: 334 B |
Loading…
x
Reference in New Issue
Block a user