Water bowl doc and config

This commit is contained in:
Ellpeck 2016-06-02 20:07:36 +02:00
parent c53ea72404
commit e46851e789
4 changed files with 27 additions and 19 deletions

View file

@ -89,6 +89,7 @@ public class InitBooklet{
new BookletChapter("lushCaves", ActuallyAdditionsAPI.entryMisc, new ItemStack(Blocks.STONE), new PageTextOnly(1), new PagePicture(2, "pageLushCaves", 0).setNoText());
new BookletChapter("hairBalls", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemHairyBall), new PagePicture(1, "pageFurBalls", 110).setStack(new ItemStack(InitItems.itemHairyBall)), new PageTextOnly(2)).setSpecial();
new BookletChapter("blackLotus", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitBlocks.blockBlackLotus), new PageTextOnly(1).setStack(new ItemStack(InitBlocks.blockBlackLotus)), new PageCrafting(2, ItemCrafting.recipeBlackDye));
new BookletChapter("waterBowl", ActuallyAdditionsAPI.entryMisc, new ItemStack(InitItems.itemWaterBowl), new PageTextOnly(1).setStack(new ItemStack(InitItems.itemWaterBowl)));
//No RF Using Blocks
new BookletChapter("itemStorage", ActuallyAdditionsAPI.entryFunctionalNonRF, new ItemStack(InitBlocks.blockLaserRelayItemWhitelist), new PageTextOnly(1), new PageTextOnly(2), new PageCrafting(3, BlockCrafting.recipeLaserRelayItem).setNoText().setPageStacksWildcard(), new PageCrafting(4, BlockCrafting.recipeLaserRelayItemWhitelist).setNoText().setPageStacksWildcard(), new PageCrafting(5, BlockCrafting.recipeItemInterface).setNoText()).setImportant();

View file

