Jump to content

V0idWa1k3r

Members
  • Posts

    1773
  • Joined

  • Last visited

  • Days Won

    61

Everything posted by V0idWa1k3r

  1. The method is called twice indeed, once on the server, once on the client as you can see from your console output. Also: If these are fields stored in your items then you can't do that since items are singletons.
  2. You would need to replicate what GuiInventory.drawEntityOnScreen does but instead of calling RenderManager#renderEntity replicate the code that the method invokes, but after the getEntityRenderObject call cast the resulting renderer to RenderPlayer, then you have the access to the player's model through RenderPlayer#getMainModel. This is your ModelRenerer object. Just restore it back to the original stte after you are done rendering.
  3. That is correct. TextureAtlasSprite is, well, a sprite on the atlas. It's not the atlas itself. This is correct. The vertex data contains the UV coordinates to use. Don't do that here. This needs to be done in the texture stich event. As for what you want to do there is a BakedQuadRetextured class already.
  4. If you just extend Container then you need to override Container#transferStackInSlot, as you've said yourself. It's still very much there on my end, so I don't know what your issue here is. Afaik the method didn't get renamed.
  5. Yes, but look at my comment: https://minecraft.gamepedia.com/Model#Block_states If you want to acheive a 22.5 increment then you would need to either use a custom IBakedModel or i think you can use a transform key https://gist.github.com/RainWarrior/0618131f51b8d37b80a6#file-forge-blockstate-v1-specs-L58
  6. You know, if they write code like that and complain about basic syntax errors they should be probably told to go and learn java. Not to be arrogant or anything but if you just throw ready-to-use solutions at them they won't learn and will come back here with a similar problem in a day or so. The purpose of the forums is not to give people code they can just copy-paste without thinking about it.
  7. You'd need to use a TESR anyway to render the text, so... Rotation in the blockstates file can only be done by 90 degrees(0, 90, 180, 270).
  8. Don't do that either. That class is legacy code that won't work properly. Show your code(without extending ITileEntityProvider) https://mcforge.readthedocs.io/en/latest/concepts/sides/#sidedproxy
  9. In that case use a proxy. You can't reference client-only classes(Minecraft, Gui) in common code anyways
  10. Then use a PlayerTick event to check if a player is inside of your block and add the modifier to them if they are(and don't have a modifier) and remove it(if they have it) if they are not. Worst case scenario you are checking 12 blocks each tich which is nothing considering the fast blockstate access and direct reference comparasons(==)
  11. Structures are a part of a datapack, not a resourcepack, thus the root directory for them would be data, not assets.
  12. All you did was rename ModRecipes to BrewingRecipeInk(efectively). That does nothing. You still have the same issue. You can have a million and one classes all extending AbstractBrewingRecipe but if the recipe being registered is not an instance of any of them then they do nothing. The recipe you register needs to be the one that extends AbstractBrewingRecipe, not some random irrelevant class.
  13. Well, what did you expect? If you haven't created a blockstates file for your block then the game is gonna complain that there isn't one. Minecraft itself marks the sign as having a "built-in" model and doesn't even attempt to load it's model as a result. Why not just create an "empty" blockstates file? That would also allow you to define the breaking particle. You could also use a custom implementation of a IStateMapper. Unfortuntely vanilla is pretty bad when it comes to handling exceptional cases. The particle textures for the sign are hardcoded in BlockModelShapes#getTexture. If you want a particle texture yourself then either use an "empty" model or a custom IBakedModel implementation. That's fine. Your code is an insane mess though: Why re you doing (this)? There is no reason to write your code (like that) or {like that}. Don't do that, it is impossible to read and is absolutely not necessarry. Why do you have a \t symbol between your modifiers and the names? That makes no sense and is difficult to read. Where did you get that coding style anyway? I have never seen anybody space their code like that. Don't. There is no need to extend BlockContainer, just extend Block and override Block#createTileEntity and Block#hasTileEntity. This 1) Makes no sense 2) Is reaching across logical sides 3) Will crash on a server Don't ever do that. Use forge's method(EntityPlayer#openGui) to opeen GUI's. Don't reference client-only classes in common code, this will crash the server. Don't reach across logical sides, that WILL break everything possible. And will crash the server. ...Why? It will just return you the said 0. There is no reason to do this. Fix all of these in your code, there are a ton. This is the prime reason why. Do you yourselves understand what's going on here? All of these casts, valueof and stuff are making it impossible to see what's actually going on. It also wastes CPU cycles and RAM space doing pointless boxing/unboxing operations. There is no need to explicitly create a new array here. The input variable is a params one already(... modifier). Don't abuse SideOnly. Have dedicated client-side only event handlers. Dear lord, why? Just compare the block you have to the constant you have in the MyModBlocks. Don't ever do stuff like this. Don't do that, metadata is gone in 1.13 anyway. Just use the blockstate properties. I am not going to complain about magic numbers in your TESR since you just copied the vanilla sign TESR, but don't use magic numbers in general.
  14. Randomly making your classes extend other classes won't do you any good. Your recipe is the one that needs to extend the AbstractBrewingRecipe, not some other random class.
  15. Again, I am notbeing arrogant, you are making a mistake that a person with enough java knowledge would never make. Case and point - if you don't know java - stop. This is not me being arrogant, you simply won't be able to proceed further without knowing the language. You could bash your head against the wall but it will just cause you great frustration. Just learn java if you don't know it enough, don't try building a rocket without the basic understanding of physics and engineering. If you want a better explanation then you need to formulate what you don't understand better. Simply saying "I don't understand what you are saying" isn't helpful and I can't help you with that. Give me a concrete issue you are having that isn't a basic java issue and I will help you with an explanation if nececcarry. If the method isn't static then you need an instance to invoke it, this is basic java. Again, you can use your IDE to figure out how to obtain the instance of Minecraft you need. Well, what do you want me to do? Copy the entire method and go through it line-by-line explaining what each and every line does? You can understand it yourself with enough time and logic, you don't need a stranger on the internet to hold your hand here. Again, give me a concrete problem that you can't solve yourselves and I will try my best to explain it to you.
  16. No. I will not give you code to copy-paste, that's the worst solution possible because you'll just come back to these forums an hour later with a similar problem. Well, the method isn't static thus you can't do that, obviously. But that's basic java. You do know basic java, right? If you don't then you need to learn it before making minecraft mods.
  17. Well, in this case you need to search for ItemRenderer, right? You can use your IDE's "find references" feature to see everything that references ItemRenderer. I don't know about eclipse but IDEA will sort the references by their type - whether it's just an import, a type parameter, etc. In IDEA I would just expad the "method return type" section to see which methods return this to me. That takes maybe 15 seconds or so on average accounting for the search type. Alternatively since I told you that it is provided by Minecraft you could just go into the Minecraft.class and perform a simple search(Ctrl+F) for ItemRenderer. Do the same RenderEntityItem does as I've told you previously but don't create the ItemRenderer, instead use the one Minecraft provides.
  18. Which point do you not understand? "Take the one provided by Minecraft" - Minecraft.class has a ItemRenderer instance that you can obtain via a getter that is called getItemRenderer, you could've found this in less than a minute by yusing your IDE. Start doing that by the way, and IDE is more than just a fancy text editor. Understanding the functionalities of your IDE will save you a lot of time and trouble later on. "Don't do it in the constructor" - exactly as it says, don't write the return value of this method onto a field to use later or you will crash. Do it in your render method. An example of what do you need? How to invoke a method?
  19. This code won't even compile. I told you exactly what you need to do
  20. What's the point in doing capabilities the way you are doing it here? If you want to manipulate the NBT then there is no need for a capability and vice-versa.
  21. This doesn't matter. IHasModel is STILL IHasModel regardless of what you call it. You are usingIHasModel still. Nope, I am suggesting this instead: ForgeRegistries.ITEMS.getValuesCollection().stream().filter(i -> i.getRegistryName().getResourceDomain().equals(VSBRegistryNames.MODID)).forEach(i -> ModelLoader.setCustomModelResourceLocation(i, 0, new ModelResourceLocation(i.getRegistryName(), "inventory"))); No proxy, no for loop, just an elegant one-line solution. If you need custom case models then an interface is acceptable and the code is modified slightly to something like that i -> i instanceof ISpecialModel ? ((ISpecialModel)i).registerModel() : ModelLoader.setCustomModelResourceLocation(...) No, dont ever do that. Don't ever use static initializers for registry entries. All registry entries must be instantinated in the appropriate registry event, otherwise your mod WILL break.
  22. This to me looks like you have a public static final ItemPickaxe COPPER_PICKAXE field in your class, annotated with ObjectHolder but the item with the minetech:copper_pickaxe registry name is actually a hoe. As in your hoe item has a pickaxe's registry name.
  23. First of all drop the IHasModel, it is stupid. All items need models, no exceptions, and IHasModel makes you write unnecessary code. Next of all stop using outdated tutorials. Thirdly never override methods manually. Use your IDE. Lastly this here is a syntax error which your IDE tells you. If you can't fix syntax errors then you need to learn java.
  24. No, put the model in the item folder. Read the docs.
×
×
  • Create New...

Important Information

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