Skip to content

Commit 232c683

Browse files
committed
comit before frameTimeUpdate
1 parent ba6a0c0 commit 232c683

6 files changed

Lines changed: 40 additions & 10 deletions

File tree

mods/eln/Eln.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,7 @@
237237
import net.minecraftforge.oredict.OreDictionary;
238238
import net.minecraftforge.oredict.ShapedOreRecipe;
239239
import net.minecraftforge.oredict.ShapelessOreRecipe;
240+
import cpw.mods.fml.client.FMLClientHandler;
240241
import cpw.mods.fml.client.registry.ClientRegistry;
241242
import cpw.mods.fml.client.registry.RenderingRegistry;
242243
import cpw.mods.fml.common.FMLCommonHandler;
@@ -865,6 +866,12 @@ public void postInit(FMLPostInitializationEvent event) {
865866

866867
}
867868

869+
/*@EventHandler
870+
public void clientStart(Client event) {
871+
872+
873+
}*/
874+
868875
@EventHandler
869876
/* Remember to use the right event! */
870877
public void onServerStopping(FMLServerStoppingEvent ev) {

mods/eln/client/FrameTime.java

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import java.io.IOException;
88
import java.nio.ByteBuffer;
99
import java.util.EnumSet;
10+
import java.util.Iterator;
1011

1112
import javax.swing.text.html.HTMLDocument.HTMLReader.IsindexAction;
1213

@@ -15,6 +16,7 @@
1516
import mods.eln.Eln;
1617
import mods.eln.item.MeterItemArmor;
1718
import mods.eln.misc.Utils;
19+
import mods.eln.node.NodeBlockEntity;
1820
import mods.eln.sim.ElectricalConnection;
1921
import mods.eln.sim.ElectricalLoad;
2022
import mods.eln.sim.IProcess;
@@ -28,6 +30,7 @@
2830
import net.minecraft.server.MinecraftServer;
2931
import net.minecraft.server.management.PlayerManager;
3032
import net.minecraft.tileentity.TileEntity;
33+
import net.minecraft.world.World;
3134
import net.minecraft.world.WorldSavedData;
3235
import net.minecraft.world.WorldServer;
3336
import net.minecraft.world.WorldServerMulti;
@@ -84,7 +87,20 @@ public void tick(RenderTickEvent event) {
8487
// Utils.println(deltaT);
8588
}
8689
oldNanoTime = nanoTime;
87-
// Utils.println("delta T : " + deltaT);
90+
91+
Utils.println(NodeBlockEntity.clientList.size());
92+
Iterator<NodeBlockEntity> i = NodeBlockEntity.clientList.iterator();
93+
World w = Minecraft.getMinecraft().theWorld;
94+
while(i.hasNext()){
95+
NodeBlockEntity e = i.next();
96+
if(e.getWorldObj() != w){
97+
i.remove();
98+
continue;
99+
}
100+
//e.clientRefresh(deltaT);
101+
}
102+
//Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(1, 1).
103+
// Utils.println("delta T : " + deltaT + " " + event);
88104
}
89105

90106

mods/eln/groundcable/GroundCableElement.java

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ public GroundCableElement(SixNode sixNode, Direction side,
4242
super(sixNode, side, descriptor);
4343

4444
electricalLoadList.add(electricalLoad);
45-
slowProcessList.add(groundProcess);
45+
// electricalProcessList.add(groundProcess);
4646
}
4747

4848

4949

5050

5151
NodeElectricalLoad electricalLoad = new NodeElectricalLoad("electricalLoad");
5252

53-
ElectricalSourceRefGroundProcess groundProcess = new ElectricalSourceRefGroundProcess(electricalLoad, 0);
53+
//ElectricalSourceRefGroundProcess groundProcess = new ElectricalSourceRefGroundProcess(electricalLoad, 0);
5454

5555
int color = 0;
5656
int colorCare = 0;
@@ -93,7 +93,7 @@ public ThermalLoad getThermalLoad(LRDU lrdu) {
9393
@Override
9494
public int getConnectionMask(LRDU lrdu) {
9595
// TODO Auto-generated method stub
96-
if(inventory.getStackInSlot(GroundCableContainer.cableSlotId) == null) return 0;
96+
//if(inventory.getStackInSlot(GroundCableContainer.cableSlotId) == null) return 0;
9797
return NodeBase.maskElectricalPower + (color << NodeBase.maskColorShift) +(colorCare << NodeBase.maskColorCareShift);
9898
}
9999

@@ -130,8 +130,7 @@ public void networkSerialize(DataOutputStream stream) {
130130
@Override
131131
public void initialize() {
132132
// TODO Auto-generated method stub
133-
electricalLoad.setC(10000);
134-
electricalLoad.setRs(0.00001);
133+
Eln.instance.lowVoltageCableDescriptor.applyTo(electricalLoad, true);
135134

136135

137136

mods/eln/groundcable/GroundCableRender.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ public void publishUnserialize(DataInputStream stream) {
5757
ItemStack cableStack = Utils.unserialiseItemStack(stream);
5858
ElectricalCableDescriptor desc = (ElectricalCableDescriptor)ElectricalCableDescriptor.getDescriptor(cableStack, ElectricalCableDescriptor.class);
5959
if(desc == null)
60-
cableRender = null;
60+
cableRender = Eln.instance.lowVoltageCableDescriptor.render;
6161
else
6262
cableRender = desc.render;
6363
} catch (IOException e) {

mods/eln/node/NodeBlockEntity.java

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import java.nio.ByteBuffer;
1313
import java.util.ArrayList;
1414
import java.util.Iterator;
15+
import java.util.LinkedList;
1516

1617
import cpw.mods.fml.common.FMLCommonHandler;
1718

@@ -55,6 +56,10 @@
5556

5657
public abstract class NodeBlockEntity extends TileEntity implements ITileEntitySpawnClient{
5758

59+
public static LinkedList<NodeBlockEntity> clientList = new LinkedList<NodeBlockEntity>();
60+
61+
62+
5863
public abstract INodeInfo getInfo();
5964
public NodeBlock getBlock(){
6065
return (NodeBlock) getBlockType();
@@ -243,7 +248,9 @@ public void updateEntity() {
243248
//worldObj.setBlock(xCoord, yCoord, zCoord, 0);//caca1.5.1
244249
//Utils.println("ASSERT NODE DESTROYED BY SECURITY updateEntity");
245250
}
246-
}
251+
} else {
252+
clientList.add(this);
253+
}
247254
}
248255
}
249256

@@ -288,7 +295,7 @@ public void onChunkUnload()
288295
//client only
289296
public void destructor()
290297
{
291-
298+
clientList.remove(this);
292299
}
293300

294301
@Override

mods/eln/tutorialsign/TutorialSignOverlay.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
import net.minecraft.util.MathHelper;
1313
import net.minecraft.world.World;
1414
import net.minecraftforge.client.event.RenderGameOverlayEvent;
15+
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
1516
import cpw.mods.fml.common.eventhandler.SubscribeEvent;
1617

1718
public class TutorialSignOverlay {
@@ -20,7 +21,7 @@ public TutorialSignOverlay() {
2021
i++;
2122
}
2223
@SubscribeEvent
23-
public void render(RenderGameOverlayEvent.Post event) {
24+
public void render(RenderGameOverlayEvent.Text event) {
2425
Minecraft mc = Minecraft.getMinecraft();
2526
EntityClientPlayerMP player = mc.thePlayer;
2627
int px = MathHelper.floor_double(player.posX),py = MathHelper.floor_double(player.posY),pz = MathHelper.floor_double(player.posZ);

0 commit comments

Comments
 (0)