Jump to content
Search In
  • More options...
Find results that contain...
Find results in...


  • Posts

  • Joined

  • Last visited

Everything posted by Atijaf

  1. Thank you all for the amount of replies and discussions. I have been away from home and am delighted to see all these answers to my question. I will probably be using diesieben07's tutorial, even though I will be replacing many crafting recipes, if not all. I would like complete control and customizable crafting recipes as well as requirements to craft them, so with diesieben07's tutorial, it looks like I can have that. Again, thanks for all the input. It helped me immensely! Edit: With a few tweaks here and there, I was able to recreate my own way of adding recipes (i.e. extending shapedOreRecipes) This way, I can now use my new class, which is pretty much a copy of shapedOreRecipes, except I added a few variables such as required level and skill name. No need to create a new class for each recipe.
  2. Not appearing in the output would be neat, but not required. Honestly, any of those will work. Whichever is easier I suppose. I believe you when you say it's not easy. I've looked around a little bit and haven't found too much. This is similar to what I found, but was confused and was hoping to find an alternative. Also, incompatibility is just fine. It's the only mod my friends and I will be using. Yes.
  3. Is there some way to stop the player from obtaining the item crafted? I have used this @SubscribeEvent public void onItemCrafted(ItemCraftedEvent event){ event.player.inventory.setItemStack(null) } which deletes what the player is holding with the mouse. However, if the player shift clicks the item, he still gets it. I would prefer to leave the shift clicking ability in there.
  4. I understand the frustration with learning OOP, but if each player is to have their OWN set of variables, you need to remove the static keyword from playerHuman, playerVampire, playerWerwolf inside your ExtendedPlayer class. Removing the static keyword will make those variables owned by the object and not the class. Alright, so now you have many errors. Most of those errors are probably trying to acquire playerHuman, playerVamp, and playerWerewolf variables. What you were previously doing was trying to obtain the class variables, so now you need to obtain the object's variables. To obtain the Object: So you already have the getter for the object. public static final ExtendedPlayer get(EntityPlayer player){ return (ExtendedPlayer) player.getExtendedProperties(EXT_PROP_VZPLAYER); } Which is great. This will be used. Inside your public class "PlayerTransformed" and right before that first if statement, add this. ExtendedPlayer extended_player = ExtendedPlayer.get(event.player); We make use of the get method you have. That obtains the instance from your class and you can now play with the variables inside using the ExtendedPlayer object, extended_player. Hopefully this will solve the errors you are having. As for saving, we wont know until this is done.
  5. Note, that you can't jusy copy these methods from grass block, otherwise all mimiced blocks will be recolored... And you will get green planks... Thanks for telling me that. I had a feeling, but wasn't sure. However, I did test the wood and it comes out fine, but then I tested tall grass and redstone. The tall grass was gray and the redstone was green:p So I looked at the code from both classes and came up with something that seemed to have worked. It takes the only blocks that actually use this color coding stuff, or atleast the ones I currently know about... So I will be patching it as I see others that need it @SideOnly(Side.CLIENT) public int getRenderColor(IBlockState state){ if(state == Blocks.redstone_wire.getDefaultState()){//This will make the mimiced redstone line look like it's off (red) float f1 = 0.3F; float f2 = 0.0F; float f3 = 0.0F; int j = MathHelper.clamp_int((int)(f1 * 255.0F), 0, 255); int k = MathHelper.clamp_int((int)(f2 * 255.0F), 0, 255); int l = MathHelper.clamp_int((int)(f3 * 255.0F), 0, 255); return -16777216 | j << 16 | k << 8 | l; } return this.getBlockColor(); } @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { TileEntity tile_entity; IBlockState state = worldIn.getBlockState(pos); if(worldIn.getTileEntity(pos) instanceof TileEntityMimicBlock){ tile_entity = (TileEntityMimicBlock)worldIn.getTileEntity(pos); state = ((TileEntityMimicBlock) tile_entity).getState(); if(state == Blocks.grass.getDefaultState() || state.getBlock() == Blocks.tallgrass) return BiomeColorHelper.getGrassColorAtPos(worldIn, pos); return getRenderColor(state); } return getRenderColor(state); }
  6. Thanks a bunch! I copied this over from the grass block and I've tested it and it seems to work. @SideOnly(Side.CLIENT) public int getBlockColor(){ return ColorizerGrass.getGrassColor(0.5D, 1.0D); } @SideOnly(Side.CLIENT) public int getRenderColor(IBlockState state){ return this.getBlockColor(); } @SideOnly(Side.CLIENT) public int colorMultiplier(IBlockAccess worldIn, BlockPos pos, int renderPass) { return BiomeColorHelper.getGrassColorAtPos(worldIn, pos); } out of curiosity, would you know whether or not I should copy the block's Model In my TileEntity?
  7. I have a a tile entity called mimic block. It mimics other blocks textures from it's state, and it seemed to be working great until I tried it on grass. It gives me a strange texture. The strange texture I'm getting https://gyazo.com/05e6d28803f8ec71565c578aad6f97e2 TileEntityMimicBlock http://pastebin.com/QvZi553P MimicBlock http://pastebin.com/uGUKsVYM MimicBlockISmartBlockModelFactory http://pastebin.com/J1w1EEVx Any ideas as to what would cause that?
  8. Packet Dispatcher http://pastebin.com/Ydv74KaB SyncCurrentMimicBlockState http://pastebin.com/VqRP80NQ CurrentMimicBlockState class http://pastebin.com/gjL6dCyC Thanks!
  9. Hmmm.. I thought it was fine after looking at it for a little bit. Unfortunately, it looks like it's not syncing to the server. What is suppose to happen is this.. Each player has nbt tag that holds an IBlockState Id. This Id is then used in my Tile Entity Mimic block to tell the block what to look like. (client side only) When I press shift, and f together, it checks the player's inventory to see if he has a block, and if so, copy that blocks state into the tile entity Mimic block. after that it is suppose to send message to the server, syncing the object. key Input method (doesn't work/ doesn't sync to server...) @SubscribeEvent public void onKeyInput(KeyInputEvent event){ EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; if (ClientProxy.keyBindings[0].isPressed()){ if (player.isSneaking() && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() != null){ ItemStack item = player.getCurrentEquippedItem(); Block block = Block.getBlockFromItem(item.getItem()); IBlockState state = block.getStateFromMeta(item.getMetadata()); CurrentMimicBlockState.get((EntityPlayer) player).setMimicBlock(state); PacketDispatcher.sendToServer(new SyncCurrentMimicBlockState((EntityPlayer) player)); } } } } setMimic command execute (works) public void execute(ICommandSender sender, String[] args) throws CommandException { if(args.length > 0){ CurrentMimicBlockState.get((EntityPlayer) sender).setMimicBlock(Block.getStateById(Integer.parseInt(args[0]))); } } setMimicBlock method public void setMimicBlock(IBlockState state) { this.state = state; } I have figured out that the server side is not in sync with the client side. The command works just fine, while the playerInput doesn't.. I don't know why
  10. Thanks:) Thanks for the help with getting the block from the item. And all that server talk made me think a little harder. I found the error and I'm good to go now! I was sending a packet to the client side instead of the server. Ooops!! Thanks again for all the help.
  11. I require the EntityPlayer from the event and the only way I know of getting a player is by using Minecraft.getMinecraft.thePlayer, which I think is incorrect... @SubscribeEvent public void onKeyInput(KeyInputEvent event){ EntityPlayerSP player = Minecraft.getMinecraft().thePlayer; if (ClientProxy.keyBindings[0].isPressed()){ if (player.isSneaking() && player.getCurrentEquippedItem() != null && player.getCurrentEquippedItem().getItem() != null){ Block block = Block.getBlockById(Item.getIdFromItem(player.getCurrentEquippedItem().getItem())); IBlockState state = block.getStateFromMeta(player.getCurrentEquippedItem().getMetadata()); CurrentMimicBlockState.get((EntityPlayer) player).setMimicBlock(state);//Crashes here.. I have tested it elsewhere and it works fine. } } } }
  12. You don't. TileEntities are only written to NBT when the world is being saved, at runtime you should use the TileEntity 's fields directly. Treat it like a normal Java object. Get the TileEntity at the Block 's position ( World#getTileEntity ), cast it to TileEntityMimicBlock and call the getState method on it to get the IBlockState that particular instance is mimicing. You are wonderful!!! I'm so use to reading it from nbt that I didn't even think about treating it like an object and just obtaining the state that way. Makes complete sense now. Thank you so much!
  13. How would I load the NBT Data from the current Tile Entity? I'm sorry.. I'm not quite sure I understand. I would pass the blockPos instead of the TileEntity? Thanks!
  14. Still nothing. Maybe it will help if I explain what I'm trying to do. I want a block that can mimic the look of another block. For example, I would mimic the look of stone, place it down, then mimic the look of grass, and place it next to the 'stone' block. Both would keep their original texture. I have found that this bit of code, public static int getTileStateId(TileEntity tile_entity){ return tile_entity.getTileData().getInteger("stateId"); } always returns 0 which is telling me that the tile doesn't have any data. tile_entity is found using blockPos.
  15. I appreciate the tip. You're completely right and that would make the code easier to follow. I will try setting a few breakpoints and find out what's going on.
  16. I have a tileEntity that holds an IBlockState value. This value is used to figure out what to render, but when I place the block, it doesn't see anything in the nbt with said tag. Basically, how do I obtain the information within the tile entity? Mimic Block class http://pastebin.com/uGUKsVYM TileEntity Mimic Block class http://pastebin.com/QvZi553P
  17. I am going to open a new thread that better suits my issue. I believe the topic has been answered on this forum. Here's where I moved it http://www.minecraftforge.net/forum/index.php/topic,32777.0.html [solved] Thanks for all the help!
  18. How would I use an ISmartBlockModel with a tileEntity?
  19. This block could mimic any texture of any blocks. Also, this block would keep it's original texture when it was placed. Example: I place this block down and it'll mimic the texture of sand. I place this block down again, but this time, it'll mimic the texture of stone. Both blocks will keep their textures. Here is what I have. TileEntity Block Class http://pastebin.com/QvZi553P Block Class http://pastebin.com/uGUKsVYM How would I obtain the texture for each block, telling the renderer what to render?
  20. Funny enough. I haven't messed with Tile Entities as much as I wish I had. I looked up a tutorial and I have a TileEntity class for my block now. What kind of class fields would I put into my TileEntity class? And would I use nbt data? My Mimic Block class http://pastebin.com/uGUKsVYM My Tile Entity Mimic Block class http://pastebin.com/QvZi553P Thanks for the prompt replies.
  21. Alright. I've got it working. There may be a fatal flaw as to what I want. When I place this block, it looks like stone. (What I want it to look like for current purpose) I now change it to look like a snow block. When I place this block, it looks like a snow block... But it also updates the block that I placed before into looking like a snow block. I'm wanting the two blocks that I placed down to look like they did originally. Is that possible?
  22. That sounds promising. I haven't touched ISmartBlockModels or IBakedModels. Would you happen to know if there are any tutorials out there? I'll be looking around. Thanks
  23. Would it be possible to create a block the mimics the texture of any block I want? This one block would be able to take on any textures... So it could look like grass, stone, sand(without the attributes of falling). Is that possible? I wanted to make a minecraft world with structures that are unbreakable. I am hoping to be able to use a command to change the texture of this block.
  • Create New...

Important Information

By using this site, you agree to our Privacy Policy.