Jump to content

jordsta95

Members
  • Posts

    169
  • Joined

  • Last visited

Everything posted by jordsta95

  1. Simple question, how do you create a blockstate based on a registry name. What I essentially want to do is to be able to pass regName as a parameter, and have said block be created above the current block. BlockPos pos = getPos(); String regName = "minecraft:stone"; world.setBlockState(new BlockPos(pos.getX(), (pos.getY() + 1), pos.getZ()), regName); However, I understand that the second parameter is an instance of IBlockState, but I'm a little lost as to how I can create this using the registry name of a block, which I can then pass in as the variable. Thanks, Jordan
  2. Because when you install a mod pack you download the mods and configs folders (generally), and if the images that the pack dev want the user to see (maybe it's a themed pack, for example) are in the configs folder the user will see the intended textures (as long as they don't delete the images from the config folder)
  3. Because that requires the user using a resource pack (even if bundled with a mod pack, it doesn't mean the user will activate/not deactivate it)
  4. Load from outside the jar, in the mymod folder. And the reason for that is because I have a few items which are there for modpack developers which can be fully customized, apart from the textures (at the minute) and it would be great if they could just replace those textures/add their own in there (so either replace texture.png with the image they want, or put image.png in the folder, and put that filename in the config file to replace the default)
  5. Hi there, I was wondering how to move the .cfg from the main config folder into a subfolder e.g. minecraft/configs/mymod and how I could call a texture from e.g. /mymod/texture.png instead of it being taken from the assets folder in the jar. Thank you
  6. Hey there, Someone has asked me to make a small thing for them, which seems easy enough to do, when I get home. I was just wondering if it would be following to do something like this (without having any coding stuff infront of me to be able to check the spelling, etc.) public void onNeighborBlockChange(World world, int posX, int posY, int posZ, Block neighbourBlock){ if(world.getBlock(posX, posY+1, posZ) == Blocks.stone){ setBlock(posX, posY+1, posZ, world.getBlock(poxX, posY-1, posZ)); } } Just in case this is wrong, what I am looking for is: If a play places stone on top of this block, it will replace the stone, with the block that is below it (essentially copying the block)
  7. According to this link: http://www.minecraftinfo.com/smoothstoneslabdouble.htm the ID you are looking for is: double_stone_slab:8
  8. The potion will be a custom potion I add, yes. And I already have the code: List<EntityPlayer> list = SpellHelper.getPlayersInRange(worldObj, xCoord + 0.5, yCoord + 0.5, zCoord + 0.5, 15, 15); // for (EntityPlayer player : list) // { // PotionEffect regenEffect = player.getActivePotionEffect(Potion.regeneration); // if (regenEffect != null && regenEffect.getAmplifier() > 0) // { // if(AlchemicalWizardry.causeHungerChatMessage && !player.isPotionActive(Potion.hunger.id)) // { // player.addChatComponentMessage(new ChatComponentText(StatCollector.translateToLocal("message.altar.hunger"))); // } // player.addPotionEffect(new PotionEffect(Potion.hunger.id, 40, regenEffect.getAmplifier() * 2 - 2)); // } // } (Ignore that it is commented out) That is what (used to be) there, and I want to replicate what I am doing, but instead of causing hunger it will fill the altar, slowly. I already know how I will do this bit though. I just need to know how to "inject" my bit of code into the class file for the Blood Altar (which is a tile entity). i.e. Blood Altar's tile entity file, which is where this code goes, will load with my bit of code added in.
  9. Sorry for the terribly worded title, but here's what I want to do: When a player is standing near a blood altar with <potion effect> then <thing happens>. I have the code to do this, but I don't know how I would do this.
  10. Alright, so this is in the client proxy: @Override public void postInit(FMLPostInitializationEvent event){ super.postInit(event); Main.versionChecker = new CheckVersion(); Thread versionCheckThread = new Thread(Main.versionChecker, "Version Check"); versionCheckThread.start(); } @SubscribeEvent(priority=EventPriority.NORMAL, receiveCanceled=true) public void onEvent(PlayerTickEvent event1) { if (!Main.haveWarnedVersionOutOfDate && event1.player.worldObj.isRemote && !Main.versionChecker.isLatestVersion()) { ClickEvent versionCheckChatClickEvent = new ClickEvent(ClickEvent.Action.OPEN_URL, "http://jabelarminecraft.blogspot.com"); ChatStyle clickableChatStyle = new ChatStyle().setChatClickEvent(versionCheckChatClickEvent); ChatComponentText versionWarningChatComponent = new ChatComponentText("Your Magic Beans Mod is not latest version! Click here to update."); versionWarningChatComponent.setChatStyle(clickableChatStyle); event1.player.addChatMessage(versionWarningChatComponent); Main.haveWarnedVersionOutOfDate = true; } } However, it still doesn't notify (it gets the version number "4" from the URL, and I have the version number set to 3, to test.) So it should notify now, but it doesn't
  11. I did as you said here, everything still works as it did before... and that includes the update checker not working... It prints to the Log, but not in game
  12. It's probably easier to link the full thing, because it may be something unrelated: https://github.com/ThisIsASuperAwesomeAccount/AMod/tree/master/main/java/com/aa/mod Ignore the fact there's two separate version checker thingies (I was trying to get yours to work, so that I could figure out how to get the other to work -- If that makes sense)
  13. The only log stuff I get that contains anything to do with versions and my mod is: And that is obviously not it. So, I added: public void run(){ System.out.println("Client Proxy Loaded"); } To the client proxy, just as a test. But it doesn't print anything... So I would assume it is that, however, I don't know what it wouldn't get called. As I have the same proxy calling thing as I have seen in dozens of other places: @SidedProxy(clientSide = Reference.CLIENT_PROXY, serverSide = Reference.COMMON_PROXY) public static CommonProxy proxy; with the correct folder structure in Reference for them: public static final String CLIENT_PROXY = "com.aa.mod.proxies.ClientProxy"; public static final String COMMON_PROXY = "com.aa.mod.proxies.CommonProxy"; I have never had to use the client proxy before, so I never knew about this not working. But I don't get why it doesn't work.
  14. Here's the only things I have in the main class that talk about proxies: @Mod(modid = Reference.MODID, version = Reference.VERSION) public class Main { @SidedProxy(clientSide = Reference.CLIENT_PROXY, serverSide = Reference.COMMON_PROXY) public static CommonProxy proxy; public static Configuration config; public static Logger logger; @Mod.Instance(Reference.MODID) public static Main instance; public static CheckVersion versionChecker; public static boolean haveWarnedVersionOutOfDate = false; As for it not working... No console message, no message when you log in; not working As for getting the version number, I can only assume it finds that, as that seemed pretty simple. And RealMcrafter, I tried it in the Init, not PostInit, just to see if that was the issue. I tried it there, and it didn't work.
  15. Is that not what the "public static CheckVersion versionChecker;" does? As I said, I followed the example I linked to the tee, and it never mentioned anything about calling the Init, or anything. I will admit, that tutorial was pretty crap at explaining what everything does and how it works, which is why I came here. Because it doesn't work, and there is no troubleshooting, or reasons why it may not work.
  16. Hey there, I had a look at Botania and COFHcore's version checker, and didn't really understand it, but then I found this http://jabelarminecraft.blogspot.co.uk/p/minecraft-forge-1721710-making-mod.html However, I followed that tutorial, and I still can't get it to work. Any ideas why? Here's the code: version checker class: Here's the client proxy And the 2 lines in the main file are: public static CheckVersion versionChecker; public static boolean haveWarnedVersionOutOfDate = false; I've never even thought about this before, and I learn most of what I do through tutorials (even if they are outdated, as long as it is similar, I can understand it) but that's the only tutorial I could find on version checkers, and I don't know what I am doing wrong. Thanks -Jordan
  17. I can't really find much documentation on Configs, especially strings... To put simply, I want to have it so that a user will set the information of the item. When I do something like a boolean, I do it like so: public static boolean disableUberium; public static boolean disabled = false; final String UBERIUM = Main.config.CATEGORY_GENERAL + Main.config.CATEGORY_SPLITTER + "Materials"; Main.config.addCustomCategoryComment(UBERIUM, "Disable materials here"); this.disableUberium = Main.config.get(UBERIUM, "I don't like being OP", disabled).getBoolean(disabled); if(Main.config.hasChanged()){ Main.config.save(); } So if I was to do a string how would I do it? I thought it would be like this, but then I get lost: public static String description; final String DESC = Main.config.CATEGORY_GENERAL + Main.config.CATEGORY_SPLITTER + "Materials"; this.description = Main.config.get(DESC, "default text").getString(); if(Main.config.hasChanged()){ Main.config.save(); } But it doesn't seem to work, any ideas? (default text is what the description of the item would be)
  18. I would understand that if it didn't not work when the lines: altarEntity.sacrificialDaggerCall(amount, false); altarEntity.startCycle(); were removed from: public void findAndFillAltar(World world, EntityPlayer player, int amount) { int posX = (int) Math.round(player.posX - 0.5f); int posY = (int) player.posY; int posZ = (int) Math.round(player.posZ - 0.5f); IBloodAltar altarEntity = getAltar(world, posX, posY, posZ); if (altarEntity == null) { return; } altarEntity.sacrificialDaggerCall(amount, false); altarEntity.startCycle(); } But seeing as when those 2 lines get removed I can compile, but the item doesn't fill the altar, it makes me wonder
  19. Hey there, I am getting this message when failing to compile: http://puu.sh/i2PEH.png Only issue is, those lines of code are needed, and do do things... How can I stop Forge from saying it is deprecated? Everything works as it should in the dev environment. I can delete those lines of code and the mod loads... however, it doesn't do what it should (fill the Blood Altar)
  20. What I have right now is: public boolean onItemUse(ItemStack itemStack, EntityPlayer player, World world, int x, int y, int z, int side, float px, float py, float pz) { if (world.getBlock(x, y + 1, z) == Blocks.air) { world.setBlock(x, y + 1, z, Blocks.water); return true; } return false; } But I want it so if a player clicks on the top of the block it will spawn at y +1 water, if they click on the bottom, y -1 cobblestone etc. (as an example) Any ideas how to get the face of block clicked on?
  21. Hey there, I am wondering how one would go about doing something like this, for example something like if(player == username"jordsta95"){ GameRegistry.addRecipe(new ItemStack(blockRegist.blankGlass, 9), new Object[]{ "GGG", "GGG", "GGG", 'G', new ItemStack(Blocks.dirt) }); } else GameRegistry.addRecipe(new ItemStack(blockRegist.blankGlass, 9), new Object[]{ "GGG", "GGG", "GGG", 'G', new ItemStack(Blocks.glass) }); } Obviously not that recipe, but I am thinking of a sort of troll for some friends
  22. How would I do that, other than calling the jar zName or change thaumcraft to aThaumcraft?
  23. Here's the full class file, where everything but that one recipe works: http://pastebin.com/mupfHBNk The Thaumcraft recipe starts at line 122 Sorry for the code being very ugly
  24. Hey there, I am having an issue with crafting... yeah, very nooblike. I have always avoided crafting with armours/tools, because they have always been awkward (when I have tried to do them), but I don't see why this doesn't work: if(Loader.isModLoaded("Thaumcraft")){ Item goggles = (Item) Item.itemRegistry.getObject("Thaumcraft:ItemGoggles"); GameRegistry.addShapelessRecipe(new ItemStack(itemRegist.visViewerS), new ItemStack(itemRegist.superHelmet), new ItemStack(goggles) ); } To be honest, I don't know what the thaumcraft thing actually does, I am not going to lie, I copied it from a different mod which does the exact same crafting recipe I am trying to do, and it works there. However, when I try to combine the Goggles of Revealing (Thaumcraft:ItemGoggles) and superHelmet it doesn't allow me to craft the visViewerS The code I copied:
×
×
  • Create New...

Important Information

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