Improvements for debug tool and solar panel
This commit is contained in:
parent
1e9cfa07b6
commit
d06bd5eef9
3 changed files with 28 additions and 16 deletions
|
@ -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;
|
||||
|
|
|
@ -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())));
|
||||
if (tile != null) {
|
||||
sendMessage(playerIn, worldIn, new TextComponentString(
|
||||
TextFormatting.GREEN + "Tile Entity: " + TextFormatting.BLUE + tile.getDisplayName().toString()));
|
||||
}
|
||||
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
|
||||
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;
|
||||
}
|
||||
return EnumActionResult.FAIL;
|
||||
|
||||
private void sendMessage(EntityPlayer playerIn, World worldIn, TextComponentString string) {
|
||||
if (!worldIn.isRemote) {
|
||||
playerIn.sendMessage(string);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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()) {
|
||||
|
|
Loading…
Reference in a new issue