Everything posted by V0idWa1k3r
-
Forge config gui
It is true for 1.11 aswell. You can still use both. The annotation based config system is just less messy and easier to use in general.
-
[1.12] Tile entity doesn't save itemstacks
Why are you never breaking your loop is a question for you, the equality check is not responsible for it. The getCardAmount currenty checks if the itemstack in a slot is an empty stack and increments the counter. It should do the opposite though considering it's usage. I am not sure why the code you've posted crashes the game. The cards list is not null, it can't contain a null element and you are not going out of bounds. Additionally I am unable to encounter any exception with this method. What is the exception exactly? It still will only count empty items though. And will stop counting them as soon as it hits a non-empty item. Edit: after a bit of debugging I found why your items are never added to the box. You are still shrinking the itemstack, just this time in your block code. You are still effectively adding an empty stack to the list. Adding a copy of the stack into the list instead of the stack itself fixes the issue and cards can be inserted/extracted just fine after fixing the getCardAmount method that is. I also could not get any exceptions even without the method not being fixed so I really do not know what that was about.
-
[1.12] Tile entity doesn't save itemstacks
if(cards.get(i) == ItemStack.EMPTY) Don't compare it to an empty stack directly, use ItemStack::isEmpty. Same goes for your getRandomCard and getCardAmount methods. In your addCard method you actually never stop your for loop and end up insterting your card into every possible list position that is not empty. Your getCardAmount actually does the opposite of what it is supposed to do.
-
What is the event for zombies breaking down doors?
You need to iterate the tasks.taskEntries to find the one you want to remove. Removing the object you've just created is not going to work in most cases as it won't be present. Your AI task can just extend EntityAIBreakDoor and that way you don't need to maintain a copy of vanilla's code. You can override the shouldExecute method and && the super condition and your condition just fine.
-
[1.12] Tile entity doesn't save itemstacks
If your list has a fixed size then adding/removing things from it will indeed throw an exception as it's delegate list will be a Arrays.ArrayList(not to be confused with java.util.ArrayList) which is essentially a wrapper around an array. It is not designed to resize an array so it throws an exception. The reason it was not crashing wit a list of not fixed size is because that constructor sets an empty java.util.ArrayList as it's delegate. If you are using an array list of a fixed size you must use it's set method to modify any of it's elements.
-
[1.12] [Fixed] How do you register sounds?
Sound is not a registry entry thus it can't be used as a registry entry type. Now, SoundEvent is a registry entry...
-
[1.12] Tile entity doesn't save itemstacks
cards.add(card); card.shrink(1); If your stacksize is 1 this will effectively add an empty itemstack to the list. ItemStackHelper.loadAllItems(compound, cards); private NonNullList<ItemStack> cards = NonNullList.create(); ItemStackHelper only puts the deserialized ItemStack into the list if the slot of the itemstack is greater or equals to 0 and less than the size of the list passed. As the size of your list is always 0 at TE init this method will never load your items into the list when you re-enter the world. Vanilla uses fixed size NonNullLists(there is a method in the NonNullList to create one). If you do not want your list to have a fixed size you will need to create your own deserialization method.
-
Registering Item Models [Solved]
Items that use item/generated don't have an inventory variable you can assign a texture to. They instead have layerX, where X is the tint index.
-
[1.12] [Fixed] Assets not showing up on in-game item.
You have deleted the register method, but you are still referencing it. Remove the references to the method. You should really use refactor to delete/move methods anyway. If you are using 1.12 you should use ObjectHolders. Do not assign values to your item fields directly. ModelLoader.setCustomModelResourceLocation(johncena, 0, (ModelResourceLocation) johncena.getRegistryName()); Item::getRegistryName returns you a ResourceLocation, not a ModelResourceLocation, you can't just cast it like this. Instantinate a new ModelResourceLocation object, the first parameter is a ResourceLocation(hint - it is the registry name), the second is your variant(usually it's "inventory" for items.) Assets must be entirely lowercase is 1.12. That includes your language file if you specify your pack format as 3 in your pack.mcmeta. You do. Rename the en_US to en_us then. It is a good practice to use your registry name as the unlocalized name for the item, as it includes your modid and avoids potential conflicts.
-
1.11 to 1.12
This field is null and you never assign anything to it. An Instance annotation goes over a field you want an instance of your mod to be injected into, not over the field that contains your modid.
-
1.11 to 1.12
Well, something in your ConfigGui constructor is null. Try setup a breakpoint to figure out what. The potential culprits are:
-
1.11 to 1.12
No it was deleted, look at the signatures: 1.11: public Class<? extends GuiScreen> mainConfigGuiClass(); 1.12 public GuiScreen createConfigGui(GuiScreen parentScreen); How is that renamed? The return type changed, a parameter had been introduced and the name is different. This does not look like a rename to me. Especially considering the fact that 1.11 has the createConfigGui method with the exact 1.12 signature. Yes it does. There is no public Class<? extends GuiScreen> createConfigGui() method for you to override or implement in the interface. Your last code attachment looks fine to me.
-
[1.12] IPerspectiveAwareModel not found - upgrading from 1.11.2 --> 1.12
the only method from IPerspectiveAwareModel (handlePerspective) was moved directly to IBakedModel and made default. You are free to override it and do whatever you want to as you were doing before. MapWrapper that was a nested class of IPerspectiveAwareModel was moved into a separate PerspectiveMapWrapper.
-
1.11 to 1.12
Those particular methods have been deleted as they've been deprecated for a while now. RuntimeOptionGuiHandler was deleted as, quoting the javadocs for RuntimeOptionGuiHandler from 1.11 code: TODO remove in 1.11 - this was never fully implemented and will be removed And it also was deprecated btw.
-
[1.10.2] Error loading Item texture/model
Did you mean layer0, not 0? You have never set the unlocalized name for your item.
-
[SOLVED][1.11.2] Play default minecraft sound
https://mcforge.readthedocs.io/en/latest/effects/sounds/#world-playsound-pxyzecvp. A player can be null on a server and then all the players nearby will hear it. And if your side is the client - there is only 1 player on the client(if that is the case you can also use the overload you were using originaly).
-
[SOLVED][1.11.2] Play default minecraft sound
World::playSound takes a SoundEvent as it's 4th parameter, not a string. Vanilla SoundEvents can be found at net.minecraft.init.SoundEvents. You should also use the overload that takes an EntityPlayer as it's first parameter as the method you are using will only work on the client. All that is explained in the docs here.
-
[1.11.2] Screwed Up World Gen, Can't Find the Issue
gen_AngelicOre = new WorldGenMinable(eAngelusBlocks.angelicOre.getDefaultState(), 2, BlockMatcher.forBlock(Blocks.STONE)); eAngelusBlocks.angelicOre This is null. And it is null because you are initializing your blocks/items in your client proxy(aka client side only). Edit - well, I'm late. Anyway you should not use proxies for common code, just move it somewhere else, pereferrably to the new registry events.
-
[1.12] Boat-like entity textures not working
A ModelRegistryEvent is a normal forge event you can subscribe to just like to any other event.
-
[SOLVED][1.12] Entity not being rendered
You are rendering your model at 0,0,0 view-space wise. You need to translate the matrix accordingly by the x/y/z passed in the doRender method. You also probably want to bind your texture before rendering the model.
-
[1.11.2] Help with custom TNT
Well, all I can tell you at this point is to learn the basics of java before starting to create mods. Minecraft is fairly complex with java usages, and forge is even more complex. You need to understand the language, or at least it's common basics before using it. createRenderFor requires you to return an instance of Render<T> where T(type) is the type of the entity the renderer is designed to render. IRenderFactory also uses the very same type.
-
[1.11.2] Help with custom TNT
Your type, not your render class instance. This is java basics. You do not need to use unknown and raw types as you know for a fact that this IRenderFactory you are implementing is used for registering an entity of type NukePrimed. Thus your type is NukePrimed.
-
[1.11.2] Help with custom TNT
My mistake, your class is called NukePrimed, without the Entity prefix.
-
[1.11.2] Help with custom TNT
Do not use raw types. Do you know what generics are and how they work? Your type is EntityNukePrimed.
-
[1.11.2] Help with custom TNT
What is factory in this context? You do not have a local and/or a field with this name. You must provide an instance of IRenderFactory. This is a basic java concept. You can have all the things in the world in your renderer, if it is not registered the game is not aware of it's existance. If no renderer is found for an entity minecraft will use the one for one of the parent classes of the entity.
IPS spam blocked by CleanTalk.