Everything posted by Elyon
-
Check Player Armor
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.
-
[1.6.4] Problem With addItemStackToInventory
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] how do i make an item replace itself with another item in onUpdate()?
player.inventory.setInventorySlotContents(player.inventory.currentItem, itemStack);
-
[1.7.2] Did the system time change, or is the server overloaded?
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.
-
[Solved] [1.7.2] Custom Combat - Better alternative to entity.setHealth()?
Hint: The quote functionality is most useful for quoting posts earlier than the most recent post, as well as for specifically quoting part of a post As attackEntityFrom will trigger the onCombat event, you could give damageEntity a try instead.
-
[1.6.4] Problem With addItemStackToInventory
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.
-
[Solved] [1.7.2] Custom Combat - Better alternative to entity.setHealth()?
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?
Do you still have the lag issue?
-
[1.7.2] Chat messages?
GuiNewChat chat = Minecraft.getMinecraft().ingameGUI.getChatGUI(); chat.printChatMessage(new ChatComponentText("Hi somarani!"));
-
[Solved] [1.7.2] Custom Combat - Better alternative to entity.setHealth()?
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.
-
[1.6.4] Problem With addItemStackToInventory
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
-
[1.7.2] Fluid World Gen
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
-
[1.6.4] Problem With addItemStackToInventory
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?
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?
In your ProcessPacketClientSide class, why not use world.getEntityByID ? It is probably implemented faster than your implementation.
-
[1.7.2] how do i make an item replace itself with another item in onUpdate()?
Hint: The quote functionality is mostly useful for quoting posts earlier than the most recent post, as well as quoting specific parts of posts Anyway, pseudocode: onUpdate() { if (ticks++ >= 100) { // Remove player's current ItemStack // Give player new ItemStack in that slot } }
-
[Solved] [1.7.2] Custom Combat - Better alternative to entity.setHealth()?
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?
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
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?
Could you post a complete error log?
-
[UnSolved] [1.7.2+] Porting mod to 1.7.2
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
Do the reverse; use onBlockAdded on the BlockCropStaff that must be within the radius of the BlockSapphireCrop .
-
How to set which tools can break my block/ore?
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.
-
How to set which tools can break my block/ore?
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
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?
IPS spam blocked by CleanTalk.