Everything posted by Draco18s
-
Doing something when the player's foodlevel changes
For fuck's sake, you're making your own variable called myPreviousFoodLevel . After you do all of your checks, you set myPreviousFoodLevel = player.getFoodStats().getFoodLevel() . Done, now it's the previous tick's food level, no client side method bullshit required.
-
[1.7.10] Custom rendered block doesn't want to face east
How the F would this crash without that GL rotate line? Anyway, TrashCaster is correct.
-
[1.7.10] Custom rendered block doesn't want to face east
Well, your rotate call is the same as the rotate call for South, so "no duh."
-
[1.7.10] Custom fence gate that can connect to fences
By "serious hacks" we probably mean ASM coremodding. Should be a simple enough thing to insert an extra comparison statement into fences without completely wrecking everything. Java bytecode is not for the weak, however.
-
[1.8] Block Model not Found for Metadata Block
How are you encoding 30 stays in only 16 values of metadata? You have 5 damage states and 6 facing states.
-
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.
IPS spam blocked by CleanTalk.