Jump to content

opum2

Members
  • Posts

    13
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • URL
    https://opum2.github.io/
  • Personal Text
    Trying to learn more and more everyday...

opum2's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. If you mean 1.11, then it's not out yet, but if you want something a little bit recent (1.10.2), try here: https://minecraft.curseforge.com/projects/simply-jetpacks-2?gameCategorySlug=mc-mods&projectID=251792
  2. Yeah, I do use a decomp workspace. And I cannot even /give the item. If I cannot do that, it's obviously not in the creative menu. I'll check my code again, but I got it from my other mods, which do work on my old PC.
  3. This is more of an Eclipse thing, but on my new PC I've setup a dev environment and I'm writing a mod, start the game and the blocks and items are not there. I've registered them, but they're not showing. I go into Mod Options and the mod says "State: Available", but nothing. It couldn't be something in the code. Thanks!
  4. Well, the reason I want custom "scripts" is because I can expand on them later and make stuff that you CAN'T do with regular configs.
  5. I know that BufferedReader is a Java thing. Just not sure on how to use it. I want to make it read the file and then add something in game. For example, a player prefix in chat. I want people to enter a certain prefix and then it will show up in chat. I would also like to make permission groups have access to certain commands. Any ideas? Thanks!
  6. I make Forge configs all the time. I want to make a custom one for letting people make scripts.
  7. I've figured out how to write to a .txt file in the config directory, but I would like to know: is it easy to make a custom config file with it's own sort of syntax? For example, a .txt file that has it's own formatting and then read the file and create something with that. I am making a server utilities mod with a custom syntax for making certain things. I'm working on ranks and permissions configs first, but I want to make it in a custom syntax. I thought about using JSON, but I want it to be more unique. I tried using the BufferedReader, but not really sure how that works. I've seen other mods do this with .txt files. Just curious if there is any other efficient way to do this? I can get my code later today, but for now, I would like a bit of an explanation. Thanks!
  8. Would I use some sort of tick handler to count the ticks? Also, I don't know what the equivalent of player.inventory.consumeInventoryItem(itemHere); is in 1.10. I have the onUpdate method and I've casted Entity to EntityPlayer, but don't know what to do from there. As I said, not good at all with NBT, so I'm kinda stuck. Lol I know it's nothing, but it's just to show an example of the variables and stuff. Here is what I have: @Override public void onUpdate(ItemStack itemStack, World world, Entity entity, int i, boolean bool) { EntityPlayer player = (EntityPlayer)entity; }
  9. I know that. I said that's what I need help with, is in the onUpdate method, as I've done this in 1.7, but didn't get it fully working. And I know, I've always done the meta data and the colors that way.
  10. So I have the a flight ring, and I want it to consume an item, but I don't know much about NBT or what the equivalent to player.inventory.consumeInventoryItem(itemNameHere) is. Here is my code so far, with nothing to consume or check for the item: public class FlightDongle extends Item implements IFlight { public FlightDongle(String unlocalizedName) { this.setUnlocalizedName(unlocalizedName); this.setCreativeTab(BamsMod.tabBams); this.setMaxStackSize(1); } @Override public String getUnlocalizedName(ItemStack itemStack) { if (itemStack.getItemDamage() == 0) { return this.getUnlocalizedName() + ".deactivated"; } if (itemStack.getItemDamage() == 1) { return this.getUnlocalizedName() + ".activated"; } return "deactivated"; } @Override public void addInformation(ItemStack itemStack, EntityPlayer player, List list, boolean bool) { list.add("\u00A7f" + "Hold Shift For Details"); if((Keyboard.isKeyDown(42)) || (Keyboard.isKeyDown(54))) { list.add(""); list.add("\u00A7e" + "Consumes 1 BamSalt Every 2 Minutes."); } } @Override public void getSubItems(Item item, CreativeTabs tabs, List subItems) { subItems.add(new ItemStack(item, 1, 0)); subItems.add(new ItemStack(item, 1, 1)); } @Override public boolean onDroppedByPlayer(ItemStack stack, EntityPlayer player) { deactivateDongle(stack, player); return super.onDroppedByPlayer(stack, player); } @Override public ActionResult<ItemStack> onItemRightClick(ItemStack itemStack, World world, EntityPlayer player, EnumHand hand) { if (itemStack.getItemDamage() == 0) { activateDongle(itemStack, player); } else { deactivateDongle(itemStack, player); } return new ActionResult(EnumActionResult.PASS, itemStack); } @Override public void activateDongle(ItemStack itemStack, EntityPlayer player) { itemStack.setItemDamage(1); player.capabilities.allowFlying = true; player.capabilities.isFlying = true; player.fallDistance = 0; player.sendPlayerAbilities(); } @Override public void deactivateDongle(ItemStack itemStack, EntityPlayer player) { itemStack.setItemDamage(0); player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.sendPlayerAbilities(); } @Override public boolean isActive(ItemStack itemStack) { return itemStack.getItemDamage()==1; }
  11. Just saw your signature. You're not supporting 1.7?! I'm going to the Minecraft forums... BYYE!
  12. Hi there! So, I've been at this for 6-7 hours now. It's driving me crazy! I am trying to figure out a way for one piece of fuel to be consumed by the ring every 5 seconds (In ticks, it's 100 I think) - I've gotten it to consume one at every use, but that's pointless. Then, no one would ever turn it off, as there's no fuel requirement. So I keep changing it and toying with it. Any ideas? Here is my flight ring class: public class FlightRing extends Item implements IFlight { public IIcon[] icons = new IIcon[2]; public FlightRing() { this.setUnlocalizedName("flightRing"); this.setTextureName("opumsdongles:flightRing"); this.setHasSubtypes(true); this.setMaxStackSize(1); this.setCreativeTab(OpumsDongles.tabOpum); } @Override public boolean onDroppedByPlayer(ItemStack itemStack, EntityPlayer player) { deactivateRing(itemStack, player); return super.onDroppedByPlayer(itemStack, player); } @Override public void onUsingTick(ItemStack itemStack, EntityPlayer player, int count) { int ticksInUse = getMaxItemUseDuration(itemStack) - count; if (ticksInUse % 120 == 0) { if(player.inventory.hasItem(ModItems.opumFuel)) { player.inventory.consumeInventoryItem(ModItems.opumFuel); } } } @Override public ItemStack onItemRightClick(ItemStack itemStack, World world, EntityPlayer player) { if (itemStack.getItemDamage() == 0) { activateRing(itemStack, player); onUsingTick(itemStack, player, /*I have 2 here in the main code, but I don't think that's right*/); } else { deactivateRing(itemStack, player); } return itemStack; } @Override public void activateRing(ItemStack itemStack, EntityPlayer player) { itemStack.setItemDamage(1); player.capabilities.allowFlying = true; player.capabilities.isFlying = true; player.fallDistance = 0; player.sendPlayerAbilities(); } @Override public void deactivateRing(ItemStack itemStack, EntityPlayer player) { itemStack.setItemDamage(0); player.capabilities.allowFlying = false; player.capabilities.isFlying = false; player.sendPlayerAbilities(); } @Override public void registerIcons(IIconRegister reg) { for (int i = 0; i < 2; i ++) { this.icons[i] = reg.registerIcon(Info.modID + ":flightRing_" + i); } } @Override public IIcon getIconFromDamage(int meta) { if (meta > 2) meta = 0; return this.icons[meta]; } @Override public void getSubItems(Item item, CreativeTabs tab, List list) { for (int i = 0; i < 2; i ++) { list.add(new ItemStack(item, 1, i)); } } @Override public String getUnlocalizedName(ItemStack itemStack) { return this.getUnlocalizedName() + "_" + itemStack.getItemDamage(); } @Override public boolean isActive(ItemStack itemStack) { return itemStack.getItemDamage()==1; } }
  13. Hi there! I need help spawning ore in 1.10.2. Not really sure where to start. I did it back in 1.7, but not really sure now. Here is my code from 1.7 that I tried to convert. public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { switch (world.provider.dimensionId) { case 0: this.generateOverworld(world, random, chunkX, chunkZ); break; } } public void generateOverworld(World world, Random rand, int x, int z) { this.generateOre(main.blockOre, world, rand, x, z, 2, 7, 5, 10, 30, Blocks.stone); } public void generateOre(Block block, World world, Random random, int chunkX, int chunkZ, int minVienSize, int maxVienSize, int chance, int minY, int maxY, Block generateIn) { int vienSize = minVienSize + random.nextInt(maxVienSize - minVienSize); int heightRange = maxY - minY; WorldGenMinable gen = new WorldGenMinable(block, vienSize, generateIn); for (int i = 0; i < chance; ++i) { int xRand = chunkX * 16 + random.nextInt(16); int yRand = random.nextInt(heightRange) + minY; int zRand = chunkZ * 16 + random.nextInt(16); gen.generate(world, random, xRand, yRand, zRand); } } }
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.