
SilentThief
Members-
Posts
31 -
Joined
-
Last visited
Converted
-
Gender
Undisclosed
-
Personal Text
I am new!
SilentThief's Achievements

Tree Puncher (2/8)
0
Reputation
-
Have you written any code yet?
-
Look at the furnace class, there are two stages that is renders, idle and cooking, look around at what happens in-between those two rendering stages. I'm sure you'll find your answer, if I'm correct.
-
[1.7.10] Blacklisting Items From Appearing
SilentThief replied to SilentThief's topic in Modder Support
Didn't think to do it that way...guess I wasn't thinking you could create an ItemStack variable. It did indeed work, thank you very much. -
[1.7.10]Make player teleport when they are in bed
SilentThief replied to LogicTechCorp's topic in Modder Support
If I understand correctly - 1. Set Waypoint A (Bed A) 2. Set Waypoint B (Bed B) 3. Sleep in either Bed A or Bed B, and whichever one you sleep in, you get teleported to the other one? Here are a few ideas - 1. Save waypoint a and b in a config file. 2. Teleportation from a or b, or b to a. That's basically what you will want to have. If you want the player to be teleported while sleeping, and when teleported, still sleeping, that will be a bit tricky, or will work the first time. -
[1.7.10] Blacklisting Items From Appearing
SilentThief replied to SilentThief's topic in Modder Support
Recursion is a good idea, I will try and figure out a way to incorporate that without creating a loop that will throw stack traces. But, that's for making the method run once an argument is true or false, or equal to something, I don't know what to do to check if the items I want banned, will be not drawn from the pool of items. Because I can't use - if (getRandomItem == (new ItemStack(Blocks.portal) { getRandomItem(); } or if (ItemStack == (new ItemStack(Blocks.portal) { getRandomItem(); } -
[1.7.10] Blacklisting Items From Appearing
SilentThief replied to SilentThief's topic in Modder Support
No no no, that isn't the code. Those item stacks listed are just the items that are going to be banned. There is no code for the blacklist yet. -
Hello MCF community! I have a little issue with 'black-listing items', from appearing when I right click this item. This item gives the player a random item, block, etc, out of the pool of items that minecraft provides. I have tried to make it so certain items don't appear in the pool. I have tried creating array lists of all of the items in Minecraft, also tried simply creating itemstacks and then doing a switch statement saying if they appear, the action will loop, no luck there. So, I'd like a little bit of help if possible. package com.rien.nn.items; import java.util.List; import java.util.Random; import com.rien.nn.Main; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.init.Blocks; import net.minecraft.init.Items; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemLootBag extends Item { public ItemLootBag() { this.setUnlocalizedName("itemLootBag"); this.setTextureName("niknaks:itemLootBag"); this.setCreativeTab(Main.NNTab); this.setMaxStackSize(16); } public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { //Banned Items ItemStack netherPortalBlock = new ItemStack(Blocks.portal); ItemStack endPortalBlock = new ItemStack(Blocks.end_portal); ItemStack endPortalFrame = new ItemStack(Blocks.end_portal_frame); ItemStack fireBlock = new ItemStack(Blocks.fire); ItemStack waterBlock = new ItemStack(Blocks.water); int min = 1; int max = 3; Random r = new Random(); int randNum = r.nextInt(max-min) + min; if (player.capabilities.isCreativeMode) { player.dropPlayerItemWithRandomChoice(new ItemStack(getRandomItem(), randNum), false); return item; } else { --item.stackSize; player.dropPlayerItemWithRandomChoice(new ItemStack(getRandomItem(), randNum), false); return item; } } static Random rand = new Random(); public static Item getRandomItem() { Item i = null; int length = Item.itemRegistry.getKeys().toArray().length; Object select = Item.itemRegistry.getObjectById(ItemLootBag.rand.nextInt(length)); if(select != null && select instanceof Item) { i = (Item) select; } else { return getRandomItem(); } return i; } }
-
@ruabmbua I can perfectly capable of creating the energy system, just needed an explanation of how it'd work. @jabelar Thank you very much for the explanation, it will help me out with this. Question: Is there any references that would help me with this also?
-
Hello, I would like to know how I'd start creating an energy system like the one Thermal Expansion, AE, Etc. has. Such as: Create Energy > Store Energy > Send Energy > Receive Energy > Store Energy > Do Something With the Energy or Create Data > Store Data > Send Data > Receive Data > Store Data > Do Something with the Data How would I get started with that exactly?
-
[1.7.2] Giving entityPlayer a Random Item
SilentThief replied to SilentThief's topic in Modder Support
Sorry, was spacing out, was like 2AM when I looked at that code. -
[1.7.2] Giving entityPlayer a Random Item
SilentThief replied to SilentThief's topic in Modder Support
I got confused on that UtilRF.RANDOM part, I wasn't thinking...lol Didn't know UtilRF was the class. lol Anyways, testing the code. Doesn't seem as if the code is working, does nothing actually, here is my class: package com.hex.lootbag; import java.util.Random; import com.hex.hexcore.HexCore; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.world.World; public class ItemLootBag extends Item { public ItemLootBag() { setUnlocalizedName("itemLootBag"); setCreativeTab(CreativeTabs.tabAllSearch); setTextureName("lootbag:ItemLootBag"); setMaxStackSize(1); } public ItemStack onItemRightClick(ItemStack item, World world, EntityPlayer player) { System.out.println("Working!"); if (player.capabilities.isCreativeMode) { getRandomItem(); return item; }else{ --item.stackSize; getRandomItem(); return item; } } static Random RANDOM = new Random(); public static Item getRandomItem() { Item i = null; int length = Item.itemRegistry.getKeys().toArray().length; Object select = Item.itemRegistry.getObjectById(ItemLootBag.RANDOM.nextInt(length)); if(select != null && select instanceof Item) { i = (Item) select; } else { return getRandomItem(); } return i; } } -
[1.7.2] Giving entityPlayer a Random Item
SilentThief replied to SilentThief's topic in Modder Support
When you right click this bag, I want it to give you 1 item. The item is chosen from every single item in the game, it would be much more convenient to not have to make 300+ item stacks. -
[1.7.2] Giving entityPlayer a Random Item
SilentThief replied to SilentThief's topic in Modder Support
For some reason it returns it everytime. And, why is there: UtilRF.RANDOM.nextInt()? Instead of UtilRF.nextInt() -
[1.7.2] Giving entityPlayer a Random Item
SilentThief replied to SilentThief's topic in Modder Support
If you return getRandomItem(); it ends up creating a loop crashing the game. Removing it causes the whole method to do nothing. -
[1.7.2] Giving entityPlayer a Random Item
SilentThief replied to SilentThief's topic in Modder Support
Yea, using a random each time crashes the game. I tried using the code AlexStone provided, with a custom itemList I created. It does crash the game. Even if I were to do: ItemStack stack = new ItemStack(ItemList.itemList[r.nextInt()]; It would still end up crashing the game. I will try a few other things, see if they work.