Refactoring for translation

This commit is contained in:
drcrazy 2017-09-08 02:03:35 +03:00
parent 8a8205b4b1
commit ab1802ba5e
48 changed files with 240 additions and 118 deletions

View file

@ -32,7 +32,7 @@ import net.minecraft.world.IBlockAccess;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.tiles.TileAdjustableSU; import techreborn.tiles.storage.TileAdjustableSU;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;

View file

@ -33,7 +33,7 @@ import reborncore.common.blocks.BlockMachineBase;
import techreborn.client.EGui; import techreborn.client.EGui;
import techreborn.client.TechRebornCreativeTab; import techreborn.client.TechRebornCreativeTab;
import techreborn.lib.ModInfo; import techreborn.lib.ModInfo;
import techreborn.tiles.TileAlloySmelter; import techreborn.tiles.teir1.TileAlloySmelter;
public class BlockAlloySmelter extends BlockMachineBase { public class BlockAlloySmelter extends BlockMachineBase {

View file

@ -44,6 +44,7 @@ import techreborn.tiles.multiblock.*;
import techreborn.tiles.storage.TileHighVoltageSU; import techreborn.tiles.storage.TileHighVoltageSU;
import techreborn.tiles.storage.TileLowVoltageSU; import techreborn.tiles.storage.TileLowVoltageSU;
import techreborn.tiles.storage.TileMediumVoltageSU; import techreborn.tiles.storage.TileMediumVoltageSU;
import techreborn.tiles.storage.TileAdjustableSU;
import techreborn.tiles.teir1.*; import techreborn.tiles.teir1.*;
public class GuiHandler implements IGuiHandler { public class GuiHandler implements IGuiHandler {

View file

@ -177,7 +177,7 @@ public class RegisterItemJsons {
}); });
} }
public static void setBlockStateMapper(Block block, String path, IProperty... ignoredProperties) { public static void setBlockStateMapper(Block block, String path, IProperty<?>... ignoredProperties) {
final String slash = !path.isEmpty() ? "/" : ""; final String slash = !path.isEmpty() ? "/" : "";
ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() { ModelLoader.setCustomStateMapper(block, new DefaultStateMapper() {
@Override @Override
@ -204,6 +204,7 @@ public class RegisterItemJsons {
register(item, 0, name); register(item, 0, name);
} }
@SuppressWarnings("unused")
private static void register(Block block, int meta, String name) { private static void register(Block block, int meta, String name) {
register(Item.getItemFromBlock(block), meta, name); register(Item.getItemFromBlock(block), meta, name);
} }
@ -212,6 +213,7 @@ public class RegisterItemJsons {
register(Item.getItemFromBlock(block), 0, name); register(Item.getItemFromBlock(block), 0, name);
} }
@SuppressWarnings("unused")
private static void registerBlockstate(Item i, int meta, String variant) { private static void registerBlockstate(Item i, int meta, String variant) {
registerBlockstate(i, meta, variant, ""); registerBlockstate(i, meta, variant, "");
} }
@ -221,6 +223,7 @@ public class RegisterItemJsons {
ModelLoader.setCustomModelResourceLocation(i, meta, new ModelResourceLocation(loc, "type=" + variant)); ModelLoader.setCustomModelResourceLocation(i, meta, new ModelResourceLocation(loc, "type=" + variant));
} }
@SuppressWarnings("unused")
private static void registerBlockstate(Block i, int meta, String variant) { private static void registerBlockstate(Block i, int meta, String variant) {
registerBlockstate(i, meta, variant, ""); registerBlockstate(i, meta, variant, "");
} }

View file

@ -30,7 +30,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.client.gui.slots.BaseSlot; import reborncore.client.gui.slots.BaseSlot;
import reborncore.common.container.RebornContainer; import reborncore.common.container.RebornContainer;
import techreborn.tiles.TileAdjustableSU; import techreborn.tiles.storage.TileAdjustableSU;
public class ContainerAESU extends RebornContainer { public class ContainerAESU extends RebornContainer {

View file

@ -29,12 +29,12 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import reborncore.common.network.NetworkManager; import reborncore.common.network.NetworkManager;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerAESU; import techreborn.client.container.ContainerAESU;
import techreborn.packets.PacketAesu; import techreborn.packets.PacketAesu;
import techreborn.tiles.TileAdjustableSU; import techreborn.tiles.storage.TileAdjustableSU;
import java.awt.*; import java.awt.*;
import java.io.IOException; import java.io.IOException;
@ -78,7 +78,7 @@ public class GuiAESU extends GuiContainer {
} }
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRenderer.drawString(I18n.translateToLocal("tile.techreborn:adjustable_su.name"), 40, 10, this.fontRenderer.drawString(I18n.format("tile.techreborn:adjustable_su.name"), 40, 10,
Color.WHITE.getRGB()); Color.WHITE.getRGB());
this.fontRenderer.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20, this.fontRenderer.drawString(PowerSystem.getLocaliszedPower(containerAesu.euOut) + " /tick", 10, 20,
Color.WHITE.getRGB()); Color.WHITE.getRGB());

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileIronAlloyFurnace; import techreborn.tiles.TileIronAlloyFurnace;
public class GuiAlloyFurnace extends GuiContainer { public class GuiAlloyFurnace extends GuiContainer {
@ -47,8 +47,6 @@ public class GuiAlloyFurnace extends GuiContainer {
@Override @Override
public void initGui() { public void initGui() {
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@ -71,10 +69,10 @@ public class GuiAlloyFurnace extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:iron_alloy_furnace.name"); final String name = I18n.format("tile.techreborn:iron_alloy_furnace.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }

View file

@ -28,8 +28,8 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileAlloySmelter; import techreborn.tiles.teir1.TileAlloySmelter;
public class GuiAlloySmelter extends GuiContainer { public class GuiAlloySmelter extends GuiContainer {
@ -47,8 +47,6 @@ public class GuiAlloySmelter extends GuiContainer {
@Override @Override
public void initGui() { public void initGui() {
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@ -76,10 +74,10 @@ public class GuiAlloySmelter extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:alloy_smelter.name"); final String name = I18n.format("tile.techreborn:alloy_smelter.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileAssemblingMachine; import techreborn.tiles.TileAssemblingMachine;
public class GuiAssemblingMachine extends GuiContainer { public class GuiAssemblingMachine extends GuiContainer {
@ -47,8 +47,6 @@ public class GuiAssemblingMachine extends GuiContainer {
@Override @Override
public void initGui() { public void initGui() {
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@ -76,10 +74,10 @@ public class GuiAssemblingMachine extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:assembly_machine.name"); final String name = I18n.format("tile.techreborn:assembly_machine.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.tileentity.TileEntity; import net.minecraft.tileentity.TileEntity;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.api.tile.IUpgradeable; import reborncore.api.tile.IUpgradeable;
@ -145,7 +145,7 @@ public class GuiBase extends GuiContainer {
} }
protected void drawTitle() { protected void drawTitle() {
drawCentredString(I18n.translateToLocal(tile.getBlockType().getUnlocalizedName() + ".name"), 6, 4210752, Layer.FOREGROUND); drawCentredString(I18n.format(tile.getBlockType().getUnlocalizedName() + ".name"), 6, 4210752, Layer.FOREGROUND);
} }
protected void drawCentredString(String string, int y, int colour, Layer layer) { protected void drawCentredString(String string, int y, int colour, Layer layer) {

View file

@ -29,7 +29,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileChunkLoader; import techreborn.tiles.TileChunkLoader;
public class GuiChunkLoader extends GuiContainer { public class GuiChunkLoader extends GuiContainer {
@ -78,10 +78,10 @@ public class GuiChunkLoader extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:chunk_loader.name"); final String name = I18n.format("tile.techreborn:chunk_loader.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }

View file

@ -29,7 +29,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.inventory.Container; import net.minecraft.inventory.Container;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
public class GuiDestructoPack extends GuiContainer { public class GuiDestructoPack extends GuiContainer {
@ -52,9 +52,9 @@ public class GuiDestructoPack extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(int arg0, int arg1) { protected void drawGuiContainerForegroundLayer(int arg0, int arg1) {
String name = I18n.translateToLocal("item.techreborn.part.destructoPack.name"); String name = I18n.format("item.techreborn.part.destructoPack.name");
fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 5, 4210752); fontRenderer.drawString(name, xSize / 2 - fontRenderer.getStringWidth(name) / 2, 5, 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory"), 8, this.ySize - 96 + 2, this.fontRenderer.drawString(I18n.format("container.inventory"), 8, this.ySize - 96 + 2,
4210752); 4210752);
super.drawGuiContainerForegroundLayer(arg0, arg1); super.drawGuiContainerForegroundLayer(arg0, arg1);
} }

View file

@ -25,7 +25,6 @@
package techreborn.client.gui; package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.tiles.TileDigitalChest; import techreborn.tiles.TileDigitalChest;
public class GuiDigitalChest extends GuiBase { public class GuiDigitalChest extends GuiBase {

View file

@ -31,7 +31,7 @@ import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.EnumFacing; import net.minecraft.util.EnumFacing;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import reborncore.client.multiblock.MultiblockRenderEvent; import reborncore.client.multiblock.MultiblockRenderEvent;
import reborncore.client.multiblock.MultiblockSet; import reborncore.client.multiblock.MultiblockSet;
import reborncore.common.misc.Location; import reborncore.common.misc.Location;
@ -56,9 +56,9 @@ public class GuiFusionReactor extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:fusion_control_computer.name"); final String name = I18n.format("tile.techreborn:fusion_control_computer.name");
this.fontRenderer.drawString(name, 87, 6, 4210752); this.fontRenderer.drawString(name, 87, 6, 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRenderer.drawString(PowerSystem.getLocaliszedPower(this.fusionController.getEnergy()), 11, 8, this.fontRenderer.drawString(PowerSystem.getLocaliszedPower(this.fusionController.getEnergy()), 11, 8,

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.multiblock.TileImplosionCompressor; import techreborn.tiles.multiblock.TileImplosionCompressor;
public class GuiImplosionCompressor extends GuiContainer { public class GuiImplosionCompressor extends GuiContainer {
@ -47,8 +47,6 @@ public class GuiImplosionCompressor extends GuiContainer {
@Override @Override
public void initGui() { public void initGui() {
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@ -63,7 +61,7 @@ public class GuiImplosionCompressor extends GuiContainer {
if (!this.compressor.getMutliBlock()) { if (!this.compressor.getMutliBlock()) {
// GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10); // GuiDraw.drawTooltipBox(k + 30, l + 50 + 12 - 0, 114, 10);
this.fontRenderer.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1); this.fontRenderer.drawString(I18n.format("techreborn.message.missingmultiblock"), k + 38, l + 52 + 12, -1);
} }
this.mc.getTextureManager().bindTexture(GuiImplosionCompressor.texture); this.mc.getTextureManager().bindTexture(GuiImplosionCompressor.texture);
@ -80,9 +78,9 @@ public class GuiImplosionCompressor extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:implosion_compressor.name"); final String name = I18n.format("tile.techreborn:implosion_compressor.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, 4210752); this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752); this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, 4210752);
} }
@Override @Override

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileIndustrialElectrolyzer; import techreborn.tiles.TileIndustrialElectrolyzer;
public class GuiIndustrialElectrolyzer extends GuiContainer { public class GuiIndustrialElectrolyzer extends GuiContainer {
@ -47,8 +47,6 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
@Override @Override
public void initGui() { public void initGui() {
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@ -76,10 +74,10 @@ public class GuiIndustrialElectrolyzer extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:industrial_electrolyzer.name"); final String name = I18n.format("tile.techreborn:industrial_electrolyzer.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }
} }

View file

@ -30,7 +30,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import techreborn.tiles.multiblock.TileIndustrialSawmill; import techreborn.tiles.multiblock.TileIndustrialSawmill;
@ -50,8 +50,6 @@ public class GuiIndustrialSawmill extends GuiContainer {
@Override @Override
public void initGui() { public void initGui() {
final int k = (this.width - this.xSize) / 2;
final int l = (this.height - this.ySize) / 2;
super.initGui(); super.initGui();
} }
@ -81,7 +79,7 @@ public class GuiIndustrialSawmill extends GuiContainer {
if (!this.sawmill.getMutliBlock()) { if (!this.sawmill.getMutliBlock()) {
//GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10); //GuiUtil.drawTooltipBox(k + 30, l + 50 + 12, 114, 10);
this.fontRenderer.drawString(I18n.translateToLocal("techreborn.message.missingmultiblock"), k + 38, this.fontRenderer.drawString(I18n.format("techreborn.message.missingmultiblock"), k + 38,
l + 52 + 12, -1); l + 52 + 12, -1);
} }
} }
@ -110,9 +108,9 @@ public class GuiIndustrialSawmill extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:industrial_sawmill.name"); final String name = I18n.format("tile.techreborn:industrial_sawmill.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, 4210752); this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory"), 58, this.ySize - 96 + 2, 4210752); this.fontRenderer.drawString(I18n.format("container.inventory"), 58, this.ySize - 96 + 2, 4210752);
} }
@Override @Override

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileIronFurnace; import techreborn.tiles.TileIronFurnace;
public class GuiIronFurnace extends GuiContainer { public class GuiIronFurnace extends GuiContainer {
@ -69,10 +69,10 @@ public class GuiIronFurnace extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:iron_furnace.name"); final String name = I18n.format("tile.techreborn:iron_furnace.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.client.container.ContainerLESU; import techreborn.client.container.ContainerLESU;
import techreborn.tiles.lesu.TileLapotronicSU; import techreborn.tiles.lesu.TileLapotronicSU;
@ -62,7 +62,7 @@ public class GuiLESU extends GuiContainer {
} }
protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) { protected void drawGuiContainerForegroundLayer(int p_146979_1_, int p_146979_2_) {
this.fontRenderer.drawString(I18n.translateToLocal("tile.techreborn:lapotronic_su.name"), 40, 10, this.fontRenderer.drawString(I18n.format("tile.techreborn:lapotronic_su.name"), 40, 10,
Color.WHITE.getRGB()); Color.WHITE.getRGB());
this.fontRenderer.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20, this.fontRenderer.drawString(PowerSystem.getLocaliszedPower(containerLesu.euOut) + "/t", 10, 20,
Color.WHITE.getRGB()); Color.WHITE.getRGB());

View file

@ -25,7 +25,6 @@
package techreborn.client.gui; package techreborn.client.gui;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack;
import techreborn.tiles.TileQuantumChest; import techreborn.tiles.TileQuantumChest;
public class GuiQuantumChest extends GuiBase { public class GuiQuantumChest extends GuiBase {

View file

@ -28,7 +28,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileQuantumTank; import techreborn.tiles.TileQuantumTank;
public class GuiQuantumTank extends GuiContainer { public class GuiQuantumTank extends GuiContainer {
@ -57,10 +57,10 @@ public class GuiQuantumTank extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:quantum_tank.name"); final String name = I18n.format("tile.techreborn:quantum_tank.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
this.fontRenderer.drawString("Liquid Amount", 10, 20, 16448255); this.fontRenderer.drawString("Liquid Amount", 10, 20, 16448255);
this.fontRenderer.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255); this.fontRenderer.drawString(this.quantumTank.tank.getFluidAmount() + "", 10, 30, 16448255);

View file

@ -29,7 +29,7 @@ import net.minecraft.client.gui.inventory.GuiContainer;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import techreborn.tiles.TileRollingMachine; import techreborn.tiles.TileRollingMachine;
public class GuiRollingMachine extends GuiContainer { public class GuiRollingMachine extends GuiContainer {
@ -65,10 +65,10 @@ public class GuiRollingMachine extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = I18n.translateToLocal("tile.techreborn:rolling_machine.name"); final String name = I18n.format("tile.techreborn:rolling_machine.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.translateToLocalFormatted("container.inventory", new Object[0]), 8, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8,
this.ySize - 96 + 2, 4210752); this.ySize - 96 + 2, 4210752);
} }

View file

@ -70,7 +70,7 @@ public class GuiScrapboxinator extends GuiContainer {
@Override @Override
protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) { protected void drawGuiContainerForegroundLayer(final int p_146979_1_, final int p_146979_2_) {
final String name = net.minecraft.util.text.translation.I18n.translateToLocal("tile.techreborn:scrapboxinator.name"); final String name = I18n.format("tile.techreborn:scrapboxinator.name");
this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6, this.fontRenderer.drawString(name, this.xSize / 2 - this.fontRenderer.getStringWidth(name) / 2, 6,
4210752); 4210752);
this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2, this.fontRenderer.drawString(I18n.format("container.inventory", new Object[0]), 8, this.ySize - 96 + 2,

View file

@ -31,7 +31,7 @@ import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.texture.TextureMap; import net.minecraft.client.renderer.texture.TextureMap;
import net.minecraft.util.ResourceLocation; import net.minecraft.util.ResourceLocation;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import net.minecraftforge.fluids.FluidStack; import net.minecraftforge.fluids.FluidStack;
import net.minecraftforge.fml.client.config.GuiUtils; import net.minecraftforge.fml.client.config.GuiUtils;
import net.minecraftforge.fml.common.Loader; import net.minecraftforge.fml.common.Loader;
@ -280,7 +280,7 @@ public class TRBuilder extends GuiBuilder {
GuiUtils.drawGradientRect(0, x, y + 68, x + 176, y + 70 + 20, 0xC0000000, 0x00000000); GuiUtils.drawGradientRect(0, x, y + 68, x + 176, y + 70 + 20, 0xC0000000, 0x00000000);
GlStateManager.colorMask(true, true, true, true); GlStateManager.colorMask(true, true, true, true);
GlStateManager.enableDepth(); GlStateManager.enableDepth();
gui.drawCentredString(I18n.translateToLocal("techreborn.message.missingmultiblock"), 43, 0xFFFFFF, layer); gui.drawCentredString(I18n.format("techreborn.message.missingmultiblock"), 43, 0xFFFFFF, layer);
} }
public void drawBigBlueBar(GuiBase gui, int x, int y, int value, int max, int mouseX, int mouseY, GuiBase.Layer layer) { public void drawBigBlueBar(GuiBase gui, int x, int y, int value, int max, int mouseX, int mouseY, GuiBase.Layer layer) {

View file

@ -1,7 +1,30 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client.gui.autocrafting; package techreborn.client.gui.autocrafting;
import net.minecraft.client.Minecraft; import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButtonImage;
import net.minecraft.client.renderer.GlStateManager; import net.minecraft.client.renderer.GlStateManager;
import net.minecraft.client.renderer.RenderHelper; import net.minecraft.client.renderer.RenderHelper;
import net.minecraft.client.renderer.RenderItem; import net.minecraft.client.renderer.RenderItem;
@ -37,7 +60,6 @@ public class GuiAutoCrafting extends GuiBase {
static final ResourceLocation RECIPE_BOOK_TEXTURE = new ResourceLocation("textures/gui/recipe_book.png"); static final ResourceLocation RECIPE_BOOK_TEXTURE = new ResourceLocation("textures/gui/recipe_book.png");
GuiAutoCraftingRecipeSlector recipeSlector = new GuiAutoCraftingRecipeSlector(); GuiAutoCraftingRecipeSlector recipeSlector = new GuiAutoCraftingRecipeSlector();
private GuiButtonImage recipeButton;
boolean showGui = true; boolean showGui = true;
InventoryCrafting dummyInv; InventoryCrafting dummyInv;
TileAutoCraftingTable tileAutoCraftingTable; TileAutoCraftingTable tileAutoCraftingTable;

View file

@ -1,11 +1,32 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.client.gui.autocrafting; package techreborn.client.gui.autocrafting;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.GuiButtonToggle; import net.minecraft.client.gui.GuiButtonToggle;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.recipebook.GuiRecipeBook; import net.minecraft.client.gui.recipebook.GuiRecipeBook;
import net.minecraft.client.gui.recipebook.RecipeList; import net.minecraft.client.gui.recipebook.RecipeList;
import net.minecraft.inventory.Container;
import net.minecraft.inventory.InventoryCrafting; import net.minecraft.inventory.InventoryCrafting;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;

View file

@ -69,8 +69,6 @@ public class GuiSideConfig extends GuiBase {
@Override @Override
protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) { protected void drawGuiContainerBackgroundLayer(final float f, final int mouseX, final int mouseY) {
super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY); super.drawGuiContainerBackgroundLayer(f, mouseX, mouseY);
final GuiBase.Layer layer = GuiBase.Layer.BACKGROUND;
} }
@Override @Override

View file

@ -59,7 +59,6 @@ public class RenderNukePrimed extends Render<EntityNukePrimed> {
float f1 = 1.0F + f * 0.3F; float f1 = 1.0F + f * 0.3F;
GlStateManager.scale(f1, f1, f1); GlStateManager.scale(f1, f1, f1);
} }
float f2 = (1.0F - ((float) entity.fuse - partialTicks + 1.0F) / 100.0F) * 0.8F;
this.bindEntityTexture(entity); this.bindEntityTexture(entity);
GlStateManager.translate(-0.5F, -0.5F, 0.5F); GlStateManager.translate(-0.5F, -0.5F, 0.5F);
blockrendererdispatcher.renderBlockBrightness(ModBlocks.NUKE.getDefaultState(), blockrendererdispatcher.renderBlockBrightness(ModBlocks.NUKE.getDefaultState(),

View file

@ -62,7 +62,7 @@ public class CompatManager {
} }
public void registerCompact(Class<? extends ICompatModule> moduleClass, boolean config, Object... objs) { public void registerCompact(Class<? extends ICompatModule> moduleClass, boolean config, Object... objs) {
boolean shouldLoad = true; //boolean shouldLoad = true;
//TODO config //TODO config
// if (config) { // if (config) {
// shouldLoad = ConfigTechReborn.config // shouldLoad = ConfigTechReborn.config

View file

@ -133,6 +133,7 @@ public class CTFusionReactor {
} }
} }
@SuppressWarnings("unused")
private static class RemoveBottomInput implements IAction { private static class RemoveBottomInput implements IAction {
private final IIngredient output; private final IIngredient output;
List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>(); List<FusionReactorRecipe> removedRecipes = new ArrayList<FusionReactorRecipe>();

View file

@ -1,3 +1,27 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.compat.thermalexpansion; package techreborn.compat.thermalexpansion;
import cofh.api.util.ThermalExpansionHelper; import cofh.api.util.ThermalExpansionHelper;

View file

@ -48,9 +48,9 @@ public class BehaviorDispenseScrapbox extends BehaviorDefaultDispenseItem {
if (dispenseScrapboxes) { if (dispenseScrapboxes) {
int random = source.getWorld().rand.nextInt(ScrapboxList.stacks.size()); int random = source.getWorld().rand.nextInt(ScrapboxList.stacks.size());
ItemStack out = ScrapboxList.stacks.get(random).copy(); ItemStack out = ScrapboxList.stacks.get(random).copy();
float xOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; /* float xOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F;
float yOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; float yOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F;
float zOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F; float zOffset = source.getWorld().rand.nextFloat() * 0.8F + 0.1F;*/
stack.splitStack(1); stack.splitStack(1);
TileEntityDispenser tile = source.getBlockTileEntity(); TileEntityDispenser tile = source.getBlockTileEntity();

View file

@ -42,9 +42,10 @@ import java.util.List;
public class TRRecipeHandler { public class TRRecipeHandler {
@SuppressWarnings("rawtypes")
private static List<IForgeRegistryEntry> hiddenEntrys = new ArrayList<>(); private static List<IForgeRegistryEntry> hiddenEntrys = new ArrayList<>();
public static void hideEntry(IForgeRegistryEntry entry) { public static void hideEntry(IForgeRegistryEntry<?> entry) {
hiddenEntrys.add(entry); hiddenEntrys.add(entry);
} }

View file

@ -61,6 +61,7 @@ import techreborn.tiles.multiblock.*;
import techreborn.tiles.storage.TileHighVoltageSU; import techreborn.tiles.storage.TileHighVoltageSU;
import techreborn.tiles.storage.TileLowVoltageSU; import techreborn.tiles.storage.TileLowVoltageSU;
import techreborn.tiles.storage.TileMediumVoltageSU; import techreborn.tiles.storage.TileMediumVoltageSU;
import techreborn.tiles.storage.TileAdjustableSU;
import techreborn.tiles.teir1.*; import techreborn.tiles.teir1.*;
import techreborn.tiles.transformers.TileHVTransformer; import techreborn.tiles.transformers.TileHVTransformer;
import techreborn.tiles.transformers.TileLVTransformer; import techreborn.tiles.transformers.TileLVTransformer;

View file

@ -1,3 +1,27 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.init.recipes; package techreborn.init.recipes;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;

View file

@ -40,7 +40,7 @@ import net.minecraftforge.fml.relauncher.Side;
import net.minecraftforge.fml.relauncher.SideOnly; import net.minecraftforge.fml.relauncher.SideOnly;
import reborncore.common.powerSystem.PowerSystem; import reborncore.common.powerSystem.PowerSystem;
import techreborn.init.ModBlocks; import techreborn.init.ModBlocks;
import techreborn.tiles.TileAdjustableSU; import techreborn.tiles.storage.TileAdjustableSU;
import java.util.List; import java.util.List;
@ -69,8 +69,6 @@ public class ItemBlockAdjustableSU extends ItemBlock {
} }
if (world.getBlockState(pos).getBlock() == block) { if (world.getBlockState(pos).getBlock() == block) {
world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack); world.getBlockState(pos).getBlock().onBlockPlacedBy(world, pos, newState, player, stack);
// world.getBlockState(pos).getBlock().onPostBlockPlaced(world, x,
// y, z, metadata);
} }
if (!stack.isEmpty() && stack.hasTagCompound()) { if (!stack.isEmpty() && stack.hasTagCompound()) {
((TileAdjustableSU) world.getTileEntity(pos)) ((TileAdjustableSU) world.getTileEntity(pos))

View file

@ -33,7 +33,7 @@ import net.minecraft.util.*;
import net.minecraft.util.math.BlockPos; import net.minecraft.util.math.BlockPos;
import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.DimensionManager; import net.minecraftforge.common.DimensionManager;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@ -81,13 +81,13 @@ public class ItemFrequencyTransmitter extends ItemTR {
if (!world.isRemote) { if (!world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " X: " + TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " X: " +
TextFormatting.GOLD + pos.getX() + TextFormatting.GOLD + pos.getX() +
TextFormatting.GRAY + " Y: " + TextFormatting.GRAY + " Y: " +
TextFormatting.GOLD + pos.getY() + TextFormatting.GOLD + pos.getY() +
TextFormatting.GRAY + " Z: " + TextFormatting.GRAY + " Z: " +
TextFormatting.GOLD + pos.getZ() + TextFormatting.GOLD + pos.getZ() +
TextFormatting.GRAY + " " + I18n.translateToLocal("techreborn.message.in") + " " + TextFormatting.GRAY + " " + I18n.format("techreborn.message.in") + " " +
TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension()) TextFormatting.GOLD + DimensionManager.getProviderType(world.provider.getDimension())
.getName() + " (" + world.provider.getDimension() + ")")); .getName() + " (" + world.provider.getDimension() + ")"));
} }
@ -102,8 +102,8 @@ public class ItemFrequencyTransmitter extends ItemTR {
stack.setTagCompound(null); stack.setTagCompound(null);
if (!world.isRemote) { if (!world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.freqTransmitterID, new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.coordsHaveBeen") + " " TextFormatting.GRAY + I18n.format("techreborn.message.coordsHaveBeen") + " "
+ TextFormatting.GOLD + I18n.translateToLocal("techreborn.message.cleared"))); + TextFormatting.GOLD + I18n.format("techreborn.message.cleared")));
} }
} }
@ -123,7 +123,7 @@ public class ItemFrequencyTransmitter extends ItemTR {
list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName()); list.add(TextFormatting.DARK_GRAY + DimensionManager.getProviderType(dim).getName());
} else { } else {
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.noCoordsSet")); list.add(TextFormatting.GRAY + I18n.format("techreborn.message.noCoordsSet"));
} }
} }
@ -145,7 +145,7 @@ public class ItemFrequencyTransmitter extends ItemTR {
int coordDim = stack.getTagCompound().getInteger("dim"); int coordDim = stack.getTagCompound().getInteger("dim");
text = grey + "X: " + gold + coordX + grey + " Y: " + gold + coordY + grey + " Z: " + gold + coordZ + grey + " Dim: " + gold + DimensionManager.getProviderType(coordDim).getName() + " (" + coordDim + ")"; text = grey + "X: " + gold + coordX + grey + " Y: " + gold + coordY + grey + " Z: " + gold + coordZ + grey + " Dim: " + gold + DimensionManager.getProviderType(coordDim).getName() + " (" + coordDim + ")";
} else { } else {
text = grey + I18n.translateToLocal("techreborn.message.noCoordsSet"); text = grey + I18n.format("techreborn.message.noCoordsSet");
} }
} }
return text; return text;

View file

@ -34,9 +34,6 @@ import techreborn.events.TRRecipeHandler;
*/ */
public class ItemTRArmour extends ItemArmor { public class ItemTRArmour extends ItemArmor {
private ArmorMaterial material = ArmorMaterial.LEATHER;
private EntityEquipmentSlot slot = EntityEquipmentSlot.HEAD;
public ItemTRArmour(ArmorMaterial material, EntityEquipmentSlot slot) { public ItemTRArmour(ArmorMaterial material, EntityEquipmentSlot slot) {
super(material, material.getDamageReductionAmount(slot), slot); super(material, material.getDamageReductionAmount(slot), slot);
if (slot == EntityEquipmentSlot.HEAD) if (slot == EntityEquipmentSlot.HEAD)

View file

@ -59,7 +59,6 @@ public class ItemCloakingDevice extends ItemTR implements IEnergyItemInfo, IEner
public static int MaxCharge = ConfigTechReborn.CloakingDeviceCharge; public static int MaxCharge = ConfigTechReborn.CloakingDeviceCharge;
public static int Limit = 100; public static int Limit = 100;
public static boolean isActive; public static boolean isActive;
private int armorType = 1;
public ItemCloakingDevice() { public ItemCloakingDevice() {
setUnlocalizedName("techreborn.cloakingdevice"); setUnlocalizedName("techreborn.cloakingdevice");

View file

@ -122,7 +122,6 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo, IEne
return transferLimit; return transferLimit;
} }
@SuppressWarnings({ "rawtypes", "unchecked" })
@SideOnly(Side.CLIENT) @SideOnly(Side.CLIENT)
@Override @Override
public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) { public void getSubItems(CreativeTabs par2CreativeTabs, NonNullList<ItemStack> itemList) {

View file

@ -40,7 +40,7 @@ import net.minecraft.nbt.NBTTagCompound;
import net.minecraft.util.*; import net.minecraft.util.*;
import net.minecraft.util.text.TextComponentString; import net.minecraft.util.text.TextComponentString;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.world.World; import net.minecraft.world.World;
import net.minecraftforge.common.capabilities.ICapabilityProvider; import net.minecraftforge.common.capabilities.ICapabilityProvider;
import net.minecraftforge.fml.relauncher.Side; import net.minecraftforge.fml.relauncher.Side;
@ -141,9 +141,9 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) { public void addInformation(ItemStack stack, EntityPlayer player, List list, boolean par4) {
if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) { if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) {
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberInactive")); list.add(TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberInactive"));
} else { } else {
list.add(TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberActive")); list.add(TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberActive"));
} }
} }
@ -154,9 +154,9 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
if (player.isSneaking()) { if (player.isSneaking()) {
if (!PoweredItem.canUseEnergy(this.cost, stack)) { if (!PoweredItem.canUseEnergy(this.cost, stack)) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberEnergyErrorTo") + " " TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyErrorTo") + " "
+ TextFormatting.GOLD + I18n + TextFormatting.GOLD + I18n
.translateToLocal("techreborn.message.nanosaberActivate"))); .format("techreborn.message.nanosaberActivate")));
} else { } else {
if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) { if (stack.getTagCompound() == null || !stack.getTagCompound().getBoolean("isActive")) {
if (stack.getTagCompound() == null) { if (stack.getTagCompound() == null) {
@ -165,17 +165,17 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
stack.getTagCompound().setBoolean("isActive", true); stack.getTagCompound().setBoolean("isActive", true);
if (world.isRemote) { if (world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " " TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " "
+ TextFormatting.GOLD + I18n + TextFormatting.GOLD + I18n
.translateToLocal("techreborn.message.nanosaberActive"))); .format("techreborn.message.nanosaberActive")));
} }
} else { } else {
stack.getTagCompound().setBoolean("isActive", false); stack.getTagCompound().setBoolean("isActive", false);
if (world.isRemote) { if (world.isRemote) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.setTo") + " " TextFormatting.GRAY + I18n.format("techreborn.message.setTo") + " "
+ TextFormatting.GOLD + I18n + TextFormatting.GOLD + I18n
.translateToLocal("techreborn.message.nanosaberInactive"))); .format("techreborn.message.nanosaberInactive")));
} }
} }
} }
@ -188,9 +188,9 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo, IEnergy
public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) { public void onUpdate(ItemStack stack, World worldIn, Entity entityIn, int itemSlot, boolean isSelected) {
if (stack.getTagCompound() != null && stack.getTagCompound().getBoolean("isActive") && !PoweredItem.canUseEnergy(cost, stack)) { if (stack.getTagCompound() != null && stack.getTagCompound().getBoolean("isActive") && !PoweredItem.canUseEnergy(cost, stack)) {
ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString( ChatUtils.sendNoSpamMessages(MessageIDs.nanosaberID, new TextComponentString(
TextFormatting.GRAY + I18n.translateToLocal("techreborn.message.nanosaberEnergyError") + " " TextFormatting.GRAY + I18n.format("techreborn.message.nanosaberEnergyError") + " "
+ TextFormatting.GOLD + I18n + TextFormatting.GOLD + I18n
.translateToLocal("techreborn.message.nanosaberDeactivating"))); .format("techreborn.message.nanosaberDeactivating")));
stack.getTagCompound().setBoolean("isActive", false); stack.getTagCompound().setBoolean("isActive", false);
} }
} }

View file

@ -31,7 +31,7 @@ import net.minecraft.util.ActionResult;
import net.minecraft.util.EnumActionResult; import net.minecraft.util.EnumActionResult;
import net.minecraft.util.EnumHand; import net.minecraft.util.EnumHand;
import net.minecraft.util.text.TextFormatting; import net.minecraft.util.text.TextFormatting;
import net.minecraft.util.text.translation.I18n; import net.minecraft.client.resources.I18n;
import net.minecraft.world.World; import net.minecraft.world.World;
import techreborn.Core; import techreborn.Core;
import techreborn.client.EGui; import techreborn.client.EGui;
@ -58,6 +58,6 @@ public class ItemTechManual extends ItemTR {
@Override @Override
public void addInformation(final ItemStack stack, final World world, final List<String> tooltip, ITooltipFlag flag) { public void addInformation(final ItemStack stack, final World world, final List<String> tooltip, ITooltipFlag flag) {
tooltip.add(TextFormatting.RED + I18n.translateToLocal("tooltip.wip")); tooltip.add(TextFormatting.RED + I18n.format("tooltip.wip"));
} }
} }

View file

@ -28,7 +28,7 @@ import net.minecraft.util.math.BlockPos;
import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; import net.minecraftforge.fml.common.network.simpleimpl.MessageContext;
import reborncore.common.network.ExtendedPacketBuffer; import reborncore.common.network.ExtendedPacketBuffer;
import reborncore.common.network.INetworkPacket; import reborncore.common.network.INetworkPacket;
import techreborn.tiles.TileAdjustableSU; import techreborn.tiles.storage.TileAdjustableSU;
import java.io.IOException; import java.io.IOException;

View file

@ -1,3 +1,27 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.packets; package techreborn.packets;
import net.minecraft.item.crafting.IRecipe; import net.minecraft.item.crafting.IRecipe;

View file

@ -1,3 +1,27 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2017 TechReborn
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*/
package techreborn.tiles; package techreborn.tiles;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;

View file

@ -102,13 +102,13 @@ public class TileRollingMachine extends TilePowerAcceptor
} }
@Override @Override
public void updateEntity() { public void update() {
super.updateEntity(); super.update();
this.charge(2); this.charge(2);
if (!this.world.isRemote) { if (!this.world.isRemote) {
this.currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world); this.currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world);
if (!this.currentRecipe.isEmpty() && this.canMake()) { if (!this.currentRecipe.isEmpty() && this.canMake()) {
if (this.tickTime >= this.runTime) { if (this.tickTime >= TileRollingMachine.runTime) {
this.currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world); this.currentRecipe = RollingMachineRecipe.instance.findMatchingRecipe(this.craftMatrix, this.world);
if (!this.currentRecipe.isEmpty()) { if (!this.currentRecipe.isEmpty()) {
boolean hasCrafted = false; boolean hasCrafted = false;
@ -136,7 +136,7 @@ public class TileRollingMachine extends TilePowerAcceptor
} }
} }
if (!this.currentRecipe.isEmpty()) { if (!this.currentRecipe.isEmpty()) {
if (this.canUseEnergy(energyPerTick) && this.tickTime < this.runTime) { if (this.canUseEnergy(energyPerTick) && this.tickTime < TileRollingMachine.runTime) {
this.useEnergy(energyPerTick); this.useEnergy(energyPerTick);
this.tickTime++; this.tickTime++;
} }
@ -225,10 +225,10 @@ public class TileRollingMachine extends TilePowerAcceptor
} }
public int getBurnTimeRemainingScaled(final int scale) { public int getBurnTimeRemainingScaled(final int scale) {
if (this.tickTime == 0 || this.runTime == 0) { if (this.tickTime == 0 || TileRollingMachine.runTime == 0) {
return 0; return 0;
} }
return this.tickTime * scale / this.runTime; return this.tickTime * scale / TileRollingMachine.runTime;
} }
@Override @Override

View file

@ -22,7 +22,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package techreborn.tiles; package techreborn.tiles.storage;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.item.ItemStack; import net.minecraft.item.ItemStack;
@ -57,8 +57,8 @@ public class TileAdjustableSU extends TilePowerAcceptor implements IToolDrop {
} }
@Override @Override
public void updateEntity() { public void update() {
super.updateEntity(); super.update();
if (ticks == 100) { if (ticks == 100) {
euChange = -1; euChange = -1;
ticks = 0; ticks = 0;

View file

@ -22,7 +22,7 @@
* SOFTWARE. * SOFTWARE.
*/ */
package techreborn.tiles; package techreborn.tiles.teir1;
import net.minecraft.entity.player.EntityPlayer; import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.inventory.ISidedInventory; import net.minecraft.inventory.ISidedInventory;