
Elyon
Members-
Posts
270 -
Joined
-
Last visited
Everything posted by Elyon
-
You need to change this: if(player.inventory.armorInventory[0] == new ItemStack(SoulCraft.soulHelmet)) to this: if (player.inventory.armorInventory[0].getItem() == SoulCraft.soulHelmet) for all the pieces of armour.
-
No worries; we're here to help Anyway, the code you pasted has sentID set to 50, which would execute this line: ((EntityPlayer)player).inventory.setInventorySlotContents(1, new ItemStack(Minespresso.HotChocolate)); You may want to change the sentID to 1, or chance the line above to use addItemStackToInventory .
-
[1.7.2] Did the system time change, or is the server overloaded?
Elyon replied to loawkise's topic in Modder Support
Is your project on GitHub or similar? I would like to delve into the code to figure out why you can't have more than a few blocklings. Failing that, could you paste all the relevant classes (network as well as blockling) in gists? You can just make them private and PM me if you prefer. -
Under what circumstances is this packet sent? It is possibly either being sent or handled multiple times, or it might be related to the lack of @SideOnly annotations. ... Also: I did not ask where you handle your packets You wrote that you were sending a packet, not handling one The code you wrote earlier turned out to be from packet handling, not sending Handling or sending a packet does not make it obvious what custom class you are handling/sending it in, or what the contents of that class are You still haven't pasted any code from where you send the packet Hardly obvious, no need to be snappy. We're trying to help, here. Finally, please use http:/gist.github.com/ for longer pastes.
-
Please use http://gist.github.com/ for longer code pasting. Which line is line 86? If it is this line: defender.attackEntityFrom(event.source, getComabtDamage((EntityLivingBase) event.entity, event.source, event.ammount)); , will that not trigger the onCombat event, which will call the line above, which will trigger the onCombat event again, and so on?
-
[1.7.2] Did the system time change, or is the server overloaded?
Elyon replied to loawkise's topic in Modder Support
Do you still have the lag issue? -
GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); chat.printChatMessage(new ChatComponentText("Hi somarani!"));
-
The crash log tells you exactly what is wrong: java.lang.StackOverflowError: Unexpected error and at com.sirniloc.sirs.events.SirPlayerEvent.onCombat(SirPlayerEvent.java:86) If you cannot figure out how to avoid the stack overflow yourself, post either the SirPlayerEvent class, or the onCombat method from that class, or line 86 in SirPlayerEvent.java.
-
Can you post your entire method or class? Under what circumstances is this packet sent? Where in your class/method setup are you calling addItemStackToInventory (what method in what class)? You have to help us to help you
-
Inherit from WorldGenLiquids, Override generate , set the blocks you need in there. Give it a go, show us what you come up with and any issues that arise. Become inspired by vanilla worldgen classes
-
Can you post your entire method or class? In what context are you calling addItemStackToInventory ?
-
[1.7.2] Did the system time change, or is the server overloaded?
Elyon replied to loawkise's topic in Modder Support
You have written your own getEntityByID method in that class. That seems unnecessary: Replace the line Entity foundEntity = getEntityByID(entityID, theWorld); with Entity foundEntity = world.getEntityByID(entityID); . -
[1.7.2] Did the system time change, or is the server overloaded?
Elyon replied to loawkise's topic in Modder Support
In your ProcessPacketClientSide class, why not use world.getEntityByID ? It is probably implemented faster than your implementation. -
Usually (read: almost always), the crash log will be helpful in figuring out why it crashes. Usually (read: always), the crash log should be accompanying reports of crashes on the forums.\ Please either use [ spoiler ] tags, or paste your crashlog somewhere meaningful, such as http://gist.github.com/.
-
[1.7.2] Did the system time change, or is the server overloaded?
Elyon replied to loawkise's topic in Modder Support
Hmm. Well, the debug log shows that the controls section is taking up a lot of time. If I recall correctly, that is related to movement. I am not quite sure where the issue lies, hence I am asking for as much context as possible. -
[1.6.4] Tile Entity NBT not saving on exit
Elyon replied to TheMoleTractor's topic in Modder Support
Hint: The quote functionality is useful mostly for quoting posts that are not the one just above, or for selectively quoting part of a post Also, the best way to go about it depends on the functionality you desire. The instance of the BlockCropStaff holds information about the general BlockCropStaff . Depending on how many levels of growth your BlockSapphireCrop needs to use the metadata for, you could use a single bit as a flag to indicate whether a BlockCropStaff is within range. Alternatively, you could use NBT. Pseudopseudocode for the onBlockAdded code of BlockCropStaff : Array<Block> crops = { MainMod.blockSapphireCrop, MainMod.blockRubyCrop, MainMod.blockAmethystCrop }; for (int x = -5; x <= 5; ++x) { for (int z = -5; z <= 5; ++z) { Block block = world.getBlock(x, y, z); // Assuming all your crops inherit from BlockGemCrops if (block instanceof BlockGemCrops) { // Assuming the most significant bit of the crop metadata indicates a staff in range int metadata = world.getBlockMetadata(x, y, z); world.setBlockMetadataWithNotify(x, y, z, metadata | 0x7, 2); } } } -
[1.7.2] Did the system time change, or is the server overloaded?
Elyon replied to loawkise's topic in Modder Support
Could you post a complete error log? -
Set your block to tick randomly. In the updateTick method of BlockGrass , you will see how it spreads.
-
[1.6.4] Tile Entity NBT not saving on exit
Elyon replied to TheMoleTractor's topic in Modder Support
Do the reverse; use onBlockAdded on the BlockCropStaff that must be within the radius of the BlockSapphireCrop . -
Either way, you will want to extend ItemTool and set the value of the field toolClass to "testitem", then use "testitem" as the parameter for setHarvestLevel.
-
Will the block be completely unbreakable (bedrock-like) if the player is not using "testItem"?
-
[1.6.4] Tile Entity NBT not saving on exit
Elyon replied to TheMoleTractor's topic in Modder Support
Tossing a while (!staffFound) around it would move you from 100 blocks per tick to infinity blocks per tick. Hardly a performant decision. onNeighborBlockChange() checks whenever a neighbouring block changes, no more, no less. Could you concisely describe what you are trying to achieve?