diff --git a/src/main/java/techreborn/init/TRContent.java b/src/main/java/techreborn/init/TRContent.java index 8930df5f0..82538d6d4 100644 --- a/src/main/java/techreborn/init/TRContent.java +++ b/src/main/java/techreborn/init/TRContent.java @@ -286,7 +286,7 @@ public class TRContent { INDUSTRIAL(EnumPowerTier.MEDIUM, ConfigTechReborn.industrialGenerationRateD, ConfigTechReborn.industrialGenerationRateN), ULTIMATE(EnumPowerTier.HIGH, ConfigTechReborn.ultimateGenerationRateD, ConfigTechReborn.ultimateGenerationRateN), QUANTUM(EnumPowerTier.EXTREME, ConfigTechReborn.quantumGenerationRateD, ConfigTechReborn.quantumGenerationRateN), - CREATIVE(EnumPowerTier.INFINITE, Integer.MAX_VALUE, Integer.MAX_VALUE); + CREATIVE(EnumPowerTier.INFINITE, Integer.MAX_VALUE / 100, Integer.MAX_VALUE / 100); public final String name; public final Block block; diff --git a/src/main/java/techreborn/items/tool/ItemDebugTool.java b/src/main/java/techreborn/items/tool/ItemDebugTool.java index 035a9b4ad..03cfa0ea5 100644 --- a/src/main/java/techreborn/items/tool/ItemDebugTool.java +++ b/src/main/java/techreborn/items/tool/ItemDebugTool.java @@ -52,23 +52,30 @@ public class ItemDebugTool extends Item { EnumFacing facing, float hitX, float hitY, float hitZ) { Block block = worldIn.getBlockState(pos).getBlock(); if (block != null) { - playerIn.sendMessage(new TextComponentString( - TextFormatting.GREEN + "Block Registry Name:" + TextFormatting.BLUE + block.getRegistryName().toString())); + sendMessage(playerIn, worldIn, new TextComponentString(TextFormatting.GREEN + "Block Registry Name: " + + TextFormatting.BLUE + block.getRegistryName().toString())); + } else { + return EnumActionResult.FAIL; } + TileEntity tile = worldIn.getTileEntity(pos); - if (tile instanceof IEnergyInterfaceTile) { - if (!tile.getWorld().isRemote) { - playerIn.sendMessage(new TextComponentString(TextFormatting.GREEN + "Power" + TextFormatting.BLUE - + PowerSystem.getLocaliszedPower(((IEnergyInterfaceTile) tile).getEnergy()))); - } - return EnumActionResult.SUCCESS; - } else if (tile != null && tile.hasCapability(CapabilityEnergy.ENERGY, facing)) { - if (!tile.getWorld().isRemote) { - playerIn.sendMessage(new TextComponentString(TextFormatting.GREEN + "Power " + TextFormatting.RED - + tile.getCapability(CapabilityEnergy.ENERGY, facing).getEnergyStored() + "FU")); - } - return EnumActionResult.SUCCESS; + if (tile != null) { + sendMessage(playerIn, worldIn, new TextComponentString( + TextFormatting.GREEN + "Tile Entity: " + TextFormatting.BLUE + tile.getDisplayName().toString())); + } + if (tile instanceof IEnergyInterfaceTile) { + sendMessage(playerIn, worldIn, new TextComponentString(TextFormatting.GREEN + "Power: " + + TextFormatting.BLUE + PowerSystem.getLocaliszedPower(((IEnergyInterfaceTile) tile).getEnergy()))); + } else if (tile.hasCapability(CapabilityEnergy.ENERGY, facing)) { + sendMessage(playerIn, worldIn, new TextComponentString(TextFormatting.GREEN + "Power " + TextFormatting.RED + + tile.getCapability(CapabilityEnergy.ENERGY, facing).getEnergyStored() + "FU")); + } + return EnumActionResult.SUCCESS; + } + + private void sendMessage(EntityPlayer playerIn, World worldIn, TextComponentString string) { + if (!worldIn.isRemote) { + playerIn.sendMessage(string); } - return EnumActionResult.FAIL; } } diff --git a/src/main/java/techreborn/tiles/generator/TileSolarPanel.java b/src/main/java/techreborn/tiles/generator/TileSolarPanel.java index 8d8a33ace..4785fc027 100644 --- a/src/main/java/techreborn/tiles/generator/TileSolarPanel.java +++ b/src/main/java/techreborn/tiles/generator/TileSolarPanel.java @@ -36,6 +36,7 @@ import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.TilePowerAcceptor; import reborncore.common.util.StringUtils; import techreborn.blocks.generator.BlockSolarPanel; +import techreborn.init.TRContent; import techreborn.init.TRContent.SolarPanels; import java.util.List; @@ -57,6 +58,10 @@ public class TileSolarPanel extends TilePowerAcceptor implements IToolDrop { if (world.isRemote) { return; } + if (panel == TRContent.SolarPanels.CREATIVE) { + setEnergy(Integer.MAX_VALUE); + return; + } if (world.getTotalWorldTime() % 20 == 0) { canSeeSky = world.canBlockSeeSky(pos.up()); if (lastState != isSunOut()) {