Long-Range Breaker Localization & Documentation

This commit is contained in:
Ellpeck 2015-10-05 19:55:28 +02:00
parent 486541c794
commit 446f122fee
12 changed files with 81 additions and 57 deletions

View file

@ -79,6 +79,7 @@ public class InitBooklet{
new BookletChapter("lavaFactory", entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue()), new PageCrafting(2, BlockCrafting.recipeLavaFactory).setNoText()); new BookletChapter("lavaFactory", entryFunctionalRF, new ItemStack(InitBlocks.blockLavaFactoryController), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.LAVA_FACTORY_ENERGY_USED.getValue()), new PageCrafting(2, BlockCrafting.recipeLavaFactory).setNoText());
new BookletChapter("energizer", entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator)); new BookletChapter("energizer", entryFunctionalRF, new ItemStack(InitBlocks.blockEnergizer), new PageCrafting(1, BlockCrafting.recipeEnergizer), new PageCrafting(2, BlockCrafting.recipeEnervator));
new BookletChapter("repairer", entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("<rf>", ConfigIntValues.REPAIRER_ENERGY_USED.getValue())); new BookletChapter("repairer", entryFunctionalRF, new ItemStack(InitBlocks.blockItemRepairer), new PageCrafting(1, BlockCrafting.recipeRepairer).addTextReplacement("<rf>", ConfigIntValues.REPAIRER_ENERGY_USED.getValue()));
new BookletChapter("longRangeBreaker", entryFunctionalRF, new ItemStack(InitBlocks.blockDirectionalBreaker), new PageTextOnly(1).addTextReplacement("<rf>", ConfigIntValues.DIRECTIONAL_BREAKER_RF_PER_BLOCK.getValue()).addTextReplacement("<range>", ConfigIntValues.DIRECTIONAL_BREAKER_RANGE.getValue()), new PageCrafting(2, BlockCrafting.recipeDirectionalBreaker));
//RF Generating Blocks //RF Generating Blocks
new BookletChapter("coalGen", entryGeneratingRF, new ItemStack(InitBlocks.blockCoalGenerator), new PageCrafting(1, BlockCrafting.recipeCoalGen).addTextReplacement("<rf>", ConfigIntValues.COAL_GEN_ENERGY_PRODUCED.getValue())); new BookletChapter("coalGen", entryGeneratingRF, new ItemStack(InitBlocks.blockCoalGenerator), new PageCrafting(1, BlockCrafting.recipeCoalGen).addTextReplacement("<rf>", ConfigIntValues.COAL_GEN_ENERGY_PRODUCED.getValue()));

View file

