Everything posted by Draco18s
-
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
-
[1.12.1] getStateFromMeta and getActualState deprecated with no functional replacements?
And even if it did (and somehow enforced it), IBlockState implementations are still allowed to call it.
-
Get an error when trying to run certain mods
-
TextComponentTranslation retunring original string without translating
Very rarely. You have to subscribe to them, have the console log which side it thinks its on, and run the code in single player. If you get 2 loggings you'll know it runs on both sides. If you get one, it'll tell you which side its on.
IPS spam blocked by CleanTalk.