Skip to content

Commit

Permalink
Fix localization key and scanning validation, closes #3 and #5
Browse files Browse the repository at this point in the history
  • Loading branch information
LemmaEOF committed Jan 13, 2018
1 parent 473379d commit 6619e37
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ public class BlockController extends BlockTileEntity<TileEntityBoilerController>

public BlockController() {
super(Material.ROCK, "controller");
setUnlocalizedName("bb.controller");
// this.setDefaultState(blockState.getBaseState().withProperty(ACTIVE, false));

setCreativeTab(BetterBoilers.creativeTab);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ public class BoilerContainer extends ConcreteContainer {
private ResourceLocation fireFG = new ResourceLocation(BetterBoilers.modId,"textures/gui/fire_fg.png");
private ResourceLocation arrowBG = new ResourceLocation(BetterBoilers.modId,"textures/gui/arrow_bg.png");
private ResourceLocation arrowFG = new ResourceLocation(BetterBoilers.modId,"textures/gui/arrow_fg.png");
private ResourceLocation fireABG = new ResourceLocation(BetterBoilers.modId,"textures/gui/single_fire_bg.png");
private ResourceLocation fireAFG = new ResourceLocation(BetterBoilers.modId,"textures/gui/single_fire_fg.png");
private static ResourceLocation[] pumpAnim = new ResourceLocation[13];
static {
for (int i = 0; i <= 12; i++) {
Expand Down Expand Up @@ -54,6 +56,10 @@ public BoilerContainer(IInventory player, IInventory container, TileEntityBoiler
panel.add(fuelTicks0, 11, 46, 14, 14);
panel.add(fuelTicks1, 29, 46, 14, 14);
panel.add(fuelTicks2, 47, 46, 14, 14);
// panel.add(fuelTicks0, 10, 46, 4, 14);
// panel.add(fuelTicks1, 15, 46, 4, 14);
// panel.add(fuelTicks2, 20, 46, 4, 14);

if (boiler.pumpCount == 0) {
panel.add(progressTicks, 75, 37, 24, 17);
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ public void update() {

public boolean isValid(World world, List<BlockPos> blocks) {
int minY = 255;
int validBlockCount = 0;
for(BlockPos pos : blocks) minY = Math.min(pos.getY(), minY);
if (this.pos.getY() != minY) {
status = "msg.bb.badController";
Expand All @@ -114,27 +115,28 @@ public boolean isValid(World world, List<BlockPos> blocks) {
status = "msg.bb.tooManyControllers";
return false;
}
validBlockCount++;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.BOILER
|| world.getBlockState(pos).getBlock() == ModBlocks.VENT
|| world.getBlockState(pos).getBlock() == ModBlocks.VALVE
|| world.getBlockState(pos).getBlock() == ModBlocks.PUMP) {
boilerBlockCount++;
if (pos.getY() == minY) {
status = "msg.bb.badBoiler";
return false;
}
validBlockCount++;
}
if (world.getBlockState(pos).getBlock() == ModBlocks.FIREBOX
|| world.getBlockState(pos).getBlock() == ModBlocks.HATCH) {
fireboxBlockCount++;
if (pos.getY() != minY) {
status = "msg.bb.badFirebox";
return false;
}
validBlockCount++;
}
}
if (boilerBlockCount + fireboxBlockCount < BBConfig.defaultMinMultiblock) {
if (validBlockCount < BBConfig.defaultMinMultiblock) {
status = "msg.bb.tooSmall";
return false;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/assets/betterboilers/lang/en_US.lang
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ tile.boiler_vent.name=Boiler Vent
tile.boiler_pump.name=Boiler Pump
tile.firebox.name=Firebox
tile.firebox_hatch.name=Firebox Hatch
tile.controller.name=Boiler Controller
tile.bb.controller.name=Boiler Controller

#tooltips
tooltip.bb.inspector.0=What did you do this time?
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 6619e37

Please sign in to comment.