@ -149,7 +149,8 @@ public enum ConfigCrafting{
MAGNET_RING("Magnet Ring", ConfigCategories.ITEMS_CRAFTING), MAGNET_RING("Magnet Ring", ConfigCategories.ITEMS_CRAFTING),
WATER_RING("Water Ring", ConfigCategories.ITEMS_CRAFTING), WATER_RING("Water Ring", ConfigCategories.ITEMS_CRAFTING),
GROWTH_RING("Growth Ring", ConfigCategories.ITEMS_CRAFTING); GROWTH_RING("Growth Ring", ConfigCategories.ITEMS_CRAFTING),
DIRECTIONAL_BREAKER("Long-Range Breaker", ConfigCategories.BLOCKS_CRAFTING);
public final String name; public final String name;
public final String category; public final String category;

View file

@ -164,7 +164,10 @@ public enum ConfigIntValues{
LEAF_GENERATOR_ENERGY_PRODUCED("Leaf Generator: Energy Produce", ConfigCategories.MACHINE_VALUES, 40, 1, 10000, "How much Energy the Leaf Generator produces per Leaf broken"), LEAF_GENERATOR_ENERGY_PRODUCED("Leaf Generator: Energy Produce", ConfigCategories.MACHINE_VALUES, 40, 1, 10000, "How much Energy the Leaf Generator produces per Leaf broken"),
LEAF_GENERATOR_COOLDOWN_TIME("Leaf Generator: Cooldown Time", ConfigCategories.MACHINE_VALUES, 5, 0, 100, "The amount of ticks that it takes util another Leaf gets proken"), LEAF_GENERATOR_COOLDOWN_TIME("Leaf Generator: Cooldown Time", ConfigCategories.MACHINE_VALUES, 5, 0, 100, "The amount of ticks that it takes util another Leaf gets proken"),
LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 7, 1, 100, "The radius of a leaf generator"); LEAF_GENERATOR_RANGE("Leaf Generator: Range", ConfigCategories.MACHINE_VALUES, 7, 1, 100, "The radius of a leaf generator"),
DIRECTIONAL_BREAKER_RF_PER_BLOCK("Directional Breaker: RF per Block", ConfigCategories.MACHINE_VALUES, 5, 0, 1000, "The amount of RF the Directional Breaker uses to break each block"),
DIRECTIONAL_BREAKER_RANGE("Directional Breaker: Range", ConfigCategories.MACHINE_VALUES, 8, 1, 1000, "The range of the Directional Breaker");
public final String name; public final String name;
public final String category; public final String category;

View file

@ -74,9 +74,18 @@ public class BlockCrafting{
public static IRecipe[] recipesLamps = new IRecipe[BlockColoredLamp.allLampTypes.length]; public static IRecipe[] recipesLamps = new IRecipe[BlockColoredLamp.allLampTypes.length];
public static IRecipe recipePowerer; public static IRecipe recipePowerer;
public static IRecipe recipeLeafGen; public static IRecipe recipeLeafGen;
public static IRecipe recipeDirectionalBreaker;
public static void init(){ public static void init(){
//Directional Breaker
if(ConfigCrafting.DIRECTIONAL_BREAKER.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockDirectionalBreaker),
"BBB",
'B', new ItemStack(InitBlocks.blockBreaker)));
recipeDirectionalBreaker = Util.GetRecipes.lastIRecipe();
}
//Smiley Cloud //Smiley Cloud
if(ConfigCrafting.CLOUD.isEnabled()){ if(ConfigCrafting.CLOUD.isEnabled()){
GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockSmileyCloud), GameRegistry.addRecipe(new ShapedOreRecipe(new ItemStack(InitBlocks.blockSmileyCloud),

View file

@ -81,6 +81,7 @@ public class CreativeTab extends CreativeTabs{
add(InitBlocks.blockItemRepairer); add(InitBlocks.blockItemRepairer);
add(InitBlocks.blockFishingNet); add(InitBlocks.blockFishingNet);
add(InitBlocks.blockBreaker); add(InitBlocks.blockBreaker);
add(InitBlocks.blockDirectionalBreaker);
add(InitBlocks.blockPlacer); add(InitBlocks.blockPlacer);
add(InitBlocks.blockDropper); add(InitBlocks.blockDropper);
add(InitBlocks.blockFluidPlacer); add(InitBlocks.blockFluidPlacer);

View file

@ -41,6 +41,12 @@ public abstract class ItemEnergy extends ItemEnergyContainer implements IActAddI
this.setEnergy(stack, 0); this.setEnergy(stack, 0);
} }
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){
list.add(this.getEnergyStored(stack)+"/"+this.getMaxEnergyStored(stack)+" RF");
}
@Override @Override
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@ -72,12 +78,6 @@ public abstract class ItemEnergy extends ItemEnergyContainer implements IActAddI
return false; return false;
} }
@SuppressWarnings("unchecked")
@Override
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean bool){
list.add(this.getEnergyStored(stack)+"/"+this.getMaxEnergyStored(stack)+" RF");
}
public void setEnergy(ItemStack stack, int energy){ public void setEnergy(ItemStack stack, int energy){
NBTTagCompound compound = stack.getTagCompound(); NBTTagCompound compound = stack.getTagCompound();
if(compound == null){ if(compound == null){

View file

@ -42,6 +42,11 @@ public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements I
return ((CachedInfoStack)this.arecipes.get(page)).theStack; return ((CachedInfoStack)this.arecipes.get(page)).theStack;
} }
@Override
public void loadTransferRects(){
transferRects.add(new RecipeTransferRect(new Rectangle(0, 18, 165, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT), NAME));
}
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
@Override @Override
public void loadCraftingRecipes(String outputId, Object... results){ public void loadCraftingRecipes(String outputId, Object... results){
@ -112,6 +117,11 @@ public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements I
} }
} }
@Override
public Class<? extends GuiContainer> getGuiClass(){
return GuiFurnaceDouble.class;
}
@Override @Override
public void drawBackground(int recipe){ public void drawBackground(int recipe){
@ -124,16 +134,6 @@ public class BookletInfoRecipeHandler extends TemplateRecipeHandler implements I
this.drawExtras(recipe); this.drawExtras(recipe);
} }
@Override
public void loadTransferRects(){
transferRects.add(new RecipeTransferRect(new Rectangle(0, 18, 165, Minecraft.getMinecraft().fontRenderer.FONT_HEIGHT), NAME));
}
@Override
public Class<? extends GuiContainer> getGuiClass(){
return GuiFurnaceDouble.class;
}
@Override @Override
public int recipiesPerPage(){ public int recipiesPerPage(){
return 1; return 1;

View file

@ -43,8 +43,8 @@ public class TileEntityDirectionalBreaker extends TileEntityInventoryBase implem
public void updateEntity(){ public void updateEntity(){
if(!worldObj.isRemote){ if(!worldObj.isRemote){
if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){ if(!worldObj.isBlockIndirectlyGettingPowered(xCoord, yCoord, zCoord)){
int usagePerBlock = 5; //TODO Config int usagePerBlock = ConfigIntValues.DIRECTIONAL_BREAKER_RF_PER_BLOCK.getValue();
int range = 8; //TODO Config int range = ConfigIntValues.DIRECTIONAL_BREAKER_RANGE.getValue();
if(this.storage.getEnergyStored() >= usagePerBlock*range){ if(this.storage.getEnergyStored() >= usagePerBlock*range){
if(this.currentTime > 0){ if(this.currentTime > 0){
this.currentTime--; this.currentTime--;

View file

@ -75,13 +75,14 @@ public abstract class TileEntityInventoryBase extends TileEntityBase implements
else{ else{
return new int[0]; return new int[0];
} }
} @Override }
@Override
public int getInventoryStackLimit(){ public int getInventoryStackLimit(){
return 64; return 64;
} }
@Override @Override
public boolean isUseableByPlayer(EntityPlayer player){ public boolean isUseableByPlayer(EntityPlayer player){
return player.getDistanceSq(xCoord+0.5D, yCoord+0.5D, zCoord+0.5D) <= 64; return player.getDistanceSq(xCoord+0.5D, yCoord+0.5D, zCoord+0.5D) <= 64;

View file

@ -222,9 +222,6 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
return this.getHandler().fill(from, resource, doFill); return this.getHandler().fill(from, resource, doFill);
} }
return 0; return 0;
} @Override
public boolean isBoundThingInRange(){
return super.isBoundThingInRange() && this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IFluidHandler;
} }
@Override @Override
@ -233,6 +230,9 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
return this.getHandler().drain(from, resource, doDrain); return this.getHandler().drain(from, resource, doDrain);
} }
return null; return null;
} @Override
public boolean isBoundThingInRange(){
return super.isBoundThingInRange() && this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IFluidHandler;
} }
@Override @Override
@ -281,9 +281,6 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
@Override @Override
public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate){ public int extractEnergy(ForgeDirection from, int maxExtract, boolean simulate){
return this.isBoundThingInRange() && this.getProvider() != null ? this.getProvider().extractEnergy(from, maxExtract, simulate) : 0; return this.isBoundThingInRange() && this.getProvider() != null ? this.getProvider().extractEnergy(from, maxExtract, simulate) : 0;
} @Override
public boolean isBoundThingInRange(){
return super.isBoundThingInRange() && (this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IEnergyReceiver || this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IEnergyProvider);
} }
@Override @Override
@ -297,6 +294,9 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
} }
} }
return 0; return 0;
} @Override
public boolean isBoundThingInRange(){
return super.isBoundThingInRange() && (this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IEnergyReceiver || this.boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ()) instanceof IEnergyProvider);
} }
@Override @Override
@ -310,6 +310,26 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
} }
} }
return 0; return 0;
}
public IEnergyProvider getProvider(){
if(this.boundPosition != null && this.boundPosition.getWorld() != null){
TileEntity tile = boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
if(tile instanceof IEnergyProvider){
return (IEnergyProvider)tile;
}
}
return null;
}
public IEnergyReceiver getReceiver(){
if(this.boundPosition != null && this.boundPosition.getWorld() != null){
TileEntity tile = boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
if(tile instanceof IEnergyReceiver){
return (IEnergyReceiver)tile;
}
}
return null;
} @Override } @Override
public void updateEntity(){ public void updateEntity(){
super.updateEntity(); super.updateEntity();
@ -326,15 +346,7 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
} }
} }
public IEnergyReceiver getReceiver(){
if(this.boundPosition != null && this.boundPosition.getWorld() != null){
TileEntity tile = boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
if(tile instanceof IEnergyReceiver){
return (IEnergyReceiver)tile;
}
}
return null;
}
private void pushEnergy(ForgeDirection side){ private void pushEnergy(ForgeDirection side){
TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, xCoord, yCoord, zCoord); TileEntity tile = WorldUtil.getTileEntityFromSide(side, worldObj, xCoord, yCoord, zCoord);
@ -349,17 +361,6 @@ public class TileEntityPhantomface extends TileEntityInventoryBase implements IP
public IEnergyProvider getProvider(){
if(this.boundPosition != null && this.boundPosition.getWorld() != null){
TileEntity tile = boundPosition.getWorld().getTileEntity(boundPosition.getX(), boundPosition.getY(), boundPosition.getZ());
if(tile instanceof IEnergyProvider){
return (IEnergyProvider)tile;
}
}
return null;
}
@Override @Override

View file

@ -48,6 +48,10 @@ public class WorldUtil{
*/ */
public static final ForgeDirection[] CARDINAL_DIRECTIONS_ORDER = new ForgeDirection[]{ForgeDirection.NORTH, ForgeDirection.EAST, ForgeDirection.SOUTH, ForgeDirection.WEST}; public static final ForgeDirection[] CARDINAL_DIRECTIONS_ORDER = new ForgeDirection[]{ForgeDirection.NORTH, ForgeDirection.EAST, ForgeDirection.SOUTH, ForgeDirection.WEST};
public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z){
breakBlockAtSide(side, world, x, y, z, 0);
}
public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z, int offset){ public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z, int offset){
if(side == ForgeDirection.UNKNOWN){ if(side == ForgeDirection.UNKNOWN){
world.setBlockToAir(x, y, z); world.setBlockToAir(x, y, z);
@ -59,10 +63,6 @@ public class WorldUtil{
} }
} }
public static void breakBlockAtSide(ForgeDirection side, World world, int x, int y, int z){
breakBlockAtSide(side, world, x, y, z, 0);
}
public static WorldPos getCoordsFromSide(ForgeDirection side, World world, int x, int y, int z, int offset){ public static WorldPos getCoordsFromSide(ForgeDirection side, World world, int x, int y, int z, int offset){
if(side == ForgeDirection.UNKNOWN){ if(side == ForgeDirection.UNKNOWN){
return null; return null;
@ -253,8 +253,9 @@ public class WorldUtil{
/** /**
* Add an ArrayList of ItemStacks to an Array of slots * Add an ArrayList of ItemStacks to an Array of slots
* @param slots The slots to try to put the items into *
* @param stacks The stacks to be put into the slots (Items don't actually get removed from there!) * @param slots The slots to try to put the items into
* @param stacks The stacks to be put into the slots (Items don't actually get removed from there!)
* @param actuallyDo Do it or just test if it works? * @param actuallyDo Do it or just test if it works?
* @return Does it work? * @return Does it work?
*/ */
@ -278,9 +279,9 @@ public class WorldUtil{
} }
else{ else{
if(actuallyDo){ if(actuallyDo){
slots[i].stackSize+=stackToPutIn.stackSize; slots[i].stackSize += stackToPutIn.stackSize;
} }
testSlots[i].stackSize+=stackToPutIn.stackSize; testSlots[i].stackSize += stackToPutIn.stackSize;
} }
working++; working++;

View file

@ -103,6 +103,7 @@ tile.actuallyadditions.blockCoffeeMachine.name=Coffee Machine
tile.actuallyadditions.blockXPSolidifier.name=Experience Solidifier tile.actuallyadditions.blockXPSolidifier.name=Experience Solidifier
tile.actuallyadditions.blockSmileyCloud.name=Smiley Cloud tile.actuallyadditions.blockSmileyCloud.name=Smiley Cloud
tile.actuallyadditions.blockLeafGenerator.name=Leaf-Eating Generator tile.actuallyadditions.blockLeafGenerator.name=Leaf-Eating Generator
tile.actuallyadditions.blockDirectionalBreaker.name=Long-Range Breaker
#ESD #ESD
tile.actuallyadditions.blockInputter.name=ESD tile.actuallyadditions.blockInputter.name=ESD
@ -348,6 +349,7 @@ container.actuallyadditions.enervator.name=Enervator
container.actuallyadditions.xpSolidifier.name=Experience Solidifier container.actuallyadditions.xpSolidifier.name=Experience Solidifier
container.actuallyadditions.oreMagnet.name=Magnetic Miner container.actuallyadditions.oreMagnet.name=Magnetic Miner
container.actuallyadditions.cloud.name=Smiley Cloud container.actuallyadditions.cloud.name=Smiley Cloud
container.actuallyadditions.directionalBreaker.name=Long-Range Breaker
#Update Information #Update Information
info.actuallyadditions.update.generic.desc=[{"text":"There is an "},{"text":"Update ","bold":"true"},{"text":"for ","bold":"false"},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"available!","color":"none","bold":"false"}] info.actuallyadditions.update.generic.desc=[{"text":"There is an "},{"text":"Update ","bold":"true"},{"text":"for ","bold":"false"},{"text":"Actually Additions ","color":"dark_green","bold":"true"},{"text":"available!","color":"none","bold":"false"}]
@ -542,4 +544,8 @@ booklet.actuallyadditions.chapter.batteries.text.1=<item>Batteries<r> are a good
booklet.actuallyadditions.chapter.leafGen.name=Leaf-Eating Generator booklet.actuallyadditions.chapter.leafGen.name=Leaf-Eating Generator
booklet.actuallyadditions.chapter.leafGen.text.1=The <item>Leaf Generator<r> can generate <imp>RF<r> just by being placed alongside some <item>Leaves<r>. <n>It will destroy the leaves, generating <imp><rf> RF per leaf broken<r> in the process. <n>By right-clicking the generator, you can see how much RF it has stored. <n>It has a <imp>range of <range><r> blocks. booklet.actuallyadditions.chapter.leafGen.text.1=The <item>Leaf Generator<r> can generate <imp>RF<r> just by being placed alongside some <item>Leaves<r>. <n>It will destroy the leaves, generating <imp><rf> RF per leaf broken<r> in the process. <n>By right-clicking the generator, you can see how much RF it has stored. <n>It has a <imp>range of <range><r> blocks.
booklet.actuallyadditions.chapter.leafGen.text.2=<i>Munchy booklet.actuallyadditions.chapter.leafGen.text.2=<i>Munchy
booklet.actuallyadditions.chapter.longRangeBreaker.name=Long-Range Breaker
booklet.actuallyadditions.chapter.longRangeBreaker.text.1=The <item>Long-Range Breaker<r> works like a normal <item>Breaker<r>, but it can break <imp>up to <range> blocks in front of it<r>. <n>Per block broken, it uses <imp><rf> RF<r>. <n><n><i>Breaking the <range>th wall
booklet.actuallyadditions.chapter.longRangeBreaker.text.2=<i>Sequence Breaking