Everything posted by Jdb100
-
[1.6.4]storing maps in nbt
nvm, solved myself
-
[1.6.4]storing maps in nbt
I looked into IExtendedEntityProperties but it wouldn't work for what I want.
-
[1.6.4]storing maps in nbt
I have a hash map that I want to store as nbt. I write on FMLServerStoppingEvent and read on FMLServerStartingEvent. The hash map is as so: Public static Map<String, Set<Research>> researchedByPlayer = new HashMap<String, Set<Research>>(); I have a method to get the name of the research as a string aswell as find the research by a string. I thought of doing it by looping through the keys of the map and saving each as a string in nbt then doing the same for the values by iterating through the set and getting the name to save. I don't know how I and then just do the reverse for loading. Is this the correct way or should I do it a different way?
-
[1.6.4]Creating custom events
I have been working on a research api and was trying to find a way to allow the coder to intervene when the player researches something. The best way i can think to do this is create an event that the coder can use to determine what they want to do like they BreakEvent in BlockEvent. i just need to understand how these are created. i have looked at the Universal Electricity code on there custom event but it wasn't very helpful.
-
[1.6.4]I am having a problem with a Item texture
Ya I always use registerIcon because I find it easier to work with for multiple textures
-
[1.6.4]I am having a problem with a Item texture
.setUnlocalizedName is for lang files not textures instead override the method registerIcon in your block class
-
[1.6.4] Can someone help with this crash I am getting
you have this right now GameRegistry.addRecipe(new ItemStack(PureEnergyHoe, 1), new Object [] { "D**", " XL", " X ", 'X', Item.stick, '*', PureEnergy, LiteEnergyHoe, 'D', DarkEnergyHoe }); where after Pure energy you never give the LiteEnergyHoe a character so replace with this GameRegistry.addRecipe(new ItemStack(PureEnergyHoe, 1), new Object [] { "D**", " XL", " X ", 'X', Item.stick, '*', PureEnergy, 'L', LiteEnergyHoe, 'D', DarkEnergyHoe });
-
[1.6.4]Update item name in-game.
you can look through the anvil code
-
[1.6.4] Can someone help with this crash I am getting
when you are creating a recipe you are trying to cast your ItemLiteEnergy to a Character. please post this code
-
[1.6.4]comparing strings always returns false
i am an idiot i put a semicolon after the if statement
-
[1.6.4]comparing strings always returns false
i had it as if(!(event.getPlayer().username.equals(desk.owner))) before so i changed it to see if it worked with == which i normally do not do.
-
[1.6.4]comparing strings always returns false
I was using an event and i needed to check some strings to see if they didn't match but for some reason they always never match. Code: @ForgeSubscribe public void blockBroken(BreakEvent event) { if(event.block instanceof BlockDesk) { System.out.println(event.getPlayer().username); TileEntityDesk desk = (TileEntityDesk) event.world.getBlockTileEntity(event.x, event.y, event.z); System.out.println(desk.owner); if(desk.owner != null) { if(event.getPlayer().username.equals(desk.owner) == false); { event.setCanceled(true); } } } } and the 2 prints both say jdb100 which is my username.
-
[1.7.2]Simple 1-slot chest/Container returns ClassCastException
Just scimmed over it but in your GUI handler when you return in the server side you are giving it your GUI not your container.
-
[SOLVED]Mob Rotation on Jump
Just add all parts as childs to your main body part then rotate the main body part and they all will follow.
-
[1.6.4]Creating New ItemStack In Gui Slot.
Have the button call the setInventorySlotContents method in your tile entity.
-
Rideable Mobs Help [1.6.2]
when you are moving the pig on your screen you never tell the server that its position is different so when you stop the server tries to sync with client and teleports you back so you need to send a packet from the client to the server telling the server you are in a new position.
-
[SOLVED][1.7.2] Send Chat Message to self!
Pretty sure this is what you want Minecraf.getMinecraft().thePlayer.addChatMessage("chat message")
- distrubting
-
[Solved] Having troubles with RenderGameOverlayEvent
no problem
-
[Solved] Having troubles with RenderGameOverlayEvent
don't use @EventHandler over your renderGameOverlayEvent use @SubscribeEvent
-
[Solved] Having troubles with RenderGameOverlayEvent
are you 1.7.2 or 1.6
-
[1.6.2 Forge] Randomizer Item Help
All you need to do is create a new instance of random then make a new int of random with a cap of 32000 then check if that id is an item and if it is continue or else loop through and create a new int till it is then make an itemstack with it and then have it return that itemstack.
-
Added Chat Messages Posting Twice
add @SideOnly(Side.CLIENT) or @SideOnly(Side.SERVER) above your method like when you do the @EventHandler
-
[Solved] Having troubles with RenderGameOverlayEvent
you need to register your class as event handler and seeing as you are using your base class for event handler just add this into your post init MinecraftForge.EVENT_BUS.register(this);
-
[solved]IsidedInventory block duplicating items
I was able to add to my block ISidedInventory to allow it to hold and insert/extract items however when i try to remove the item from the book it duplicates. So a quick overview of my block; if the player is holding a book well he clicks my block it will remove the book and insert the book into the block. When the block is clicked again well the inventory is full it will remove the item and spawn an entityItem which is the book into the world. The problem when removing the book by clicking it will duplicate the book if the player has more then 1 of the books in his hand. So for example you have 3 books in your hand and you click on the block(which is empty at this point) this removes a book from your hand and places it in the block so then when you click the block again to retrieve your book it spawns 2 books because that was how many i had after i placed the book. However even though this number is how many you have in your hand after adding the book it is not dependent on how many you have when removing the book so if i had 3 then placed 1 and then threw my 2nd one on the ground then clicked it would still spawn 2. Block Code: Tile Entity Code: edit: added check to see if item in slot was greater then inventory stack limit then set it to stack limit if it was.
IPS spam blocked by CleanTalk.