Jump to content

UntouchedWagons

Members
  • Posts

    156
  • Joined

  • Last visited

Everything posted by UntouchedWagons

  1. I'm porting a mod from 1.6.4 to 1.7.10 that uses the Redstone Flux API. It's more or less done but for some reason the tile entity client-side doesn't seem to be updated whenever the tile entity server-side receives energy. Do I need to call markDirty every time it receives energy or am I missing something else? Here is the repository: https://github.com/UntouchedWagons/OpenModularTurrets Here is the code for the TileEntity class: https://github.com/UntouchedWagons/OpenModularTurrets/blob/master/src/main/java/modularTurrets/tileentity/turretBase/TurretBase.java Current build can be found here: http://untouchedwagons.com:8080/job/OpenModularTurrets/
  2. I hardly consider posting in a thread that hasn't had a post for 10 days to be necrobumping. Relavent XKCD Yeah I mostly figured it out by looking at forestry's code. GUIs in minecraft could be a bit more intuitive
  3. What did you do? I want to implement the same feature in my mod.
  4. I had gotten some help from some of the Minechem devs and they helped me fix the Creative Tab issue. I had to override CreativeTab's getIconItemStack method, have it return an ItemStack and make getTabIconItem return null. The code in my mod's repository is what I'm at right now.
  5. I know the TileEntity renderer works. The way the original author wrote it, when you put an item in to sell, the TileEntity renderer will render the item inside the block (the vending machine looks not unlike a glass cookie jar) as if you simply dropped the item on the ground. When I put an item in, the item does show up. I put an "FMLLog.info" bit at the beginning of each method of the ISBRH class that does render stuff (drawBlock, renderInventoryBlock, and renderWorldBlock) and I saw "renderInventoryBlock" and "drawBlock" spammed to the console. So that tells me it's doing stuff, just not the right stuff.
  6. You can access them via Reflection, you'd have to decompile the mod though to figure out what you need to reflect into.
  7. Okay making the BlockAbstractVendingMachine override getRenderType has its rendering sort of work. I figured out how to register my ISBRH and the vending machine is rendering in my inventory but not in world: http://i.imgur.com/jmR2lNx.png
  8. I'm working on porting a mod from 1.6.4 to 1.7.10 and I finally got it to compile (after rewriting all the packet stuff and whatnot) but the blocks aren't rendering properly. I really don't understand how OpenGL and all the rendering stuff works so it could very well be something I broke porting the mod. Picture: http://i.imgur.com/R9uGk30.png All the code for the mod can be found on my github account Tile Entity class: code Tile Entity Render: code
  9. In the Item class' getItemStackDisplayName method it calls StatCollector's translateToLocal method but there's no reference to the mod that the item is from. So if two mods add an item with the same unlocalized name, how does Minecraft know which item.the_thing.name to use? Also, is it possible to get the display name of an item using only the mod id and the unlocalized name?
  10. It doesn't make sense for Blocks.brewing_stand to be null in postInit because you're supposed to make your recipes in the init method which happens before postInit.
  11. When I started this thread, it didn't occur to me that the getDisplayName method would be client-side only. It makes sense. However even if I try to get the display name of a brewing stand in a ClientProxy, I still get a NullPointerException: package untouchedwagons.minecraft.sandbox; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.SidedProxy; import cpw.mods.fml.common.event.FMLPostInitializationEvent; @Mod(modid = "sandbox", name = "Sandbox", version = "1.0.0", dependencies = "required-after:FML") public class Sandbox { @SidedProxy(clientSide = "untouchedwagons.minecraft.sandbox.ClientProxy", serverSide = "untouchedwagons.minecraft.sandbox.CommonProxy") public static CommonProxy proxy; @Mod.EventHandler public void postInit(FMLPostInitializationEvent event) { proxy.doTheNeedful(); } } package untouchedwagons.minecraft.sandbox; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; public class ClientProxy extends CommonProxy { @Override public void doTheNeedful() { ItemStack brewing_stand = new ItemStack(Blocks.brewing_stand); brewing_stand.getDisplayName(); } } Maybe because I passed a block into the ItemStack's constructor? Do I need to do something different to get the localized name of a block?
  12. In the actual mod this snippet is from, it is called client-side.
  13. package untouchedwagons.minecraft.sandbox; import cpw.mods.fml.common.Mod; import cpw.mods.fml.common.event.FMLInitializationEvent; import net.minecraft.init.Blocks; import net.minecraft.item.ItemStack; @Mod(modid = "sandbox", name = "Sandbox", version = "1.0.0", dependencies = "required-after:FML") public class Sandbox { @Mod.EventHandler public void load(FMLInitializationEvent event) { ItemStack brewing_stand = new ItemStack(Blocks.brewing_stand); brewing_stand.getDisplayName(); } } Throws a NullPointerException: java.lang.NullPointerException: Initializing game at net.minecraft.item.ItemStack.func_82833_r(ItemStack.java:426) at untouchedwagons.minecraft.sandbox.Sandbox.load(Sandbox.java:25)
  14. So what's this block state stuff all about? It replaces the meta data stuff I guess.
  15. If you do a search in that class, you'll see that it's referenced in the getDigSpeed method so it probably has to do with mining speed. If you look at the ItemPickaxe class, you'll see that it overrides the func_150893_a method in ItemTool which overrides that method in the Item class.
  16. I want to check if the result of a crafting recipe is a block (planks, gold blocks, etc...) rather than an item. Is this the right way to check? ItemStack result = recipe.getRecipeOutput(); Block result_block = Block.getBlockFromItem(result .getItem()); if (result_block != null) System.out.println("Yup the result is a block"); Likewise if I want to check if the result is an Item (fish, diamond sword, etc...): ItemStack result = recipe.getRecipeOutput(); Item result_item = Item.getItemById(Item.getIdFromItem(result.getItem())); if (result_item != null) System.out.println("Yup the result is an item"); Is this right?
  17. A while back there was a user on /r/feedthebeast who made a thread warning others not to store too much stuff on a single Applied Energistics disk. Apparently the NBT data got so big that it corrupted his world or something like that. 200,000 slots might be a bit much for one NBT structure unless you 'partition' the chest into several smaller chunks and save each chunk in its own file but present all the chunks as a single inventory.
  18. I'm trying to learn to use git after having used mercurial for ~2 years and I found this cheatsheet to help a bit.
  19. Well I'm using Netty which doesn't push the listening socket onto another thread, but I know how to deal with threads so that's trivial. I'll look into shutdown hooks. [Edit] Yup a shutdown hook will work. Thanks.
  20. Clicking "Quit Game" on the main title or clicking the X on the top right corner of the window. I want to start an HTTP server when the game starts and then safely shut it down when the game closes.
  21. So is there an event of some sort that's triggered when the game itself is shutting down that works client side?
  22. Cool. I was looking at your tutorial and I saw there's events for the server starting and stopping but is there an event for the game (client-side) shutting down? I want to have a built-in HTTP server using netty and I want it running as long as the player has Minecraft running, not necessarily connected to a server.
×
×
  • Create New...

Important Information

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