Everything posted by Draco18s
- Smelting
-
[1.12.2][SOLVED] Issue with update() in tile entity
Why the hell are you storing your TE's position? TEs already do this, that's what getPos() does.
-
World Changes Not Saving
There are server side player events, but the player's motion is always 0 (because the client is the authority, the server ends up just teleporting the player to where the client says the player should be).
-
World Changes Not Saving
That is your "commit the changes to the world somewhere" line. You're done. The only thing wrong with your code is that instead of using LivingUpdateEvent you should use PlayerUpdateEvent. Also, those updates have Phases, you should check for one of them (START or END). You should probably also do an if(!world.isRemote) check, just to insure you're on the server. Have you tried the debugger?
-
[1.12.2] Prevent all Inventory interaction server-side
Here's an example (of supplying it) in a TE. https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/ores/entities/TileEntityMillstone.java#L176-L178
-
[1.12.2] Make a player unable to jump?
Look at how the potion accomplishes what it does.
-
[1.11.2] GUI Not Appearing In Game
What, no. You should not need to do this. Looking at some old code of mine, you shouldn't even need a cast: https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/industry/inventory/ContainerFilter.java#L34-L40 Called from: https://github.com/Draco18s/HarderStuff/blob/master/src/main/java/com/draco18s/industry/GuiHandler.java#L29
-
[1.12.2] Make a player unable to jump?
Look at the jump boost potion and the slowness potion.
-
[1.11.2] GUI Not Appearing In Game
Line 30: this.addSlotToContainer(new Slot((IInventory) player, x + y * 9 + 9, 8 + x * 18, 84 + y * 18)); Player is defined as an EntityPlayer on line 22: ContainerPestle(TileEntityPestle tileentity, EntityPlayer player) { //CustomSlots This cast makes no sense and that is why it crashes.
-
Not On Windows Computer/Laptop... ??
-
Smelting
This is what you need to do:
-
Smelting
Follow these steps and everything will work out: 1) Go learn Java 2) Come back and look at your code 3) Profit
-
[1.11.2] GUI Not Appearing In Game
new Slot((IInventory) player, ... The fuck are you casting an EntityPlayer to an IInventory for?
-
[1.12.2] Prevent all Inventory interaction server-side
It's a Capability. Vanilla doesn't use it, but there are wrappers around all of the IInventory implementations that return an ItemStackHandler. Not sure how you'd go about making it do its thing in this case, though.
-
[SOLVED] [1.10.2] Event in between BreakEvent and HarvestDropsEvent?
Wait, what? Why aren't you just overriding onNeighborChanged and checking to see if the block below has Material.AIR?
-
[1.12.2] Prevent all Inventory interaction server-side
You will probably need a custom ItemStackHandler class that prevents the extraction.
-
SOLVED Entity Move Event
world = player.getWorld(); //now you have everything you need
-
1.10.2 Broken tool isn't removed (Solved)
Ok, the ItemStack.EMPTY was added in 1.11 I believe. Yes, in 1.10 you still need to manage your own destroyed stacks.
-
SOLVED Entity Move Event
state = world.getBlockState(pos); //this gets you the IBlockState (Block + Metadata combination) block = state.getBlock(); //this gets the Block (no metadata)
-
[1.11.2] GUI Not Appearing In Game
I think he means things like this: for(int x = 0; x < 9; ++x) //Hotbar this.addSlotToContainer(new Slot(player, x, 8 + x * 18, 142 ));
-
NBT based OBJ model as item [1.10.2]
Rendering obj models means "put the obj path reference in your json model" and call OBJLoader.INSTANCE.addDomain(Refrence.MOD_ID);
-
[1.12.2] Check for free slot in player inventory
A stack of size 0 (but still with some other item) won't == ItemStack.EMPTY but it will still resolve .isEmpty() as true.
-
1.10.2 Broken tool isn't removed (Solved)
What version are you on? Because in the current versions, this problem no longer exists (stack size 0 stacks are treated the same as AIR / EMPTY).
-
Server sided localized messages
https://dzone.com/articles/java-string-format-examples The translation system runs the result through String.format
-
NBT based OBJ model as item [1.10.2]
You need to register a custom mesh definition for your item. Registration: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/hardlib/client/ClientEasyRegistry.java#L127-L129 Implementation: https://github.com/Draco18s/ReasonableRealism/blob/1.12.1/src/main/java/com/draco18s/industry/item/ItemCastingMold.java#L87-L118
IPS spam blocked by CleanTalk.