
RaTheBadger
Members-
Posts
34 -
Joined
-
Last visited
Everything posted by RaTheBadger
-
Awesome, thank you for the solution!
-
Hi! Posting this to ask a pretty simple question. I'd like to get a flat block, like redstone wire or rails, to work properly. However, instead of the transparent parts of the PNG being transparent in game, they appear white. Any idea why this is? Here's an example of what's going on. On the left is my block and on the right is how it's meant to render in game. { "ambientocclusion": true, "textures": { "particle": "spiritmod:blocks/block_sigilPlaced" }, "elements": [ { "from": [ 0, 1, 0 ], "to": [ 16, 1, 16 ], "faces": { "down": { "uv": [ 0, 16, 16, 0 ], "texture": "#particle" }, "up": { "uv": [ 0, 0, 16, 16 ], "texture": "#particle" } } } ] } Here is the models/block/sigilPlaced json file. Yes, the model and texture are both being pulled properly. I've looked at the rail/redstone wire files, but I can't see where the difference would be Any help would be greatly appreciated, thank you!
-
[1.6.2] [Solved] Selecting entity ID returns an incorrect value
RaTheBadger replied to RaTheBadger's topic in Modder Support
Thanks Goto, works beautifully now. -
Hello. I'm trying to make an item which changes its own damage value to the entity ID of a mob, when the mob is right clicked. For example, its damage value would be 52 for a spider, 61 for a blaze, etc. However, when I right click a mob with the item, the damage value becomes something completely different; 3732, 167, or any other sort of seemingly random value. I think that the problem might be that it's returning that specific entity's ID, rather than the ID of the type of entity it is. How should I fix this? Relevant code: public boolean func_111207_a(ItemStack par1ItemStack, EntityPlayer par2EntityPlayer, EntityLivingBase par3EntityLivingBase) { if (par1ItemStack.getItemDamage() == 0) { if (par3EntityLivingBase instanceof EntityLiving) { EntityLiving entityliving = (EntityLiving)par3EntityLivingBase; par1ItemStack.setItemDamage(par3EntityLivingBase.entityId); return true; } else { return super.func_111207_a(par1ItemStack, par2EntityPlayer, par3EntityLivingBase); } } else { return false; } } Thanks again.
-
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
Ah, good, thanks I've got almost everything working now, including the problem that this topic was posted for. -
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
Well, this particular block already has metadata for the amount of water in it. Is it possible to have two different sets of metadata for one block, or would I need a tile entity for that? -
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
Argh, I'm terrible with Tile Entities. I'll try that though, thanks. -EDIT- Actually, how might I go about that? Doing this: if (par1World.getBlockTileEntity(par2, par3, par4).potionPrimaryAdded == true) Gives me an error, complaining that potionPrimaryAdded isn't a field in TileEntity. I've made it a field in TileEntityCauldronm, but how do I write it to check the state of potionPrimaryAdded in TileEntityCauldronm? Also, note that 'Cauldronm' is intentionally spelled with an M at the end. -
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
Okay.. I feel incredibly stupid for not seeing the pinned post, though. Thanks anyway. -
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
Oh god am I oblivious. I honestly didn't see that, I'll remove my bump post Sorry. EDIT: For the record, is there a way to post without bumping? Because this post is a bit ironic. I've seen the ability on other forums. -
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
I intend for 'potionPrimaryAdded' to be set to true for the cauldron being used, upon right clicking it with a potion item. else if (itemstack.itemID == Item.potion.itemID && j1 >= 3) If the held item is a potion and the cauldron has 3 levels of water in it, if (this.potionPrimaryAdded == false) { If potionPrimaryAdded is false, if (dmg == 8193 || dmg == 8257 || dmg == 8225) { potionIngred = "resistance"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage1 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Resistance added [1]"); par5EntityPlayer.sendChatToPlayer(chatMessage1); ++itemstack.itemID; } Then it checks the damage value of the held potion, and labels it in the chat (for debugging purposes), and is meant to set potionPrimaryAdded to true only for that particular cauldron. However, all cauldrons in the world update, whether or not the boolean says static. -
[1.6.2] [Solved] Every block of a type updates based on one
RaTheBadger replied to RaTheBadger's topic in Modder Support
Alright, I removed 'static', but I'm still getting the problem. Thanks for responding, though. -
Hey all, I'm having another undoubtedly silly issue with my mod. There's a block in my mod which extends the vanilla cauldron and adds some functionality. However, I'm having a problem where every block of my cauldron's type updates itself based on only one. In other words, if I interact with one cauldron, they all act as if they've been interacted with. Here's the code for my cauldron, what am I doing wrong? I know very little of java, so I could use some help/advice. package mod_mythica; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import java.util.List; import java.util.Random; import net.minecraft.block.Block; import net.minecraft.block.BlockCauldron; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IconRegister; import net.minecraft.entity.Entity; import net.minecraft.entity.item.EntityItem; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayerMP; import net.minecraft.item.EnumArmorMaterial; import net.minecraft.item.Item; import net.minecraft.item.ItemArmor; import net.minecraft.item.ItemStack; import net.minecraft.util.AxisAlignedBB; import net.minecraft.util.ChatMessageComponent; import net.minecraft.util.Icon; import net.minecraft.world.IBlockAccess; import net.minecraft.world.World; public class Cauldronm extends BlockCauldron { @SideOnly(Side.CLIENT) private Icon field_94378_a; @SideOnly(Side.CLIENT) private Icon cauldronTopIcon; @SideOnly(Side.CLIENT) private Icon cauldronBottomIcon; public boolean potionPrimaryAdded; public Cauldronm(int par1) { super(par1); this.potionPrimaryAdded = false; } @SideOnly(Side.CLIENT) public Icon getIcon(int par1, int par2) { return par1 == 1 ? this.cauldronTopIcon : (par1 == 0 ? this.cauldronBottomIcon : this.blockIcon); } @SideOnly(Side.CLIENT) public void registerIcons(IconRegister par1IconRegister) { this.field_94378_a = par1IconRegister.registerIcon("modmythica:cauldronm_inner"); this.cauldronTopIcon = par1IconRegister.registerIcon("modmythica:cauldronm_top"); this.cauldronBottomIcon = par1IconRegister.registerIcon("modmythica:cauldronm_bottom"); this.blockIcon = par1IconRegister.registerIcon("modmythica:cauldronm_side"); } public void addCollisionBoxesToList(World par1World, int par2, int par3, int par4, AxisAlignedBB par5AxisAlignedBB, List par6List, Entity par7Entity) { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 0.3125F, 1.0F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); float f = 0.125F; this.setBlockBounds(0.0F, 0.0F, 0.0F, f, 1.0F, 1.0F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, f); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); this.setBlockBounds(1.0F - f, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); this.setBlockBounds(0.0F, 0.0F, 1.0F - f, 1.0F, 1.0F, 1.0F); super.addCollisionBoxesToList(par1World, par2, par3, par4, par5AxisAlignedBB, par6List, par7Entity); this.setBlockBoundsForItemRender(); } @SideOnly(Side.CLIENT) public static Icon func_94375_b(String par0Str) { return par0Str.equals("inner") ? Block.cauldron.getField_94378_a() : (par0Str.equals("bottom") ? Block.cauldron.getCauldronBottomIcon() : null); } public void setBlockBoundsForItemRender() { this.setBlockBounds(0.0F, 0.0F, 0.0F, 1.0F, 1.0F, 1.0F); } public boolean isOpaqueCube() { return false; } public int getRenderType() { return 24; } public boolean renderAsNormalBlock() { return false; } public boolean onBlockActivated(World par1World, int par2, int par3, int par4, EntityPlayer par5EntityPlayer, int par6, float par7, float par8, float par9) { if (par1World.isRemote) { return true; } else { ItemStack itemstack = par5EntityPlayer.inventory.getCurrentItem(); if (itemstack == null) { return true; } else { int i1 = par1World.getBlockMetadata(par2, par3, par4); int j1 = func_111045_h_(i1); //Adding water from a bucket if (itemstack.itemID == Item.bucketWater.itemID) { if (j1 < 3) { if (!par5EntityPlayer.capabilities.isCreativeMode) { par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, new ItemStack(Item.bucketEmpty)); } par1World.setBlockMetadataWithNotify(par2, par3, par4, 3, 2); par1World.func_96440_m(par2, par3, par4, this.blockID); } return true; } else { //Adding water from a bottle if (itemstack.itemID == Item.glassBottle.itemID) { if (j1 > 0) { ItemStack itemstack1 = new ItemStack(Item.potion, 1, 0); if (!par5EntityPlayer.inventory.addItemStackToInventory(itemstack1)) { par1World.spawnEntityInWorld(new EntityItem(par1World, (double)par2 + 0.5D, (double)par3 + 1.5D, (double)par4 + 0.5D, itemstack1)); } else if (par5EntityPlayer instanceof EntityPlayerMP) { ((EntityPlayerMP)par5EntityPlayer).sendContainerToPlayer(par5EntityPlayer.inventoryContainer); } --itemstack.stackSize; if (itemstack.stackSize <= 0) { par5EntityPlayer.inventory.setInventorySlotContents(par5EntityPlayer.inventory.currentItem, (ItemStack)null); } par1World.setBlockMetadataWithNotify(par2, par3, par4, j1 - 1, 2); par1World.func_96440_m(par2, par3, par4, this.blockID); } } //Washing armor else if (j1 > 0 && itemstack.getItem() instanceof ItemArmor && ((ItemArmor)itemstack.getItem()).getArmorMaterial() == EnumArmorMaterial.CLOTH) { ItemArmor itemarmor = (ItemArmor)itemstack.getItem(); itemarmor.removeColor(itemstack); par1World.setBlockMetadataWithNotify(par2, par3, par4, j1 - 1, 2); par1World.func_96440_m(par2, par3, par4, this.blockID); return true; } //Adding potions else if (itemstack.itemID == Item.potion.itemID && j1 >= 3) { if (this.potionPrimaryAdded == false) { String potionIngred; int dmg = itemstack.getItemDamage(); if (dmg == 8193 || dmg == 8257 || dmg == 8225) { potionIngred = "resistance"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage1 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Resistance added [1]"); par5EntityPlayer.sendChatToPlayer(chatMessage1); ++itemstack.itemID; } else if (dmg == 8194 || dmg == 8258 || dmg == 8226) { potionIngred = "swiftness"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage2 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Swiftness added [2]"); par5EntityPlayer.sendChatToPlayer(chatMessage2); ++itemstack.itemID; } else if (dmg == 8195 || dmg == 8259 || dmg == 8227) { potionIngred = "fireresistance"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage3 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Fire Resistance added [3]"); par5EntityPlayer.sendChatToPlayer(chatMessage3); ++itemstack.itemID; } else if (dmg == 8196 || dmg == 8260 || dmg == 8228) { potionIngred = "poison"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage4 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Poison added [4]"); par5EntityPlayer.sendChatToPlayer(chatMessage4); ++itemstack.itemID; } else if (dmg == 8197 || dmg == 8261 || dmg == 8229) { potionIngred = "healing"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage5 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Healing added [5]"); par5EntityPlayer.sendChatToPlayer(chatMessage5); ++itemstack.itemID; } else if (dmg == 8198 || dmg == 8262 || dmg == 8230) { potionIngred = "nightvision"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage6 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Night Vision added [6]"); par5EntityPlayer.sendChatToPlayer(chatMessage6); ++itemstack.itemID; } else if (dmg == 8200 || dmg == 8264 || dmg == 8232) { potionIngred = "weakness"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage7 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Weakness added [7]"); par5EntityPlayer.sendChatToPlayer(chatMessage7); ++itemstack.itemID; } else if (dmg == 8201 || dmg == 8265 || dmg == 8233) { potionIngred = "strength"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage8 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Strength added [8]"); par5EntityPlayer.sendChatToPlayer(chatMessage8); ++itemstack.itemID; } else if (dmg == 8202 || dmg == 8266 || dmg == 8234) { potionIngred = "slowness"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage9 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Slowness added [9]"); par5EntityPlayer.sendChatToPlayer(chatMessage9); ++itemstack.itemID; } else if (dmg == 8204 || dmg == 8268 || dmg == 8236) { potionIngred = "harming"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage10 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Harming added [10]"); par5EntityPlayer.sendChatToPlayer(chatMessage10); ++itemstack.itemID; } else if (dmg == 8206 || dmg == 8270 || dmg == 8238) { potionIngred = "invisibility"; this.potionPrimaryAdded = true; ChatMessageComponent chatMessage11 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Invisibility added [11]"); par5EntityPlayer.sendChatToPlayer(chatMessage11); ++itemstack.itemID; } } else { ChatMessageComponent chatMessage12 = ChatMessageComponent.func_111066_d("§5<<Mythica>>§r Primary potion already added"); par5EntityPlayer.sendChatToPlayer(chatMessage12); } } return true; } } } } public void fillWithRain(World par1World, int par2, int par3, int par4) { if (par1World.rand.nextInt(20) == 1) { int l = par1World.getBlockMetadata(par2, par3, par4); if (l < 3) { par1World.setBlockMetadataWithNotify(par2, par3, par4, l + 1, 2); } } } //This just makes it display portal particles for testing purposes. public void randomDisplayTick(World par1World, int par2, int par3, int par4, Random par5Random) { if (potionPrimaryAdded == true) { for (int l = 0; l < 4; ++l) { double d0 = (double)((float)par2 + par5Random.nextFloat()); double d1 = (double)((float)par3 + par5Random.nextFloat()); double d2 = (double)((float)par4 + par5Random.nextFloat()); double d3 = 0.0D; double d4 = 0.0D; double d5 = 0.0D; int i1 = par5Random.nextInt(2) * 2 - 1; d3 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; d4 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; d5 = ((double)par5Random.nextFloat() - 0.5D) * 0.5D; /* if (par1World.getBlockId(par2 - 1, par3, par4) != this.blockID && par1World.getBlockId(par2 + 1, par3, par4) != this.blockID) { d0 = (double)par2 + 0.5D + 0.25D * (double)i1; d3 = (double)(par5Random.nextFloat() * 2.0F * (float)i1); } else { d2 = (double)par4 + 0.5D + 0.25D * (double)i1; d5 = (double)(par5Random.nextFloat() * 2.0F * (float)i1); } */ par1World.spawnParticle("portal", d0, d1, d2, d3, d4, d5); } } else { } } public int idDropped(int par1, Random par2Random, int par3) { return Item.cauldron.itemID; } @SideOnly(Side.CLIENT) public int idPicked(World par1World, int par2, int par3, int par4) { return Item.cauldron.itemID; } public boolean hasComparatorInputOverride() { return true; } public int getComparatorInputOverride(World par1World, int par2, int par3, int par4, int par5) { int i1 = par1World.getBlockMetadata(par2, par3, par4); return func_111045_h_(i1); } public static int func_111045_h_(int par0) { return par0; } } Thanks for helping
-
Alright, I added this: private static final ResourceLocation field_110839_f = new ResourceLocation("modtest","/textures/exsang.png"); @Override @SideOnly(Side.CLIENT) public boolean hasStatusIcon() { Minecraft.getMinecraft().renderEngine.func_110577_a(field_110839_f); return true; } However, now, the icon is blank. The file is there, and the console doesn't say that it can't find it, so I'm not sure quite what the issue is. EDIT: I fixed this! Hooray! I just forgot to put 'this.setIconIndex(0, 0);' in the file, lol.
-
Yes, I've done so; but as it is, it only works with the default inventory.png. How do I get it to refer to the custom inventory.png with the proper icon?
-
Yeah, I saw that the icons are located at the bottom of inventory.png, having produced a texture pack. Making my own inventory.png is easy enough, but how do I actually use it?
-
Hello. I recently made a custom potion effect, but I can't figure out how to customize the icon that appears next to your inventory. This icon, that appears within the effect display; not the item icon. I know how to display a vanilla icon, but I don't know how to display an image of my own. Thanks for the help.
-
How do I display a random message per click? [Solved]
RaTheBadger replied to RaTheBadger's topic in Modder Support
Okay, thanks! It works now. EDIT: I've changed the boolean to an int which is initially 0; it checks on click to see if hasBeenClicked < 3 , what would the line be to add 1 to the value of hasBeenChecked (as opposed to hasBeenClicked = true; )? -
How do I display a random message per click? [Solved]
RaTheBadger replied to RaTheBadger's topic in Modder Support
Thanks, but the random picking is working now Any idea on how to make it work only on the first right click? -
How do I display a random message per click? [Solved]
RaTheBadger replied to RaTheBadger's topic in Modder Support
Okay, thanks! I'll try that. EDIT: Works! How might I go about making it only work once? I tried looking at the code for checking whether a wolf is angry or not, but that didn't help. -
I have an entity in my mod which displays text when right-clicked; how can I make it select randomly and display one line from a selection? Also, once it displays this message, I'd like it to not display a message the next time it is right clicked. Current 'on interact' code: public boolean interact(EntityPlayer player) { if(!player.worldObj.isRemote) { player.sendChatToPlayer("Testing"); } return true; } Thanks.
-
Chat message is sent twice per click [Solved]
RaTheBadger replied to RaTheBadger's topic in Modder Support
Alright, I'll do that! Thanks! EDIT: Works I appreciate the help. -
Alright, so I have an entity that displays a message when clicked. However, it sends this message twice per click. How can I fix this? Relevant code: public boolean interact(EntityPlayer player) { player.sendChatToPlayer("Testing"); return true; } Thanks
-
[SOLVED!] Entity Damage & Potion Effect
RaTheBadger replied to RaTheBadger's topic in Modder Support
Thank you, Diesie, with your help I could solve the issue. -
[SOLVED!] Entity Damage & Potion Effect
RaTheBadger replied to RaTheBadger's topic in Modder Support
Well- now the entity doesn't spawn (and can't be spawned with its egg) at all. public class EntityExample extends EntityMob { public EntityExample(World par1World, Entity par1Entity) { super(par1World); super.attackEntityAsMob(par1Entity); I thought that you meant to put it at the top. Is this correct placement? -
[SOLVED!] Entity Damage & Potion Effect
RaTheBadger replied to RaTheBadger's topic in Modder Support
It gives me an error on the super(par1Entity) line; saying that the constructor call must be the first statement in the constructor.