-
Posts
235 -
Joined
-
Last visited
Everything posted by abused_master
-
So i found out *derp* that i had to sync the values with my Container aswell, so i did that public void detectAndSendChanges() { super.detectAndSendChanges(); for (int i = 0; i < this.listeners.size(); ++i) { IContainerListener icontainerlistener = (IContainerListener)this.listeners.get(i); if (this.cookTime != this.tileTestFurnace.getField(0)) { icontainerlistener.sendProgressBarUpdate(this, 2, this.tileTestFurnace.getField(0)); } if (this.totalCookTime != this.tileTestFurnace.getField(1)) { icontainerlistener.sendProgressBarUpdate(this, 3, this.tileTestFurnace.getField(1)); } } this.cookTime = this.tileTestFurnace.getField(0); this.totalCookTime = this.tileTestFurnace.getField(1); } @SideOnly(Side.CLIENT) public void updateProgressBar(int id, int data) { this.tileTestFurnace.setField(id, data); } is this the correct?
-
@Override public void update() { if(!getWorld().isRemote) { PacketHandler.INSTANCE.sendToAll(new MessageTEUpdate(this)); } boolean flag1 = false; if (!this.worldObj.isRemote) { ItemStack itemstack = (ItemStack)this.testFurnaceInv.get(1); if (storage.getEnergyStored() > 50 || !itemstack.func_190926_b() && !((ItemStack)this.testFurnaceInv.get(0)).func_190926_b()) { if (!(storage.getEnergyStored() > 50) && this.canSmelt()) { if (storage.getEnergyStored() > 50) { flag1 = true; if (!itemstack.func_190926_b()) { Item item = itemstack.getItem(); itemstack.func_190918_g(1); if (itemstack.func_190926_b()) { ItemStack item1 = item.getContainerItem(itemstack); this.testFurnaceInv.set(1, item1); } } } } if (storage.getEnergyStored() > 50 && this.canSmelt()) { ++this.cookTime; if (this.cookTime == this.totalCookTime) { this.cookTime = 0; this.totalCookTime = this.getCookTime((ItemStack)this.testFurnaceInv.get(0)); this.SmeltItem(); flag1 = true; } } else { this.cookTime = 0; } } else if (!(storage.getEnergyStored() > 50) && this.cookTime > 0) { this.cookTime = MathHelper.clamp_int(this.cookTime - 2, 0, this.totalCookTime); } } if (flag1) { this.markDirty(); } } public void SmeltItem() { if (this.canPulverize()) { ItemStack itemstack = (ItemStack) this.testFurnaceInv.get(0); ItemStack itemstack1 = RecipeTestFurnace.instance().getSmeltingResult(itemstack); ItemStack itemstack2 = (ItemStack) this.testFurnaceInv.get(1); if (storage.getEnergyStored() >= 50 && !itemstack1.func_190926_b()) { storage.setEnergyStored(storage.getEnergyStored() - 50); if (itemstack2.func_190926_b()) { this.testFurnaceInv.set(1, itemstack1.copy()); } else if (itemstack2.getItem() == itemstack1.getItem()) { itemstack2.func_190917_f(itemstack1.func_190916_E()); } itemstack.func_190918_g(1); } } }
-
Well the result is nothing, no progress bar is rendered, at all, just the plain gui, for the values, im using basically the same stuff the furnace is using just different recipes
-
yeah
-
yeah they are yeah i did type the right values i tested with it, i also tried the code u gave but that didnt solve it either
-
Hey guys, so im working on a furnace sort of block and an having trouble rendering the progress bar, it runs with the same ticks for each item/block as a furnace, so i thought id take a look, and tried doing what the furnace did to see if it would work but even then i cant get it to work, what iv tried public class GuiTestFurnace extends GuiContainer { public static final ResourceLocation TestFurnace = new ResourceLocation(Info.MODID, "textures/gui/test_furnace.png"); public static final int WIDTH = 176; public static final int HEIGHT = 166; TileTestFurnace testFurnace; public GuiPulverizer(TileTestFurnace tileEntity, TestFurnaceContainer container, TileEntity te) { super(container); xSize = WIDTH; ySize = HEIGHT; testFurnace= (TileTestFurnace ) tileEntity; } @Override protected void drawGuiContainerBackgroundLayer(float partialTicks, int mouseX, int mouseY) { mc.getTextureManager().bindTexture(TestFurnace ); drawTexturedModalRect(guiLeft, guiTop, 0, 0, xSize, ySize); int l = this.getCookProgressScaled(24); this.drawTexturedModalRect(guiLeft + 81, guiTop + 27, 176, 46, l + 1, 16); } private int getCookProgressScaled(int pixels) { int i = this.testFurnace.getField(0); int j = this.testFurnace.getField(1); return j != 0 && i != 0 ? i * pixels / j : 0; } } and my getField in my testFurnace is public int getField(int id) { switch (id) { case 0: return this.cookTime; case 1: return this.totalCookTime; default: return 0; } } public void setField(int id, int value) { switch (id) { case 0: this.cookTime = value; break; case 1: this.totalCookTime = value; } }
-
[Solved][1.10.2] Select World Generation
abused_master replied to abused_master's topic in Modder Support
Thanks! i got it working, but what method would i use for always day/day, night shifts -
Hey guys, i was wondering what i would need to do for a mod to make it always generate a select world With this mod i want it to just a regular flat world without any structures, just the standard 2-3layer dirt, 1 layer stone, and then bedrock.
-
Hey guys, so i got a question iv been working on a new mod and remembered model rendering in ISBRH from 1.7.10, and thought it would be neat to have it for 1.10.2+, so i worked on it, and got it for 1.10.2 working, i was wondering if there were any performance issues with it or i should just delete it right now and not bother with it
-
Right now im not starting off with a block model, just a regular 16x16 block
-
Hey, so this time im working on a block like one carpenters had, where you right click a block with another and it changes the texture of it to the one in your hand, and then decreases the stack size of that block -1, i was wondering how can i make my block change its texture to the block the player is holding on right click
-
i dont really have any experience with TESR's, or how to use it to render a model like this
-
Hey guys, im trying to get a "triangle" block or slope, as how carpenters blocks had it with that one slope, but im not sure how to render it, or how to make the model itself, and what format to use(json, java, obj) was hoping one of you guys could help
-
[1.10.2] Any idea how I would go about creating a custom book?
abused_master replied to MaxAskew's topic in Modder Support
Its really Simple, GuiHandler, and make a Gui, and code the stuff into that, then create an item, and make it onItemRightClick open the gui. I suggest taking a look at: http://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/gui-handler/ for the GuiHandler and then you want to look at GuiScreen without Inventory to see how to do the gui: http://bedrockminer.jimdo.com/modding-tutorials/advanced-modding/gui-screen/ i'd also recommend taking a look at vazkii's gui from PSI as an example of how its done, https://github.com/Vazkii/Psi/blob/master/src/main/java/vazkii/psi/client/gui/GuiIntroduction.java -
that didnt change anything
-
Hey guys, im trying to add support for jei to my pulverizer, but am not able to get it working, i tried asking for help from a few people from MMD but they said im doing it the way they are and dont know why its not working, i have looked at the wiki, and various other mods that use it. Basically nothing is erroring, but when i start my game and want to look at a recipe for a dust for example there is none, it just doesnt work/open the gui that shows the recipes in my pulverizer. Code: https://github.com/abused/Tech-Expansion/tree/master/src/main/java/abused_master/TechExpansion/jei
-
Solved, i created a packet and called on that from my TE
-
so iv done a bit of work, and testing, it seems that it is storing it, but its only doing it on server side, so i have to relog to fix it as you can see here how can i make it work on server side aswell so i dont need to update the client
-
So iv done a bit of work and got it to produce power based on the power stored, but am running into a problem my generator stores 50k rf, once full, its supposed to just store the lava thats input into it, but whats happening is the lava is disappearing and no power is being generated Code: Block: @Override public boolean onBlockActivated(World world, BlockPos pos, IBlockState state, EntityPlayer player, EnumHand hand, EnumFacing heldItem, float side, float hitX, float hitY){ if(!world.isRemote){ TileLavaGen lavaGen = (TileLavaGen)world.getTileEntity(pos); ItemStack itemstack = player.getHeldItem(hand); Item item = itemstack.getItem(); if(lavaGen != null && !player.isSneaking() && item != Items.LAVA_BUCKET){ player.openGui(TechExpansion.instance, GuiHandler.GUI_LAVAGEN, world, pos.getX(), pos.getY(), pos.getZ()); }else if(item == Items.LAVA_BUCKET && lavaGen.lavaStored.getFluidAmount() + UtilBase.BUCKET <= 8000){ lavaGen.lavaStored.fillInternal(new FluidStack(FluidRegistry.LAVA, UtilBase.BUCKET), true); player.replaceItemInInventory(player.inventory.currentItem, new ItemStack(Items.BUCKET)); } return true; } return true; } TileEntity: public EnergyStorage storage = new EnergyStorage(50000); public static int PRODUCE = 1000; public static int DRAINPERTICK = 250; public FluidTank lavaStored = new FluidTank(8000); public void handleGenerating() { if(this.lavaStored.getFluidAmount() > 0 && storage.getEnergyStored() < 50000) { storage.receiveEnergy(PRODUCE, false); this.lavaStored.drain(DRAINPERTICK, true); } } also is for my FluidTank method im specifying 8000, is 1000 = 1bucket? or is that 8000 buckets?
-
Hey guys, im working on a lava generator rn and am trying to figure out liquid storage, is there a class i implement on my TileLavaGen? i know how to do everything else but its my first time working with liquids, and how to store them/use them for energy generation.
-
Coal and charcoal use the same item, just different metdata. So just check for Items.COAL without checking metadata and you will cover both. To consume an item you can use the extractItem method on your IItemHandler . How to generate energy from that depends on how you have energy implemented in your system. In the simplest case you only have to increment an int field in your TileEntity class. Im not sure what method to use to check if the item is in that slot
-
Hey guys, i got a few questions regarding a generator im making that uses anything that is burnable #1 how can i check say coal or charcoal was in the slot? #2 how can i make it consume that item and turn it into energy? like a coal generator lets say, and generate the amount energy i want with the value i specify
-
All right, ill check em out, ty
-
yourCapability? do i have to create my own capability? and if so how?
-
public class LeadJetpack extends ItemArmor implements IEnergyContainerItem { public EnergyStorage storage = new EnergyStorage(100000); ModelLeadJetpack pack; public LeadJetpack(ArmorMaterial materialIn, int renderIndexIn, EntityEquipmentSlot equipmentSlotIn) { super(materialIn, renderIndexIn, equipmentSlotIn); this.setCreativeTab(TechExpansion.TechExpansion); this.setMaxStackSize(1); this.setUnlocalizedName("lead_jetpack"); } @SideOnly(Side.CLIENT) public net.minecraft.client.model.ModelBiped getArmorModel(EntityLivingBase entityLiving, ItemStack itemStack, EntityEquipmentSlot armorSlot, net.minecraft.client.model.ModelBiped _default) { return ModelLeadJetpack.INSTANCE; } @Nullable @Override public String getArmorTexture(ItemStack stack, Entity entity, EntityEquipmentSlot slot, String type) { return super.getArmorTexture(stack, entity, slot, type); } @Override public void onArmorTick(World world, EntityPlayer player, ItemStack itemStack) { if(KeybindHandler.keybind.isKeyDown() && storage.getEnergyStored() > 200) { storage.setEnergyStored(storage.getEnergyStored() - 50); player.addVelocity(0, 0.1, 0); player.fallDistance = 0; } super.onArmorTick(world, player, itemStack); } @Override public int receiveEnergy(ItemStack container, int maxReceive, boolean simulate) { return storage.receiveEnergy(maxReceive, simulate); } @Override public int extractEnergy(ItemStack container, int maxExtract, boolean simulate) { return 0; } @Override public int getEnergyStored(ItemStack container) { return storage.getEnergyStored(); } @Override public int getMaxEnergyStored(ItemStack container) { return storage.getMaxEnergyStored(); } @Nullable @Override public ICapabilityProvider initCapabilities(ItemStack stack, @Nullable NBTTagCompound nbt) { return super.initCapabilities(stack, nbt); } }