@ -49,7 +49,9 @@ public enum ConfigBoolValues{
DUNGEON_LOOT("Dungeon Loot", ConfigCategories.OTHER, true, "Should Actually Additions Loot spawn in Dungeons"),
GEN_LUSH_CAVES("Generate Lush Caves", ConfigCategories.WORLD_GEN, true, "Should caves with trees and grass randomly generate underground"),
BOOKLET_TEXT_TO_FILE("Booklet Text to File", ConfigCategories.OTHER, false, "Should the entire text of the booklet be put into a new file in the Minecraft Folder on startup or resource reload. This is for debug purposes only and shouldn't really ever be needed.");
BOOKLET_TEXT_TO_FILE("Booklet Text to File", ConfigCategories.OTHER, false, "Should the entire text of the booklet be put into a new file in the Minecraft Folder on startup or resource reload. This is for debug purposes only and shouldn't really ever be needed."),
WATER_BOWL("Water Bowl", ConfigCategories.OTHER, true, "If right-clicking a bowl on water should create a water bowl");
public final String name;
public final String category;

View file

@ -94,26 +94,28 @@ public class EntityLivingEvents{
@SubscribeEvent
public void onPlayerInteractEvent(PlayerInteractEvent event){
if(event.getWorld() != null){
if(event.getItemStack() != null && event.getItemStack().getItem() == Items.BOWL){
RayTraceResult trace = WorldUtil.getNearestBlockWithDefaultReachDistance(event.getWorld(), event.getEntityPlayer(), true, false, false);
ActionResult<ItemStack> result = ForgeEventFactory.onBucketUse(event.getEntityPlayer(), event.getWorld(), event.getItemStack(), trace);
if(result == null && trace != null && trace.getBlockPos() != null){
if(event.getEntityPlayer().canPlayerEdit(trace.getBlockPos().offset(trace.sideHit), trace.sideHit, event.getItemStack())){
IBlockState state = event.getWorld().getBlockState(trace.getBlockPos());
Material material = state.getMaterial();
if(ConfigBoolValues.WATER_BOWL.isEnabled()){
if(event.getItemStack() != null && event.getItemStack().getItem() == Items.BOWL){
RayTraceResult trace = WorldUtil.getNearestBlockWithDefaultReachDistance(event.getWorld(), event.getEntityPlayer(), true, false, false);
ActionResult<ItemStack> result = ForgeEventFactory.onBucketUse(event.getEntityPlayer(), event.getWorld(), event.getItemStack(), trace);
if(result == null && trace != null && trace.getBlockPos() != null){
if(event.getEntityPlayer().canPlayerEdit(trace.getBlockPos().offset(trace.sideHit), trace.sideHit, event.getItemStack())){
IBlockState state = event.getWorld().getBlockState(trace.getBlockPos());
Material material = state.getMaterial();
if(material == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0){
event.getEntityPlayer().playSound(SoundEvents.ITEM_BUCKET_FILL, 1.0F, 1.0F);
if(material == Material.WATER && state.getValue(BlockLiquid.LEVEL) == 0){
event.getEntityPlayer().playSound(SoundEvents.ITEM_BUCKET_FILL, 1.0F, 1.0F);
if(!event.getWorld().isRemote){
event.getWorld().setBlockState(trace.getBlockPos(), Blocks.AIR.getDefaultState(), 11);
event.getItemStack().stackSize--;
if(!event.getWorld().isRemote){
event.getWorld().setBlockState(trace.getBlockPos(), Blocks.AIR.getDefaultState(), 11);
event.getItemStack().stackSize--;
ItemStack bowl = new ItemStack(InitItems.itemWaterBowl);
if(!event.getEntityPlayer().inventory.addItemStackToInventory(bowl.copy())){
EntityItem entityItem = new EntityItem(event.getWorld(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, bowl.copy());
entityItem.setPickupDelay(0);
event.getWorld().spawnEntityInWorld(entityItem);
ItemStack bowl = new ItemStack(InitItems.itemWaterBowl);
if(!event.getEntityPlayer().inventory.addItemStackToInventory(bowl.copy())){
EntityItem entityItem = new EntityItem(event.getWorld(), event.getEntityPlayer().posX, event.getEntityPlayer().posY, event.getEntityPlayer().posZ, bowl.copy());
entityItem.setPickupDelay(0);
event.getWorld().spawnEntityInWorld(entityItem);
}
}
}
}

View file

@ -882,4 +882,7 @@ booklet.actuallyadditions.chapter.lushCaves.text.1=If you have ever done any <im
booklet.actuallyadditions.chapter.bookStand.name=Wall-Mount Manual
booklet.actuallyadditions.chapter.bookStand.text.1=The <item>Manual Stand<r> is a block that is supposed to mainly be used on <imp>Servers<r>. <n>You can, provided you are the person who <imp>placed it down<r>, set a page in the GUI that will <imp>open when someone else accesses it<r> by pressing the "Set Page"-button while being on the desired page. <n>The Wall-Mount Manual <imp>does not save<r> pages another player navigated to, meaing re-accessing the Manual will cause it to always <imp>end up on the page speficied<r> by the placer.
booklet.actuallyadditions.chapter.bookStand.text.2=People were using this not to have to have a manual item on their hotbar. <n>This is <imp>not supposed<r> to be used for that, because the <item>Actually Additions Manual<r> has <imp>bookmarks<r> and also <imp>keeps the page you were on before<r>. This, however, <imp>does neither<r>. <n><n>This was also originally made for Better Than Minecon. But whatever.
booklet.actuallyadditions.chapter.bookStand.text.2=People were using this not to have to have a manual item on their hotbar. <n>This is <imp>not supposed<r> to be used for that, because the <item>Actually Additions Manual<r> has <imp>bookmarks<r> and also <imp>keeps the page you were on before<r>. This, however, <imp>does neither<r>. <n><n>This was also originally made for Better Than Minecon. But whatever.
booklet.actuallyadditions.chapter.waterBowl.name=Bowl of Water
booklet.actuallyadditions.chapter.waterBowl.text.1=The <item>Bowl of Water<r> can be obtained by <imp>right-cliking a bowl on water<r> anywhere in the world. When the <item>Bowl of Water<r> is then right-clicked onto a block, the water will be placed, much like a <item>Bucket<r>. <n><n>This can be used, for example, for early game farms.