
Everything posted by SuperHB
-
1.12 Custom Gui Not Showing
Call openGui when world.isRemote is true
-
[1.11.2] Gui drawScreen not with FPS
This is my first time working with partialTicks. I'm guessing I have to use this formula? partialTick + partialTick * (currentTick - previousTick) I have the previousTick and currentTick updated in updateScreen like so: @Override public void updateScreen () { previousTick = currentTick; currentTick++; } But I'm not really sure what to do in drawScreen to make sure it runs the animation consistently
-
[1.11.2] Gui drawScreen not with FPS
I have a tick counter variable and when that reaches a certain number, the code inside the if statement will run. The problem with this is that the speed of the animation now changes depending on FPS. Lets say that every 20 ticks I have the code run. In game, if I get 20 FPS the animation will be slow, but if I have 200 FPS the animation will speed up. I'm wondering how I can stop it from doing this, to keep a consistent speed when the game is running at different FPS.
-
[1.11.2] Gui drawScreen not with FPS
I'm currently working on a mod that adds arcade machines into minecraft. I currently have the gui to render based on ticks. This isn't the best as depending on the FPS the game could run too fast or too slow. I was wondering if it is possible to render parts in GuiScreen#drawScreen consistently at different FPS?
-
[1.11.2] Consume Item when GuiButton is pressed
Thank you! I got everything working now.
-
[1.11.2] Consume Item when GuiButton is pressed
How do I get the packet data from my Gui class?
-
[1.11.2] Consume Item when GuiButton is pressed
I was able to move all the checks to server-side. But how do I send data back to the client? I've been looking around and haven't been able to find how to receive the return from the onMessage
-
[1.11.2] Consume Item when GuiButton is pressed
Thank you. That helped. But what would be the best way to do the checks server-side?
-
[1.11.2] Consume Item when GuiButton is pressed
What I'm trying to accomplish is when the button is pressed it will consume an item in the players inventory. This is what I have currently @Override protected void actionPerformed (GuiButton button) throws IOException { if (button == insertCoin) { if (menu == -1){ EntityPlayer player = Minecraft.getMinecraft().player; if (player.inventory.hasItemStack(new ItemStack(ArcadeItems.coin))) { ItemStack coin = player.inventory.getStackInSlot(player.inventory.getSlotFor(new ItemStack(ArcadeItems.coin))); if (coin.getCount() > cost) { int slot = player.inventory.getSlotFor(new ItemStack(ArcadeItems.coin)); ItemStack newStack = player.inventory.decrStackSize(slot, coin.getCount() - cost); player.inventory.setInventorySlotContents(slot, newStack); menu = 0; } else if (coin.getCount() == cost) { player.inventory.setInventorySlotContents(player.inventory.getSlotFor(new ItemStack(ArcadeItems.coin)), ItemStack.EMPTY); menu = 0; } else enoughCoins = false; } else enoughCoins = false; } } } It does remove a coin, but it only updates client side so relogging into the world I would have the original numbered stack. How do I properly update the player's inventory?
-
[1.11.2] Making a animated block model???
https://github.com/MinecraftForge/MinecraftForge/blob/1.10.x/src/test/java/net/minecraftforge/debug/ModelAnimationDebug.java Some example code for 1.10 by MinecraftForge you can work off of.
-
[SOLVED][1.8]Problem with BlockStates - Slabs'n'Stairs
First of all, metadata can only hold 16 values. Secondly, the HALF variant isn't set to change anywhere in your code.
-
[1.10.2] Submodels within another model?
The Forge documentation gives an example of using submodels here
-
Texture only shown when placed
your file isn't a .json file
-
Texture only shown when placed
try changing your item/BlockSchwarzpulver json to just { "parent": "cyc:block/schwarzpulver" }
-
Texture only shown when placed
forgot the 's'
-
[1.11] Custom Furnace buggy
Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery. Well I meant why are you going to have more than one. Why don't you just use a switch statement or an if else statement to handle your GUIs and Containers? item.getMetadata(1) // Doesn't work the way you think it does. "// TODO: Figure out difference between simulate = true and simulate = false" If simulate is true then the process doesn't happen, if false it does happen. In this case if true it doesn't mess with your ItemStacks, if false the ItemStacks change. Also quick question did you follow a tutorial? I originally followed TheGreyGhost's code here but I'm trying to switch it to Forge's capability system. Also, checked getMetadata, thought it just returned the int I put in, but I switched it to getMetadata(ItemStack) now. For that todo I originally had insertItem, but I switched it to setStackInSlot. I'm guessing it would be better to use insertItem? Thank you for explaining it though.
-
[1.11] Custom Furnace buggy
Do you mean BloomeryGUIHandler and GuiHandlerRegistry? GuiHandlerRegistry is just to register all of my Gui's and BloomeryGUIHandler is specificly for the Bloomery.
-
[1.11] Custom Furnace buggy
I'm currently working on a custom furnace with 2 inputs and 3 outputs and 1 fuel slot. I've got the furnace to smelt but it creates a lot of weird bugs. Which are: 1. When I try to put say 40 coal into the fuel slot, it puts a full stack of 64 coal. That same effect is on every slot that I place items in. It doesn't take the items either, It creates a whole new stack of 64. Sometime it takes the stack, puts it in, but when I try and take it back out, gone. (This seems to only happen when there isn't any inputs and only for the fuel, but if there is an input bug 1 still happens to the fuel) 2. When I try to take the items out of the furnace like the fuel or input or output, it just disappears when I click on it. 3. When both inputs are full, it takes two out of the first input instead of one from both Here is my code: Block TileEntity Container Gui I've been looking at the code inside the container, do I need to override detectAndSendChanges and other functions inside Container to possibly get this to work?
-
[1.11] [Solved] How do I use BlockStates without metadata?
Thank you. That works.
-
[1.11] [Solved] How do I use BlockStates without metadata?
Block class TileEntity class BlockState file Model folder
-
[1.11] [Solved] How do I use BlockStates without metadata?
Figured it out. It can't switch textures. only models. Is that a possible bug?
-
[1.11] [Solved] How do I use BlockStates without metadata?
I followed the Custom Furnace code by TheGreyGhost and the furnace doesn't use metadata to store its states either but it works. I've been looking through the code for it and changing my block but it's not making a difference. Here is the code if you want to take a look through it: https://github.com/TheGreyGhost/MinecraftByExample/tree/b1f1192efe029a8e8c1dff47c82da76fb80509b7/src/main/java/minecraftbyexample/mbe31_inventory_furnace
-
[1.11] [Solved] How do I use BlockStates without metadata?
What if you just don't mention the banner_top & bottom textures in the model file? Purple and black texture aswell
-
[1.11] [Solved] How do I use BlockStates without metadata?
bump.
-
[1.11] [Solved] How do I use BlockStates without metadata?
Well that's why you see blocks/debug. I'm going to be using more than 14 (I have 19 right now). I had more than 16 but I commented them out as I was going to use metadata before I found out that you can have more than 16 state. Also Im going to be using the metadata for probably facing. If i set the textures to nothing in the model file it would give me the purple/black texture.
IPS spam blocked by CleanTalk.