Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. See how vanilla does it at any of it's guis with buttons, like GuiIngameMenu. A couple of issues I can see: question.drawTextBox(); answerA.drawTextBox(); answerB.drawTextBox(); answerC.drawTextBox(); answerD.drawTextBox(); In initGui? Drawing must happen each frame, not once the GUI is open and never again. You are adding to your list but are never clearing it. Minecraft won't clear your lists for you, so every time the GUI is resized you will put "logical duplicates" into the list. this.drawDefaultBackground(); this.mc.getTextureManager().bindTexture(BACKGROUND_TEXTURE); You need to do something with the texture you are binding(hint: draw it). You can't just bind it and expect it to be drawn. In your current call ordering everything you draw will be drawn over your buttons. Your saveCard method shrinks the size of the item stack... on the client. You can't do that as the server still has different data. You need to use custom packets. After doing that it proceeds to create a new item, write a bunch of stuff into it's NBT and... discards it completely.
  2. new ItemStack(block, amount, metadata)
  3. OreDictionary::getOreIDs takes an ItemStack and returns all ore ids associated with that ItemStack. You can get a string ore name out of an integer ore id using OreDictionary::getOreName. Be aware that if the itemstack has no ore ids associated you will get an empty array of ids. And you also need to be aware that an item may have more than one ore name associated with it, hence the ore id being an array.
  4. Obviously this is null. And interestingly enough you have posted every file you could but the most important one - your entity class. The client is not aware of the parameter change if you do it like this. If you want the client to be aware of some kind of data changes you need to use EntityDataManager and DataParameters. Kinda how boats do that with the BOAT_TYPE parameter. As a side note: ModelLoader is client-side only, you must call it from your proxy/client-only class or you will crash the server. Models must be registered in the appropriate ModelRegistryEvent. Unlocalized names have nothing to do with anything but displaying the name of the item, stop using them. Just use Item::getRegistryName().
  5. Judjing by his crash report(especially the fact that there is optifine mentioned in there) I think he is not a modmaker and posted in the wrong subforum. @Gaming4me am I correct? If I am your solution lies in the fact that you've installed a wrong version of Waila. You need a normal, not dev version.
  6. Clear the relevant lists in your initGui method. By default vanilla clears the button list on gui's resize. If you setup something else in that method you need to clear it beforehand too or you end up with stuff duplicating in your lists. To clarify: This is your culprit. The butonList is cleared before initGui is called, but your allyButtons and enemyButtons are not.
  7. I am literally telling you how to make it so in this entire thread but you are doing something else and asking why is it not working. 1. Create a field/DataManager param that stores the amount of ticks left before the mob can be sheared. 2. Check if this value lequals 0 in your isShearable method 3. Set it to the desired cooldown in onSheared method 4. Decrement it each tick. And you are done.
  8. This is not how you raytrace anything. Items already have a built-in raytrace method conviniently called Item::rayTrace.
  9. What? GuiIngameMenu is a normal GuiScreen, you can just call Minecraft::displayGuiScreen with null as it's argument and call Minecraft::setIngameFocus to close it as most other GUIs. Kinda how it is already done in the very same GuiIngameMenu at GuiIngameMenu::actionPerformed when the button.id is 4.
  10. As you press your button you would need to send a custom packet to the server that does all those operations you want it to do. As it is a container all ItemStacks changes made on the server should automatically be synced to the client watching the GUI.
  11. You can check if the current screen (Minecraft.currentScreen) is an instance of GuiIngameMenu
  12. registry names must be entirely lower case. GameRegistry.register is outdated. You should use registry events. ItemModelMesher is outdated and buggy, never use it. You should use ModelLoader in the approptiate ModelRegistryEvent instead. Or at least do it in pre-init and not init. Your BlockProfanePutrefaction still uses incorrect super call in the code you've attached. Your version is invalid. See this. BlockDirt specifies additional variants to your blockstate, but your json does not contain them. You will need to either override all methods that use them and noop them or choose a different class to extend, like Block. If you want a tool to be effective agains a certain block in that block's constructor you can use Block::setHarvestLevel. The first parameter is a tool class, for a shovel it is "shovel", the second parameter is the harvest level. You can leave it at 0. As it is the material by default that determines whether the block is harvestable by hand or not the GROUND material will still make your block harvestable by hand even if you call this method.
  13. This is the correct way. Please show the code where you initialize your block and the edited block class's constructor.
  14. You still need it regardless of your parent class. Otherwise a lot of things are not set, such as the default blockstate which indirectly controls the texture and the model, or the material which indirectly controls break speed with tools...
  15. You are missing a super call at this constructor.
  16. I literally mean to give them a purpose. Why do you have a method that does nothing? If you do not need them - drop them, you are returning false to begin with and that is a constant value. If you want them to do something - introduce the code to do so. That is irrelevant. The names of methods imply that they are getters and setters for whether your entity was sheared or not. If you do not need them - delete them, this is your own code. If they are supposed to be setters and getters for a value - introduce that value with a field or a DataParameter in the DataManager. This is a basic java concept. I'm not telling you to do that because of code cleanup or something like that. I'm telling you to do so because you are still using those methods as getters and setters which they are not in their current implementation and that can lead to potential issues.
  17. If you want a custom keybind you can't use the default methods, you will need custom packets. The problem with shift-right clicking is that shift is the default keybind to stop riding an entity(or rather it is a sneak keybind and sneaking is what makes you dismount) and that is defined in EntityPlayer so you can't change that. ? If you are creating getters and setters make them have a purpose. Post the log then.
  18. In what way? You can simply check if the player is holding shears or not. If they are - run the shearing code, if they are not - ride your entity.
  19. No, you set it as %modid%:%path%. In your case it would be camfm:blocks/%name%. Also, if this is your folder structure then it is incorrect. The folder structure for resources is assets/modid/. Any other folders(including the textures one) must be located in a folder with a name of your modid. From there you can structure it as you want.
  20. "0": "blocks/gunhilt", "1": "blocks/gunbarrel", "2": "blocks/merp", "3": "blocks/revolver" No they are not. You need to have a modid as a domain for your textures locations otherwise the game is going to look for them at assets/minecraft/textures/
  21. BlockRedstoneDiode::calculateInputStrength is the method you are looking for, not it's update tick. You can adapt the code from that method to check all faces instead of just the input one.
  22. Check how vanilla does it at BlockRedstoneDiode. I believe it has something to do with the fact that Block::canConnectRedstone is actually irrelevant when it comes to recieving weak power and is relevant when it comes to sending it.
  23. Look at the methods in the class you are extending - Gui. The image dimenions are irrelevant as you specify everything yourself.
  24. wr.pos(0, 0, 0).tex(90, 90).endVertex(); wr.pos(0, 256, 0).tex(90, 90).endVertex(); wr.pos(256, 0, 0).tex(90, 90).endVertex(); wr.pos(256, 256, 0).tex(90, 90).endVertex(); Vertices must be specified either CW or CCW, not in a "flipped N" order as you currently are doing(that's why your texture looks like a triangle). UVs range from 0 to 1, and different vertices should have different UVs. ResourceLocation textureLocation = new ResourceLocation("hackerdt", "assets/hackernotify.png"); assets/ gets resolved automatically, you do not need to specify it in your path. You must have your resources(textures/sounds/jsons/etc) in assets/modid/ folder. GlStateManager.pushMatrix(); GlStateManager.popMatrix(); ? RenderGameOverlayEvent has different ElementTypes you need to check, otherwise you will be drawing your image multiple times a frame for each thing the event fires for. A priority of an event is NORMAL by default, you do not need to explicitly specify it.
  25. I assume that you can't use these methods as you do not have the DYE_COLOR data parameter as you manage your sheared items differently and don't exatcly store the wool color anywhere, correct? You do not need these methods then. Simply store your delay and it can be your isSheared indicator aswell - if it is at 0 the mob is not sheared and if it is anything else then the mob was sheared.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.