This commit is contained in:
modmuss50 2018-07-20 22:31:20 +01:00
parent 389b716880
commit f5c6b59ebd
No known key found for this signature in database
GPG key ID: 773D17BE8BF49C82
79 changed files with 163 additions and 204 deletions

View file

@ -43,8 +43,8 @@ if (ENV.BUILD_NUMBER) {
}
minecraft {
version = "1.12.2-14.23.4.2705"
mappings = "snapshot_20171003"
version = "1.12.2-14.23.4.2739"
mappings = "snapshot_20180720"
replace "@MODVERSION@", project.version
useDepAts = true
runDir = "run"

View file

@ -69,12 +69,12 @@ public class RollingMachineRecipe {
public static ResourceLocation getNameForRecipe(ItemStack output) {
ModContainer activeContainer = Loader.instance().activeModContainer();
ResourceLocation baseLoc = new ResourceLocation(activeContainer.getModId(), output.getItem().getRegistryName().getResourcePath());
ResourceLocation baseLoc = new ResourceLocation(activeContainer.getModId(), output.getItem().getRegistryName().getPath());
ResourceLocation recipeLoc = baseLoc;
int index = 0;
while (recipes.containsKey(recipeLoc)) {
index++;
recipeLoc = new ResourceLocation(activeContainer.getModId(), baseLoc.getResourcePath() + "_" + index);
recipeLoc = new ResourceLocation(activeContainer.getModId(), baseLoc.getPath() + "_" + index);
}
return recipeLoc;
}

View file

@ -63,7 +63,7 @@ public class BlockAlarm extends BaseTileBlock {
public BlockAlarm() {
super(Material.ROCK);
setUnlocalizedName("techreborn.alarm");
setTranslationKey("techreborn.alarm");
this.setDefaultState(this.blockState.getBaseState().withProperty(FACING, EnumFacing.NORTH).withProperty(ACTIVE, false));
this.bbs = GenBoundingBoxes(0.19, 0.81);
setCreativeTab(TechRebornCreativeTab.instance);
@ -144,7 +144,7 @@ public class BlockAlarm extends BaseTileBlock {
@Override
public IBlockState getStateFromMeta(int meta) {
Boolean active = (meta & 8) == 8;
EnumFacing facing = EnumFacing.getFront(meta & 7);
EnumFacing facing = EnumFacing.byIndex(meta & 7);
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active);
}

View file

@ -47,7 +47,7 @@ public class BlockComputerCube extends BlockMachineBase {
public BlockComputerCube() {
super();
this.setUnlocalizedName("techreborn.computercube");
this.setTranslationKey("techreborn.computercube");
setCreativeTab(TechRebornCreativeTab.instance);
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
}

View file

@ -58,7 +58,7 @@ public class BlockFlare extends BlockContainer {
public BlockFlare() {
super(Material.REDSTONE_LIGHT);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.flare");
setTranslationKey("techreborn.flare");
this.setDefaultState(this.blockState.getBaseState().withProperty(COLOR, EnumDyeColor.WHITE));
}
@ -104,7 +104,7 @@ public class BlockFlare extends BlockContainer {
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}

View file

@ -53,7 +53,7 @@ public class BlockNuke extends BaseBlock {
public BlockNuke() {
super(Material.TNT);
setUnlocalizedName("techreborn.nuke");
setTranslationKey("techreborn.nuke");
setCreativeTab(TechRebornCreativeTab.instance);
this.setDefaultState(this.blockState.getBaseState().withProperty(OVERLAY, false));
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this));
@ -70,7 +70,7 @@ public class BlockNuke extends BaseBlock {
}
@Override
public void onBlockDestroyedByExplosion(World worldIn, BlockPos pos, Explosion explosionIn) {
public void onExplosionDestroy(World worldIn, BlockPos pos, Explosion explosionIn) {
if (!worldIn.isRemote) {
EntityNukePrimed entitynukeprimed = new EntityNukePrimed(worldIn, (double) ((float) pos.getX() + 0.5F),
(double) pos.getY(), (double) ((float) pos.getZ() + 0.5F), explosionIn.getExplosivePlacedBy());
@ -80,7 +80,7 @@ public class BlockNuke extends BaseBlock {
}
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entityIn) {
if (!worldIn.isRemote && entityIn instanceof EntityArrow) {
EntityArrow entityarrow = (EntityArrow) entityIn;

View file

@ -61,7 +61,7 @@ public class BlockReinforcedGlass extends BlockGlass {
@Override
@SideOnly(Side.CLIENT)
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}

View file

@ -72,9 +72,9 @@ public class BlockRubberLeaves extends BlockLeaves {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
if(!fancyLeaves()){
return super.getBlockLayer();
return super.getRenderLayer();
}
return BlockRenderLayer.CUTOUT_MIPPED;
}

View file

@ -91,7 +91,7 @@ public class BlockRubberLog extends Block {
hasSap = true;
tempMeta -= 3;
}
EnumFacing facing = EnumFacing.getHorizontal(tempMeta);
EnumFacing facing = EnumFacing.byHorizontalIndex(tempMeta);
return this.getDefaultState().withProperty(SAP_SIDE, facing).withProperty(HAS_SAP, hasSap);
}
@ -153,7 +153,7 @@ public class BlockRubberLog extends Block {
super.updateTick(worldIn, pos, state, rand);
if (!state.getValue(HAS_SAP)) {
if (rand.nextInt(50) == 0) {
EnumFacing facing = EnumFacing.getHorizontal(rand.nextInt(4));
EnumFacing facing = EnumFacing.byHorizontalIndex(rand.nextInt(4));
if (worldIn.getBlockState(pos.down()).getBlock() == this
&& worldIn.getBlockState(pos.up()).getBlock() == this) {
worldIn.setBlockState(pos, state.withProperty(HAS_SAP, true).withProperty(SAP_SIDE, facing));
@ -177,7 +177,7 @@ public class BlockRubberLog extends Block {
if ((capEnergy != null && capEnergy.getEnergyStored() > 20) || stack.getItem() instanceof ItemTreeTap) {
if (state.getValue(HAS_SAP) && state.getValue(SAP_SIDE) == side) {
worldIn.setBlockState(pos,
state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.getHorizontal(0)));
state.withProperty(HAS_SAP, false).withProperty(SAP_SIDE, EnumFacing.byHorizontalIndex(0)));
worldIn.playSound(null, pos.getX(), pos.getY(), pos.getZ(), ModSounds.SAP_EXTRACT, SoundCategory.BLOCKS,
0.6F, 1F);
if (!worldIn.isRemote) {

View file

@ -113,8 +113,8 @@ public abstract class BlockRubberPlankSlab extends BlockSlab {
}
@Override
public String getUnlocalizedName(int meta) {
return super.getUnlocalizedName();
public String getTranslationKey(int meta) {
return super.getTranslationKey();
}
@Override

View file

@ -38,7 +38,7 @@ import java.util.List;
public class BlockSupercondensator extends BlockMachineBase {
public BlockSupercondensator(Material material) {
super();
setUnlocalizedName("techreborn.supercondensator");
setTranslationKey("techreborn.supercondensator");
setCreativeTab(TechRebornCreativeTab.instance);
}

View file

@ -204,7 +204,7 @@ public class BlockCable extends BlockContainer {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@ -285,8 +285,8 @@ public class BlockCable extends BlockContainer {
}
@Override
public void onEntityCollidedWithBlock(World worldIn, BlockPos pos, IBlockState state, Entity entity) {
super.onEntityCollidedWithBlock(worldIn, pos, state, entity);
public void onEntityCollision(World worldIn, BlockPos pos, IBlockState state, Entity entity) {
super.onEntityCollision(worldIn, pos, state, entity);
if (state.getValue(TYPE).canKill && entity instanceof EntityLivingBase) {
TileEntity tileEntity = worldIn.getTileEntity(pos);
if (tileEntity != null && tileEntity instanceof TileCable) {

View file

@ -38,7 +38,7 @@ public class BlockFluidTechReborn extends BlockFluidBase {
public BlockFluidTechReborn(Fluid fluid, Material material, String name) {
super(fluid, material);
setUnlocalizedName(name);
setTranslationKey(name);
this.name = name;
}

View file

@ -134,7 +134,7 @@ public class BlockLamp extends BaseTileBlock {
}
@Override
public BlockRenderLayer getBlockLayer() {
public BlockRenderLayer getRenderLayer() {
return BlockRenderLayer.CUTOUT;
}
@ -197,7 +197,7 @@ public class BlockLamp extends BaseTileBlock {
@Override
public IBlockState getStateFromMeta(int meta) {
Boolean active = (meta&8)==8;
EnumFacing facing = EnumFacing.getFront(meta&7);
EnumFacing facing = EnumFacing.byIndex(meta&7);
return this.getDefaultState().withProperty(FACING, facing).withProperty(ACTIVE, active);
}
}

View file

@ -41,7 +41,7 @@ public class BlockAutoCraftingTable extends BlockMachineBase {
public BlockAutoCraftingTable() {
super(true);
setUnlocalizedName("techreborn.electriccraftingtable");
setTranslationKey("techreborn.electriccraftingtable");
setCreativeTab(TechRebornCreativeTab.instance);
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier1_machines"));
}

View file

@ -46,7 +46,7 @@ public class BlockDigitalChest extends BlockMachineBase {
public BlockDigitalChest() {
super();
this.setUnlocalizedName("techreborn.digitalChest");
this.setTranslationKey("techreborn.digitalChest");
setCreativeTab(TechRebornCreativeTab.instance);
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier2_machines"));
}

View file

@ -46,7 +46,7 @@ public class BlockQuantumChest extends BlockMachineBase {
public BlockQuantumChest() {
super();
this.setUnlocalizedName("techreborn.quantumChest");
this.setTranslationKey("techreborn.quantumChest");
setCreativeTab(TechRebornCreativeTab.instance);
RebornModelRegistry.registerModel(new ModelCompound(ModInfo.MOD_ID, this, "machines/tier3_machines"));
}

View file

@ -61,7 +61,6 @@ public class RegisterItemJsons {
register(ModItems.MANUAL, "misc/manual");
register(ModItems.DEBUG, "misc/debug");
register(ModBlocks.RUBBER_SAPLING, "misc/rubber_sapling");
register(ModItems.MISSING_RECIPE_PLACEHOLDER, "misc/missing_recipe");
register(ModItems.STEEL_DRILL, "tool/steel_drill");
register(ModItems.DIAMOND_DRILL, "tool/diamond_drill");
@ -181,9 +180,9 @@ public class RegisterItemJsons {
protected ModelResourceLocation getModelResourceLocation(IBlockState state) {
Map<IProperty<?>, Comparable<?>> map = Maps.<IProperty<?>, Comparable<?>>newLinkedHashMap(state.getProperties());
if (state.getValue(BlockCable.TYPE).ordinal() <= 4) {
return new ModelResourceLocation(new ResourceLocation(ModBlocks.CABLE.getRegistryName().getResourceDomain(), ModBlocks.CABLE.getRegistryName().getResourcePath()) + "_thin", this.getPropertyString(map));
return new ModelResourceLocation(new ResourceLocation(ModBlocks.CABLE.getRegistryName().getNamespace(), ModBlocks.CABLE.getRegistryName().getPath()) + "_thin", this.getPropertyString(map));
}
return new ModelResourceLocation(new ResourceLocation(ModBlocks.CABLE.getRegistryName().getResourceDomain(), ModBlocks.CABLE.getRegistryName().getResourcePath()) + "_thick", this.getPropertyString(map));
return new ModelResourceLocation(new ResourceLocation(ModBlocks.CABLE.getRegistryName().getNamespace(), ModBlocks.CABLE.getRegistryName().getPath()) + "_thick", this.getPropertyString(map));
}
});
}
@ -197,7 +196,7 @@ public class RegisterItemJsons {
for (IProperty<?> iproperty : ignoredProperties) {
map.remove(iproperty);
}
return new ModelResourceLocation(new ResourceLocation(block.getRegistryName().getResourceDomain(), path + slash + block.getRegistryName().getResourcePath()), this.getPropertyString(map));
return new ModelResourceLocation(new ResourceLocation(block.getRegistryName().getNamespace(), path + slash + block.getRegistryName().getPath()), this.getPropertyString(map));
}
});
}
@ -230,7 +229,7 @@ public class RegisterItemJsons {
}
private static void registerBlockstate(Item i, int meta, String variant, String dir) {
ResourceLocation loc = new ResourceLocation("techreborn", dir + i.getRegistryName().getResourcePath());
ResourceLocation loc = new ResourceLocation("techreborn", dir + i.getRegistryName().getPath());
ModelLoader.setCustomModelResourceLocation(i, meta, new ModelResourceLocation(loc, "type=" + variant));
}

View file

@ -177,7 +177,7 @@ public class GuiBase extends GuiContainer {
}
protected void drawTitle() {
drawCentredString(I18n.format(tile.getBlockType().getUnlocalizedName() + ".name"), 6, 4210752, Layer.FOREGROUND);
drawCentredString(I18n.format(tile.getBlockType().getTranslationKey() + ".name"), 6, 4210752, Layer.FOREGROUND);
}
protected void drawCentredString(String string, int y, int colour, Layer layer) {

View file

@ -157,9 +157,9 @@ public class GuiBlastFurnace extends GuiBase {
// this.tile.getPos().getY(), this.tile.getPos().getZ(), this.tile.getWorld());
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
- EnumFacing.byIndex(this.tile.getFacingInt()).getXOffset() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
- EnumFacing.byIndex(this.tile.getFacingInt()).getZOffset() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -154,9 +154,9 @@ public class GuiDistillationTower extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = this.tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
- EnumFacing.byIndex(this.tile.getFacingInt()).getXOffset() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
- EnumFacing.byIndex(this.tile.getFacingInt()).getZOffset() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -134,9 +134,9 @@ public class GuiFluidReplicator extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
- EnumFacing.byIndex(this.tile.getFacingInt()).getXOffset() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
- EnumFacing.byIndex(this.tile.getFacingInt()).getZOffset() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -153,9 +153,9 @@ public class GuiIndustrialGrinder extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = this.tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
- EnumFacing.byIndex(this.tile.getFacingInt()).getXOffset() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
- EnumFacing.byIndex(this.tile.getFacingInt()).getZOffset() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -152,9 +152,9 @@ public class GuiIndustrialSawmill extends GuiBase {
ClientProxy.multiblockRenderEvent.parent = this.tile.getPos();
MultiblockRenderEvent.anchor = new BlockPos(
this.tile.getPos().getX()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetX() * 2,
- EnumFacing.byIndex(this.tile.getFacingInt()).getYOffset() * 2,
this.tile.getPos().getY() - 1, this.tile.getPos().getZ()
- EnumFacing.getFront(this.tile.getFacingInt()).getFrontOffsetZ() * 2);
- EnumFacing.byIndex(this.tile.getFacingInt()).getYOffset() * 2);
}
} else {
ClientProxy.multiblockRenderEvent.setMultiblock(null);

View file

@ -129,7 +129,7 @@ public class ModelDynamicCell implements IModel {
@Override
public boolean accepts(ResourceLocation modelLocation) {
return modelLocation.getResourceDomain().equals("techreborn") && modelLocation.getResourcePath().contains("dynamic_cell");
return modelLocation.getNamespace().equals("techreborn") && modelLocation.getNamespace().contains("dynamic_cell");
}
@Override

View file

@ -60,7 +60,7 @@ public class ModelHelper {
}
public static Reader getReaderForResource(ResourceLocation location) throws IOException {
ResourceLocation file = new ResourceLocation(location.getResourceDomain(), location.getResourcePath() + ".json");
ResourceLocation file = new ResourceLocation(location.getNamespace(), location.getPath() + ".json");
IResource iresource = Minecraft.getMinecraft().getResourceManager().getResource(file);
return new BufferedReader(new InputStreamReader(iresource.getInputStream(), Charsets.UTF_8));
}

View file

@ -86,7 +86,7 @@ public class FluidBlockModelHandler {
}
private static void registerFluidBlockModel(BlockFluidTechReborn block) {
String name = block.getUnlocalizedName().substring(5).toLowerCase();
String name = block.getTranslationKey().substring(5).toLowerCase();
Item item = Item.getItemFromBlock(block);
ModelResourceLocation location = new ModelResourceLocation(
new ResourceLocation(ModInfo.MOD_ID.toLowerCase(), "fluids"), name);

View file

@ -83,7 +83,7 @@ public class StackToolTipEvent {
try {
Block block = Block.getBlockFromItem(item);
if (block != null && (block instanceof BlockContainer || block instanceof ITileEntityProvider)
&& block.getRegistryName().getResourceDomain().contains("techreborn")) {
&& block.getRegistryName().getNamespace().contains("techreborn")) {
TileEntity tile = block.createTileEntity(Minecraft.getMinecraft().world,
block.getStateFromMeta(event.getItemStack().getItemDamage()));
if (tile instanceof IListInfoProvider) {

View file

@ -80,10 +80,10 @@ public class TRRecipeHandler {
if (recipe.getRegistryName() == null) {
return false;
}
if (!recipe.getRegistryName().getResourceDomain().equals(ModInfo.MOD_ID)) {
if (!recipe.getRegistryName().getNamespace().equals(ModInfo.MOD_ID)) {
return false;
}
if (!recipe.getRecipeOutput().getItem().getRegistryName().getResourceDomain().equals(ModInfo.MOD_ID)) {
if (!recipe.getRecipeOutput().getItem().getRegistryName().getNamespace().equals(ModInfo.MOD_ID)) {
return false;
}
if (hiddenEntrys.contains(recipe.getRecipeOutput().getItem())) {

View file

@ -393,7 +393,7 @@ public class ModBlocks {
*/
public static void registerBlock(Block block, String name) {
name = name.toLowerCase();
block.setUnlocalizedName(ModInfo.MOD_ID + ":" + name);
block.setTranslationKey(ModInfo.MOD_ID + ":" + name);
RebornRegistry.registerBlock(block, new ResourceLocation(ModInfo.MOD_ID, name));
}
@ -405,19 +405,19 @@ public class ModBlocks {
*/
public static void registerBlock(Block block, Class<? extends ItemBlock> itemclass, String name) {
name = name.toLowerCase();
block.setUnlocalizedName(ModInfo.MOD_ID + ":" + name);
block.setTranslationKey(ModInfo.MOD_ID + ":" + name);
RebornRegistry.registerBlock(block, itemclass, new ResourceLocation(ModInfo.MOD_ID, name));
}
public static void registerBlock(Block block, ItemBlock itemBlock, String name) {
name = name.toLowerCase();
block.setUnlocalizedName(ModInfo.MOD_ID + ":" + name);
block.setTranslationKey(ModInfo.MOD_ID + ":" + name);
RebornRegistry.registerBlock(block, itemBlock, new ResourceLocation(ModInfo.MOD_ID, name));
}
public static void registerBlockNoItem(Block block, String name) {
name = name.toLowerCase();
block.setUnlocalizedName(ModInfo.MOD_ID + ":" + name);
block.setTranslationKey(ModInfo.MOD_ID + ":" + name);
RebornRegistry.registerBlockNoItem(block, new ResourceLocation(ModInfo.MOD_ID, name));
}

View file

@ -140,178 +140,178 @@ public class ModFluids {
public static void init() {
FluidRegistry.registerFluid(BERYLLIUM);
BLOCK_BERYLLIUM = new BlockFluidTechReborn(BERYLLIUM, Material.WATER, "techreborn.berylium");
registerBlock(BLOCK_BERYLLIUM, ModInfo.MOD_ID + "_" + BLOCK_BERYLLIUM.getUnlocalizedName().substring(5));
registerBlock(BLOCK_BERYLLIUM, ModInfo.MOD_ID + "_" + BLOCK_BERYLLIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(CALCIUM);
BLOCK_CALCIUM = new BlockFluidTechReborn(CALCIUM, Material.WATER, "techreborn.calcium");
registerBlock(BLOCK_CALCIUM,
ModInfo.MOD_ID + "_" + BLOCK_CALCIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_CALCIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(CALCIUM_CARBONATE);
BLOCK_CALCIUM_CARBONATE = new BlockFluidTechReborn(CALCIUM_CARBONATE, Material.WATER,
"techreborn.calciumcarbonate");
registerBlock(BLOCK_CALCIUM_CARBONATE,
ModInfo.MOD_ID + "_" + BLOCK_CALCIUM_CARBONATE.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_CALCIUM_CARBONATE.getTranslationKey().substring(5));
FluidRegistry.registerFluid(CHLORITE);
BLOCK_CHLORITE = new BlockFluidTechReborn(CHLORITE, Material.WATER, "techreborn.chlorite");
registerBlock(BLOCK_CHLORITE,
ModInfo.MOD_ID + "_" + BLOCK_CHLORITE.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_CHLORITE.getTranslationKey().substring(5));
FluidRegistry.registerFluid(DEUTERIUM);
BLOCK_DEUTERIUM = new BlockFluidTechReborn(DEUTERIUM, Material.WATER, "techreborn.deuterium");
registerBlock(BLOCK_DEUTERIUM,
ModInfo.MOD_ID + "_" + BLOCK_DEUTERIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_DEUTERIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(GLYCERYL);
BLOCK_GLYCERYL = new BlockFluidTechReborn(GLYCERYL, Material.WATER, "techreborn.glyceryl");
registerBlock(BLOCK_GLYCERYL,
ModInfo.MOD_ID + "_" + BLOCK_GLYCERYL.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_GLYCERYL.getTranslationKey().substring(5));
FluidRegistry.registerFluid(HELIUM);
BLOCK_HELIUM = new BlockFluidTechReborn(HELIUM, Material.WATER, "techreborn.helium");
registerBlock(BLOCK_HELIUM,
ModInfo.MOD_ID + "_" + BLOCK_HELIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_HELIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(HELIUM_3);
BLOCK_HELIUM_3 = new BlockFluidTechReborn(HELIUM_3, Material.WATER, "techreborn.helium3");
registerBlock(BLOCK_HELIUM_3,
ModInfo.MOD_ID + "_" + BLOCK_HELIUM_3.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_HELIUM_3.getTranslationKey().substring(5));
FluidRegistry.registerFluid(HELIUMPLASMA);
BLOCK_HELIUMPLASMA = new BlockFluidTechReborn(HELIUMPLASMA, Material.WATER, "techreborn.heliumplasma");
registerBlock(BLOCK_HELIUMPLASMA,
ModInfo.MOD_ID + "_" + BLOCK_HELIUMPLASMA.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_HELIUMPLASMA.getTranslationKey().substring(5));
FluidRegistry.registerFluid(HYDROGEN);
BLOCK_HYDROGEN = new BlockFluidTechReborn(HYDROGEN, Material.WATER, "techreborn.hydrogen");
registerBlock(BLOCK_HYDROGEN,
ModInfo.MOD_ID + "_" + BLOCK_HYDROGEN.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_HYDROGEN.getTranslationKey().substring(5));
FluidRegistry.registerFluid(LITHIUM);
BLOCK_LITHIUM = new BlockFluidTechReborn(LITHIUM, Material.WATER, "techreborn.lithium");
registerBlock(BLOCK_LITHIUM,
ModInfo.MOD_ID + "_" + BLOCK_LITHIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_LITHIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(MERCURY);
BLOCK_MERCURY = new BlockFluidTechReborn(MERCURY, Material.WATER, "techreborn.mercury");
registerBlock(BLOCK_MERCURY,
ModInfo.MOD_ID + "_" + BLOCK_MERCURY.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_MERCURY.getTranslationKey().substring(5));
FluidRegistry.registerFluid(METHANE);
BLOCK_METHANE = new BlockFluidTechReborn(METHANE, Material.WATER, "techreborn.methane");
registerBlock(BLOCK_METHANE,
ModInfo.MOD_ID + "_" + BLOCK_METHANE.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_METHANE.getTranslationKey().substring(5));
FluidRegistry.registerFluid(NITROCOAL_FUEL);
BLOCK_NITROCOAL_FUEL = new BlockFluidTechReborn(NITROCOAL_FUEL, Material.WATER,
"techreborn.nitrocoalfuel");
registerBlock(BLOCK_NITROCOAL_FUEL,
ModInfo.MOD_ID + "_" + BLOCK_NITROCOAL_FUEL.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_NITROCOAL_FUEL.getTranslationKey().substring(5));
FluidRegistry.registerFluid(NITROFUEL);
BLOCK_NITROFUEL = new BlockFluidTechReborn(NITROFUEL, Material.WATER, "techreborn.nitrofuel");
registerBlock(BLOCK_NITROFUEL,
ModInfo.MOD_ID + "_" + BLOCK_NITROFUEL.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_NITROFUEL.getTranslationKey().substring(5));
FluidRegistry.registerFluid(NITROGEN);
BLOCK_NITROGEN = new BlockFluidTechReborn(NITROGEN, Material.WATER, "techreborn.nitrogen");
registerBlock(BLOCK_NITROGEN,
ModInfo.MOD_ID + "_" + BLOCK_NITROGEN.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_NITROGEN.getTranslationKey().substring(5));
FluidRegistry.registerFluid(NITROGENDIOXIDE);
BLOCK_NITROGENDIOXIDE = new BlockFluidTechReborn(NITROGENDIOXIDE, Material.WATER,
"techreborn.nitrogendioxide");
registerBlock(BLOCK_NITROGENDIOXIDE,
ModInfo.MOD_ID + "_" + BLOCK_NITROGENDIOXIDE.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_NITROGENDIOXIDE.getTranslationKey().substring(5));
FluidRegistry.registerFluid(POTASSIUM);
BLOCK_POTASSIUM = new BlockFluidTechReborn(POTASSIUM, Material.WATER, "techreborn.potassium");
registerBlock(BLOCK_POTASSIUM,
ModInfo.MOD_ID + "_" + BLOCK_POTASSIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_POTASSIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(SILICON);
BLOCK_SILICON = new BlockFluidTechReborn(SILICON, Material.WATER, "techreborn.silicon");
registerBlock(BLOCK_SILICON,
ModInfo.MOD_ID + "_" + BLOCK_SILICON.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_SILICON.getTranslationKey().substring(5));
FluidRegistry.registerFluid(SODIUM);
BLOCK_SODIUM = new BlockFluidTechReborn(SODIUM, Material.WATER, "techreborn.sodium");
registerBlock(BLOCK_SODIUM,
ModInfo.MOD_ID + "_" + BLOCK_SODIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_SODIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(SODIUMPERSULFATE);
BLOCK_SODIUMPERSULFATE = new BlockFluidTechReborn(SODIUMPERSULFATE, Material.WATER,
"techreborn.sodiumpersulfate");
registerBlock(BLOCK_SODIUMPERSULFATE,
ModInfo.MOD_ID + "_" + BLOCK_SODIUMPERSULFATE.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_SODIUMPERSULFATE.getTranslationKey().substring(5));
FluidRegistry.registerFluid(TRITIUM);
BLOCK_TRITIUM = new BlockFluidTechReborn(TRITIUM, Material.WATER, "techreborn.tritium");
registerBlock(BLOCK_TRITIUM,
ModInfo.MOD_ID + "_" + BLOCK_TRITIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_TRITIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(WOLFRAMIUM);
BLOCK_WOLFRAMIUM = new BlockFluidTechReborn(WOLFRAMIUM, Material.WATER, "techreborn.wolframium");
registerBlock(BLOCK_WOLFRAMIUM,
ModInfo.MOD_ID + "_" + BLOCK_WOLFRAMIUM.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_WOLFRAMIUM.getTranslationKey().substring(5));
FluidRegistry.registerFluid(CARBON);
BLOCK_CARBON = new BlockFluidTechReborn(CARBON, Material.WATER, "techreborn.carbon");
registerBlock(BLOCK_CARBON,
ModInfo.MOD_ID + "_" + BLOCK_CARBON.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_CARBON.getTranslationKey().substring(5));
FluidRegistry.registerFluid(CARBON_FIBER);
BLOCK_CARBON_FIBER = new BlockFluidTechReborn(CARBON_FIBER, Material.WATER, "techreborn.carbonfiber");
registerBlock(BLOCK_CARBON_FIBER,
ModInfo.MOD_ID + "_" + BLOCK_CARBON_FIBER.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_CARBON_FIBER.getTranslationKey().substring(5));
FluidRegistry.registerFluid(NITRO_CARBON);
BLOCK_NITRO_CARBON = new BlockFluidTechReborn(NITRO_CARBON, Material.WATER, "techreborn.nitrocarbon");
registerBlock(BLOCK_NITRO_CARBON,
ModInfo.MOD_ID + "_" + BLOCK_NITRO_CARBON.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_NITRO_CARBON.getTranslationKey().substring(5));
FluidRegistry.registerFluid(SULFUR);
BLOCK_SULFUR = new BlockFluidTechReborn(SULFUR, Material.WATER, "techreborn.sulfur");
registerBlock(BLOCK_SULFUR,
ModInfo.MOD_ID + "_" + BLOCK_SULFUR.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_SULFUR.getTranslationKey().substring(5));
FluidRegistry.registerFluid(SODIUM_SULFIDE);
BLOCK_SODIUM_SULFIDE = new BlockFluidTechReborn(SODIUM_SULFIDE, Material.WATER, "techreborn.sodiumsulfide");
registerBlock(BLOCK_SODIUM_SULFIDE,
ModInfo.MOD_ID + "_" + BLOCK_SODIUM_SULFIDE.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_SODIUM_SULFIDE.getTranslationKey().substring(5));
FluidRegistry.registerFluid(DIESEL);
BLOCK_DIESEL = new BlockFluidTechReborn(DIESEL, Material.WATER, "techreborn.diesel");
registerBlock(BLOCK_DIESEL,
ModInfo.MOD_ID + "_" + BLOCK_DIESEL.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_DIESEL.getTranslationKey().substring(5));
FluidRegistry.registerFluid(NITRO_DIESEL);
BLOCK_NITRO_DIESEL = new BlockFluidTechReborn(NITRO_DIESEL, Material.WATER, "techreborn.nitrodiesel");
registerBlock(BLOCK_NITRO_DIESEL,
ModInfo.MOD_ID + "_" + BLOCK_NITRO_DIESEL.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_NITRO_DIESEL.getTranslationKey().substring(5));
FluidRegistry.registerFluid(OIL);
BLOCK_OIL = new BlockFluidTechReborn(OIL, Material.WATER, "techreborn.oil");
registerBlock(BLOCK_OIL,
ModInfo.MOD_ID + "_" + BLOCK_OIL.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_OIL.getTranslationKey().substring(5));
FluidRegistry.registerFluid(SULFURIC_ACID);
BLOCK_SULFURIC_ACID = new BlockFluidTechReborn(SULFURIC_ACID, Material.WATER, "techreborn.sulfuricacid");
registerBlock(BLOCK_SULFURIC_ACID,
ModInfo.MOD_ID + "_" + BLOCK_SULFURIC_ACID.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_SULFURIC_ACID.getTranslationKey().substring(5));
FluidRegistry.registerFluid(COMPRESSED_AIR);
BLOCK_COMPRESSED_AIR = new BlockFluidTechReborn(COMPRESSED_AIR, Material.WATER, "techreborn.compressedair");
registerBlock(BLOCK_COMPRESSED_AIR,
ModInfo.MOD_ID + "_" + BLOCK_COMPRESSED_AIR.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_COMPRESSED_AIR.getTranslationKey().substring(5));
FluidRegistry.registerFluid(ELECTROLYZED_WATER);
BLOCK_ELECTROLYZED_WATER = new BlockFluidTechReborn(ELECTROLYZED_WATER, Material.WATER, "techreborn.electrolyzedwater");
registerBlock(BLOCK_ELECTROLYZED_WATER,
ModInfo.MOD_ID + "_" + BLOCK_ELECTROLYZED_WATER.getUnlocalizedName().substring(5));
ModInfo.MOD_ID + "_" + BLOCK_ELECTROLYZED_WATER.getTranslationKey().substring(5));
}
public static void registerBlock(Block block, String name) {

View file

@ -154,7 +154,6 @@ public class ModItems {
@Nullable
public static Item PERIDOT_BOOTS;
public static Item UPGRADES;
public static Item MISSING_RECIPE_PLACEHOLDER;
public static Item DEBUG;
public static DynamicCell CELL;
@ -326,9 +325,6 @@ public class ModItems {
CLOAKING_DEVICE = new ItemCloakingDevice();
registerItem(CLOAKING_DEVICE, "cloakingdevice");
MISSING_RECIPE_PLACEHOLDER = new ItemMissingRecipe().setUnlocalizedName("missingRecipe");
registerItem(MISSING_RECIPE_PLACEHOLDER, "missingRecipe");
DEBUG = new ItemDebugTool();
registerItem(DEBUG, "debug");

View file

@ -60,14 +60,14 @@ public class ModLoot {
@SubscribeEvent
public void lootLoad(LootTableLoadEvent event) {
if(!event.getName().getResourceDomain().equals("minecraft")) {
if(!event.getName().getNamespace().equals("minecraft")) {
return;
}
for (ResourceLocation lootTable : lootTables) {
if (event.getName().getResourcePath().equals(lootTable.getResourcePath())) {
if (event.getName().getNamespace().equals(lootTable.getPath())) {
event.getTable().addPool(getLootPool(lootTable));
if (Core.DEV_FEATURES) {
Core.logHelper.info("Loot pool injected into " + lootTable.getResourcePath());
Core.logHelper.info("Loot pool injected into " + lootTable.getPath());
}
}
}

View file

@ -381,7 +381,7 @@ public class ModRecipes {
public static ItemStack getOre(String name) {
if (OreDictionary.getOres(name).isEmpty()) {
return new ItemStack(ModItems.MISSING_RECIPE_PLACEHOLDER);
throw new RuntimeException("Failed to get ore: " + name);
}
return OreDictionary.getOres(name).get(0).copy();
}

View file

@ -167,8 +167,8 @@ public enum ModTileEntities {
@Override
public NBTTagCompound fixTagCompound(NBTTagCompound compound) {
ResourceLocation tileEntityLocation = new ResourceLocation(compound.getString("id"));
if(tileEntityLocation.getResourceDomain().equalsIgnoreCase("minecraft")){
Optional<ModTileEntities> tileData = getFromOldName(tileEntityLocation.getResourcePath());
if(tileEntityLocation.getNamespace().equalsIgnoreCase("minecraft")){
Optional<ModTileEntities> tileData = getFromOldName(tileEntityLocation.getPath());
tileData.ifPresent(modTileEntities -> compound.setString("id", modTileEntities.name.toString()));
}
return compound;

View file

@ -45,7 +45,7 @@ public class ItemBlockCable extends ItemBlock {
}
@Override
public String getUnlocalizedName(ItemStack stack) {
return super.getUnlocalizedName() + "." + EnumCableType.values()[stack.getItemDamage()].getName();
public String getTranslationKey(ItemStack stack) {
return super.getTranslationKey() + "." + EnumCableType.values()[stack.getItemDamage()].getName();
}
}

View file

@ -36,6 +36,6 @@ public class ItemBlockRubberSapling extends ItemBlock {
public ItemBlockRubberSapling(Block block) {
super(block);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.rubberSapling");
setTranslationKey("techreborn.rubberSapling");
}
}

View file

@ -61,7 +61,7 @@ public class DynamicCell extends Item {
public DynamicCell() {
super();
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.cell");
setTranslationKey("techreborn.cell");
setMaxStackSize(64);
TRRecipeHandler.hideEntry(this);
}

View file

@ -37,7 +37,7 @@ import techreborn.utils.TechRebornCreativeTab;
public class ItemDestructopack extends ItemTR {
public ItemDestructopack() {
this.setUnlocalizedName("techreborn.destructopack");
this.setTranslationKey("techreborn.destructopack");
this.setCreativeTab(TechRebornCreativeTab.instance);
}

View file

@ -46,7 +46,7 @@ public class ItemDusts extends ItemTR {
ModItems.META_PLACEHOLDER, "andesite", "diorite", "granite" };
public ItemDusts() {
setUnlocalizedName("techreborn.dust");
setTranslationKey("techreborn.dust");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
@ -91,13 +91,13 @@ public class ItemDusts extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -46,7 +46,7 @@ public class ItemDustsSmall extends ItemTR {
ModItems.META_PLACEHOLDER, "redstone", "glowstone", "andesite", "diorite", "granite" };
public ItemDustsSmall() {
setUnlocalizedName("techreborn.dustsmall");
setTranslationKey("techreborn.dustsmall");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
@ -71,13 +71,13 @@ public class ItemDustsSmall extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -51,7 +51,7 @@ import java.util.List;
public class ItemFrequencyTransmitter extends ItemTR {
public ItemFrequencyTransmitter() {
setUnlocalizedName("techreborn.frequencyTransmitter");
setTranslationKey("techreborn.frequencyTransmitter");
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
this.addPropertyOverride(new ResourceLocation("techreborn:coords"), new IItemPropertyGetter() {

View file

@ -40,7 +40,7 @@ public class ItemGems extends ItemTR {
public ItemGems() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.gem");
setTranslationKey("techreborn.gem");
setHasSubtypes(true);
TRRecipeHandler.hideEntry(this);
}
@ -61,13 +61,13 @@ public class ItemGems extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -44,7 +44,7 @@ public class ItemIngots extends ItemTR {
public ItemIngots() {
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.ingot");
setTranslationKey("techreborn.ingot");
TRRecipeHandler.hideEntry(this);
}
@ -70,13 +70,13 @@ public class ItemIngots extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -1,36 +0,0 @@
/*
* This file is part of TechReborn, licensed under the MIT License (MIT).
*
* Copyright (c) 2018 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.items;
import techreborn.events.TRRecipeHandler;
import techreborn.utils.TechRebornCreativeTab;
public class ItemMissingRecipe extends ItemTR {
public ItemMissingRecipe() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.missingrecipe");
TRRecipeHandler.hideEntry(this);
}
}

View file

@ -44,7 +44,7 @@ public class ItemNuggets extends ItemTR {
public ItemNuggets() {
setCreativeTab(TechRebornCreativeTab.instance);
setHasSubtypes(true);
setUnlocalizedName("techreborn.nuggets");
setTranslationKey("techreborn.nuggets");
TRRecipeHandler.hideEntry(this);
}
@ -64,13 +64,13 @@ public class ItemNuggets extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -50,7 +50,7 @@ public class ItemParts extends ItemTR {
public ItemParts() {
this.setCreativeTab(TechRebornCreativeTab.instance);
this.setHasSubtypes(true);
this.setUnlocalizedName("techreborn.part");
this.setTranslationKey("techreborn.part");
}
public static ItemStack getPartByName(String name, final int count) {
@ -84,13 +84,13 @@ public class ItemParts extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(final ItemStack itemStack) {
public String getTranslationKey(final ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= ItemParts.types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + ItemParts.types[meta];
return super.getTranslationKey() + "." + ItemParts.types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -43,7 +43,7 @@ public class ItemPlates extends ItemTR {
};
public ItemPlates() {
setUnlocalizedName("techreborn.plate");
setTranslationKey("techreborn.plate");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
@ -82,13 +82,13 @@ public class ItemPlates extends ItemTR {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -41,7 +41,7 @@ import java.util.List;
public class ItemScrapBox extends ItemTR {
public ItemScrapBox() {
setUnlocalizedName("techreborn.scrapbox");
setTranslationKey("techreborn.scrapbox");
setCreativeTab(TechRebornCreativeTab.instance);
}

View file

@ -30,6 +30,6 @@ public class ItemUUmatter extends ItemTR {
public ItemUUmatter() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.uuMatter");
setTranslationKey("techreborn.uuMatter");
}
}

View file

@ -66,7 +66,7 @@ public class ItemUpgrades extends ItemTR implements IUpgrade {
public static final String[] types = new String[] { "overclock", "transformer", "energy_storage"};
public ItemUpgrades() {
setUnlocalizedName("techreborn.upgrade");
setTranslationKey("techreborn.upgrade");
setHasSubtypes(true);
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(16);
@ -87,13 +87,13 @@ public class ItemUpgrades extends ItemTR implements IUpgrade {
@Override
// gets Unlocalized Name depending on meta data
public String getUnlocalizedName(ItemStack itemStack) {
public String getTranslationKey(ItemStack itemStack) {
int meta = itemStack.getItemDamage();
if (meta < 0 || meta >= types.length) {
meta = 0;
}
return super.getUnlocalizedName() + "." + types[meta];
return super.getTranslationKey() + "." + types[meta];
}
// Adds Dusts SubItems To Creative Tab

View file

@ -55,7 +55,7 @@ public class ItemLapotronPack extends ItemArmor implements IEnergyItemInfo {
public ItemLapotronPack() {
super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST);
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.lapotronpack");
setTranslationKey("techreborn.lapotronpack");
setMaxStackSize(1);
}

View file

@ -57,7 +57,7 @@ public class ItemLithiumBatpack extends ItemArmor implements IEnergyItemInfo {
public ItemLithiumBatpack() {
super(ItemArmor.ArmorMaterial.DIAMOND, 7, EntityEquipmentSlot.CHEST);
setMaxStackSize(1);
setUnlocalizedName("techreborn.lithiumbatpack");
setTranslationKey("techreborn.lithiumbatpack");
setCreativeTab(TechRebornCreativeTab.instance);
}

View file

@ -46,13 +46,13 @@ public class ItemTRArmour extends ItemArmor {
super(material, material.getDamageReductionAmount(slot), slot);
this.repairOreDict = repairOreDict;
if (slot == EntityEquipmentSlot.HEAD)
setUnlocalizedName(material.name().toLowerCase() + "Helmet");
setTranslationKey(material.name().toLowerCase() + "Helmet");
if (slot == EntityEquipmentSlot.CHEST)
setUnlocalizedName(material.name().toLowerCase() + "Chestplate");
setTranslationKey(material.name().toLowerCase() + "Chestplate");
if (slot == EntityEquipmentSlot.LEGS)
setUnlocalizedName(material.name().toLowerCase() + "Leggings");
setTranslationKey(material.name().toLowerCase() + "Leggings");
if (slot == EntityEquipmentSlot.FEET)
setUnlocalizedName(material.name().toLowerCase() + "Boots");
setTranslationKey(material.name().toLowerCase() + "Boots");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}

View file

@ -52,7 +52,7 @@ public class ItemBattery extends ItemTR implements IEnergyItemInfo {
super();
setMaxStackSize(1);
setMaxDamage(1);
setUnlocalizedName("techreborn." + name);
setTranslationKey("techreborn." + name);
this.name = name;
this.maxEnergy = maxEnergy;
this.maxTransfer = maxTransfer;

View file

@ -63,7 +63,7 @@ public class ItemChainsaw extends ItemAxe implements IEnergyItemInfo {
super(material);
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setUnlocalizedName(unlocalizedName);
setTranslationKey(unlocalizedName);
this.maxCharge = energyCapacity;
this.efficiency = unpoweredSpeed;

View file

@ -65,7 +65,7 @@ public class ItemCloakingDevice extends ItemTRArmour implements IEnergyItemInfo
public ItemCloakingDevice() {
super(Reference.CLOAKING_ARMOR, EntityEquipmentSlot.CHEST);
setUnlocalizedName("techreborn.cloakingdevice");
setTranslationKey("techreborn.cloakingdevice");
setMaxStackSize(1);
setCreativeTab(TechRebornCreativeTab.instance);
}

View file

@ -46,7 +46,7 @@ public class ItemDebugTool extends ItemTR {
public ItemDebugTool() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.debug");
setTranslationKey("techreborn.debug");
}
@Override

View file

@ -57,7 +57,7 @@ public class ItemDrill extends ItemPickaxe implements IEnergyItemInfo {
this.efficiency = efficiencyOnProperMaterial;
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setUnlocalizedName(unlocalizedName);
setTranslationKey(unlocalizedName);
this.maxCharge = energyCapacity;
this.unpoweredSpeed = unpoweredSpeed;
}

View file

@ -50,7 +50,7 @@ public class ItemElectricTreetap extends ItemTR implements IEnergyItemInfo {
public int cost = 20;
public ItemElectricTreetap() {
setUnlocalizedName("techreborn.electric_treetap");
setTranslationKey("techreborn.electric_treetap");
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
}

View file

@ -59,7 +59,7 @@ public class ItemJackhammer extends ItemPickaxe implements IEnergyItemInfo {
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(240);
setUnlocalizedName(unlocalizedName);
setTranslationKey(unlocalizedName);
this.maxCharge = energyCapacity;
}

View file

@ -70,7 +70,7 @@ public class ItemNanosaber extends ItemSword implements IEnergyItemInfo {
setNoRepair();
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setUnlocalizedName("techreborn.nanosaber");
setTranslationKey("techreborn.nanosaber");
this.addPropertyOverride(new ResourceLocation("techreborn:active"), new IItemPropertyGetter() {
@Override
@SideOnly(Side.CLIENT)

View file

@ -66,7 +66,7 @@ public class ItemOmniTool extends ItemPickaxe implements IEnergyItemInfo {
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
setMaxDamage(200);
setUnlocalizedName("techreborn.omniTool");
setTranslationKey("techreborn.omniTool");
}
// ItemPickaxe

View file

@ -59,7 +59,7 @@ public class ItemRockCutter extends ItemPickaxe implements IEnergyItemInfo {
public ItemRockCutter() {
super(ToolMaterial.DIAMOND);
setUnlocalizedName("techreborn.rockcutter");
setTranslationKey("techreborn.rockcutter");
setCreativeTab(TechRebornCreativeTab.instance);
setMaxStackSize(1);
efficiency = 16F;

View file

@ -41,7 +41,7 @@ public class ItemTRAxe extends ItemAxe {
public ItemTRAxe(ToolMaterial material, String repairOreDict) {
super(material, material.getAttackDamage() + 5.75F, (material.getAttackDamage() + 6.75F) * -0.344444F);
this.repairOreDict = repairOreDict;
setUnlocalizedName(material.name().toLowerCase() + "Axe");
setTranslationKey(material.name().toLowerCase() + "Axe");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}

View file

@ -43,7 +43,7 @@ public class ItemTRHoe extends ItemHoe {
public ItemTRHoe(ToolMaterial material, String repairOreDict) {
super(material);
this.repairOreDict = repairOreDict;
setUnlocalizedName(material.name().toLowerCase() + "Hoe");
setTranslationKey(material.name().toLowerCase() + "Hoe");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}

View file

@ -41,7 +41,7 @@ public class ItemTRPickaxe extends ItemPickaxe {
public ItemTRPickaxe(ToolMaterial material, String repairOreDict) {
super(material);
this.repairOreDict = repairOreDict;
setUnlocalizedName(material.name().toLowerCase() + "Pickaxe");
setTranslationKey(material.name().toLowerCase() + "Pickaxe");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}

View file

@ -41,7 +41,7 @@ public class ItemTRSpade extends ItemSpade {
public ItemTRSpade(ToolMaterial material, String repairOreDict) {
super(material);
this.repairOreDict = repairOreDict;
setUnlocalizedName(material.name().toLowerCase() + "Spade");
setTranslationKey(material.name().toLowerCase() + "Spade");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}

View file

@ -41,7 +41,7 @@ public class ItemTRSword extends ItemSword {
public ItemTRSword(ToolMaterial material, String repairOreDict) {
super(material);
this.repairOreDict = repairOreDict;
setUnlocalizedName(material.name().toLowerCase() + "Sword");
setTranslationKey(material.name().toLowerCase() + "Sword");
setCreativeTab(TechRebornCreativeTab.instance);
TRRecipeHandler.hideEntry(this);
}

View file

@ -39,7 +39,7 @@ public class ItemTechManual extends ItemTR {
public ItemTechManual() {
this.setCreativeTab(TechRebornCreativeTab.instance);
this.setUnlocalizedName("techreborn.manual");
this.setTranslationKey("techreborn.manual");
this.setMaxStackSize(1);
}

View file

@ -33,7 +33,7 @@ public class ItemTreeTap extends ItemTR {
public ItemTreeTap() {
setMaxStackSize(1);
setMaxDamage(20);
setUnlocalizedName("techreborn.treetap");
setTranslationKey("techreborn.treetap");
setCreativeTab(TechRebornCreativeTab.instance);
}

View file

@ -44,7 +44,7 @@ public class ItemWrench extends ItemTR implements IToolHandler {
public ItemWrench() {
setCreativeTab(TechRebornCreativeTab.instance);
setUnlocalizedName("techreborn.wrench");
setTranslationKey("techreborn.wrench");
setMaxStackSize(1);
}

View file

@ -325,7 +325,7 @@ public class MultiBlockCasing extends RectangularMultiblockControllerBase {
if (block.isAir(world.getBlockState(new BlockPos(x, y, z)), world, new BlockPos(x, y, z))) {
} else if (block.getUnlocalizedName().equals("tile.lava")) {
} else if (block.getTranslationKey().equals("tile.lava")) {
hasLava = true;
} else {
super.isBlockGoodForInterior(world, x, y, z);

View file

@ -42,10 +42,10 @@ public class TileLSUStorage extends TileLegacyMachineBase
network = new LesuNetwork();
network.addElement(this);
for (EnumFacing direction : EnumFacing.values()) {
if (world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(), y + direction.getFrontOffsetY(),
z + direction.getFrontOffsetZ())) instanceof TileLSUStorage) {
TileLSUStorage lesu = (TileLSUStorage) world.getTileEntity(new BlockPos(x + direction.getFrontOffsetX(),
y + direction.getFrontOffsetY(), z + direction.getFrontOffsetZ()));
if (world.getTileEntity(new BlockPos(x + direction.getXOffset(), y + direction.getYOffset(),
z + direction.getZOffset())) instanceof TileLSUStorage) {
TileLSUStorage lesu = (TileLSUStorage) world.getTileEntity(new BlockPos(x + direction.getXOffset(),
y + direction.getYOffset(), z + direction.getZOffset()));
if (lesu.network != null) {
lesu.network.merge(network);
}

View file

@ -72,8 +72,8 @@ public class TileLapotronicSU extends TileEnergyStorage implements IContainerPro
countedNetworks.clear();
connectedBlocks = 0;
for (EnumFacing dir : EnumFacing.values()) {
BlockPos adjucentBlockPos = new BlockPos(pos.getX() + dir.getFrontOffsetX(),
pos.getY() + dir.getFrontOffsetY(), pos.getZ() + dir.getFrontOffsetZ());
BlockPos adjucentBlockPos = new BlockPos(pos.getX() + dir.getXOffset(),
pos.getY() + dir.getXOffset(), pos.getZ() + dir.getXOffset());
TileEntity adjucentTile = world.getTileEntity(adjucentBlockPos);
if (adjucentTile == null || !(adjucentTile instanceof TileLSUStorage)) {
continue;

View file

@ -95,8 +95,8 @@ public class TileIndustrialBlastFurnace extends TileGenericMachine implements IC
heat += casing1.getHeatFromState(world.getBlockState(part.getPos()));
}
if (world.getBlockState(location.offset(EnumFacing.UP, 1)).getBlock().getUnlocalizedName().equals("tile.lava")
&& world.getBlockState(location.offset(EnumFacing.UP, 2)).getBlock().getUnlocalizedName().equals("tile.lava")) {
if (world.getBlockState(location.offset(EnumFacing.UP, 1)).getBlock().getTranslationKey().equals("tile.lava")
&& world.getBlockState(location.offset(EnumFacing.UP, 2)).getBlock().getTranslationKey().equals("tile.lava")) {
heat += 500;
}
return heat;

View file

@ -37,7 +37,7 @@ public class TechRebornCreativeTab extends CreativeTabs {
}
@Override
public ItemStack getTabIconItem() {
public ItemStack createIcon() {
return ItemParts.getPartByName("machine_parts");
}
}

View file

@ -148,7 +148,7 @@ public class RubberTreeGenerator extends WorldGenerator {
boolean isAddingSap = false;
if (rand.nextInt(Core.worldGen.config.rubberTreeConfig.sapRarity) == 0) {
newState = newState.withProperty(BlockRubberLog.HAS_SAP, true)
.withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.getHorizontal(rand.nextInt(4)));
.withProperty(BlockRubberLog.SAP_SIDE, EnumFacing.byHorizontalIndex(rand.nextInt(4)));
isAddingSap = true;
}
if (isAddingSap) {

View file

@ -53,7 +53,7 @@ public class OreConfig {
public OreConfig(IBlockState blockSate, int veinSize, int veinsPerChunk, int minYHeight, int maxYHeight) {
this.meta = blockSate.getBlock().getMetaFromState(blockSate);
this.state = blockSate;
this.blockName = blockSate.getBlock().getUnlocalizedName();
this.blockName = blockSate.getBlock().getTranslationKey();
if (blockSate.getBlock() instanceof IOreNameProvider) {
this.blockNiceName = ((IOreNameProvider) blockSate.getBlock()).getUserLoclisedName(blockSate);
} else {