Jump to content

Ms_Raven

Members
  • Posts

    106
  • Joined

  • Last visited

Everything posted by Ms_Raven

  1. When my biome generates in the overworld it just mountainous stone with black water. The filler block and top block don't generate and it spawns Vanilla mobs. public class BiomeBadlands extends FCBiomes { public static int treesPerChunk; protected BiomeDecorate decorator; private WorldGenerator WorldGenOWBloodTreeSmall; private WorldGenerator WorldGenOWBloodTreeMedium; private WorldGenerator WorldGenOWBloodTreeLarge; private WorldGenerator WorldGenOWRockSmall; private WorldGenerator WorldGenOWRockTall; private WorldGenerator WorldGenOWGrass; private WorldGenerator WorldGenOWThorns; private WorldGenerator WorldGenOWDeathPlant; public BiomeBadlands(int biomeId) { super(biomeId); BiomeBadlands.treesPerChunk = 0; this.topBlock = HorrorReg.bloodGrass; this.fillerBlock = HorrorReg.bloodstoneRock; this.WorldGenOWBloodTreeSmall = new WorldGenOWBloodTreeSmall(); this.WorldGenOWBloodTreeMedium = new WorldGenOWBloodTreeMedium(); this.WorldGenOWBloodTreeLarge = new WorldGenOWBloodTreeLarge(); this.WorldGenOWRockSmall = new WorldGenOWRockSmall(); this.WorldGenOWRockTall = new WorldGenOWRockTall(); this.WorldGenOWGrass = new WorldGenOWGrass(); this.WorldGenOWThorns = new WorldGenOWThorns(); this.WorldGenOWDeathPlant = new WorldGenOWDeathPlant(); this.setBiomeName("Badlands"); this.waterColorMultiplier = 0x1d0000; this.spawnableCaveCreatureList.clear(); this.spawnableCreatureList.clear(); this.spawnableMonsterList.clear(); this.spawnableWaterCreatureList.clear(); this.spawnableMonsterList.add(new SpawnListEntry(EntityBat.class, 50, 1, 5)); this.spawnableMonsterList.add(new SpawnListEntry(EntityBombskit.class, 50, 1, 5)); this.spawnableMonsterList.add(new SpawnListEntry(EntityHobbe.class, 50, 1, 5)); this.spawnableMonsterList.add(new SpawnListEntry(EntityHollowMan.class, 50, 1, 5)); } @Override public BiomeGenBase.TempCategory getTempCategory() { return BiomeGenBase.TempCategory.MEDIUM; } @SideOnly(Side.CLIENT) public int getBiomeGrassColor() { return 0x443333; } @SideOnly(Side.CLIENT) public int getBiomeFoliageColor() { return 0x443333; } @SideOnly(Side.CLIENT) public int getSkyColorByTemp(float par1) { return 0x443333; } public WorldGenerator getRandomWorldGenForTrees(Random par1Random) { return (WorldGenerator)(par1Random.nextInt(5) == 0 ? this.worldGeneratorSwamp : (par1Random.nextInt(10) == 0 ? this.WorldGenOWBloodTreeSmall : this.worldGeneratorTrees)); } @Override public float getSpawningChance() { return 0.5F; } }
  2. I'm trying to cause the Nausea effect on the player when their Sanity (custom variable) has run out. The console spams "Sanity = 0" when it runs out, but the effect is never added. Why not? @SubscribeEvent public void onLivingUpdate(LivingUpdateEvent event) { if (event.entity instanceof EntityPlayer) { EntityPlayer player = (EntityPlayer) event.entity; ExtendedPlayer props = ExtendedPlayer.get(player); if (player.isPlayerFullyAsleep()) { props.replenishSanity(); //This works fine } //Problem starts here if(props.getCurrentSanity() == 0) { Tools.printcon("Sanity = " + props.getCurrentSanity()); //This DOES happen. player.addPotionEffect(new PotionEffect(Potion.confusion.getId(), 1, 5)); //This does NOT happen. } } }
  3. I have a dozen other GUIs that use the same code for buttons that work perfectly fine... A button list or overriding the method isn't the problem...
  4. There are two printouts BEFORE the packet sending that are never printed. It's not getting even that far.
  5. None of my gui's buttons will click at all. No errors, it's just not happening. I have a bunch of system printouts throughout the code and it's like the actionPerformed method isn't even being called?
  6. That totally skipped my mind... But even after moving necessary things to packets, this is still a valid problem.
  7. I have a shop screen where a player enters into text fields the amount of certain items they want to buy, and it removes non-numbers then converts the fields into integers so they can be used with addItemStackToInventory. But it's giving me a NullPointerException on my convertToInteger() method even though I make sure they're not null... Everything is initialised as 0 or "0" and 'amount1/2/3/4' are the text fields. I can't figure out what I'm doing wrong.
  8. I'm trying to open the gui.... It just won't open. Not with an item or by interacting with a mob. I added a system printout after the openGui line and it does show up in console, so the gui is not being called. I can't figure out what I'm doing wrong. It just doesn't work for me.
  9. But now with GuiScreen nothing happens at all, whether I use a packet or open it directly... The item used to open the gui just disappears and appears when used now, nothing else. @Override public Object getServerGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if(id == Main.GuiBackpack) { return new ContainerBackpack(player, player.inventory, new InventoryBackpack(player.getHeldItem())); } if(id == Main.GuiTravellerOver) { return null; } return new FCGuiContainer(player); } @Override public Object getClientGuiElement(int id, EntityPlayer player, World world, int x, int y, int z) { if(id == 0) { return new FCGuideHome(world, y, z, z, player); } if(id == 1) { return new FCGuidePage1(world, y, z, z, player); } if(id == 2) { return new FCGuidePage2(world, y, z, z, player); } if(id == 3) { return new FCGuidePage3(world, y, z, z, player); } if(id == 4) { return new FCGuidePage4(world, y, z, z, player); } if(id == 5) { return new FCGuidePage5(world, y, z, z, player); } if(id == 6) { return new FCGuidePage6(world, y, z, z, player); } if(id == 7) { return new FCGuidePage7(world, y, z, z, player); } if(id == { return new FCGuidePage8(world, y, z, z, player); } if(id == 9) { return new FCGuidePage9(world, y, z, z, player); } if(id == Main.GuiBackpack) { return new GuiBackpack((ContainerBackpack) new ContainerBackpack(player, player.inventory, new InventoryBackpack(player.getHeldItem()))); } if(id == Main.GuiTravellerOver) { return new GuiShopTravellerOver(); } return new FCGuiContainer(player); }
  10. I'm assuming this is another problem with the gui I just made... But I have NO idea what this means. I'm seeing 'processPlayerBlockPlacement' but I'm trying to open a gui with an item, there's no blocks involved? The gui pops up, and a second or two later there's this: Crash Opening the gui: The gui: The container: Gui handler:
  11. So am I leaving client alone and changing the return type to FCGuiContainer(player) for every id? Yep, so that worked, thanks.
  12. I don't see that. I'm seeing it return the all the Gui classes which all extend GuiContainer. Nothing extends Container except FCGuiContainer.
  13. STILL doesn't explain why that works and all the others don't..... This is the crash:
  14. They all extend GuiContainer, is that not enough? And then why do all the others work??
  15. But that still doesn't explain why this is the only one that does not work when it's the same as all the others... This is how I'm opening the gui: @Override public ItemStack onItemRightClick(ItemStack stack, World world, EntityPlayer player) { if (!player.capabilities.isCreativeMode) { --stack.stackSize; } if (!world.isRemote) { int i = (int)player.posX; int j = (int)player.posY; int k = (int)player.posZ; player.openGui(Main.instance, Main.GuiTravellerOver, world, i, j, k); } return stack; } And these are the id's in Main, which are all correct... public static int FGuideHome= 0; public static int FGuidePage1 = 1; public static int FGuidePage2 = 2; public static int FGuidePage3 = 3; public static int FGuidePage4 = 4; public static int FGuidePage5 = 5; public static int FGuidePage6 = 6; public static int FGuidePage7 = 7; public static int FGuidePage8 = 8; public static int FGuidePage9 = 9; //public static int SanityBar = 10; //public static int FuelBar = 11; public static int GuiBackpack = 12; public static int GuiTravellerOver = 13; //public static int GuiTravellerOther = 14; //public static int GuiTravellerNether = 15;
  16. First of all, I have 12 GUI's that work perfectly fine. I made a new GUI that's just a copy of one of the ones that work and added lots of stuff to it. However, even though its structure is basically the same and it's registered the same way, it gives the error in the title when trying to open it from an item. I can't figure out for the life of me what the problem is. GUI that crashes: GUI that works fine: Container: ServerProxy (GuiHandler):
  17. I didn't know you could even register them as "effects"...
  18. I want to play a sound when picking up coins. But no sound happens. The sound is valid since it works with the /playsound command. Is this not the correct way to do it? @SubscribeEvent public void pickupItem(EntityItemPickupEvent event) { Item item = event.item.getEntityItem().getItem(); ItemStack stack = new ItemStack(item); int amount = stack.stackSize; EntityPlayer player = (EntityPlayer)event.entity; ExtendedPlayer props = ExtendedPlayer.get(player); if(item == TerraReg.copper_coin) { player.playSound(Main.modid + ":" + "getCoins", 1F, 1F); props.addMoney(1 * amount); event.item.setDead(); event.setCanceled(true); } }
  19. Okay, so that works, but then what's the right way to get the stack size?
  20. I want to increase the player's money value when picking up coins, so it's a number on the screen instead of items in the inventory. My first try increased the value on screen, but didn't account for the amount of coins picked up and didn't remove it from the inventory: @SubscribeEvent public void pickupItem(EntityItemPickupEvent event) { Item item = event.item.getEntityItem().getItem(); EntityPlayer player = (EntityPlayer)event.entity; ExtendedPlayer props = ExtendedPlayer.get(player); if(item == TerraReg.copper_coin) { props.addMoney(1); player.inventory.consumeInventoryItem(TerraReg.copper_coin); } if(item == TerraReg.silver_coin) { props.addMoney(10); player.inventory.consumeInventoryItem(TerraReg.silver_coin); } if(item == TerraReg.gold_coin) { props.addMoney(100); player.inventory.consumeInventoryItem(TerraReg.gold_coin); } if(item == TerraReg.platinum_coin) { props.addMoney(1000); player.inventory.consumeInventoryItem(TerraReg.platinum_coin); } } My second try attempted to resolve the amount issue, but instead nothing happens at all now: @SubscribeEvent public void pickupItem(EntityItemPickupEvent event) { ItemStack item = event.item.getEntityItem(); EntityPlayer player = (EntityPlayer)event.entity; ExtendedPlayer props = ExtendedPlayer.get(player); if(item == new ItemStack(TerraReg.copper_coin)) { props.addMoney(1); for(int amount = 0; amount < item.stackSize; amount++) { player.inventory.consumeInventoryItem(TerraReg.copper_coin); } } if(item == new ItemStack(TerraReg.silver_coin)) { props.addMoney(10); for(int amount = 0; amount < item.stackSize; amount++) { player.inventory.consumeInventoryItem(TerraReg.silver_coin); } } if(item == new ItemStack(TerraReg.gold_coin)) { props.addMoney(100); for(int amount = 0; amount < item.stackSize; amount++) { player.inventory.consumeInventoryItem(TerraReg.gold_coin); } } if(item == new ItemStack(TerraReg.platinum_coin)) { props.addMoney(1000); for(int amount = 0; amount < item.stackSize; amount++) { player.inventory.consumeInventoryItem(TerraReg.platinum_coin); } } How can I get this to work?
  21. I have an event that makes mobs drop certain items when killed with certain weapons, but killing them with nothing in your hand causes a NullPointerException even though I check to make sure the currently equipped item is not null. What am I doing wrong?
×
×
  • Create New...

Important Information

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