Everything posted by DiabolusNeil
-
Crash on Opening GUI. HELP!
314owen? I recognize you from PlanetMinecraft. Well, welcome to to the forums. Like what Angus Young said, you need a GuiHandler. Here's an example: // Lots of imports public class GuiHandler implements IGuiHandler { @Override public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile = world.getTileEntity(x, y, z); if (tile != null && tile instanceof TileEntityDNAExtractor && ID == 0) { return new GuiDNAExtractor(player.inventory, (TileEntityDNAExtractor) tile); } return null; } @Override public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) { TileEntity tile = world.getTileEntity(x, y, z); if (tile != null && tile instanceof TileEntityDNAExtractor && ID == 0) { return new ContainerDNAExtractor(player.inventory, (TileEntityDNAExtractor) tile); } return null; } }
-
How can you edit a sword to repair itself upon killing something?
Override the hitEntity method. Example: @Override public boolean hitEntity(ItemStack itemStack, EntityLivingBase living1, EntityLivingBase living2) { if (itemStack.getItemDamage() > 0) { itemStack.setItemDamage(itemStack.getItemDamage() - 1); } return true; }
-
[1.6.4] Gui Slots Bug!
I made a 1.6.4 mod a little bit ago dealing with simple inventories. This: https://github.com/DiabolusNeil/MoreStorage/tree/master/common/diabolusneil/morestorage should help you greatly.
-
1.7.2 Generation
Just look at the source code for the Minecraft generator. You can learn a ton of stuff from the source code.
-
When is a block updated and random tick info
This might answer your questions: http://minecraft.gamepedia.com/Tick
-
[1.6.4] Gui Slots Bug!
Could you please post the code for the TileEntity? I think your problem is in there.
-
program Blocks like Furnace or Crafting table
You can look at the code for the BlockWorkbench (net.minecraft.block), and InventoryWorkbench (net.minecraft.inventory). You can learn how those work and learn from that code.
-
Gradle Won't Work
This thread might help you: http://stackoverflow.com/questions/585599/whats-causing-my-java-net-socketexception-connection-reset
-
RESOLVED [1.7.2] Multi-layered textures
Thank you. This is exactly what I needed.
-
Random Eclipse/Mod Breaking Issues
You (or some form of malware) must have edited or deleted some of the files. For a last resort, consider deleting the old ForgeGradle files, and starting fresh. I also recommend using Forge build 1060.
-
[1.7.2] Persist TileEntity data when Block is broken
Override the breakBlock() method and put your code in that.
-
[1.7.2]Adding slots to container after creation and sync
Why have separate inventories for each upgrade applied? Just have the container initialize certain slots based on the upgrades found to be present in the backpack. You're making this process too complicated than it has to be.
-
RESOLVED [1.7.2] Multi-layered textures
I like the effort you put into your tutorials, but I want to render a texture that requires multiple images that come together to form a single texture. Example for items: Tinkers' Construct's special tools.
-
RESOLVED [1.7.2] Multi-layered textures
As far as I can tell, there's no up-to-date tutorials for this. I know it has something to do with Multi-Pass Rendering, but the tutorial on the wiki doesn't work. Could someone help me?
-
[1.7.2][SOLVED] Place a Block with ItemStack
Take a look in the ItemBlock class.
-
[1.7.2] Custom Tree
Well, maybe the 1.6.4 tutorial would work for 1.7.2. There's still plenty of 1.6.4 modding tutorials that are still viable to use for 1.7.2. Try following the tutorial and see what you can come up with.
-
[1.7.2] How to register commands and ...
You should register them during FMLServerStartingEvent. Example: public class MyMainModClass { // Additional code ... @EventHandler public void serverStarting(FMLServerStartingEvent event) { event.registerServerCommand(new MyCustomCommand()); // MyCustomCommand must inherit the CommandBase class } }
-
[1.7] World crashes on save after I added NBT
Try pre-declaring the variables. If the controllerid is not declared, it's assumed to be null. It seems you have the solution in the current code, but you commented it out.
-
[1.7.2]Custom Tanks on gui
Override the onInventoryChanged() method wherever you're using the IInventory method, and do some extra processing in that. It gets called every time any part of the inventory is changed.
-
FORGE SRC 9.11.1.965 INSTALLATION HELP
Like what diesieben07 said, use build 964. Forge has upgraded to using Gradle, which 964 implements, and 965 doesn't.
-
[Resolved] [1.7.2] Block icon not being registered
Thanks! I was taking MachineMuse's advice from here: https://github.com/MachineMuse/MachineMusePowersuits/blob/master/src/minecraft/net/machinemuse/powersuits/common/ModularPowersuits.java though it is for 1.6.4.
-
[Resolved] [1.7.2] Block icon not being registered
Using: Forge 10.12.0.1024 on a Windows 7 64 bit Java with JDK 7_51 Okay, inside of my custom Block class, I have this code: @Override public void registerBlockIcons(IIconRegister iconRegister) { System.out.println("TRIGGER1"); super.registerBlockIcons(iconRegister); } @Override public IIcon getIcon(int side, int meta) { System.out.println("TRIGGER2"); return super.getIcon(side, meta); } Whenever I go inside my testing world, the texture doesn't show, and only TRIGGER2 appears in the console, never TRIGGER1. I've actually gotten this to work earlier, but I accidentally deleted the code. What am I doing wrong?
-
[1.7.2] Lang and Assets System
I've used the simple addName() method in the past, and wanted to use the localization system. Got to know the system, updated my development environment to 1.7, and now all of the methods are depreciated. It seems I'm supposed to use the loadLanguagesFor() method, but I don't understand it and can't find any good tutorials for it. Could someone point me in the right direction?
-
[1.6.4] [RESOLVED] How to access inventory with an item
Thanks!
-
[1.6.4] [RESOLVED] How to access inventory with an item
So what would be a good example of that?
IPS spam blocked by CleanTalk.