-
[1.10.2] Getting a long from player's nbt and displaying in a gui?
Currently using the following code: @Override public void drawForeground(int mouseX, int mouseY) { long rupees = Minecraft.getMinecraft().thePlayer.getEntityData().getLong("rupeeCount"); System.out.println(rupees); Minecraft.getMinecraft().fontRendererObj.drawString(Long.toString(rupees), 45, 92, 4210752); } It always displays as 0. I know I am using the correct key for the long because I have added a chat command that checks it and it is returning the proper value.
-
[1.8] Replacements for "ItemRenderer.renderItemIn2D" and IIcon's UV's
As the title says, what would the replacement be for "ItemRenderer.renderItemIn2D" and the getMin/MaxU/V of IIcon?
-
[1.7.10] How to create retrogen?
I can't seem to find any tutorials on how to create RetroGen. What classes do i need to extend/implement?
-
[1.7.10] Custom "vine" generation.
Yes, it's registered. Didn't know that, will fix. Finally, generateBacteria is an exact copy of Minecraft's vine generation with the function name changed. So go yell at Jeb_ or whoever makes Minecraft nowadays.
-
[1.7.10] Custom "vine" generation.
I'm attempting to make world gen for a custom block that works the same as vines. The following is my IWorldGenerator code: package dudesmods.fancycheeses.world.gen.feature; import java.util.Random; import cpw.mods.fml.common.IWorldGenerator; import dudesmods.fancycheeses.FancyCheeses; import net.minecraft.util.Direction; import net.minecraft.util.Facing; import net.minecraft.world.World; import net.minecraft.world.chunk.IChunkProvider; public class WorldGenBacteraLactococcus implements IWorldGenerator { @Override public void generate(Random random, int chunkX, int chunkZ, World world, IChunkProvider chunkGenerator, IChunkProvider chunkProvider) { if(world.provider.dimensionId == 0) { int firstBlockXCoord = chunkX + random.nextInt(16); int firstBlockYCoord = 64; int firstBlockZCoord = chunkZ + random.nextInt(16); generateBacteria(world, random, firstBlockXCoord, firstBlockYCoord, firstBlockZCoord); } } public boolean generateBacteria(World world, Random rand, int x, int y, int z) { int l = x; for (int i1 = z; y < 128; ++y) { if (world.isAirBlock(x, y, z)) { for (int j1 = 2; j1 <= 5; ++j1) { if (FancyCheeses.bacteria_lactococcus.canPlaceBlockOnSide(world, x, y, z, j1)) { world.setBlock(x, y, z, FancyCheeses.bacteria_lactococcus, 1 << Direction.facingToDirection[Facing.oppositeSide[j1]], 2); break; } } } else { x = l + rand.nextInt(4) - rand.nextInt(4); z = i1 + rand.nextInt(4) - rand.nextInt(4); } } return true; } } but nothing is generating.
-
[1.7.10] getBlock for an ItemStack?
ItemStacks have the method getItem(), but they don't seem to have getBlock(). Is it one of the func_s or does it simply not exist?
-
[1.7.10] Consume item in hand instead of just any item?
And then how would I consume the item? ConsumeItem doesn't take a slot.
-
[1.7.10] Consume item in hand instead of just any item?
In the code below i'm making it so a milk bucket acts as a normal bucket. But when "event.entityPlayer.inventory.consumeInventoryItem(Items.milk_bucket);" is called it will consume any milk bucket on the hotbar (in order from left to right) instead of the one in hand. @SubscribeEvent public void onPlayerInteraction(PlayerInteractEvent event) { if(event.action == PlayerInteractEvent.Action.RIGHT_CLICK_BLOCK) { if(event.entityPlayer.getHeldItem().getItem() != null && event.entityPlayer.getHeldItem().getItem() == Items.milk_bucket) { if(!event.entityPlayer.capabilities.isCreativeMode) { event.entityPlayer.inventory.consumeInventoryItem(Items.milk_bucket); event.entityPlayer.inventory.addItemStackToInventory(new ItemStack(Items.bucket, 1)); } switch (event.face) { case 0: event.world.setBlock(event.x, event.y-1, event.z, FancyCheeses.block_cow_milk); //y-1 case 1: event.world.setBlock(event.x, event.y+1, event.z, FancyCheeses.block_cow_milk); //y+1 case 2: event.world.setBlock(event.x, event.y, event.z-1, FancyCheeses.block_cow_milk); //z-1 case 3: event.world.setBlock(event.x, event.y, event.z+1, FancyCheeses.block_cow_milk); //z+1 case 4: event.world.setBlock(event.x-1, event.y, event.z, FancyCheeses.block_cow_milk); //x-1 case 5: event.world.setBlock(event.x+1, event.y, event.z, FancyCheeses.block_cow_milk); //x+1 } } } }
-
[1.7.10]Make TileEntity compatible with fluid pipes?
I was wondering how to make my TileEntity compatible with fluid pipes such as BuildCraft's Waterproof pipes or Thermal Expansion's Liquiducts.
-
Overwrite vanilla milk bucket and make milk a fluid?
I was wondering how to overwrite the vanilla milk bucket so I can make milk a fluid, as MFR does. Also, If it's possible, have my mod detect if MFR is installed and use it's fluid instead of adding my own.
-
[1.7.10]Display liquid and mB when hovered over in gui?
where do i get fontRenderer from? Edit: Found it, It's ment to be fontRendererObj
-
[1.7.10]Display liquid and mB when hovered over in gui?
In mods such as Tinker's Construct and Thermal Expansion when you hover over a liquid in a gui it tells you the name of the liquid and the amount in mB. How is this accomplished?
-
[1.7.10] Gui button won't click.
This man is correct. buttonList is deprecated. use controlList instead.
-
Shift+Right Click but not Right Click+Shift
I was wondering how to make something happen in onItemUse when the player Shift+Right Clicks, but not if the player is holding right-click and then hits shift.
-
Display an item icon in a GUI.
So, something like this? protected void guiDrawIcon(Item item, int x, int y) { Minecraft.getMinecraft().getTextureManager().bindTexture(TextureMap.locationBlocksTexture); IIcon icon = item.getIconFromDamage(0); GL11.glEnable(GL11.GL_BLEND); this.drawTexturedModelRectFromIcon(x, y, icon, 16, 16); GL11.glDisable(GL11.GL_BLEND); }
IPS spam blocked by CleanTalk.