Skip to content

Commit

Permalink
Lang files
Browse files Browse the repository at this point in the history
- Added US Localization, others should be added AND managed via PRs.
- API folder should only contain things that can be included in other
mods, moved APIImp to core.
- Gem storage blocks
- Fixed/added recipes
- Optimized/recolored lamp halos
  • Loading branch information
MrTJP committed Sep 6, 2013
1 parent 9443149 commit f177efd
Show file tree
Hide file tree
Showing 39 changed files with 512 additions and 357 deletions.
14 changes: 3 additions & 11 deletions common/mrtjp/projectred/ProjectRedCore.java
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
package mrtjp.projectred;

import mrtjp.projectred.api.APIImpl;
import codechicken.lib.packet.PacketCustom.CustomTinyPacketHandler;
import mrtjp.projectred.api.ProjectRedAPI;
import mrtjp.projectred.core.APIImpl;
import mrtjp.projectred.core.BlockBasics;
import mrtjp.projectred.core.CommandDebug;
import mrtjp.projectred.core.Configurator;
Expand Down Expand Up @@ -40,7 +41,7 @@
"after:CCTurtle;" +
"after:ComputerCraft;"
)
@NetworkMod(clientSideRequired = true, serverSideRequired = true)
@NetworkMod(clientSideRequired = true, serverSideRequired = true, tinyPacketHandler = CustomTinyPacketHandler.class)
public class ProjectRedCore {

public ProjectRedCore() {
Expand All @@ -63,15 +64,6 @@ public ProjectRedCore() {
@SidedProxy(clientSide = "mrtjp.projectred.core.CoreClientProxy", serverSide = "mrtjp.projectred.core.CoreProxy")
public static IProxy proxy;

static {
LanguageRegistry.instance().addStringLocalization("itemGroup.core", "en_US", "Project Red: Core");
LanguageRegistry.instance().addStringLocalization("itemGroup.trans", "en_US", "Project Red: Transmission");
LanguageRegistry.instance().addStringLocalization("itemGroup.int", "en_US", "Project Red: Integration");
LanguageRegistry.instance().addStringLocalization("itemGroup.ill", "en_US", "Project Red: Illumination");
LanguageRegistry.instance().addStringLocalization("itemGroup.expansion", "en_US", "Project Red: Expansion");
LanguageRegistry.instance().addStringLocalization("itemGroup.exploration", "en_US", "Project Red: Exploration");
}

public static CreativeTabs tabCore = new CreativeTabs("core") {
@Override
public ItemStack getIconItemStack() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
package mrtjp.projectred.api;
package mrtjp.projectred.core;

import codechicken.lib.vec.BlockCoord;
import codechicken.lib.vec.Rotation;
import codechicken.multipart.TMultiPart;
import codechicken.multipart.TileMultipart;
import mrtjp.projectred.api.IBundledEmitter;
import mrtjp.projectred.api.IBundledTile;
import mrtjp.projectred.api.ProjectRedAPI;
import mrtjp.projectred.transmission.BundledCableCommons;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
Expand Down
41 changes: 0 additions & 41 deletions common/mrtjp/projectred/core/BasicRenderUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -43,45 +43,4 @@ public static void setFullBrightness() {
public static void setFullColor() {
Tessellator.instance.setColorRGBA(255, 255, 255, 255);
}

static EntityItem entityItem;
static RenderItem uniformRenderItem = new RenderItem() {
@Override
public boolean shouldBob() {
return false;
}
};

static {
uniformRenderItem.setRenderManager(RenderManager.instance);
entityItem = new EntityItem(null);
entityItem.hoverStart = 0;
}

public static void renderItemUniform(ItemStack item) {
IItemRenderer customRenderer = MinecraftForgeClient.getItemRenderer(item, ENTITY);
boolean is3D = customRenderer != null && customRenderer.shouldUseRenderHelper(ENTITY, item, BLOCK_3D);

boolean larger = false;
if (item.getItem() instanceof ItemBlock && RenderBlocks.renderItemIn3d(Block.blocksList[item.itemID].getRenderType())) {
int renderType = Block.blocksList[item.itemID].getRenderType();
larger = !(renderType == 1 || renderType == 19 || renderType == 12 || renderType == 2);
} else if (is3D) {
larger = true;
}

double d = 2;
double d1 = 1 / d;
if (larger)
GL11.glScaled(d, d, d);

GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

entityItem.setEntityItemStack(item);
uniformRenderItem.doRenderItem(entityItem, 0, larger ? 0.09 : 0.06, 0, 0, 0);

if (larger)
GL11.glScaled(d1, d1, d1);
}

}
1 change: 1 addition & 0 deletions common/mrtjp/projectred/core/BlockBasics.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public class BlockBasics extends BlockContainer {
public BlockBasics(int id) {
super(id, new Material(Material.iron.materialMapColor));
setCreativeTab(ProjectRedExpansion.tabExpansion);
this.setUnlocalizedName("projectred.core.appliance");
setHardness(0.75f);
}

Expand Down
5 changes: 0 additions & 5 deletions common/mrtjp/projectred/core/Configurator.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,6 @@ public class Configurator {
public static final String buildnumber = "@BUILD_NUMBER@";
public static final String modName = "Project: Red";

public static final String corePacketChannel = "PR:Core";
public static final String integrationPacketChannel = "PR:Int";
public static final String transmissionPacketChannel = "PR:Trans";
public static final String expansionPacketChannel = "PR:Expan";

/** Multipart IDs **/
public static Property part_gate;
public static Property part_wire;
Expand Down
5 changes: 4 additions & 1 deletion common/mrtjp/projectred/core/CoreCPH.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package mrtjp.projectred.core;

import mrtjp.projectred.ProjectRedCore;
import net.minecraft.client.Minecraft;
import net.minecraft.client.multiplayer.NetClientHandler;
import net.minecraft.entity.player.EntityPlayer;
Expand All @@ -8,7 +9,8 @@
import codechicken.lib.packet.PacketCustom.IClientPacketHandler;

public class CoreCPH implements IClientPacketHandler {

public static Object channel = ProjectRedCore.instance;

@Override
public void handlePacket(PacketCustom packet, NetClientHandler nethandler, Minecraft mc) {
EntityPlayer player = mc.thePlayer;
Expand All @@ -17,6 +19,7 @@ public void handlePacket(PacketCustom packet, NetClientHandler nethandler, Minec
switch (packet.getType()) {
case CoreProxy.messengerQueue:
Messenger.addMessage(packet.readDouble(), packet.readDouble(), packet.readDouble(), packet.readString());
return;
case CoreProxy.alloySmelterWatcherUpdate:
TileAlloySmelter t = BasicUtils.getTileEntity(world, packet.readCoord(), TileAlloySmelter.class);
if (t != null) {
Expand Down
14 changes: 1 addition & 13 deletions common/mrtjp/projectred/core/CoreClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -17,19 +17,7 @@ public class CoreClientProxy extends CoreProxy {
@Override
public void init() {
super.init();
for (EnumPart part : EnumPart.VALID_PARTS) {
LanguageRegistry.addName(new ItemStack(itemComponent, 1, part.meta), part.fullName);
}

for (EnumBasics m : EnumBasics.VALID_MACHINES) {
LanguageRegistry.addName(new ItemStack(blockMachines, 1, m.meta), m.fullname);
}

LanguageRegistry.addName(itemDrawPlate, "Draw Plate");
LanguageRegistry.addName(itemScrewdriver, "Screwdriver");
LanguageRegistry.addName(new ItemStack(itemWireDebugger, 1, 0), "Wire debugger");

MinecraftForge.EVENT_BUS.register(new Messenger());
PacketCustom.assignHandler(Configurator.corePacketChannel, 1, 32, new CoreCPH());
PacketCustom.assignHandler(CoreCPH.channel, new CoreCPH());
}
}
2 changes: 1 addition & 1 deletion common/mrtjp/projectred/core/ItemBlockBasics.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public int getMetadata(int md) {
*/
@Override
public String getUnlocalizedName(ItemStack itemstack) {
return EnumBasics.get(itemstack.getItemDamage()).unlocalname;
return getUnlocalizedName()+"."+EnumBasics.get(itemstack.getItemDamage()).unlocalname;
}

}
3 changes: 2 additions & 1 deletion common/mrtjp/projectred/core/ItemPart.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public class ItemPart extends Item {

public ItemPart(int par1) {
super(par1);
setUnlocalizedName("projectred.core.part");
setCreativeTab(ProjectRedCore.tabCore);
setHasSubtypes(true);
}
Expand All @@ -40,7 +41,7 @@ public void getSubItems(int id, CreativeTabs tab, List list) {
*/
@Override
public String getUnlocalizedName(ItemStack itemstack) {
return EnumPart.get(itemstack.getItemDamage()).unlocalName;
return getUnlocalizedName()+"."+EnumPart.get(itemstack.getItemDamage()).unlocalName;
}

@Override
Expand Down
32 changes: 16 additions & 16 deletions common/mrtjp/projectred/core/PRColors.java
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
package mrtjp.projectred.core;

public enum PRColors {
WHITE("White", 1.0F, 1.0F, 1.0F, 0xFFFFFF),
ORANGE("Orange", 0.95F, 0.7F, 0.2F, 0xFFA100),
MAGENTA("Magenta", 0.9F, 0.5F, 0.85F, 0xFF00FF),
LIGHT_BLUE("Light Blue", 0.6F, 0.7F, 0.95F, 0xAEAEFF),
YELLOW("Yellow", 0.9F, 0.9F, 0.2F, 0xFFFF00),
LIME("Lime", 0.5F, 0.8F, 0.1F, 0xA1FF63),
PINK("Pink", 0.95F, 0.7F, 0.8F, 0xFFB9B9),
GREY("Grey", 0.3F, 0.3F, 0.3F, 0x9D9D9D),
LIGHT_GREY("Light Grey", 0.6F, 0.6F, 0.6F, 0xCBCBCB),
CYAN("Cyan", 0.3F, 0.6F, 0.7F, 0x00FFFF),
PURPLE("Purple", 0.7F, 0.4F, 0.9F, 0xAE00FF),
BLUE("Blue", 0.2F, 0.4F, 0.8F, 0x0000FF),
BROWN("Brown", 0.5F, 0.4F, 0.3F, 0xA55A00),
GREEN("Green", 0.2F, 0.8F, 0.2F, 0x00A600),
RED("Red", 0.8F, 0.3F, 0.3F, 0xFF0000),
BLACK("Black", 0.1F, 0.1F, 0.1F, 0x3B3B3B),
WHITE("White", 1.0F, 1.0F, 1.0F, 16777215),
ORANGE("Orange", 0.95F, 0.7F, 0.2F, 12608256),
MAGENTA("Magenta", 0.9F, 0.5F, 0.85F, 11868853),
LIGHT_BLUE("Light Blue", 0.6F, 0.7F, 0.95F, 7308529),
YELLOW("Yellow", 0.9F, 0.9F, 0.2F, 12566272),
LIME("Lime", 0.5F, 0.8F, 0.1F, 7074048),
PINK("Pink", 0.95F, 0.7F, 0.8F, 15812213),
GREY("Grey", 0.3F, 0.3F, 0.3F, 5460819),
LIGHT_GREY("Light Grey", 0.6F, 0.6F, 0.6F, 9671571),
CYAN("Cyan", 0.3F, 0.6F, 0.7F, 34695),
PURPLE("Purple", 0.7F, 0.4F, 0.9F, 6160576),
BLUE("Blue", 0.2F, 0.4F, 0.8F, 1250240),
BROWN("Brown", 0.5F, 0.4F, 0.3F, 5187328),
GREEN("Green", 0.2F, 0.8F, 0.2F, 558848),
RED("Red", 0.8F, 0.3F, 0.3F, 10620678),
BLACK("Black", 0.1F, 0.1F, 0.1F, 2039583),

;

Expand Down
2 changes: 1 addition & 1 deletion common/mrtjp/projectred/core/TileAlloySmelter.java
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ public void updateWatchers() {
if (BasicUtils.isClient(worldObj)) {
return;
}
PacketCustom packet = new PacketCustom(Configurator.expansionPacketChannel, CoreProxy.alloySmelterWatcherUpdate);
PacketCustom packet = new PacketCustom(CoreCPH.channel, CoreProxy.alloySmelterWatcherUpdate);
packet.writeCoord(xCoord, yCoord, zCoord);
packet.writeShort(heat);
packet.writeShort(progress);
Expand Down
5 changes: 0 additions & 5 deletions common/mrtjp/projectred/expansion/ExpansionClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ public class ExpansionClientProxy extends ExpansionProxy {
@Override
public void init() {
super.init();
LanguageRegistry.addName(new ItemStack(itemVAWT, 1, 0), "Vertical-Axis Wind Turbine");

for (EnumTube t : EnumTube.VALID_TUBE) {
LanguageRegistry.addName(new ItemStack(itemPartTube, 1, t.meta), t.name);
}
}

@Override
Expand Down
2 changes: 1 addition & 1 deletion common/mrtjp/projectred/expansion/ItemVAWT.java
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public ItemVAWT(int id) {
maxStackSize = 1;
setMaxDamage(1280);
setNoRepair();
setUnlocalizedName("projectred.items.turbine.VAWT");
setUnlocalizedName("projectred.expansion.VAWT");
setCreativeTab(ProjectRedExpansion.tabExpansion);
}

Expand Down
15 changes: 10 additions & 5 deletions common/mrtjp/projectred/exploration/BlockOre.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,16 +32,17 @@ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, in
int max = type.maxDrop;

if (min == max) {
ret.add(type.getDropStack(max));
if (type.drop != null)
ret.add(type.getDropStack(max));
else
ret.add(type.getItemStack(max));
return ret;
}
int count = world.rand.nextInt(fortune + max);
if (count > max) {
if (count > max)
count = max;
}
if (count < min) {
if (count < min)
count = min;
}
dropXpOnBlockBreak(world, x, y, z, MathHelper.getRandomIntegerInRange(world.rand, type.minXP, type.maxXP));
ret.add(type.getDropStack(count));
return ret;
Expand All @@ -59,6 +60,10 @@ public void registerIcons(IconRegister reg) {
}
}

@Override
public int damageDropped(int meta) {
return meta;
}

public enum EnumOre {
ORERUBY("Ruby Ore", "oreruby", 2, EnumPart.RUBY.getItemStack(), 1, 4, 1, 8),
Expand Down
25 changes: 14 additions & 11 deletions common/mrtjp/projectred/exploration/BlockSpecialStone.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,17 +48,24 @@ public ArrayList<ItemStack> getBlockDropped(World world, int x, int y, int z, in

@Override
public void registerIcons(IconRegister reg) {
for (EnumSpecialStone s : EnumSpecialStone.VALID_STONE) {
for (EnumSpecialStone s : EnumSpecialStone.VALID_STONE)
s.loadTextures(reg);
}
}

@Override
public int damageDropped(int meta) {
return meta;
}

public enum EnumSpecialStone {
MARBLE("Marble", "stonemarble", 1, 6),
MARBLEBRICK("Marble Brick", "brickmarble", 1, 6),
BASALTCOBBLE("Basalt Cobblestone", "cobblebasalt", 2.5f, 16),
MARBLE("Marble", "stonemarble", 1, 6, null),
MARBLEBRICK("Marble Brick", "brickmarble", 1, 6, null),
BASALTCOBBLE("Basalt Cobblestone", "cobblebasalt", 2.5f, 16, null),
BASALT("Basalt", "stonebasalt", 2.5f, 8, BASALTCOBBLE.getItemStack()),
BASALTBRICK("Basalt Brick", "brickbasalt", 2.5f, 8),
BASALTBRICK("Basalt Brick", "brickbasalt", 2.5f, 8, null),
RUBYBLOCK("Ruby Block", "storageruby", 5.0F, 10.0F, null),
SAPPHIREBLOCK("Sapphire Block", "storagesapphire", 5.0F, 10.0F, null),
PERIDOTBLOCK("Peridot Block", "storageperidot", 5.0F, 10.0F, null),
;

public final String name;
Expand All @@ -70,10 +77,6 @@ public enum EnumSpecialStone {
public Icon texture;
public static EnumSpecialStone[] VALID_STONE = values();

private EnumSpecialStone(String name, String unlocal, float hardness, float explosionRes) {
this(name, unlocal, hardness, explosionRes, null);
}

private EnumSpecialStone(String name, String unlocal, float hardness, float explosionRes, ItemStack drop) {
this.name = name;
this.unlocal = unlocal;
Expand All @@ -91,7 +94,7 @@ public ItemStack getItemStack() {
}

public ItemStack getItemStack(int i) {
return new ItemStack(ProjectRedExploration.blockStones, 1, meta);
return new ItemStack(ProjectRedExploration.blockStones, i, meta);
}
}
}
46 changes: 0 additions & 46 deletions common/mrtjp/projectred/exploration/ExplorationClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,52 +44,6 @@ public class ExplorationClientProxy extends ExplorationProxy {
@Override
public void init() {
super.init();
LanguageRegistry.addName(itemWoolGin, "Wool Gin");

for (EnumOre o : EnumOre.VALID_ORES) {
LanguageRegistry.addName(o.getItemStack(1), o.name);
}

for (EnumSpecialStone s : EnumSpecialStone.VALID_STONE) {
LanguageRegistry.addName(s.getItemStack(), s.name);
}

for (EnumBackpack b : EnumBackpack.VALID_BP) {
LanguageRegistry.addName(b.getItemStack(), b.fullname);
}

LanguageRegistry.addName(itemRubyAxe, itemRubyAxe.tool.name);
LanguageRegistry.addName(itemSapphireAxe, itemSapphireAxe.tool.name);
LanguageRegistry.addName(itemPeridotAxe, itemPeridotAxe.tool.name);
LanguageRegistry.addName(itemRubyHoe, itemRubyHoe.tool.name);
LanguageRegistry.addName(itemSapphireHoe, itemSapphireHoe.tool.name);
LanguageRegistry.addName(itemPeridotHoe, itemPeridotHoe.tool.name);
LanguageRegistry.addName(itemRubyPickaxe, itemRubyPickaxe.tool.name);
LanguageRegistry.addName(itemSapphirePickaxe, itemSapphirePickaxe.tool.name);
LanguageRegistry.addName(itemPeridotPickaxe, itemPeridotPickaxe.tool.name);
LanguageRegistry.addName(itemRubyShovel, itemRubyShovel.tool.name);
LanguageRegistry.addName(itemSapphireShovel, itemSapphireShovel.tool.name);
LanguageRegistry.addName(itemPeridotShovel, itemPeridotShovel.tool.name);
LanguageRegistry.addName(itemRubySword, itemRubySword.tool.name);
LanguageRegistry.addName(itemSapphireSword, itemSapphireSword.tool.name);
LanguageRegistry.addName(itemPeridotSword, itemPeridotSword.tool.name);
LanguageRegistry.addName(itemWoodSaw, itemWoodSaw.tool.name);
LanguageRegistry.addName(itemStoneSaw, itemStoneSaw.tool.name);
LanguageRegistry.addName(itemIronSaw, itemIronSaw.tool.name);
LanguageRegistry.addName(itemGoldSaw, itemGoldSaw.tool.name);
LanguageRegistry.addName(itemRubySaw, itemRubySaw.tool.name);
LanguageRegistry.addName(itemSapphireSaw, itemSapphireSaw.tool.name);
LanguageRegistry.addName(itemPeridotSaw, itemPeridotSaw.tool.name);
LanguageRegistry.addName(itemDiamondSaw, itemDiamondSaw.tool.name);
LanguageRegistry.addName(itemWoodSickle, itemWoodSickle.tool.name);
LanguageRegistry.addName(itemStoneSickle, itemStoneSickle.tool.name);
LanguageRegistry.addName(itemIronSickle, itemIronSickle.tool.name);
LanguageRegistry.addName(itemGoldSickle, itemGoldSickle.tool.name);
LanguageRegistry.addName(itemRubySickle, itemRubySickle.tool.name);
LanguageRegistry.addName(itemSapphireSickle, itemSapphireSickle.tool.name);
LanguageRegistry.addName(itemPeridotSickle, itemPeridotSickle.tool.name);
LanguageRegistry.addName(itemDiamondSickle, itemDiamondSickle.tool.name);

MinecraftForgeClient.registerItemRenderer(itemWoodSaw.itemID, GemSawItemRenderer.instance);
MinecraftForgeClient.registerItemRenderer(itemStoneSaw.itemID, GemSawItemRenderer.instance);
MinecraftForgeClient.registerItemRenderer(itemIronSaw.itemID, GemSawItemRenderer.instance);
Expand Down

0 comments on commit f177efd

Please sign in to comment.