Jump to content

xxWhatsherfacex

Members
  • Posts

    28
  • Joined

  • Last visited

Converted

  • Gender
    Undisclosed
  • Personal Text
    I am new!

xxWhatsherfacex's Achievements

Tree Puncher

Tree Puncher (2/8)

0

Reputation

  1. Ah! thank you so much! That makes a lot of sense. For anyone in a similar situation, I changed it to this and it works beautifully.
  2. Hello everyone! I'm trying to implement an event where players receive an item upon eating an apple. My code works fine unless there is only one apple in hand, then It doesn't work at all. I have a feeling it's detecting the item in the player's hand after it's been eaten, and not the item being eaten itself... I've also tried: But this doesn't give the second message or the item at all. I really appreciate any help I can get on this. Sorry if this is an easy fix and I didn't catch it. Cheers!
  3. Alright! Thanks so much! I managed to successfully check the biome and detect if the player is trying to collect water with their bucket. public class BucketFillHandler { @SubscribeEvent public void onBucketFill(FillBucketEvent event) { EntityPlayer player = Minecraft.getMinecraft().player; BlockPos pos = new BlockPos(player.getPositionVector()); if (event.getWorld().getBiome(pos) == Biomes.BEACH || event.getWorld().getBiome(pos) == Biomes.OCEAN || event.getWorld().getBiome(pos) == Biomes.DEEP_OCEAN || event.getWorld().getBiome(pos) == Biomes.COLD_BEACH || event.getWorld().getBiome(pos) == Biomes.FROZEN_OCEAN || event.getWorld().getBiome(pos) == Biomes.STONE_BEACH) { if(event.getEntityPlayer() != null && !event.getWorld().isRemote) { RayTraceResult target = event.getTarget(); if(target != null && target.typeOfHit == RayTraceResult.Type.BLOCK) { if(target.getBlockPos() != null) { IBlockState state = event.getWorld().getBlockState(target.getBlockPos()); Material material = state.getMaterial(); if(material == Material.WATER && ((Integer)state.getValue(BlockLiquid.LEVEL)).intValue() == 0) { //Give the player ModItems.SALTWATER_BUCKET } } } } } } I'm a little stumped on how to give the player the bucket now. I tried using event.setFilledBucket(new ItemStack(ModItems.SALTWATER_BUCKET, 1)); where the comment is but it isn't doing anything but giving the regular bucket of water.
  4. I'm trying to make it so when a player stands in an ocean or beach biome and tries to fill a bucket with water, it instead gives a different item (SaltwaterBucket). I think I have to do this in an event handler class and the FullBucketEvent? Or would I accomplish this in my Item class? I'm a little stumped on what to do specifically though. Any pointers would be really appreciated! public class BucketFillHandler { @SubscribeEvent public void onBucketFill(FillBucketEvent event) { //Check for Ocean Biome and give player either saltwaterbucket or regular bucket. } }
  5. Oh wow! I think I implemented all those changes correctly. Here is the updated code. Things seem a lot simpler now, thanks! It seems pretty silly for people to teach it the other way. Haha. Using the Item to place the block seems to be working well now too!
  6. Oof. I'm real sorry. My Github was a mess. (I'd just uploaded those two files to an outdated version of my code.) It's up to date now. I think I've fixed one problem and caused another... I started from scratch again and it seems like the model is working. But when I try to place it with the Item. I get a CTD, with the error:
  7. I removed it but nothing seems to have changed.
  8. I've scoured my console and couldn't find anything relating to textures or models, unfortunately.
  9. Hello there! I'm messing around with how to make a double block, and I've gotten to the point where the model isn't showing up correctly. I've been looking this over for about an hour trying to figure it out. I ran my blockstate JSON through a validator and it came back okay...Is there a glaringly obvious issue that I missed here? Thanks! doubleblock.json (Located in assets/yummy/blockstates) { "variants": { "facing=east,half=lower": { "model": "yummy:PresserModelLower", "y": 90 }, "facing=south,half=lower": { "model": "yummy:PresserModelLower", "y": 180 }, "facing=west,half=lower": { "model": "yummy:PresserModelLower", "y": 270 }, "facing=north,half=lower": { "model": "yummy:PresserModelLower" }, "facing=east,half=upper": { "model": "yummy:PresserModelUpper", "y": 90 }, "facing=south,half=upper": { "model": "yummy:PresserModelUpper", "y": 180 }, "facing=west,half=upper": { "model": "yummy:PresserModelUpper", "y": 270 }, "facing=north,half=upper": { "model": "yummy:PresserModelUpper" } } } Here are the PresserModelUpper and PresserModelLower.
  10. I'm having some trouble with a custom block model I made using Ichun's Tabula. As per the screenshot included, the block is offset. I'm not exactly sure what the fix is, but I've narrowed it down to the .json file...(I think?) Any help would be greatly appreciated. I'm pretty stumped right now. Thanks! ❤️
  11. I was following a tutorial and I understand the content of it I'm just getting different results then shown. I'm trying to learn what it does, the best way I know is by trial and error. I can only figure out so much by myself, so that's why I ask questions like this.
  12. Oops! Sorry i knew i was forgetting something. i'll add it to the top right now.
  13. When I enter the creative tab the game crashes. CrashReport package com.rnh.Yummy.Trees.Logs; import java.util.List; import com.rnh.Yummy.Yummy; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import net.minecraft.block.Block; import net.minecraft.block.BlockLog; import net.minecraft.block.material.Material; import net.minecraft.client.renderer.texture.IIconRegister; import net.minecraft.creativetab.CreativeTabs; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; import net.minecraft.util.IIcon; public class Log extends BlockLog{ public static final String[] logs = new String[] { "Apple", "banana"}; @SideOnly(Side.CLIENT) public void getSubBlocks(Item item, CreativeTabs tabs, List list){ for (int i = 0; i < logs.length; i++) { list.add(new ItemStack( item ,1 ,i)); } } @SideOnly(Side.CLIENT) public void registerBLockIcons ( IIconRegister icon){ this.field_150167_a = new IIcon[logs.length]; this.field_150166_b = new IIcon[logs.length]; for (int i = 0; i < this.field_150167_a.length; i++){ this.field_150167_a[i] =icon.registerIcon(Yummy.MODID + this.getTextureName() + logs[i]); this.field_150166_b[i] =icon.registerIcon(Yummy.MODID + this.getTextureName() + logs[i] + "top"); } } } and heres my ItemBlock Class package com.rnh.Yummy.ItemBlocks; import net.minecraft.block.Block; import net.minecraft.item.ItemBlock; import net.minecraft.item.ItemStack; public class ItemLogBlocks extends ItemBlock { public static final String[] logs = new String[]{"Apple","Banana"}; public ItemLogBlocks(Block block) { super(block); this.setHasSubtypes(true); } public String getUnlocalizedName(ItemStack itemstack) { int i = itemstack.getItemDamage(); if ( i < 0 || i >= logs.length){ i = 0; } return super.getUnlocalizedName() + "." + logs[i]; } public int getMetadata (int meta){ return meta; } } I would really appreciate is someone explained what went wrong here, and taught me the right way to do it. Please forgive me if I seem incompetent. I'm still learning. Thank you. <3
×
×
  • Create New...

Important Information

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