Skip to content

Commit

Permalink
comit before frameTimeUpdate
Browse files Browse the repository at this point in the history
Dolu1990 committed Jun 16, 2014
1 parent ba6a0c0 commit 232c683
Showing 6 changed files with 40 additions and 10 deletions.
7 changes: 7 additions & 0 deletions mods/eln/Eln.java
Original file line number Diff line number Diff line change
@@ -237,6 +237,7 @@
import net.minecraftforge.oredict.OreDictionary;
import net.minecraftforge.oredict.ShapedOreRecipe;
import net.minecraftforge.oredict.ShapelessOreRecipe;
import cpw.mods.fml.client.FMLClientHandler;
import cpw.mods.fml.client.registry.ClientRegistry;
import cpw.mods.fml.client.registry.RenderingRegistry;
import cpw.mods.fml.common.FMLCommonHandler;
@@ -865,6 +866,12 @@ public void postInit(FMLPostInitializationEvent event) {

}

/*@EventHandler
public void clientStart(Client event) {
}*/

@EventHandler
/* Remember to use the right event! */
public void onServerStopping(FMLServerStoppingEvent ev) {
18 changes: 17 additions & 1 deletion mods/eln/client/FrameTime.java
Original file line number Diff line number Diff line change
@@ -7,6 +7,7 @@
import java.io.IOException;
import java.nio.ByteBuffer;
import java.util.EnumSet;
import java.util.Iterator;

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

@@ -15,6 +16,7 @@
import mods.eln.Eln;
import mods.eln.item.MeterItemArmor;
import mods.eln.misc.Utils;
import mods.eln.node.NodeBlockEntity;
import mods.eln.sim.ElectricalConnection;
import mods.eln.sim.ElectricalLoad;
import mods.eln.sim.IProcess;
@@ -28,6 +30,7 @@
import net.minecraft.server.MinecraftServer;
import net.minecraft.server.management.PlayerManager;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
import net.minecraft.world.WorldSavedData;
import net.minecraft.world.WorldServer;
import net.minecraft.world.WorldServerMulti;
@@ -84,7 +87,20 @@ public void tick(RenderTickEvent event) {
// Utils.println(deltaT);
}
oldNanoTime = nanoTime;
// Utils.println("delta T : " + deltaT);

Utils.println(NodeBlockEntity.clientList.size());
Iterator<NodeBlockEntity> i = NodeBlockEntity.clientList.iterator();
World w = Minecraft.getMinecraft().theWorld;
while(i.hasNext()){
NodeBlockEntity e = i.next();
if(e.getWorldObj() != w){
i.remove();
continue;
}
//e.clientRefresh(deltaT);
}
//Minecraft.getMinecraft().theWorld.getChunkFromChunkCoords(1, 1).
// Utils.println("delta T : " + deltaT + " " + event);
}


9 changes: 4 additions & 5 deletions mods/eln/groundcable/GroundCableElement.java
Original file line number Diff line number Diff line change
@@ -42,15 +42,15 @@ public GroundCableElement(SixNode sixNode, Direction side,
super(sixNode, side, descriptor);

electricalLoadList.add(electricalLoad);
slowProcessList.add(groundProcess);
// electricalProcessList.add(groundProcess);
}




NodeElectricalLoad electricalLoad = new NodeElectricalLoad("electricalLoad");

ElectricalSourceRefGroundProcess groundProcess = new ElectricalSourceRefGroundProcess(electricalLoad, 0);
//ElectricalSourceRefGroundProcess groundProcess = new ElectricalSourceRefGroundProcess(electricalLoad, 0);

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

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



2 changes: 1 addition & 1 deletion mods/eln/groundcable/GroundCableRender.java
Original file line number Diff line number Diff line change
@@ -57,7 +57,7 @@ public void publishUnserialize(DataInputStream stream) {
ItemStack cableStack = Utils.unserialiseItemStack(stream);
ElectricalCableDescriptor desc = (ElectricalCableDescriptor)ElectricalCableDescriptor.getDescriptor(cableStack, ElectricalCableDescriptor.class);
if(desc == null)
cableRender = null;
cableRender = Eln.instance.lowVoltageCableDescriptor.render;
else
cableRender = desc.render;
} catch (IOException e) {
11 changes: 9 additions & 2 deletions mods/eln/node/NodeBlockEntity.java
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import java.nio.ByteBuffer;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.LinkedList;

import cpw.mods.fml.common.FMLCommonHandler;

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

public abstract class NodeBlockEntity extends TileEntity implements ITileEntitySpawnClient{

public static LinkedList<NodeBlockEntity> clientList = new LinkedList<NodeBlockEntity>();



public abstract INodeInfo getInfo();
public NodeBlock getBlock(){
return (NodeBlock) getBlockType();
@@ -243,7 +248,9 @@ public void updateEntity() {
//worldObj.setBlock(xCoord, yCoord, zCoord, 0);//caca1.5.1
//Utils.println("ASSERT NODE DESTROYED BY SECURITY updateEntity");
}
}
} else {
clientList.add(this);
}
}
}

@@ -288,7 +295,7 @@ public void onChunkUnload()
//client only
public void destructor()
{
clientList.remove(this);
}

@Override
3 changes: 2 additions & 1 deletion mods/eln/tutorialsign/TutorialSignOverlay.java
Original file line number Diff line number Diff line change
@@ -12,6 +12,7 @@
import net.minecraft.util.MathHelper;
import net.minecraft.world.World;
import net.minecraftforge.client.event.RenderGameOverlayEvent;
import net.minecraftforge.client.event.RenderGameOverlayEvent.ElementType;
import cpw.mods.fml.common.eventhandler.SubscribeEvent;

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

0 comments on commit 232c683

Please sign in to comment.