mirror of
https://github.com/Ellpeck/ActuallyAdditions.git
synced 2024-12-22 19:39:24 +01:00
parent
0c0d9eb068
commit
19bcfb21e9
8 changed files with 194 additions and 1 deletions
|
@ -221,7 +221,7 @@ public final class InitBooklet{
|
|||
//RF Using Blocks
|
||||
new BookletChapter("fireworkBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFireworkBox), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityFireworkBox.USE_PER_SHOT), new PageCrafting(2, BlockCrafting.recipeFireworkBox)).setSpecial();
|
||||
new BookletChapter("batteryBox", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockBatteryBox), new PageTextOnly(1), new PageCrafting(2, BlockCrafting.recipeBatteryBox).setNoText()).setSpecial();
|
||||
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
|
||||
new BookletChapter("farmer", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockFarmer), new PageTextOnly(1), new PagePicture(2, "page_farmer_crops", 95).addItemsToPage(new ItemStack(Items.WHEAT_SEEDS)).addItemsToPage(new ItemStack(InitItems.itemCanolaSeed)), new PagePicture(3, "page_farmer_cactus", 105).addItemsToPage(new ItemStack(Blocks.CACTUS)), new PagePicture(4, "page_farmer_wart", 95).addItemsToPage(new ItemStack(Items.NETHER_WART)), new PagePicture(5, "page_farmer_reeds", 105).addItemsToPage(new ItemStack(Items.REEDS)), new PagePicture(6, "page_farmer_melons", 105).addItemsToPage(new ItemStack(Items.MELON), new ItemStack(Blocks.PUMPKIN), new ItemStack(Blocks.MELON_BLOCK)), new PagePicture(7, "page_farmer_enderlilly", 105), new PagePicture(8, "page_farmer_redorchid", 105), new PageCrafting(4, BlockCrafting.recipeFarmer).setWildcard().setNoText()).setImportant();
|
||||
new BookletChapter("miner", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockMiner), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityMiner.ENERGY_USE_PER_BLOCK).addTextReplacement("<range>", TileEntityMiner.DEFAULT_RANGE), new PageCrafting(2, BlockCrafting.recipeMiner)).setSpecial();
|
||||
new BookletChapterCoffee("coffeeMachine", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockCoffeeMachine), new PageTextOnly(1).addItemsToPage(new ItemStack(InitItems.itemCoffeeBean)).addTextReplacement("<rf>", TileEntityCoffeeMachine.ENERGY_USED).addTextReplacement("<coffee>", TileEntityCoffeeMachine.CACHE_USE).addTextReplacement("<water>", TileEntityCoffeeMachine.WATER_USE), new PageTextOnly(2).addItemsToPage(new ItemStack(InitItems.itemCoffee)), new PagePicture(3, "page_coffee_machine", 115), new PageCrafting(4, BlockCrafting.recipeCoffeeMachine).setWildcard().setNoText(), new PageCrafting(5, ItemCrafting.recipeCup).setNoText()).setImportant();
|
||||
new BookletChapterCrusher("crusher", ActuallyAdditionsAPI.entryFunctionalRF, new ItemStack(InitBlocks.blockGrinderDouble), new PageTextOnly(1).addTextReplacement("<rf>", TileEntityGrinder.ENERGY_USE), new PageCrafting(2, BlockCrafting.recipeCrusher).setWildcard().setNoText(), new PageCrafting(3, BlockCrafting.recipeDoubleCrusher).setWildcard().setNoText(), new PageCrusherRecipe(4, CrusherCrafting.recipeIronHorseArmor).setNoText(), new PageCrusherRecipe(5, CrusherCrafting.recipeGoldHorseArmor).setNoText(), new PageCrusherRecipe(6, CrusherCrafting.recipeDiamondHorseArmor).setNoText());
|
||||
|
|
|
@ -15,6 +15,8 @@ import de.ellpeck.actuallyadditions.mod.fluids.InitFluids;
|
|||
import de.ellpeck.actuallyadditions.mod.items.InitItems;
|
||||
import de.ellpeck.actuallyadditions.mod.items.metalists.TheMiscItems;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.*;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu.EnderlillyFarmerBehavior;
|
||||
import de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu.RedOrchidFarmerBehavior;
|
||||
import de.ellpeck.actuallyadditions.mod.util.ModUtil;
|
||||
import net.minecraft.init.Blocks;
|
||||
import net.minecraft.item.ItemStack;
|
||||
|
@ -45,6 +47,8 @@ public final class InitCrafting{
|
|||
ActuallyAdditionsAPI.addFarmerBehavior(new NetherWartFarmerBehavior());
|
||||
ActuallyAdditionsAPI.addFarmerBehavior(new ReedFarmerBehavior());
|
||||
ActuallyAdditionsAPI.addFarmerBehavior(new MelonPumpkinFarmerBehavior());
|
||||
ActuallyAdditionsAPI.addFarmerBehavior(new EnderlillyFarmerBehavior());
|
||||
ActuallyAdditionsAPI.addFarmerBehavior(new RedOrchidFarmerBehavior());
|
||||
|
||||
RecipeSorter.register(ModUtil.MOD_ID+":recipeKeepDataShaped", RecipeKeepDataShaped.class, RecipeSorter.Category.SHAPED, "after:minecraft:shaped");
|
||||
RecipeSorter.register(ModUtil.MOD_ID+":recipeKeepDataShapeless", RecipeKeepDataShapeless.class, RecipeSorter.Category.SHAPELESS, "after:minecraft:shapeless");
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
/*
|
||||
* This file ("EnderlillyFarmerBehavior.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockDirt;
|
||||
import net.minecraft.block.BlockGrass;
|
||||
import net.minecraft.init.Blocks;
|
||||
|
||||
public class EnderlillyFarmerBehavior extends ExUPlantFarmerBehavior{
|
||||
|
||||
@Override
|
||||
protected String getPlantName(){
|
||||
return "extrautils2:enderlilly";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canPlaceOn(Block block){
|
||||
return block == Blocks.END_STONE || block instanceof BlockDirt || block instanceof BlockGrass;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxStage(){
|
||||
return 7;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,121 @@
|
|||
/*
|
||||
* This file ("ExUPlantFarmerBehavior.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu;
|
||||
|
||||
import de.ellpeck.actuallyadditions.api.farmer.FarmerResult;
|
||||
import de.ellpeck.actuallyadditions.api.farmer.IFarmerBehavior;
|
||||
import de.ellpeck.actuallyadditions.api.internal.IFarmer;
|
||||
import de.ellpeck.actuallyadditions.mod.util.StackUtil;
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.state.IBlockState;
|
||||
import net.minecraft.item.Item;
|
||||
import net.minecraft.item.ItemBlock;
|
||||
import net.minecraft.item.ItemStack;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.BlockPos;
|
||||
import net.minecraft.world.World;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public abstract class ExUPlantFarmerBehavior implements IFarmerBehavior{
|
||||
|
||||
@Override
|
||||
public FarmerResult tryPlantSeed(ItemStack seed, World world, BlockPos pos, IFarmer farmer){
|
||||
int use = 600;
|
||||
if(farmer.getEnergy() >= use){
|
||||
if(StackUtil.isValid(seed)){
|
||||
Item item = seed.getItem();
|
||||
ResourceLocation reg = item.getRegistryName();
|
||||
|
||||
if(reg != null && this.getPlantName().equals(reg.toString())){
|
||||
if(item instanceof ItemBlock){
|
||||
Block block = ((ItemBlock)item).getBlock();
|
||||
if(block != null){
|
||||
IBlockState stateThere = world.getBlockState(pos);
|
||||
Block blockThere = stateThere.getBlock();
|
||||
|
||||
if(world.isAirBlock(pos) || blockThere.isReplaceable(world, pos)){
|
||||
BlockPos posBelow = pos.down();
|
||||
IBlockState stateBelow = world.getBlockState(posBelow);
|
||||
|
||||
if(this.canPlaceOn(stateBelow.getBlock())){
|
||||
world.setBlockState(pos, block.getDefaultState(), 2);
|
||||
farmer.extractEnergy(use);
|
||||
|
||||
return FarmerResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return FarmerResult.STOP_PROCESSING;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return FarmerResult.FAIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public FarmerResult tryHarvestPlant(World world, BlockPos pos, IFarmer farmer){
|
||||
int use = 600;
|
||||
if(farmer.getEnergy() >= use){
|
||||
IBlockState state = world.getBlockState(pos);
|
||||
Block block = state.getBlock();
|
||||
ResourceLocation reg = block.getRegistryName();
|
||||
|
||||
if(reg != null && this.getPlantName().equals(reg.toString())){
|
||||
if(block.getMetaFromState(state) >= this.getMaxStage()){
|
||||
List<ItemStack> drops = block.getDrops(world, pos, state, 0);
|
||||
|
||||
for(ItemStack stack : drops){
|
||||
if(StackUtil.isValid(stack)){
|
||||
ResourceLocation itemReg = stack.getItem().getRegistryName();
|
||||
if(itemReg != null && this.getPlantName().equals(itemReg.toString())){
|
||||
if(StackUtil.getStackSize(stack) <= 1){
|
||||
drops.remove(stack);
|
||||
break;
|
||||
}
|
||||
else{
|
||||
StackUtil.addStackSize(stack, -1);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(farmer.addToOutputInventory(drops, false)){
|
||||
farmer.addToOutputInventory(drops, true);
|
||||
|
||||
world.playEvent(2001, pos, Block.getStateId(state));
|
||||
world.setBlockState(pos, block.getDefaultState(), 2);
|
||||
|
||||
farmer.extractEnergy(use);
|
||||
|
||||
return FarmerResult.SUCCESS;
|
||||
}
|
||||
}
|
||||
|
||||
return FarmerResult.STOP_PROCESSING;
|
||||
}
|
||||
}
|
||||
return FarmerResult.FAIL;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getPriority(){
|
||||
return 10;
|
||||
}
|
||||
|
||||
protected abstract String getPlantName();
|
||||
|
||||
protected abstract boolean canPlaceOn(Block block);
|
||||
|
||||
protected abstract int getMaxStage();
|
||||
}
|
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* This file ("RedOrchidFarmerBehavior.java") is part of the Actually Additions mod for Minecraft.
|
||||
* It is created and owned by Ellpeck and distributed
|
||||
* under the Actually Additions License to be found at
|
||||
* http://ellpeck.de/actaddlicense
|
||||
* View the source code at https://github.com/Ellpeck/ActuallyAdditions
|
||||
*
|
||||
* © 2015-2017 Ellpeck
|
||||
*/
|
||||
|
||||
package de.ellpeck.actuallyadditions.mod.misc.apiimpl.farmer.exu;
|
||||
|
||||
import net.minecraft.block.Block;
|
||||
import net.minecraft.block.BlockRedstoneOre;
|
||||
|
||||
public class RedOrchidFarmerBehavior extends ExUPlantFarmerBehavior{
|
||||
|
||||
@Override
|
||||
protected String getPlantName(){
|
||||
return "extrautils2:redorchid";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canPlaceOn(Block block){
|
||||
return block instanceof BlockRedstoneOre;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getMaxStage(){
|
||||
return 6;
|
||||
}
|
||||
}
|
|
@ -1205,6 +1205,8 @@ booklet.actuallyadditions.chapter.farmer.text.3=Farming <item>Cactus<r>. Sand ne
|
|||
booklet.actuallyadditions.chapter.farmer.text.4=Farming <item>Nether Wart<r>. Soul Sand needs to be laid out for it to be planted.
|
||||
booklet.actuallyadditions.chapter.farmer.text.5=Farming <item>Sugar Cane<r>. Sand and water need to be laid out for it to be planted. Harvested in the same way as <item>Cactus<r>.
|
||||
booklet.actuallyadditions.chapter.farmer.text.6=Farming <item>Melons<r> and <item>Pumpkins<r>. There will be <imp>checkerboarded air spaces<r> left out inbetween the seeds for them to grow.
|
||||
booklet.actuallyadditions.chapter.farmer.text.7=Farming <item>Ender Lillies<r> from <imp>Extra Utilities 2<r>. They need to be placed on <imp>End Stone<r>, <imp>Grass<r> or <imp>Dirt<r>.
|
||||
booklet.actuallyadditions.chapter.farmer.text.8=Farming <item>Red Orchids<r> from <imp>Extra Utilities 2<r>. They need to be placed on <imp>Redstone Ore<r>.
|
||||
|
||||
booklet.actuallyadditions.chapter.lensMoreDeath.name=Lens of the Killer
|
||||
booklet.actuallyadditions.chapter.lensMoreDeath.text.1=The <item>Lens of the Killer<r> works much like the <item>Lens of Certain Death<r>, however it will also <imp>drop experience<r> and <imp>player-kill loot<r>. <n>This means, however, that it will use <imp>a lot more power<r>. <n><n>To pick up the experience it drops, you might want to try an <item>Experience Solidifier<r>.
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
Binary file not shown.
After Width: | Height: | Size: 19 KiB |
Loading…
Reference in a new issue