Skip to content

Commit

Permalink
Push before sixNodeCache update
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Jun 6, 2014
1 parent c901890 commit eadbbf2
Show file tree
Hide file tree
Showing 10 changed files with 164 additions and 70 deletions.
Binary file modified assets/eln/model/LowVoltageSwitch/LowVoltageSwitch.blend
Binary file not shown.
14 changes: 10 additions & 4 deletions assets/eln/model/LowVoltageSwitch/LowVoltageSwitch.obj
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,12 @@ vt 0.312500 0.937500
vt 1.000000 0.562500
vt 1.000000 0.937500
vt 0.562500 0.937500
vt 0.650000 0.925000
vt 0.562500 0.925000
vt 0.475000 0.925000
vt 0.650000 0.950000
vt 0.562500 0.950000
vt 0.475000 0.950000
usemtl None_untitled
s off
f 14/23 13/24 17/25
Expand Down Expand Up @@ -218,10 +224,10 @@ f 56/54 54/55 32/56
f 56/54 32/56 34/58
f 40/39 37/51 49/52
f 40/39 49/52 52/53
f 59/55 55/59 51/56
f 58/54 59/55 51/56
f 54/57 58/54 51/56
f 54/57 51/56 50/58
f 59/65 55/66 51/67
f 58/68 59/65 51/67
f 54/69 58/68 51/67
f 54/69 51/67 50/70
f 54/52 56/61 60/40
f 54/52 60/40 58/51
f 31/58 53/54 49/55
Expand Down
Binary file modified assets/eln/model/stoneCache/stonecache.blend
Binary file not shown.
103 changes: 77 additions & 26 deletions assets/eln/model/stoneCache/stonecache.obj
Original file line number Diff line number Diff line change
@@ -1,33 +1,84 @@
# Blender v2.65 (sub 0) OBJ File: 'stonecache.blend'
# www.blender.org
mtllib stonecache.mtl
o main
o main5
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 0.500000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
usemtl None
s off
f 2/1 1/2 3/3
f 2/1 3/3 4/4
o main4
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v -0.500000 0.500000 -0.500000
v 0.500000 0.500000 -0.500000
vt 1.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 1.000000 1.000000
usemtl None
s off
f 6/5 5/6 7/7
f 6/5 7/7 8/8
o main3
v -0.500000 0.500000 -0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 0.500000 0.500000
v -0.500000 0.500000 0.500000
vt 1.000000 1.000000
vt 0.000000 1.000000
vt 0.000000 0.000000
vt 1.000000 0.000000
usemtl None
s off
f 10/9 9/10 12/11
f 10/9 12/11 11/12
o main2
v -0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
v -0.500000 0.500000 -0.500000
vt 0.000000 1.000000
vt 1.000000 1.000000
vt 1.000000 0.000000
vt 0.000000 0.000000
usemtl None
s off
f 13/13 14/14 15/15
f 13/13 15/15 16/16
o main1
v 0.500000 -0.500000 -0.500000
v 0.500000 -0.500000 0.500000
v 0.500000 0.500000 -0.500000
v 0.500000 0.500000 0.500000
vt 1.000000 0.000000
vt 0.000000 0.000000
vt 0.000000 1.000000
vt 1.000000 1.000000
usemtl None
s off
f 18/17 17/18 19/19
f 18/17 19/19 20/20
o main0
v -0.500000 -0.500000 -0.500000
v -0.500000 -0.500000 0.500000
v -0.500000 0.500000 -0.500000
v -0.500000 0.500000 0.500000
vt 0.000000 0.000000
vt 1.000000 0.000000
vt 1.000000 1.000000
vt 0.000000 1.000000
usemtl None
s off
f 2/1 1/2 5/3
f 2/1 5/3 6/4
f 6/3 7/4 3/1
f 6/3 3/1 2/2
f 7/3 8/4 4/1
f 7/3 4/1 3/2
f 1/1 4/2 8/3
f 1/1 8/3 5/4
f 1/3 2/4 3/1
f 1/3 3/1 4/2
f 8/3 7/4 6/1
f 8/3 6/1 5/2
f 21/21 22/22 24/23
f 21/21 24/23 23/24
o Minecraft_Block_Cube
v 0.500000 -0.500000 0.500000
v -0.500000 -0.500000 0.500000
Expand All @@ -43,15 +94,15 @@ vt 1.000000 1.000000
vt 0.000000 1.000000
usemtl Material
s off
f 9/5 10/6 11/7
f 9/5 11/7 12/8
f 13/5 16/6 15/7
f 13/5 15/7 14/8
f 9/5 13/6 14/7
f 9/5 14/7 10/8
f 10/5 14/6 15/7
f 10/5 15/7 11/8
f 11/5 15/6 16/7
f 11/5 16/7 12/8
f 13/5 9/6 12/7
f 13/5 12/7 16/8
f 25/25 26/26 27/27
f 25/25 27/27 28/28
f 29/25 32/26 31/27
f 29/25 31/27 30/28
f 25/25 29/26 30/27
f 25/25 30/27 26/28
f 26/25 30/26 31/27
f 26/25 31/27 27/28
f 27/25 31/26 32/27
f 27/25 32/27 28/28
f 29/25 25/26 28/27
f 29/25 28/27 32/28
39 changes: 24 additions & 15 deletions mods/eln/Eln.java
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@
import java.util.ArrayList;
import java.util.List;

