Everything posted by Draco18s
-
[1.9] Is it possible to spawn primer TNT without an EntityLivingBase?
Other project I was working with named a paramter like that as "[ x ]OrNull" e.g. "igniterOrNull" to make it clear that it was a parameter that wouldn't throw NPE if you passed in null, as it was intended to handle such things.
-
[SOLVED] [1.7.10] Problem when adding shapeless crafting recipe
I did, I was still wanting to inform you what you were doing wrong. Also, read my sig, thanks.
-
[SOLVED] [1.7.10] Problem when adding shapeless crafting recipe
You're trying to declare a class variable in a location that only local variables are allowed. Go learn Java programming.
-
Inverting Sunlight Direction
The upside down shader is his hack around doing it the right way. He wants to h have a dimension that would be like digging around on the underside of a floating island, with the sun below him.
-
[1.9] Forge API of some sort? [UNSOLVED + A few questions]
Yes, Forge has documentation. It is called in-source Javadoc.
-
[SOLVED] [1.7.10] Problem when adding shapeless crafting recipe
You are creating itemstacks at class-instantiaion, before your items have been created and registered. Those stacks are stacks of null and cannot be rendered or used in recipes.
-
Inverting Sunlight Direction
You need to write your own sky renderer. Shouldn't be very hard. You'll also want to turn off void fog.
-
The state engine was in incorrect state
Go to the edit button, click it, put [spoiler ] at the beginning, and [/spoiler ] at the end, remove the spaces.
-
How Does Forge Reflection Work?
IIRC, the lookup ("find this field/method") is the most expensive portion, but the rest of it is more costly than direct access. But a single per-tick field.setValue() or method.invoke() isn't going to be noticeable. The reason it matters for Forge events is because there are potentially thousands of them running per-tick.
-
How Does Forge Reflection Work?
Well then.
-
How Does Forge Reflection Work?
Props on making it, too. Modding Minecraft has seriously been one of the most enjoyable programming experiences I've ever had. Everything is laid out so well with incredibly intuitive and easy to use systems that let me hook into nearly everything. I've had to coremod a few things, but they were things that have either been turned down (an event for when the player feeds animals...I still don't understand that one getting declined*) or don't have a general-purpose use (modifying the overworld moon phase calculation, an event for crop growth ticks, tweaking silverfish to enter custom blocks (actually that one might be worth trying to patch into Forge), couple other things). *I was told that the method that sets animals into love mode (func_146082_f) never got an event because there were other ways to get at what it does. And while true, my usecase needed to specifically detect the player setting the animal into love mode, rather than it coming from another source. I wanted to make it take more food to feed an animal before it would breed, but also make animals go into love mode on their own. If I couldn't detect that it was a player setting love mode, vs. it being from an AI task, then I coudn't achieve the effect I wanted.
-
[SOLVED] [1.8.9] Rotating an entity with the player.
Gotcha. I figured that was why, but didn't see how the angle of rotation put it behind the player rather than in front. Huh.
-
[SOLVED] [1.8.9] Rotating an entity with the player.
Mm, degrees and radains. Don't know why you had to subtract pi though.
-
[1.8] Sound not playing on event (server side)
Use TickEvent.WorldTickEvent, unless they broke that out (not an internal subtype) for 1.8
-
[1.7.10] Entity Rotation
A does not imply B here. What calls this method?
-
[SOLVED] [1.8.9] Rotating an entity with the player.
(newPosX + - 4, d1, newPosZ + 4); Wha?
-
[1.8 and 1.9] Having a few issues on 1.9 and 1.8
What for? The class is already only ever going to get loaded on the client. If the class gets loaded on the server, those annotations aren't going to keep the server from vomiting ClassNotFoundExceptions
-
[1.7.10] Custom Gui for custom crafting table.
implement ITileEntityProvider and override its methods.
-
How Does Forge Reflection Work?
Ohgodno. Reflection is awful.
-
[1.8.9] Custom Walls issues
That can be simplified. E.g. by removing it entirely, because you're only going to get 1 item stack from that loop, so why bother with a loop?
-
[1.7.10] BlockItem loosing its metadata when placed
This: new BasicMetadataBlockMF("clayWall", Material.wood, ItemClayWall.class, 4) Calls this: public BasicMetadataBlockMF(String name, Material material, Class itemBlock, int number) { super(name, material, null); NUMBER = number; NAME = name; } Notice that the itemblock paramter goes unused.
-
How Does Forge Reflection Work?
Ah! So that's how the event handlers work. I always wondered about that.
-
[1.7.10] Custom Gui for custom crafting table.
You should be passing the TileEntity itself. The reason this isn't working is because your block doesn't HAVE a tile entity and the Container/GuiContainer are expecting an object of type moriumWorkbench (which, by the way, you should capitalize and prepend with "Block", BlockMoriumWorkbench ) You don't have a TileEntity to pass, so the TileEntity tileEntity = world.getTileEntity(x, y, z); is going to return null anyway and fail the instanceof check. If you want to do this with just the block, you're going to have some trouble. In fact, I already see some problems in your other classes. ContainerModTileEntity has this line: for(int y = 0; y < 3; ++y) { for(int x = 0; x < 3; ++x) { this.addSlotToContainer(new Slot(inventory, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); } } That's supposed to be adding a 3x3 grid for the crafting, but the inventory you told the slot that it is a part of is the player's inventory! Then there's this: public boolean canInteractWith(EntityPlayer player) { return ((IInventory) this.te).isUseableByPlayer(player); } te in this context is a moriumWorkbench , which as established above is a Block which does not extend IInventory! This line will throw a null pointer exception when run, as will likely your transferStackInSlot method; I'm not entirely sure what'll happen. Long story short, you've followed a tutorial for how to add a gui interface for a TileEntity and have even named your classes with "TileEntity" even though you do not have one.
-
How Does Forge Reflection Work?
hehehehe Figures Forge would do that. What I don't know is why runtime class creation is preferable over a standard compiled class. That is: I can't think of a use-case where it would be necessary. Then again, the only example I saw was just that: an example to show that it could be done. And no, I have no idea what that Forge one does. It's still stupid complex even if you know what you're doing, because of how many things you have to keep in your head at one time in order to write a single line of code. You have to know what's on the stack, what operation you need to do next, how it will affect the stack, and so on. So I wouldn't say it's easy, more like doable.
-
1.8 Crash Help
Oh. Try putting the @instance annotation above this line: public static TutorialMod instance;
IPS spam blocked by CleanTalk.