Thank you. And I plan on updating. However I don't know how to register Entities yet.
Use EntityRegistry#registerModEntity to register your entity and RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) from your client proxy to register its renderer. Do both of these in preInit.
how exactly should i be posting it to the EVENT_BUS, could you give me an example?
You shouldn't be. In my original post I was saying that you should only create an event if you're going to post it to an event bus (and you have a reason to do so).
You're subscribing to the base BlockEvent class, which means your event handler will be called when any subclass of BlockEvent is fired. You should subscribe to BlockEvent.BreakEvent instead.
This is caused by TestGas#getColor. Fluid#getColor must return an integer in the format 0xAARRGGBB (alpha, red, green, blue). TestGas#getColor returns 0x66FF00, which has 0 as its alpha value. This causes it to be rendered completely transparent.
Could you explain the first part a bit more? It worked, but why?
See this StackOverflow answer. ItemTorchBasic can only access protected members of Item on instances of ItemTorchBasic or its subclasses, not on any Item instance.
Casting the ItemStack's Item to ItemTorchBasic before calling the protected method on it would work, but it makes more sense to call the method on this instead (since the ItemStack's Item should always be this).
I switched part of it to use the hand, but what would I do for this method? Is there a way to have an offhand slot and get the slot from the hand?
playerIn.inventory.setInventorySlotContents(slot, new ItemStack(torch1, count, oldFuel));
Use the getter/setter methods I mentioned in my previous post. They will get/set the item in each hand's slot (using the currently selected hotbar slot as the main hand).
You didn't post your FML log, but I can see a problem already: Resource domains are always lowercase. Your assets must be in assets/forgedebugmodelfluid/..., not assets/ForgeDebugModelFluid/....
Copying and pasting code is a bad idea. Try to understand what the example code is doing and write it yourself.
what do you mean posting it to an event bus? isn't it already posted with the line "MinecraftForge.EVENT_BUS.register(new Treecapitator());" ?
EventBus#post posts an event to the registered event handlers, EventBus#register registers an event handler.
Please use Gist or Pastebin to post logs/crash reports (if applicable) and your new code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
It's much easier to read code with proper formatting and syntax highlighting.
Your Item class should assume that any ItemStack it receives as an argument contains itself unless there's a reason not to. Don't call methods on the ItemStack's Item, call methods on this.
Your lightTorch method is broken and doesn't properly support the off hand. Use EntityLivingBase#getHeldItem/setHeldItem to get/set the player's held items, InventoryPlayer#getCurrentItem only gives you the main hand.
Post your code and FML log (logs/fml-client-latest.log) using Gist or Pastebin. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
0
TestFluidBlock extends BlockFluidClassic, so it will behave like a vanilla liquid and spread.
I'm not too sure what would cause the fluid to render like that. Is your texture 16 pixels wide and a multiple of 16 pixels high?
Post your latest code and the texture.
0
If you're targeting Java 6/7, use an anonymous class. If you're targeting Java 8, use a lambda or constructor method reference.
All an IRenderFactory does is create the Render instance using the provided RenderManager and return it.
0
Use EntityRegistry#registerModEntity to register your entity and RenderingRegistry#registerEntityRenderingHandler(Class<T>, IRenderFactory<? super T>) from your client proxy to register its renderer. Do both of these in preInit.
0
You're using the lava textures in the TestGas constructor, so it renders with the lava textures.
0
You shouldn't be. In my original post I was saying that you should only create an event if you're going to post it to an event bus (and you have a reason to do so).
You're subscribing to the base BlockEvent class, which means your event handler will be called when any subclass of BlockEvent is fired. You should subscribe to BlockEvent.BreakEvent instead.
1
Only spawn entities on the server (when World#isRemote is false).
Side note: I'd highly recommend updating to 1.9.4.
0
This is caused by TestGas#getColor. Fluid#getColor must return an integer in the format 0xAARRGGBB (alpha, red, green, blue). TestGas#getColor returns 0x66FF00, which has 0 as its alpha value. This causes it to be rendered completely transparent.
0
See this StackOverflow answer. ItemTorchBasic can only access protected members of Item on instances of ItemTorchBasic or its subclasses, not on any Item instance.
Casting the ItemStack's Item to ItemTorchBasic before calling the protected method on it would work, but it makes more sense to call the method on this instead (since the ItemStack's Item should always be this).
Use the getter/setter methods I mentioned in my previous post. They will get/set the item in each hand's slot (using the currently selected hotbar slot as the main hand).
0
If you've renamed the directory, post the new FML log.
0
The field is called healthBoost, not HealthBoost.
In future, tag your thread with the Minecraft version you're using so we know how to help you.
I'd also recommend updating to 1.9.4, 1.7.10 is very old at this point.
0
You didn't post your FML log, but I can see a problem already: Resource domains are always lowercase. Your assets must be in assets/forgedebugmodelfluid/..., not assets/ForgeDebugModelFluid/....
Copying and pasting code is a bad idea. Try to understand what the example code is doing and write it yourself.
0
Shadowfacts has some 1.9.4 tutorials here. The official Forge documentation is also a useful reference for various topics.
0
EventBus#post posts an event to the registered event handlers, EventBus#register registers an event handler.
Please use Gist or Pastebin to post logs/crash reports (if applicable) and your new code with syntax highlighting. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
It's much easier to read code with proper formatting and syntax highlighting.
1
Your Item class should assume that any ItemStack it receives as an argument contains itself unless there's a reason not to. Don't call methods on the ItemStack's Item, call methods on this.
Your lightTorch method is broken and doesn't properly support the off hand. Use EntityLivingBase#getHeldItem/setHeldItem to get/set the player's held items, InventoryPlayer#getCurrentItem only gives you the main hand.
0
Post your code and FML log (logs/fml-client-latest.log) using Gist or Pastebin. To get syntax highlighting on Gist, give each file the appropriate extension (.java for Java code). To get syntax highlighting on Pastebin, select the language from the dropdown at the bottom of the page.
Screenshots are not a good way to share code.