@Mod(modid = "Eln", version = "BETA-1.3.0a")
@Mod(modid = "Eln", version = "BETA-1.3.1")
//@Mod(modid = "Eln", name = "Electrical Age", version = "BETA-1.2.0b")
//@NetworkMod(clientSideRequired = true, serverSideRequired = true, channels = { "miaouMod" }, packetHandler = PacketHandler.class)
public class Eln {
Expand Down Expand Up @@ -435,6 +435,8 @@ public class Eln {

float xRayScannerRange;
boolean addOtherModOreToXRay;

private boolean replicatorPop;
public static boolean debugEnable = false;

@EventHandler
Expand Down Expand Up @@ -496,11 +498,18 @@ public void preInit(FMLPreInitializationEvent event) {
modbusEnable = config.get("modbus", "enable", false).getBoolean(false);
debugEnable = config.get("debug", "enable", false).getBoolean(false);

replicatorPop = config.get("entity", "replicatorPop", true).getBoolean(true);

genCooper = config.get("mapGenerate", "cooper", true).getBoolean(true);
genPlumb = config.get("mapGenerate", "plumb", true).getBoolean(true);
genTungsten = config.get("mapGenerate", "tungsten", true).getBoolean(true);
genCinnabar = config.get("mapGenerate", "cinnabar", true).getBoolean(true);



incondecentLampLife = config.get("lamp", "incondescentLifeInHours", 8).getDouble(8)*3600;
economicLampLife = config.get("lamp", "economicLifeInHours", 32).getDouble(32)*3600;

/*ConfigCategory xRayOre;
if (config.hasCategory("xrayscannerore") == false) {
xRayOre = config.getCategory("xrayscannerore");
Expand Down Expand Up @@ -899,7 +908,8 @@ public void onServerStarting(FMLServerStartingEvent ev) {
WorldServer worldServer = server.worldServers[0];
simulator.init();
simulator.addSlowProcess(wind = new WindProcess());
simulator.addSlowProcess(new ReplicatorPopProcess());
if(replicatorPop)
simulator.addSlowProcess(new ReplicatorPopProcess());
simulator.addSlowProcess(new ItemEnergyInventoryProcess());

ghostManager = (GhostManager) worldServer.mapStorage.loadData(
Expand Down Expand Up @@ -2736,16 +2746,15 @@ void registerRegulatorItem(int id) {
*/

}

double incondecentLampLife;
double economicLampLife;
void registerLampItem(int id) {
int subId, completId;
String name;
double incondecentLife = Utils.minecraftDay * 10;
double[] lightPower = new double[] { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
15, 20, 30, 40, 60 };
double[] lightLevel = new double[16];
double economicPowerFactor = 0.75;
double economicLife = incondecentLife * 4;
double standardGrowRate = 0.0;
for (int idx = 0; idx < 16; idx++) {
lightLevel[idx] = (idx + 0.49) / 15.0;
Expand All @@ -2758,7 +2767,7 @@ void registerLampItem(int id) {
"incandescentlampiron", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, LVU, lightPower[12], // nominalU,
// nominalP
lightLevel[12], incondecentLife, standardGrowRate // nominalLight,
lightLevel[12], incondecentLampLife, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2770,7 +2779,7 @@ void registerLampItem(int id) {
"incandescentlampiron", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, LVU, lightPower[14], // nominalU,
// nominalP
lightLevel[14], incondecentLife, standardGrowRate // nominalLight,
lightLevel[14], incondecentLampLife, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2782,7 +2791,7 @@ void registerLampItem(int id) {
"incandescentlampiron", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, MVU, lightPower[14], // nominalU,
// nominalP
lightLevel[14], incondecentLife, standardGrowRate // nominalLight,
lightLevel[14], incondecentLampLife, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2803,7 +2812,7 @@ void registerLampItem(int id) {
"incandescentlampcarbon", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, LVU, lightPower[11], // nominalU,
// nominalP
lightLevel[11], incondecentLife / 3, standardGrowRate // nominalLight,
lightLevel[11], incondecentLampLife / 3, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2815,7 +2824,7 @@ void registerLampItem(int id) {
"incandescentlampcarbon", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, LVU, lightPower[13], // nominalU,
// nominalP
lightLevel[13], incondecentLife / 3, standardGrowRate // nominalLight,
lightLevel[13], incondecentLampLife / 3, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2828,7 +2837,7 @@ void registerLampItem(int id) {
"economiclamp", LampDescriptor.Type.eco,
LampSocketType.Douille, LVU, lightPower[12]
* economicPowerFactor, // nominalU, nominalP
lightLevel[12], economicLife, standardGrowRate // nominalLight,
lightLevel[12], economicLampLife, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2840,7 +2849,7 @@ void registerLampItem(int id) {
"economiclamp", LampDescriptor.Type.eco,
LampSocketType.Douille, LVU, lightPower[14]
* economicPowerFactor, // nominalU, nominalP
lightLevel[14], economicLife, standardGrowRate // nominalLight,
lightLevel[14], economicLampLife, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2852,7 +2861,7 @@ void registerLampItem(int id) {
"economiclamp", LampDescriptor.Type.eco,
LampSocketType.Douille, MVU, lightPower[14]
* economicPowerFactor, // nominalU, nominalP
lightLevel[14], economicLife, standardGrowRate // nominalLight,
lightLevel[14], economicLampLife, standardGrowRate // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2864,7 +2873,7 @@ void registerLampItem(int id) {
element = new LampDescriptor("50V Farming Lamp",
"incandescentlampiron", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, LVU, 120, // nominalU, nominalP
lightLevel[15], incondecentLife, 0.50 // nominalLight,
lightLevel[15], incondecentLampLife, 0.50 // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand All @@ -2875,7 +2884,7 @@ void registerLampItem(int id) {
element = new LampDescriptor("200V Farming Lamp",
"incandescentlampiron", LampDescriptor.Type.Incandescent,
LampSocketType.Douille, MVU, 120, // nominalU, nominalP
lightLevel[15], incondecentLife, 0.50 // nominalLight,
lightLevel[15], incondecentLampLife, 0.50 // nominalLight,
// nominalLife
);
sharedItem.addElement(completId, element);
Expand Down
47 changes: 29 additions & 18 deletions mods/eln/item/SixNodeCacheItem.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@
import net.minecraftforge.client.IItemRenderer.ItemRenderType;
import net.minecraftforge.client.IItemRenderer.ItemRendererHelper;
import mods.eln.generic.GenericItemUsingDamageDescriptor;
import mods.eln.misc.Coordonate;
import mods.eln.misc.Direction;
import mods.eln.misc.Obj3D;
import mods.eln.misc.UtilsClient;
import mods.eln.misc.Obj3D.Obj3DPart;
import mods.eln.misc.Utils;
import mods.eln.wiki.Data;

public class SixNodeCacheItem extends GenericItemUsingDamageDescriptor{
public static SixNodeCacheItem[] map = new SixNodeCacheItem[128];
public Obj3D obj;

public int mapIndex;
public SixNodeCacheItem(
String name,
Expand All @@ -28,13 +32,8 @@ public SixNodeCacheItem(
map[mapIndex] = this;
if(obj != null){
main = obj.getPart("main");
xn = obj.getPart("xn");
xp = obj.getPart("xp");
yn = obj.getPart("yn");
yp = obj.getPart("yp");
zn = obj.getPart("zn");
zp = obj.getPart("zp");

for(int idx = 0;idx < 6;idx++)
sidePart[idx] = obj.getPart("main"+idx);
}
}

Expand All @@ -44,19 +43,31 @@ public void setParent(net.minecraft.item.Item item, int damage)
Data.addWiring(newItemStack());
}

Obj3DPart main,xp,xn,yp,yn,zp,zn;
Obj3DPart main;
Obj3DPart[] sidePart = new Obj3DPart[6];
public void draw(World world,int x,int y,int z)
{
if(main != null)main.draw();
/* //Utils.disableLight();
if(xn != null){
float light = world.getLightBrightness(x-1, y, z)*0.97f+0.03f;
// float light = world.getBrightness(x-1, y, z,0);
//light = 1f;
// GL11.glColor3f(light, light, light);
xn.draw();
int[] v = new int[3];
if(world != null){
UtilsClient.disableLight();
for(int idx = 0;idx < 6;idx++){
if(sidePart[idx] == null) continue;
v[0] = x;v[1] = y;v[2] = z;
Direction.fromInt(idx).applyTo(v, 1);
float light = world.provider.lightBrightnessTable[UtilsClient.getLight(world,v[0],v[1],v[2])];

GL11.glColor3f(light, light, light);
sidePart[idx].draw();
}
UtilsClient.enableLight();
} else {
for(int idx = 0;idx < 6;idx++){
if(sidePart[idx] == null) continue;
sidePart[idx].draw();
}
}
Utils.enableLight();*/

}


Expand All @@ -74,7 +85,7 @@ public boolean handleRenderType(ItemStack item, ItemRenderType type) {
}
@Override
public void renderItem(ItemRenderType type, ItemStack item, Object... data) {

if(main != null)main.draw();
GL11.glScalef(0.5f, 0.5f, 0.5f);
draw(null, 0, 0, 0);
}
}
Loading

0 comments on commit eadbbf2

Please sign in to comment.