Everything posted by Draco18s
-
Doing something when the player's foodlevel changes
Well. A couple things. 1) Why are you doing this: RealLifeMod.network.sendToServer(new UpdateToiletPacket(this.poop_value + ((player.getFoodStats().getPrevFoodLevel() - player.getFoodStats().getFoodLevel()) * 5))); Why not: RealLifeMod.network.sendToServer(new UpdateToiletPacket(this.poop_value)); Second, same code, you're sending "this.poop" (5 more than last time) plus the change that occurred times five which as your trace statement shows, is negative. So you're actually sending a packet that contains the value "0." Then we get here: RLMPlayerProps.get(ctx.getServerHandler().playerEntity).poop_value = message.newpoopvalue; So we set the current poop value to whatever the packet said it should be, which is 0. Good jorb, you let the client dictate the server state and it broke. Assume the client's data always lies. Only trust it for keyboard and mouse input. So. Here's what you should do: In your IEEP store the previous food value yourself. You can do that, its easy. Compare with the saved value, then store the new value. If it changes on the server, increment your poop value. Send this new value to the client. Oh, right, IEEP already synchronizes. Now you're done!
-
Are multiple items based on one item possible?
NBT. Unique Artifacts handles several tens, if not hundreds of thousands of items with one a single item ID (the armors take up an additional 1 ID per armor slot, so 5 total).
-
How do you check if a block is in a loaded chunk
You didn't mention 1.8 at all. The method may not have been MCP'd yet. Check the classes that implement IChunkProvider, specifically for the methods in IChunkProvider.
-
Liquids in Forge 1.8?
You mean BlockDynamicLiquid and BlockStaticLiquid ?
-
How do you check if a block is in a loaded chunk
world.chunkExists will return true if the chunk is loaded.
-
[1.7.10] Custom rendered block
And here I was going to say that you were rendering it inside out by accident.
-
[1.7.10] Custom rendered blocks
If you followed the renderBlockCauldron method you'd see that it handles rendering the cauldron painstakingly one face at a time, similar to, but more annoying than, an ISBRH.
-
Block with Inventory (and keeps it!) [1.7.10]
It is possible to do the stack nbt when the block is destroyed as well.
-
Gun Mod Crash
The error you have can be explained like this: Would you please remove the lid of the peanut butter jar you are currently holding?
-
Gun Mod Crash
NPE is easy to solve. One of these is null: if (hasAttachment(stack, MainRegistry.content().ironSights.getName()))
-
[1.8] Natural vs. Manufactured block detection
Once you have other mods and things like the IC2 Macerator, almost everything can be crafted. There's a few more mods that add even more ways of crafting things. Such as seeds + dirt = grass.
-
[1.7.10] Detecting spawn/plugin protection
There's also an event (BlockBreakEvent?) for breaking blocks, for reference.
-
[1.8] Natural vs. Manufactured block detection
You will not be able to tell that the player has placed a block vs. the same block placed during worldgen. It is not possible because that data is not stored anywhere in the chunk data. You could in theory use metadata to do this, but only for blocks that had a bitflag to spare, but with the new BlockState mechanism that 1.8 has, I am not sure you can do that any more.
-
[1.8] Giving an item to the player after a delay
Is that new with 1.8? Neat.
-
More than 45 slots in the gui.
Inside the chest is more than 45 slots. 4x9 player's inventory and 6x3 inventory chest ... And two of those have Slot #0. Slot #0 (player's inventory) and Slot #0 (chest inventory). for(int j = 0; j < 9; j++) { this.addSlotToContainer(new Slot(inventoryPlayer, 9+j+i*9, 8+18*j, 166+i*18)); // "9+j+i*9" why is there a +9 here? } } for(int i = 0; i < 9; i++) { this.addSlotToContainer(new Slot(inventoryPlayer, i, 8 + i * 18, 224)); // "8 + i * 18" why is there a +9 here? }
-
[1.7.10][SOLVED] onItemRightClick problems
The fuck is all of that code doing? Creating a new stack, then calling a method you didn't show us, then calling another method, then looping over an array... If you want the item to disappear when right-clicked, do this: @Override public ItemStack onItemRightClick(ItemStack itemstack, World world, EntityPlayer player) { return null; }
-
[1.8] Giving an item to the player after a delay
To avoid the "flickering" when reloading (which is due to Minecraft thinking that a change to the itemstack NBT means its actually a new stack) you need to store the time when the reload finishes rather than making a counter that counts down every tick. So you would store "world.getWorldTime() + reloadSpeed" and then you'll compare the stored value with "world.getWorldTime()." When world.getWorldTime() is greater than the stored value, the gun has reloaded.
-
Arcing homing projectiles
Check out this article, the section titled "Adding Realistic Turns."
-
[1.7.10] Easy way to check if block can stand alone?
Signs are blocks with a TileEntity. They are specifically Blocks 63 and 68 (minecraft:standing_sign and minecraft:wall_sign).
-
[1.7.10] fontRenderer Error
"The method func_78261_a(String, int, int, int) is undefined for the type FontRenderer" That means that the parameters "string, int, int, int" is WRONG. You're absolutely positively passing "string, int, int, int" but there is no method that matches that.
-
[1.8.8] side develop
Some of us aren't very familiar with how Gradle works or the syntax used in the build.grale file. Mind providing and example? Say, SomeRandomMod-1.8.8-v3.jar located in /[install location]/libs/ Everything I know about how to use Gradle had come from other people's build.gradle file and a lot of guess work, as the documentation is very vague in some ways, as if they expect the reader to already be familiar with some other aspect of Gradle. I still haven't got my build file to produce exactly what I want and no more, only "everything minus what I don't want." (That is, it does everything and then copies what I want to a new file). There are a number of things I've tried which looked like they should have worked, but did not. For example, custom properties to manage mod versions. Never figured out why Gradle would throw undefined errors at me, ended up just using in-line variables and string concatenation. A lot of folks around here say things like, "oh, just add a maven repo to your build file" as if we know what that means and how to do so. Or, in this case, chaise is for not knowing that Forge Gradle could deobfuscate arbitrary mods. Sorry, but that feature/ability had never been mentioned anywhere that I've seen before. Maybe I suppose I could have guessed that it could, but not knowing what or how to tell Gradle that I want that, I may as well believe it to be impossible.
-
[Solved] [1.8] Dynamic Item Texture (Custom TextureAtlasSprite)
Derp. Been mobile all day, didn't notice.
-
[Solved] [1.8] Dynamic Item Texture (Custom TextureAtlasSprite)
In your icon registration method, tell it to register the custom sprite. Edit: I've lost track of where I did it that way. But the IIconRegister interface is only used by one class, so figure out what that class is, cast to it, and add the atlas sprite to it manually.
-
Is there a Forge hook to modify base classes?
I would have to make a lot of changes... I'm considering just ditching Forge and doing this on my own if there isn't a way to do it with Forge hooks. I am pretty sure the extent of the changes you would need to make would make it impossible to remain compatible with Forge: You would have to add additional parameters to a number of packets, and in doing that, everything will break.
-
[Solved] [1.8] Dynamic Item Texture (Custom TextureAtlasSprite)
The important thing is what kind of data does it use. Anyway, the class you want to extend is TextureAtlasSprite
IPS spam blocked by CleanTalk.