private static void changeVanillaTables(LootTableLoadEvent event) { if (event.getName() == LootTableList.ENTITIES_BLAZE) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_CREEPER) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ELDER_GUARDIAN) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ENDER_DRAGON) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ENDERMAN) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ENDERMITE) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_EVOCATION_ILLAGER) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_GHAST) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_GUARDIAN) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_HUSK) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_MAGMA_CUBE) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_SHULKER) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_SKELETON) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_SLIME) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_SPIDER) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_VEX) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_VINDICATION_ILLAGER) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_WITCH) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_WITHER_SKELETON) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ZOMBIE) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ZOMBIE_PIGMAN) addPool(event.getTable()); else if (event.getName() == LootTableList.ENTITIES_ZOMBIE_VILLAGER) addPool(event.getTable()); }
@Override public float work() { if (WorkUtils.isDisabled(this.getBlockType())) return 0; if (this.world.rand.nextBoolean() && this.world.rand.nextBoolean()) return 1; List<BlockPos> blockPos = BlockUtils.getBlockPosInAABB(getWorkingArea()); boolean allWaterSources = true; for (BlockPos pos : blockPos) { IBlockState state = this.world.getBlockState(pos); if (!(state.getBlock().equals(FluidRegistry.WATER.getBlock()) && state.getBlock().getMetaFromState(state) == 0)) allWaterSources = false; } if (allWaterSources) { LootContext.Builder lootcontext = new LootContext.Builder((WorldServer) this.world); List<ItemStack> items = this.world.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(this.world.rand, lootcontext.build()); for (ItemStack stack : items) { ItemHandlerHelper.insertItem(outFish, stack, false); } return 1; } return 1; }
@SubscribeEvent public static void onLootTableLoad(LootTableLoadEvent event) { ResourceLocation tableName = event.getName(); LootPool pool = null; int bandage = 0, plaster = 0, morphine = 0; if (tableName.equals(LootTableList.CHESTS_SPAWN_BONUS_CHEST)) { pool = event.getTable().getPool("main"); bandage = 8; plaster = 16; morphine = 4; } else if (tableName.equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR) || tableName.equals(LootTableList.CHESTS_STRONGHOLD_CROSSING) || tableName.equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)) { pool = event.getTable().getPool("main"); bandage = 20; plaster = 24; morphine = 8; } if (pool != null) { pool.addEntry(new LootEntryItem(FirstAidItems.BANDAGE, bandage, 0, new SetCount[]{new SetCount(new LootCondition[0], new RandomValueRange(1, 3))}, new LootCondition[0], FirstAid.MODID + "bandage")); pool.addEntry(new LootEntryItem(FirstAidItems.PLASTER, plaster, 0, new SetCount[]{new SetCount(new LootCondition[0], new RandomValueRange(1, 5))}, new LootCondition[0], FirstAid.MODID + "plaster")); pool.addEntry(new LootEntryItem(FirstAidItems.MORPHINE, morphine, 0, new SetCount[]{new SetCount(new LootCondition[0], new RandomValueRange(1, 2))}, new LootCondition[0], FirstAid.MODID + "morphine")); } }
private boolean isLootTarget(LootTableLoadEvent event) { return event.getName().equals(LootTableList.CHESTS_END_CITY_TREASURE) || event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON) || event.getName().equals(LootTableList.CHESTS_VILLAGE_BLACKSMITH) || event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT) || event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE) || event.getName().equals(LootTableList.CHESTS_STRONGHOLD_LIBRARY) || event.getName().equals(LootTableList.CHESTS_STRONGHOLD_CROSSING) || event.getName().equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR) || event.getName().equals(LootTableList.CHESTS_DESERT_PYRAMID) || event.getName().equals(LootTableList.CHESTS_JUNGLE_TEMPLE) || event.getName().equals(LootTableList.CHESTS_JUNGLE_TEMPLE_DISPENSER) || event.getName().equals(LootTableList.CHESTS_IGLOO_CHEST) || event.getName().equals(LootTableList.CHESTS_WOODLAND_MANSION); }
@SubscribeEvent public static void lootLoaded(LootTableLoadEvent event) { if (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) { LootTable customTable = event.getLootTableManager().getLootTableFromLocation(new ResourceLocation(BetterThanWeagles.MODID, "custom/simple_dungeon_chest")); LootPool customPool = customTable.getPool("weagles"); event.getTable().addPool(customPool); } }
public static void init() { // Every entity in our mod has an ID (local to this mod) int id = 1; EntityRegistry.registerModEntity(new ResourceLocation(MeeCreeps.MODID, "meecreeps"), EntityMeeCreeps.class, "MeeCreeps", id++, MeeCreeps.instance, 64, 3, true, 0x0CD5F2, 0xFF7300); EntityRegistry.registerModEntity(new ResourceLocation(MeeCreeps.MODID, "meecreeps_projectile"), EntityProjectile.class, "meecreeps_projectile", id++, MeeCreeps.instance, 100, 5, true); // This is the loot table for our mob LootTableList.register(EntityMeeCreeps.LOOT); }
public static void init() { //World generators GameRegistry.registerWorldGenerator(new AshenCubeStructure(), 5); GameRegistry.registerWorldGenerator(new MonolithStructure(), 5); GameRegistry.registerWorldGenerator(new ObeliskDecorator(), 5); //Loot tables LootTableList.register(SCHRODINGER_LOOT); }
@SubscribeEvent public void onLootTablesLoaded(LootTableLoadEvent event) { if ((event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)) || (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) || (event.getName().equals(LootTableList.CHESTS_DESERT_PYRAMID)) || (event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE)) || (event.getName().equals(LootTableList.CHESTS_STRONGHOLD_LIBRARY)) || (event.getName().equals(LootTableList.CHESTS_END_CITY_TREASURE))) { LootPool mainPool = event.getTable().getPool("main"); if (mainPool != null) { if (event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT) || event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE) || event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) { mainPool.addEntry(new LootEntryItem(ModItems.FRIENDER_PEARL, 10, 0, new LootFunction[] {}, new LootCondition[0], ModGlobals.MODID + ":friender_pearl_loot")); } } } }
protected void handleDataMarker(String p_186175_1_, BlockPos p_186175_2_, World p_186175_3_, Random p_186175_4_, StructureBoundingBox p_186175_5_) { if (p_186175_1_.startsWith("Chest")) { BlockPos blockpos = p_186175_2_.down(); if (p_186175_5_.isVecInside(blockpos)) { TileEntity tileentity = p_186175_3_.getTileEntity(blockpos); if (tileentity instanceof TileEntityChest) { ((TileEntityChest)tileentity).setLootTable(LootTableList.CHESTS_END_CITY_TREASURE, p_186175_4_.nextLong()); } } } else if (p_186175_1_.startsWith("Sentry")) { EntityShulker entityshulker = new EntityShulker(p_186175_3_); entityshulker.setPosition((double)p_186175_2_.getX() + 0.5D, (double)p_186175_2_.getY() + 0.5D, (double)p_186175_2_.getZ() + 0.5D); entityshulker.setAttachmentPos(p_186175_2_); p_186175_3_.spawnEntityInWorld(entityshulker); } else if (p_186175_1_.startsWith("Elytra")) { EntityItemFrame entityitemframe = new EntityItemFrame(p_186175_3_, p_186175_2_, this.rotation.rotate(EnumFacing.SOUTH)); entityitemframe.setDisplayedItem(new ItemStack(Items.ELYTRA)); p_186175_3_.spawnEntityInWorld(entityitemframe); } }
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) { return false; } else { this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStrongholdPieces.STRONGHOLD_STONES); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.entryDoor, 1, 1, 0); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 3, 1, 4, Blocks.STONEBRICK.getDefaultState(), Blocks.STONEBRICK.getDefaultState(), false); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 4, structureBoundingBoxIn); for (int i = 2; i <= 4; ++i) { this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 2, 1, i, structureBoundingBoxIn); } if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) { this.hasMadeChest = true; this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, LootTableList.CHESTS_STRONGHOLD_CORRIDOR); } return true; } }
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 1, 4, 4, 1, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 3, 4, 4, 3, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 0, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 3, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 1, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 4, 3, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); if (this.chest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) { this.chest = false; this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, LootTableList.CHESTS_NETHER_BRIDGE); } this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); for (int i = 0; i <= 4; ++i) { for (int j = 0; j <= 4; ++j) { this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, -1, j, structureBoundingBoxIn); } } return true; }
public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 4, 1, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 3, 0, 4, 3, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 0, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 4, 4, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 1, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 4, 3, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); if (this.chest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) { this.chest = false; this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, LootTableList.CHESTS_NETHER_BRIDGE); } this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); for (int i = 0; i <= 4; ++i) { for (int j = 0; j <= 4; ++j) { this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, -1, j, structureBoundingBoxIn); } } return true; }
@SubscribeEvent public void addTable(LootTableLoadEvent event){ if(!TF2ConfigVars.disableLoot && (event.getName().equals(LootTableList.CHESTS_SIMPLE_DUNGEON)||event.getName().equals(LootTableList.CHESTS_END_CITY_TREASURE) ||event.getName().equals(LootTableList.CHESTS_NETHER_BRIDGE)||event.getName().equals(LootTableList.CHESTS_ABANDONED_MINESHAFT) ||event.getName().equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR))){ //System.out.println("loaded: "+new ResourceLocation(TF2weapons.MOD_ID,event.getName().getResourcePath())); event.getTable().addPool(getLootPool(new ResourceLocation(TF2weapons.MOD_ID,event.getName().getResourcePath()))); } }
public static void addLoot(LootTable table, ResourceLocation tableName) { if(BBConfig.spawnMarshmallows) { if(tableName.equals(LootTableList.CHESTS_SIMPLE_DUNGEON)) { LootUtil.addItemToTable(table, "main", RegisterItems.marshmallow, 100, 1, 5); } else if(tableName.equals(LootTableList.CHESTS_DESERT_PYRAMID)) { LootUtil.addItemToTable(table, "main", RegisterItems.marshmallow, 200, 1, 10); } else if(tableName.equals(LootTableList.CHESTS_JUNGLE_TEMPLE)) { LootUtil.addItemToTable(table, "main", RegisterItems.marshmallow, 200, 1, 10); } else if(tableName.equals(LootTableList.CHESTS_STRONGHOLD_CROSSING)) { LootUtil.addItemToTable(table, "main", RegisterItems.marshmallow, 150, 1, 12); } else if(tableName.equals(LootTableList.CHESTS_STRONGHOLD_CORRIDOR)) { LootUtil.addItemToTable(table, "main", RegisterItems.marshmallow, 150, 1, 12); } else if(tableName.equals(LootTableList.CHESTS_ABANDONED_MINESHAFT)) { LootUtil.addItemToTable(table, "main", RegisterItems.marshmallow, 150, 1, 12); } } }
/** * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes * Mineshafts at the end, it adds Fences... */ public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { if (this.isLiquidInStructureBoundingBox(worldIn, structureBoundingBoxIn)) { return false; } else { this.fillWithRandomizedBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 4, 6, true, randomIn, StructureStrongholdPieces.STRONGHOLD_STONES); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, this.entryDoor, 1, 1, 0); this.placeDoor(worldIn, randomIn, structureBoundingBoxIn, StructureStrongholdPieces.Stronghold.Door.OPENING, 1, 1, 6); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 1, 2, 3, 1, 4, Blocks.STONEBRICK.getDefaultState(), Blocks.STONEBRICK.getDefaultState(), false); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 1, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 1, 5, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 2, structureBoundingBoxIn); this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 3, 2, 4, structureBoundingBoxIn); for (int i = 2; i <= 4; ++i) { this.setBlockState(worldIn, Blocks.STONE_SLAB.getStateFromMeta(BlockStoneSlab.EnumType.SMOOTHBRICK.getMetadata()), 2, 1, i, structureBoundingBoxIn); } if (!this.hasMadeChest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) { this.hasMadeChest = true; this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, LootTableList.CHESTS_STRONGHOLD_CORRIDOR); } return true; } }
/** * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes * Mineshafts at the end, it adds Fences... */ public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 1, 4, 4, 1, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 3, 3, 4, 4, 3, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 0, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 4, 3, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 1, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 4, 3, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); if (this.chest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(3, 3), this.getYWithOffset(2), this.getZWithOffset(3, 3)))) { this.chest = false; this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 3, 2, 3, LootTableList.CHESTS_NETHER_BRIDGE); } this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); for (int i = 0; i <= 4; ++i) { for (int j = 0; j <= 4; ++j) { this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, -1, j, structureBoundingBoxIn); } } return true; }
/** * second Part of Structure generating, this for example places Spiderwebs, Mob Spawners, it closes * Mineshafts at the end, it adds Fences... */ public boolean addComponentParts(World worldIn, Random randomIn, StructureBoundingBox structureBoundingBoxIn) { this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 0, 0, 4, 1, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 4, 5, 4, Blocks.AIR.getDefaultState(), Blocks.AIR.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 2, 0, 0, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 1, 0, 4, 1, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 3, 3, 0, 4, 3, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK_FENCE.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 4, 2, 0, 4, 5, 0, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 2, 4, 4, 5, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 1, 3, 4, 1, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); this.fillWithBlocks(worldIn, structureBoundingBoxIn, 3, 3, 4, 3, 4, 4, Blocks.NETHER_BRICK_FENCE.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); if (this.chest && structureBoundingBoxIn.isVecInside(new BlockPos(this.getXWithOffset(1, 3), this.getYWithOffset(2), this.getZWithOffset(1, 3)))) { this.chest = false; this.generateChest(worldIn, structureBoundingBoxIn, randomIn, 1, 2, 3, LootTableList.CHESTS_NETHER_BRIDGE); } this.fillWithBlocks(worldIn, structureBoundingBoxIn, 0, 6, 0, 4, 6, 4, Blocks.NETHER_BRICK.getDefaultState(), Blocks.NETHER_BRICK.getDefaultState(), false); for (int i = 0; i <= 4; ++i) { for (int j = 0; j <= 4; ++j) { this.replaceAirAndLiquidDownwards(worldIn, Blocks.NETHER_BRICK.getDefaultState(), i, -1, j, structureBoundingBoxIn); } } return true; }
private static ResourceLocation register(String name) { return LootTableList.register(new ResourceLocation(Reference.MODID, name)); }
@EventHandler public void preInit(FMLPreInitializationEvent event) { MinecraftForge.EVENT_BUS.register(this); LootTableList.register(ENTITIES_TRUMPET_SKELETON_LOOT_TABLE); proxy.preInit(event); }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_ZOMBIE; }
@Nullable @Override protected ResourceLocation getLootTable() { return this.getSlimeSize() == 1 ? CommonProxy.PINK_SLIME_LOOT : LootTableList.EMPTY; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_IRON_GOLEM; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_ZOMBIE_PIGMAN; }
@Nullable protected ResourceLocation getLootTable() { return this.getSlimeSize() == 1 ? LootTableList.ENTITIES_SLIME : LootTableList.EMPTY; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_GHAST; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_GIANT; }
@Nullable @Override protected ResourceLocation getLootTable() { return LootTableList.EMPTY; }
public static void registerLootTables() { LootTableList.register(ENTITIES_HALLOWMOB); LootTableList.register(ENTITIES_HALLOWITCH); LootTableList.register(ENTITIES_HAUNTER); }
private static ResourceLocation register(String id) { return LootTableList.register(new ResourceLocation(TheOink.MODID, id)); }
protected void handleDataMarker(String p_186175_1_, BlockPos p_186175_2_, World p_186175_3_, Random p_186175_4_, StructureBoundingBox p_186175_5_) { if (p_186175_1_.startsWith("Chest")) { Rotation rotation = this.placeSettings.getRotation(); IBlockState iblockstate = Blocks.CHEST.getDefaultState(); if ("ChestWest".equals(p_186175_1_)) { iblockstate = iblockstate.withProperty(BlockChest.FACING, rotation.rotate(EnumFacing.WEST)); } else if ("ChestEast".equals(p_186175_1_)) { iblockstate = iblockstate.withProperty(BlockChest.FACING, rotation.rotate(EnumFacing.EAST)); } else if ("ChestSouth".equals(p_186175_1_)) { iblockstate = iblockstate.withProperty(BlockChest.FACING, rotation.rotate(EnumFacing.SOUTH)); } else if ("ChestNorth".equals(p_186175_1_)) { iblockstate = iblockstate.withProperty(BlockChest.FACING, rotation.rotate(EnumFacing.NORTH)); } this.func_191080_a(p_186175_3_, p_186175_5_, p_186175_4_, p_186175_2_, LootTableList.field_191192_o, iblockstate); } else if ("Mage".equals(p_186175_1_)) { EntityEvoker entityevoker = new EntityEvoker(p_186175_3_); entityevoker.enablePersistence(); entityevoker.moveToBlockPosAndAngles(p_186175_2_, 0.0F, 0.0F); p_186175_3_.spawnEntityInWorld(entityevoker); p_186175_3_.setBlockState(p_186175_2_, Blocks.AIR.getDefaultState(), 2); } else if ("Warrior".equals(p_186175_1_)) { EntityVindicator entityvindicator = new EntityVindicator(p_186175_3_); entityvindicator.enablePersistence(); entityvindicator.moveToBlockPosAndAngles(p_186175_2_, 0.0F, 0.0F); entityvindicator.onInitialSpawn(p_186175_3_.getDifficultyForLocation(new BlockPos(entityvindicator)), (IEntityLivingData)null); p_186175_3_.spawnEntityInWorld(entityvindicator); p_186175_3_.setBlockState(p_186175_2_, Blocks.AIR.getDefaultState(), 2); } }
public boolean generate(World worldIn, Random rand, BlockPos position) { for (IBlockState iblockstate = worldIn.getBlockState(position); (iblockstate.getMaterial() == Material.AIR || iblockstate.getMaterial() == Material.LEAVES) && position.getY() > 1; iblockstate = worldIn.getBlockState(position)) { position = position.down(); } if (position.getY() < 1) { return false; } else { position = position.up(); for (int i = 0; i < 4; ++i) { BlockPos blockpos = position.add(rand.nextInt(4) - rand.nextInt(4), rand.nextInt(3) - rand.nextInt(3), rand.nextInt(4) - rand.nextInt(4)); if (worldIn.isAirBlock(blockpos) && worldIn.getBlockState(blockpos.down()).isFullyOpaque()) { worldIn.setBlockState(blockpos, Blocks.CHEST.getDefaultState(), 2); TileEntity tileentity = worldIn.getTileEntity(blockpos); if (tileentity instanceof TileEntityChest) { ((TileEntityChest)tileentity).setLootTable(LootTableList.CHESTS_SPAWN_BONUS_CHEST, rand.nextLong()); } BlockPos blockpos1 = blockpos.east(); BlockPos blockpos2 = blockpos.west(); BlockPos blockpos3 = blockpos.north(); BlockPos blockpos4 = blockpos.south(); if (worldIn.isAirBlock(blockpos2) && worldIn.getBlockState(blockpos2.down()).isFullyOpaque()) { worldIn.setBlockState(blockpos2, Blocks.TORCH.getDefaultState(), 2); } if (worldIn.isAirBlock(blockpos1) && worldIn.getBlockState(blockpos1.down()).isFullyOpaque()) { worldIn.setBlockState(blockpos1, Blocks.TORCH.getDefaultState(), 2); } if (worldIn.isAirBlock(blockpos3) && worldIn.getBlockState(blockpos3.down()).isFullyOpaque()) { worldIn.setBlockState(blockpos3, Blocks.TORCH.getDefaultState(), 2); } if (worldIn.isAirBlock(blockpos4) && worldIn.getBlockState(blockpos4.down()).isFullyOpaque()) { worldIn.setBlockState(blockpos4, Blocks.TORCH.getDefaultState(), 2); } return true; } } return false; } }
public int handleHookRetraction() { if (!this.world.isRemote && this.angler != null) { int i = 0; if (this.caughtEntity != null) { this.bringInHookedEntity(); this.world.setEntityState(this, (byte)31); i = this.caughtEntity instanceof EntityItem ? 3 : 5; } else if (this.ticksCatchable > 0) { LootContext.Builder lootcontext$builder = new LootContext.Builder((WorldServer)this.world); lootcontext$builder.withLuck((float)this.field_191518_aw + this.angler.getLuck()); for (ItemStack itemstack : this.world.getLootTableManager().getLootTableFromLocation(LootTableList.GAMEPLAY_FISHING).generateLootForPools(this.rand, lootcontext$builder.build())) { EntityItem entityitem = new EntityItem(this.world, this.posX, this.posY, this.posZ, itemstack); double d0 = this.angler.posX - this.posX; double d1 = this.angler.posY - this.posY; double d2 = this.angler.posZ - this.posZ; double d3 = (double)MathHelper.sqrt(d0 * d0 + d1 * d1 + d2 * d2); double d4 = 0.1D; entityitem.motionX = d0 * 0.1D; entityitem.motionY = d1 * 0.1D + (double)MathHelper.sqrt(d3) * 0.08D; entityitem.motionZ = d2 * 0.1D; this.world.spawnEntityInWorld(entityitem); this.angler.world.spawnEntityInWorld(new EntityXPOrb(this.angler.world, this.angler.posX, this.angler.posY + 0.5D, this.angler.posZ + 0.5D, this.rand.nextInt(6) + 1)); Item item = itemstack.getItem(); if (item == Items.FISH || item == Items.COOKED_FISH) { this.angler.addStat(StatList.FISH_CAUGHT, 1); } } i = 1; } if (this.inGround) { i = 2; } this.setDead(); return i; } else { return 0; } }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_RABBIT; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.field_191187_aw; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_CHICKEN; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_SKELETON_HORSE; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_MUSHROOM_COW; }
@Nullable protected ResourceLocation getLootTable() { return LootTableList.ENTITIES_BAT; }