mirror of
https://github.com/HbmMods/Hbm-s-Nuclear-Tech-GIT.git
synced 2026-01-25 10:32:49 +00:00
Transfer of item book lores to updated system
This commit is contained in:
parent
6e04fcd720
commit
9183ea7d32
@ -45,13 +45,13 @@ public class ItemBookLore extends Item implements IGUIProvider {
|
|||||||
@Override
|
@Override
|
||||||
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool) {
|
||||||
if(!stack.hasTagCompound()) return;
|
if(!stack.hasTagCompound()) return;
|
||||||
String key = stack.stackTagCompound.getString("k");
|
String key = stack.stackTagCompound.getString("k");
|
||||||
if(key.isEmpty()) return;
|
if(key.isEmpty()) return;
|
||||||
|
|
||||||
key = "book_lore." + key + ".author";
|
key = "book_lore." + key + ".author";
|
||||||
String loc = I18nUtil.resolveKey(key);
|
String loc = I18nUtil.resolveKey(key);
|
||||||
|
if(!loc.equals(key))
|
||||||
list.add(I18nUtil.resolveKey("book_lore.author", loc));
|
list.add(I18nUtil.resolveKey("book_lore.author", loc));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -143,7 +143,7 @@ public class ItemBookLore extends Item implements IGUIProvider {
|
|||||||
book.stackTagCompound.setTag("p" + page, data);
|
book.stackTagCompound.setTag("p" + page, data);
|
||||||
}
|
}
|
||||||
//TODO remove this and fix any references
|
//TODO remove this and fix any references
|
||||||
public enum BookLoreType {
|
/*public enum BookLoreType {
|
||||||
TEST(true, "test", 5),
|
TEST(true, "test", 5),
|
||||||
BOOK_IODINE(true, "book_iodine", 3) {
|
BOOK_IODINE(true, "book_iodine", 3) {
|
||||||
public String resolveKey(String key, NBTTagCompound tag) {
|
public String resolveKey(String key, NBTTagCompound tag) {
|
||||||
@ -192,7 +192,7 @@ public class ItemBookLore extends Item implements IGUIProvider {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Function to resolve I18n keys using potential save-dependent information, a la format specifiers. */
|
/** Function to resolve I18n keys using potential save-dependent information, a la format specifiers. */
|
||||||
public String resolveKey(String key, NBTTagCompound tag) {
|
/*public String resolveKey(String key, NBTTagCompound tag) {
|
||||||
return I18nUtil.resolveKey(key, tag);
|
return I18nUtil.resolveKey(key, tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,5 +220,5 @@ public class ItemBookLore extends Item implements IGUIProvider {
|
|||||||
|
|
||||||
return stack;
|
return stack;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,11 +2,6 @@ package com.hbm.items.tool;
|
|||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import com.hbm.crafting.handlers.MKUCraftingHandler;
|
|
||||||
import com.hbm.handler.pollution.PollutionHandler;
|
|
||||||
import com.hbm.handler.pollution.PollutionHandler.PollutionType;
|
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
import com.hbm.items.special.ItemBookLore;
|
|
||||||
import com.hbm.lib.Library;
|
import com.hbm.lib.Library;
|
||||||
|
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
@ -35,24 +30,6 @@ public class ItemWandD extends Item {
|
|||||||
vnt.setSFX(new ExplosionEffectStandard());
|
vnt.setSFX(new ExplosionEffectStandard());
|
||||||
vnt.explode();*/
|
vnt.explode();*/
|
||||||
|
|
||||||
MKUCraftingHandler.generateRecipe(world);
|
|
||||||
ItemStack[] recipe = MKUCraftingHandler.MKURecipe;
|
|
||||||
|
|
||||||
if(recipe == null) //take no chances
|
|
||||||
return stack;
|
|
||||||
|
|
||||||
int r = 0;
|
|
||||||
for(int i = 0; i < 9; i++) {
|
|
||||||
if(recipe[i] != null && recipe[i].getItem() == ModItems.powder_iodine) {
|
|
||||||
r = i + 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
ItemStack book = ItemBookLore.createBook("book_iodine", 3, 0x4C407A, 0xFFF7C1);
|
|
||||||
ItemBookLore.addArgs(book, 2, String.valueOf(r));
|
|
||||||
player.inventory.addItemStackToInventory(book);
|
|
||||||
player.inventoryContainer.detectAndSendChanges();
|
|
||||||
|
|
||||||
//PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15);
|
//PollutionHandler.incrementPollution(world, pos.blockX, pos.blockY, pos.blockZ, PollutionType.SOOT, 15);
|
||||||
|
|
||||||
/*TimeAnalyzer.startCount("setBlock");
|
/*TimeAnalyzer.startCount("setBlock");
|
||||||
|
|||||||
@ -1,17 +1,20 @@
|
|||||||
package com.hbm.lib;
|
package com.hbm.lib;
|
||||||
|
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.inventory.fluid.Fluids;
|
import com.hbm.inventory.fluid.Fluids;
|
||||||
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
import com.hbm.items.ItemAmmoEnums.Ammo357Magnum;
|
||||||
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
import com.hbm.items.ItemAmmoEnums.AmmoFatman;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.machine.ItemBreedingRod.*;
|
import com.hbm.items.machine.ItemBreedingRod.BreedingRodType;
|
||||||
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
|
import com.hbm.items.machine.ItemZirnoxRod.EnumZirnoxType;
|
||||||
import com.hbm.items.special.ItemBookLore.BookLoreType;
|
import com.hbm.items.special.ItemBookLore;
|
||||||
import com.hbm.items.tool.ItemBlowtorch;
|
import com.hbm.items.tool.ItemBlowtorch;
|
||||||
|
|
||||||
import net.minecraft.init.Items;
|
import net.minecraft.init.Items;
|
||||||
import net.minecraft.item.Item;
|
import net.minecraft.item.Item;
|
||||||
|
import net.minecraft.item.ItemStack;
|
||||||
import net.minecraft.util.WeightedRandomChestContent;
|
import net.minecraft.util.WeightedRandomChestContent;
|
||||||
|
|
||||||
public class HbmChestContents {
|
public class HbmChestContents {
|
||||||
@ -407,15 +410,26 @@ public class HbmChestContents {
|
|||||||
new WeightedRandomChestContent(Items.experience_bottle, 0, 1, 3, 1),
|
new WeightedRandomChestContent(Items.experience_bottle, 0, 1, 3, 1),
|
||||||
};
|
};
|
||||||
|
|
||||||
/** ITEMBOOKLORE ARRAYS */
|
/** ITEMBOOKLORE SHIT */
|
||||||
//might make a wrapper class for this, if game-state knowledge using the nbt system becomes that relevant
|
//one downside of all this huge flexibility, make a wrapper if it's too annoying
|
||||||
public final static BookLoreType[] books_office_sch = new BookLoreType[] {
|
public static ItemStack generateOfficeBook(Random rand) { //TODO rework this lore in general
|
||||||
BookLoreType.RESIGNATION_NOTE,
|
String key;
|
||||||
BookLoreType.MEMO_STOCKS,
|
int pages;
|
||||||
BookLoreType.MEMO_SCHRAB_GSA,
|
switch(rand.nextInt(5)) {
|
||||||
BookLoreType.MEMO_SCHRAB_RD,
|
case 0:
|
||||||
BookLoreType.MEMO_SCHRAB_NUKE,
|
key = "resignation_note"; pages = 3; break;
|
||||||
};
|
case 1:
|
||||||
|
key = "memo_stocks"; pages = 1; break;
|
||||||
|
case 2:
|
||||||
|
key = "memo_schrab_gsa"; pages = 2; break;
|
||||||
|
case 3:
|
||||||
|
key = "memo_schrab_rd"; pages = 4; break;
|
||||||
|
case 4:
|
||||||
|
key = "memo_schrab_nuke"; pages = 3; break;
|
||||||
|
default:
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
return ItemBookLore.createBook(key, pages, 0x6BC8FF, 0x0A0A0A);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -568,7 +568,8 @@ public class CivilianFeatures {
|
|||||||
this.fillWithBlocks(world, box, sizeX - 4, 3, sizeZ - 2, sizeX - 2, 3, sizeZ - 2, ModBlocks.steel_roof, Blocks.air, false);
|
this.fillWithBlocks(world, box, sizeX - 4, 3, sizeZ - 2, sizeX - 2, 3, sizeZ - 2, ModBlocks.steel_roof, Blocks.air, false);
|
||||||
if(!hasPlacedLoot[1]) {
|
if(!hasPlacedLoot[1]) {
|
||||||
this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, sizeX - 2, 1, 3, HbmChestContents.nukeTrash, 9);
|
this.hasPlacedLoot[1] = this.generateInvContents(world, box, rand, ModBlocks.crate_iron, sizeX - 2, 1, 3, HbmChestContents.nukeTrash, 9);
|
||||||
generateLoreBook(world, box, rand, sizeX - 2, 1, 3, 1, HbmChestContents.books_office_sch);
|
if(rand.nextInt(2) == 0)
|
||||||
|
generateLoreBook(world, box, sizeX - 2, 1, 3, 1, HbmChestContents.generateOfficeBook(rand));
|
||||||
}
|
}
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@ -8,9 +8,8 @@ import com.hbm.blocks.generic.BlockBobble.BobbleType;
|
|||||||
import com.hbm.blocks.generic.BlockBobble.TileEntityBobble;
|
import com.hbm.blocks.generic.BlockBobble.TileEntityBobble;
|
||||||
import com.hbm.config.StructureConfig;
|
import com.hbm.config.StructureConfig;
|
||||||
import com.hbm.handler.MultiblockHandlerXR;
|
import com.hbm.handler.MultiblockHandlerXR;
|
||||||
import com.hbm.items.ModItems;
|
|
||||||
import com.hbm.items.special.ItemBookLore.BookLoreType;
|
|
||||||
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
import com.hbm.tileentity.machine.TileEntityLockableBase;
|
||||||
|
|
||||||
import net.minecraft.block.Block;
|
import net.minecraft.block.Block;
|
||||||
import net.minecraft.block.BlockWeb;
|
import net.minecraft.block.BlockWeb;
|
||||||
import net.minecraft.block.material.Material;
|
import net.minecraft.block.material.Material;
|
||||||
@ -267,7 +266,7 @@ abstract public class Component extends StructureComponent {
|
|||||||
case 2: //North
|
case 2: //North
|
||||||
dirMeta ^= 2; break; //Flip second bit
|
dirMeta ^= 2; break; //Flip second bit
|
||||||
case 3: //East
|
case 3: //East
|
||||||
dirMeta = Math.abs(dirMeta - 1) % 4; break; //fuck you modulo
|
dirMeta = (dirMeta + 3) % 4; break; //fuck you modulo
|
||||||
}
|
}
|
||||||
|
|
||||||
//hee hoo
|
//hee hoo
|
||||||
@ -383,7 +382,7 @@ abstract public class Component extends StructureComponent {
|
|||||||
int posY = this.getYWithOffset(featureY);
|
int posY = this.getYWithOffset(featureY);
|
||||||
int posZ = this.getZWithOffset(featureX, featureZ);
|
int posZ = this.getZWithOffset(featureX, featureZ);
|
||||||
|
|
||||||
if(world.getBlock(posX, posY, posZ) == block) //replacement for hasPlacedLoot checks
|
if(!box.isVecInside(posX, posY, posZ) || world.getBlock(posX, posY, posZ) == block) //replacement for hasPlacedLoot checks
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
this.placeBlockAtCurrentPosition(world, block, meta, featureX, featureY, featureZ, box);
|
this.placeBlockAtCurrentPosition(world, block, meta, featureX, featureY, featureZ, box);
|
||||||
@ -414,7 +413,7 @@ abstract public class Component extends StructureComponent {
|
|||||||
int posY = this.getYWithOffset(featureY);
|
int posY = this.getYWithOffset(featureY);
|
||||||
int posZ = this.getZWithOffset(featureX, featureZ);
|
int posZ = this.getZWithOffset(featureX, featureZ);
|
||||||
|
|
||||||
if(world.getBlock(posX, posY, posZ) == block) //replacement for hasPlacedLoot checks
|
if(!box.isVecInside(posX, posY, posZ) || world.getBlock(posX, posY, posZ) == block) //replacement for hasPlacedLoot checks
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
this.placeBlockAtCurrentPosition(world, block, meta, featureX, featureY, featureZ, box);
|
this.placeBlockAtCurrentPosition(world, block, meta, featureX, featureY, featureZ, box);
|
||||||
@ -435,19 +434,17 @@ abstract public class Component extends StructureComponent {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void generateLoreBook(World world, StructureBoundingBox box, Random rand, int featureX, int featureY, int featureZ, int slot, BookLoreType[] books) {
|
protected void generateLoreBook(World world, StructureBoundingBox box, int featureX, int featureY, int featureZ, int slot, ItemStack stack) { //kept for compat
|
||||||
int posX = this.getXWithOffset(featureX, featureZ);
|
int posX = this.getXWithOffset(featureX, featureZ);
|
||||||
int posY = this.getYWithOffset(featureY);
|
int posY = this.getYWithOffset(featureY);
|
||||||
int posZ = this.getZWithOffset(featureX, featureZ);
|
int posZ = this.getZWithOffset(featureX, featureZ);
|
||||||
|
|
||||||
|
if(!box.isVecInside(posX, posY, posZ)) return;
|
||||||
|
|
||||||
IInventory inventory = (IInventory) world.getTileEntity(posX, posY, posZ);
|
IInventory inventory = (IInventory) world.getTileEntity(posX, posY, posZ);
|
||||||
|
|
||||||
if(inventory != null) {
|
if(inventory != null) {
|
||||||
ItemStack book = new ItemStack(ModItems.book_lore);
|
inventory.setInventorySlotContents(slot, stack);
|
||||||
int i = rand.nextInt(books.length);
|
|
||||||
|
|
||||||
BookLoreType.setTypeForStack(book, books[i]);
|
|
||||||
inventory.setInventorySlotContents(slot, book);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -201,7 +201,7 @@ public class OfficeFeatures {
|
|||||||
randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, sizeX - 1, 3, sizeZ - 1, Blocks.web);
|
randomlyFillWithBlocks(world, box, rand, 0.25F, 10, 3, 7, sizeX - 1, 3, sizeZ - 1, Blocks.web);
|
||||||
//Doors
|
//Doors
|
||||||
placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 2, 1, 7);
|
placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 2, 1, 7);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 3, 1, 7);
|
placeDoor(world, box, ModBlocks.door_office, 3, true, rand.nextBoolean(), 3, 1, 7);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 5, 1, 6);
|
placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 5, 1, 6);
|
||||||
|
|
||||||
//Woot
|
//Woot
|
||||||
@ -209,7 +209,8 @@ public class OfficeFeatures {
|
|||||||
this.hasPlacedLoot[0] = generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 8);
|
this.hasPlacedLoot[0] = generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), sizeX - 4, 1, sizeZ - 1, HbmChestContents.officeTrash, 8);
|
||||||
if(!this.hasPlacedLoot[1]) {
|
if(!this.hasPlacedLoot[1]) {
|
||||||
this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, getDecoMeta(3), 6, 1, 1, HbmChestContents.machineParts, 10, 0.5D);
|
this.hasPlacedLoot[1] = generateLockableContents(world, box, rand, ModBlocks.safe, getDecoMeta(3), 6, 1, 1, HbmChestContents.machineParts, 10, 0.5D);
|
||||||
generateLoreBook(world, box, rand, 6, 1, 1, 7, HbmChestContents.books_office_sch);
|
if(rand.nextInt(2) == 0)
|
||||||
|
generateLoreBook(world, box, 6, 1, 1, 7, HbmChestContents.generateOfficeBook(rand));
|
||||||
}
|
}
|
||||||
|
|
||||||
//0b00/0 West, 0b01/1 East, 0b10/2 North, 0b11/3 South, 0b100/4 West UD, 0b101 East UD, 0b110 North UD, 0b111 South UD
|
//0b00/0 West, 0b01/1 East, 0b10/2 North, 0b11/3 South, 0b100/4 West UD, 0b101 East UD, 0b110 North UD, 0b111 South UD
|
||||||
@ -431,12 +432,12 @@ public class OfficeFeatures {
|
|||||||
placeDoor(world, box, Blocks.wooden_door, 3, true, rand.nextBoolean(), 2, 1, 14);
|
placeDoor(world, box, Blocks.wooden_door, 3, true, rand.nextBoolean(), 2, 1, 14);
|
||||||
placeDoor(world, box, Blocks.wooden_door, 0, false, rand.nextBoolean(), 0, 1, 12);
|
placeDoor(world, box, Blocks.wooden_door, 0, false, rand.nextBoolean(), 0, 1, 12);
|
||||||
placeDoor(world, box, Blocks.wooden_door, 0, true, rand.nextBoolean(), 0, 1, 13);
|
placeDoor(world, box, Blocks.wooden_door, 0, true, rand.nextBoolean(), 0, 1, 13);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 6, 1, 3);
|
placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 6, 1, 3);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 5, 5, 3);
|
placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 5, 5, 3);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 2, false, rand.nextBoolean(), 4, 5, 11);
|
placeDoor(world, box, ModBlocks.door_office, 2, false, rand.nextBoolean(), 4, 5, 11);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 0, false, rand.nextBoolean(), 10, 9, 3);
|
placeDoor(world, box, ModBlocks.door_office, 3, false, rand.nextBoolean(), 10, 9, 3);
|
||||||
placeDoor(world, box, ModBlocks.door_office, 1, false, rand.nextBoolean(), 3, 9, 10);
|
placeDoor(world, box, ModBlocks.door_office, 1, false, rand.nextBoolean(), 3, 9, 10);
|
||||||
placeDoor(world, box, ModBlocks.door_metal, 0, false, rand.nextBoolean(), 5, 13, 3);
|
placeDoor(world, box, ModBlocks.door_metal, 3, false, rand.nextBoolean(), 5, 13, 3);
|
||||||
//Furniture
|
//Furniture
|
||||||
//Floor 1
|
//Floor 1
|
||||||
int NorthStairMeta = getStairMeta(2);
|
int NorthStairMeta = getStairMeta(2);
|
||||||
@ -533,7 +534,8 @@ public class OfficeFeatures {
|
|||||||
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 2, 9, 5, HbmChestContents.filingCabinet, 4);
|
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 2, 9, 5, HbmChestContents.filingCabinet, 4);
|
||||||
|
|
||||||
generateLockableContents(world, box, rand, ModBlocks.safe, getDecoMeta(2), 1, 9, 13, HbmChestContents.officeTrash, 10, 1.0D);
|
generateLockableContents(world, box, rand, ModBlocks.safe, getDecoMeta(2), 1, 9, 13, HbmChestContents.officeTrash, 10, 1.0D);
|
||||||
generateLoreBook(world, box, rand, 1, 9, 13, 7, HbmChestContents.books_office_sch);
|
if(rand.nextInt(2) == 0)
|
||||||
|
generateLoreBook(world, box, 1, 9, 13, 7, HbmChestContents.generateOfficeBook(rand));
|
||||||
|
|
||||||
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 2, 9, 13, HbmChestContents.filingCabinet, 4);
|
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 2, 9, 13, HbmChestContents.filingCabinet, 4);
|
||||||
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 3, 9, 13, HbmChestContents.filingCabinet, 4);
|
generateInvContents(world, box, rand, ModBlocks.filing_cabinet, getDecoModelMeta(0), 3, 9, 13, HbmChestContents.filingCabinet, 4);
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package com.hbm.world.generator.room;
|
|||||||
import com.hbm.blocks.ModBlocks;
|
import com.hbm.blocks.ModBlocks;
|
||||||
import com.hbm.crafting.handlers.MKUCraftingHandler;
|
import com.hbm.crafting.handlers.MKUCraftingHandler;
|
||||||
import com.hbm.items.ModItems;
|
import com.hbm.items.ModItems;
|
||||||
import com.hbm.items.special.ItemBookLore.BookLoreType;
|
import com.hbm.items.special.ItemBookLore;
|
||||||
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
import com.hbm.tileentity.machine.storage.TileEntitySafe;
|
||||||
import com.hbm.world.generator.CellularDungeon;
|
import com.hbm.world.generator.CellularDungeon;
|
||||||
import com.hbm.world.generator.CellularDungeonRoom;
|
import com.hbm.world.generator.CellularDungeonRoom;
|
||||||
@ -53,7 +53,7 @@ public class TestDungeonRoom8 extends CellularDungeonRoom {
|
|||||||
if(r == 0)
|
if(r == 0)
|
||||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(ModItems.book_of_));
|
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(ModItems.book_of_));
|
||||||
else if(r < 4)
|
else if(r < 4)
|
||||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, generateMKU(world));
|
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, generateBook(world));
|
||||||
else
|
else
|
||||||
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(Items.book));
|
((TileEntitySafe)world.getTileEntity(x + parent.width / 2, y + 2, z + parent.width / 2)).setInventorySlotContents(7, new ItemStack(Items.book));
|
||||||
}
|
}
|
||||||
@ -61,56 +61,50 @@ public class TestDungeonRoom8 extends CellularDungeonRoom {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ItemStack generateMKU(World world) {
|
public static ItemStack generateBook(World world) {
|
||||||
ItemStack book = new ItemStack(ModItems.book_lore);
|
|
||||||
int i = world.rand.nextInt(books.length);
|
|
||||||
|
|
||||||
BookLoreType.setTypeForStack(book, books[i]);
|
|
||||||
book.stackTagCompound.setInteger("mku_slot", getSlot(world, books[i]));
|
|
||||||
|
|
||||||
return book;
|
|
||||||
}
|
|
||||||
|
|
||||||
public static int getSlot(World world, BookLoreType type) {
|
|
||||||
|
|
||||||
MKUCraftingHandler.generateRecipe(world);
|
MKUCraftingHandler.generateRecipe(world);
|
||||||
ItemStack[] recipe = MKUCraftingHandler.MKURecipe;
|
ItemStack[] recipe = MKUCraftingHandler.MKURecipe;
|
||||||
|
|
||||||
|
if(recipe == null) return new ItemStack(ModItems.flame_pony);
|
||||||
|
|
||||||
|
String key;
|
||||||
|
int pages;
|
||||||
Item item;
|
Item item;
|
||||||
//fucking kill me
|
switch(world.rand.nextInt(6)) {
|
||||||
switch(type) {
|
case 0:
|
||||||
case BOOK_DUST:
|
key = "book_iodine"; pages = 3;
|
||||||
item = ModItems.dust; break;
|
|
||||||
case BOOK_FLOWER:
|
|
||||||
item = ModItems.morning_glory; break;
|
|
||||||
case BOOK_IODINE:
|
|
||||||
item = ModItems.powder_iodine; break;
|
item = ModItems.powder_iodine; break;
|
||||||
case BOOK_MERCURY:
|
case 1:
|
||||||
item = ModItems.ingot_mercury; break;
|
key = "book_phosphorous"; pages = 2;
|
||||||
case BOOK_PHOSPHOROUS:
|
|
||||||
item = ModItems.powder_fire; break;
|
item = ModItems.powder_fire; break;
|
||||||
case BOOK_SYRINGE:
|
case 2:
|
||||||
|
key = "book_dust"; pages = 3;
|
||||||
|
item = ModItems.dust; break;
|
||||||
|
case 3:
|
||||||
|
key = "book_mercury"; pages = 2;
|
||||||
|
item = ModItems.ingot_mercury; break;
|
||||||
|
case 4:
|
||||||
|
key = "book_flower"; pages = 2;
|
||||||
|
item = ModItems.morning_glory; break;
|
||||||
|
case 5:
|
||||||
|
key = "book_syringe"; pages = 2;
|
||||||
item = ModItems.syringe_metal_empty; break;
|
item = ModItems.syringe_metal_empty; break;
|
||||||
default:
|
default:
|
||||||
item = ModItems.nothing; break;
|
return new ItemStack(ModItems.flame_pony);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(recipe == null) //take no chances
|
int s = 1;
|
||||||
return -2;
|
|
||||||
|
|
||||||
for(int i = 0; i < 9; i++) {
|
for(int i = 0; i < 9; i++) {
|
||||||
|
|
||||||
if(recipe[i] != null && recipe[i].getItem() == item) {
|
if(recipe[i] != null && recipe[i].getItem() == item) {
|
||||||
return i + 1;
|
s = i + 1; break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return -1;
|
ItemStack book = ItemBookLore.createBook(key, pages, 0x271E44, 0xFBFFF4);
|
||||||
}
|
ItemBookLore.addArgs(book, pages - 1, String.valueOf(s));
|
||||||
|
|
||||||
private final static BookLoreType[] books = new BookLoreType[] {
|
return book;
|
||||||
BookLoreType.BOOK_IODINE, BookLoreType.BOOK_PHOSPHOROUS, BookLoreType.BOOK_DUST, BookLoreType.BOOK_MERCURY, BookLoreType.BOOK_FLOWER, BookLoreType.BOOK_SYRINGE
|
}
|
||||||
};
|
|
||||||
|
|
||||||
/*public static ItemStack genetateMKU(World world) {
|
/*public static ItemStack genetateMKU(World world) {
|
||||||
|
|
||||||
|
|||||||
@ -321,8 +321,8 @@ book.starter.page18=vær is just a guy who has been trapped in the grey void fea
|
|||||||
#book.rbmk.page16=§4§lAvoid.
|
#book.rbmk.page16=§4§lAvoid.
|
||||||
|
|
||||||
book_lore.author=By %s
|
book_lore.author=By %s
|
||||||
book_lore.test.name=Test
|
book_lore.test.name=this book doesn't work...
|
||||||
book_lore.test.author=the dude
|
book_lore.test.author=me i trolled you hehe :3c
|
||||||
book_lore.test.page.0=>hello anons before i begin let me clarify that i'm not gay. >Be me >This night >18 > At hanging out with my best friend with my parents gone for a few days >We've been best friends for a year now >Been drinking a bit and playing lots of video games and ordered a pizza >We were having a blast >At a certain point in the night like around 9:00 he makes a really funny joke that I don't remember but I know that it made us both laugh really hard > With out thinking I brush my right hand through his semi-curly black hair and call him a funny boy >He blushes >I realize I'm feeling flustered >We're kinda close >All of the sudden he kisses me and for some reason I kiss him back >We make love >Cuddle together and fall asleep >Wake up in the middle of the night with his head snuggled up on my chest and neck area >It feels nice but I'm not a homosexual
|
book_lore.test.page.0=>hello anons before i begin let me clarify that i'm not gay. >Be me >This night >18 > At hanging out with my best friend with my parents gone for a few days >We've been best friends for a year now >Been drinking a bit and playing lots of video games and ordered a pizza >We were having a blast >At a certain point in the night like around 9:00 he makes a really funny joke that I don't remember but I know that it made us both laugh really hard > With out thinking I brush my right hand through his semi-curly black hair and call him a funny boy >He blushes >I realize I'm feeling flustered >We're kinda close >All of the sudden he kisses me and for some reason I kiss him back >We make love >Cuddle together and fall asleep >Wake up in the middle of the night with his head snuggled up on my chest and neck area >It feels nice but I'm not a homosexual
|
||||||
book_lore.test.page.1=I'm typing this as he's asleep in my arms. How do I let my best friend down nicely? I don't want to be a [redacted] /b/
|
book_lore.test.page.1=I'm typing this as he's asleep in my arms. How do I let my best friend down nicely? I don't want to be a [redacted] /b/
|
||||||
book_lore.test.page.2=3
|
book_lore.test.page.2=3
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user