Skip to content

Commit

Permalink
little bit refractoring
Browse files Browse the repository at this point in the history
  • Loading branch information
Dolu1990 committed Jul 7, 2014
1 parent 342318c commit 53e3e2c
Show file tree
Hide file tree
Showing 412 changed files with 2,064 additions and 2,045 deletions.
44 changes: 24 additions & 20 deletions mods/eln/Eln.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import mods.eln.client.SoundLoader;
import mods.eln.entity.ReplicatorEntity;
import mods.eln.entity.ReplicatorPopProcess;
import mods.eln.generic.GenericCreativeTab;
import mods.eln.generic.GenericItemUsingDamageDescriptor;
import mods.eln.generic.GenericItemUsingDamageDescriptorWithComment;
import mods.eln.generic.SharedItem;
Expand Down Expand Up @@ -59,27 +60,30 @@
import mods.eln.misc.Utils;
import mods.eln.misc.Version;
import mods.eln.misc.WindProcess;
import mods.eln.node.NodeElectricalLoad;
import mods.eln.node.NodeManager;
import mods.eln.node.NodeServer;
import mods.eln.node.SixNode;
import mods.eln.node.SixNodeBlock;
import mods.eln.node.SixNodeCacheStd;
import mods.eln.node.SixNodeDescriptor;
import mods.eln.node.SixNodeEntity;
import mods.eln.node.SixNodeItem;
import mods.eln.node.TransparentNode;
import mods.eln.node.TransparentNodeBlock;
import mods.eln.node.TransparentNodeDescriptor;
import mods.eln.node.TransparentNodeEntity;
import mods.eln.node.TransparentNodeItem;
import mods.eln.node.six.SixNode;
import mods.eln.node.six.SixNodeBlock;
import mods.eln.node.six.SixNodeCacheStd;
import mods.eln.node.six.SixNodeDescriptor;
import mods.eln.node.six.SixNodeEntity;
import mods.eln.node.six.SixNodeItem;
import mods.eln.node.transparent.TransparentNode;
import mods.eln.node.transparent.TransparentNodeBlock;
import mods.eln.node.transparent.TransparentNodeDescriptor;
import mods.eln.node.transparent.TransparentNodeEntity;
import mods.eln.node.transparent.TransparentNodeItem;
import mods.eln.ore.OreBlock;
import mods.eln.ore.OreDescriptor;
import mods.eln.ore.OreItem;
import mods.eln.server.ConsoleListener;
import mods.eln.server.OreRegenerate;
import mods.eln.server.PlayerManager;
import mods.eln.server.SaveConfig;
import mods.eln.sim.Simulator;
import mods.eln.sim.ThermalLoadInitializer;
import mods.eln.sim.ThermalLoadInitializerByPowerDrop;
import mods.eln.sim.nbt.NbtElectricalLoad;
import mods.eln.sixnode.TreeResinCollector.TreeResinCollectorDescriptor;
import mods.eln.sixnode.batterycharger.BatteryChargerDescriptor;
import mods.eln.sixnode.diode.DiodeDescriptor;
Expand Down Expand Up @@ -671,7 +675,7 @@ public void load(FMLInitializationEvent event) {
try {
// elnHttpServer = new ElnHttpServer();
} catch (Exception e) {
// TODO Auto-generated catch block

e.printStackTrace();
}

Expand Down Expand Up @@ -1550,7 +1554,7 @@ void registerSwitch(int id) {
}

private void registerSixNodeMisc(int id) {
// TODO Auto-generated method stub

int subId, completId;
String name;
{
Expand Down Expand Up @@ -4342,7 +4346,7 @@ void recipeSwitch() {
}

void recipeElectricalRelay() {
// TODO Auto-generated method stub

addRecipe(findItemStack("Low Voltage Relay"),
" I",
" I ",
Expand Down Expand Up @@ -5464,7 +5468,7 @@ void recipeMachine() {
}

private void recipeElectricalGate() {
// TODO Auto-generated method stub

addShapelessRecipe(findItemStack("Electrical Timer"),
new ItemStack(Items.repeater),
findItemStack("Cheap Chip"));
Expand Down Expand Up @@ -5526,7 +5530,7 @@ private void recipeElectricalEnvironnementalSensor() {
}

private void recipeElectricalVuMeter() {
// TODO Auto-generated method stub

for (int idx = 0; idx < 4; idx++) {
addRecipe(findItemStack("Analog vuMeter", 1),
"WWW",
Expand All @@ -5550,7 +5554,7 @@ private void recipeElectricalVuMeter() {
}

private void recipeElectricalBreaker() {
// TODO Auto-generated method stub

addRecipe(findItemStack("Electrical Breaker", 1),
"crC",
Character.valueOf('c'), findItemStack("Overvoltage Protection"),
Expand All @@ -5560,7 +5564,7 @@ private void recipeElectricalBreaker() {
}

private void recipeElectricalGateSource() {
// TODO Auto-generated method stub

addRecipe(findItemStack("Signal Trimmer", 1),
"RsR",
"rRr",
Expand Down Expand Up @@ -5840,7 +5844,7 @@ public static double getSmallRs() {
return instance.lowVoltageCableDescriptor.electricalRs;
}

public static void applySmallRs(NodeElectricalLoad aLoad) {
public static void applySmallRs(NbtElectricalLoad aLoad) {
instance.lowVoltageCableDescriptor.applyTo(aLoad);
}

Expand Down
2 changes: 1 addition & 1 deletion mods/eln/GuiHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public Object getServerGuiElement(int id, EntityPlayer player, World world,

Utils.sendPacketToClient(bos,(EntityPlayerMP)player);
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();

}
Expand Down
20 changes: 11 additions & 9 deletions mods/eln/PacketHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,13 @@

import mods.eln.client.ClientKeyHandler;
import mods.eln.client.ClientProxy;
import mods.eln.item.IInteract;
import mods.eln.misc.Coordonate;
import mods.eln.misc.Utils;
import mods.eln.node.NodeBase;
import mods.eln.node.NodeBlockEntity;
import mods.eln.node.NodeManager;
import mods.eln.server.PlayerManager;
import mods.eln.sound.SoundClient;
import mods.eln.sound.SoundCommand;
import net.minecraft.client.Minecraft;
Expand Down Expand Up @@ -110,7 +112,7 @@ public void packetRx(DataInputStream stream, NetworkManager manager,
packetDestroyUuid(stream, manager, player);
}
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}

Expand All @@ -120,7 +122,7 @@ private void packetDestroyUuid(DataInputStream stream, NetworkManager manager, E
try {
ClientProxy.uuidManager.kill(stream.readInt());
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}
}
Expand All @@ -136,7 +138,7 @@ void packetPlaySound(DataInputStream stream, NetworkManager manager,
SoundClient.play(SoundCommand.fromStream(stream,player.worldObj));

} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}

Expand All @@ -150,7 +152,7 @@ void packetOpenLocalGui(DataInputStream stream, NetworkManager manager,
clientPlayer.worldObj, stream.readInt(), stream.readInt(),
stream.readInt());
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}
// entityPlayer.openGui( Eln.instance, side.getInt(),
Expand All @@ -170,7 +172,7 @@ void packetForNode(DataInputStream stream, NetworkManager manager,
Utils.println("packetForNode node found");
}
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}
}
Expand Down Expand Up @@ -211,7 +213,7 @@ void packetForClientNode(DataInputStream stream, NetworkManager manager,
}*/
}
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}
}
Expand Down Expand Up @@ -251,7 +253,7 @@ void packetNodeSingleSerialized(DataInputStream stream,
}*/
}
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}
}
Expand Down Expand Up @@ -300,7 +302,7 @@ void packetPlayerKey(DataInputStream stream, NetworkManager manager,

}
} catch (IOException e1) {
// TODO Auto-generated catch block

e1.printStackTrace();
}

Expand Down Expand Up @@ -335,7 +337,7 @@ void packetNodeSerialized24bitPosition(DataInputStream stream) {
* Utils.println("No node found"); stream.readShort(); int
* dataSkipLength = stream.readByte(); for(int idx = 0;idx<
* dataSkipLength;idx++) { stream.readByte(); } } } } catch
* (IOException e) { // TODO Auto-generated catch block
* (IOException e) {
* e.printStackTrace(); }
*/
}
Expand Down
4 changes: 2 additions & 2 deletions mods/eln/cable/CableRender.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
import mods.eln.misc.Utils;
import mods.eln.node.NodeBase;
import mods.eln.node.NodeBlockEntity;
import mods.eln.node.SixNodeElementRender;
import mods.eln.node.SixNodeEntity;
import mods.eln.node.six.SixNodeElementRender;
import mods.eln.node.six.SixNodeEntity;
import net.minecraft.block.Block;
import net.minecraft.tileentity.TileEntity;
import net.minecraft.world.World;
Expand Down
2 changes: 1 addition & 1 deletion mods/eln/client/ClientKeyHandler.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ void setState(int id,boolean state){
stream.writeByte(id);
stream.writeBoolean(state);
} catch (IOException e) {
// TODO Auto-generated catch block

e.printStackTrace();
}

Expand Down
8 changes: 4 additions & 4 deletions mods/eln/client/ClientProxy.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@
import mods.eln.Eln;
import mods.eln.entity.ReplicatorEntity;
import mods.eln.entity.ReplicatorRender;
import mods.eln.node.SixNodeEntity;
import mods.eln.node.SixNodeRender;
import mods.eln.node.TransparentNodeEntity;
import mods.eln.node.TransparentNodeRender;
import mods.eln.node.six.SixNodeEntity;
import mods.eln.node.six.SixNodeRender;
import mods.eln.node.transparent.TransparentNodeEntity;
import mods.eln.node.transparent.TransparentNodeRender;
import mods.eln.sixnode.tutorialsign.TutorialSignOverlay;
import mods.eln.sound.SoundClientEventListener;
import net.minecraft.client.model.ModelSilverfish;
Expand Down
8 changes: 4 additions & 4 deletions mods/eln/entity/ReplicatoCableAI.java
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
import mods.eln.misc.Coordonate;
import mods.eln.node.NodeBase;
import mods.eln.node.NodeManager;
import mods.eln.node.SixNode;
import mods.eln.node.SixNodeElement;
import mods.eln.node.six.SixNode;
import mods.eln.node.six.SixNodeElement;
import mods.eln.sim.ElectricalConnection;
import mods.eln.sim.ElectricalLoad;
import mods.eln.sim.ITimeRemoverObserver;
Expand Down Expand Up @@ -75,7 +75,7 @@ public boolean shouldExecute() {

@Override
public boolean continueExecuting() {
// TODO Auto-generated method stub

//Utils.println("Continue");
return cableCoordonate != null;
}
Expand Down Expand Up @@ -151,7 +151,7 @@ ElectricalCableElement getCable(){

@Override
public void startExecuting() {
// TODO Auto-generated method stub

//Utils.println("START REPLICATOOOOOR");

//Utils.println(this.entity.getNavigator().tryMoveToXYZ(-2470,56,-50, 1));
Expand Down
16 changes: 8 additions & 8 deletions mods/eln/entity/ReplicatorEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,16 @@ public ReplicatorEntity(World par1World) {
f.setAccessible(true);
f.set(this, true);
} catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}*/

Expand Down Expand Up @@ -100,14 +100,14 @@ public ReplicatorEntity(World par1World) {

@Override
protected void despawnEntity() {
// TODO Auto-generated method stub

//Utils.println("Replicator despawn");
super.despawnEntity();
}

@Override
public boolean attackEntityAsMob(Entity e) {
// TODO Auto-generated method stub

if(e instanceof ReplicatorEntity){
this.hunger -= 0.8;
((ReplicatorEntity)e).hunger += 0.8;
Expand All @@ -126,7 +126,7 @@ public boolean attackEntityAsMob(Entity e) {

@Override
protected void updateAITick() {
// TODO Auto-generated method stub

super.updateAITick();
// Utils.print(hunger + " ");
hunger += 0.05/hungerTime;
Expand Down Expand Up @@ -210,7 +210,7 @@ protected int getDropItemId()
public static ArrayList<ItemStack> dropList = new ArrayList<ItemStack>();
@Override
protected void dropFewItems(boolean par1, int par2) {
// TODO Auto-generated method stub

this.entityDropItem(dropList.get(new Random().nextInt(dropList.size())).copy(), 0.5f);
if(isSpawnedFromWeather == true){
if(Math.random() < 0.33){
Expand Down
8 changes: 4 additions & 4 deletions mods/eln/entity/ReplicatorPopProcess.java
Original file line number Diff line number Diff line change
Expand Up @@ -101,16 +101,16 @@ public void process(double time) {
// Utils.println("Spawn Replicator at " + x + " " + y + " " + z);
} catch (IllegalArgumentException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (NoSuchFieldException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (SecurityException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
Expand Down
4 changes: 2 additions & 2 deletions mods/eln/entity/ReplicatorRender.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,13 @@ public ReplicatorRender(ModelBase par1ModelBase, float par2)

@Override
protected ResourceLocation getEntityTexture(Entity entity) {
// TODO Auto-generated method stub

return Your_Texture;
}

@Override
public void doRender(Entity par1Entity, double par2, double par4, double par6, float par8, float par9) {
// TODO Auto-generated method stub

/*UtilsClient.disableDepthTest();
GL11.glColor3f(1, 0, 0);*/
super.doRender(par1Entity, par2, par4, par6, par8, par9);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package mods.eln;
package mods.eln.generic;

import cpw.mods.fml.relauncher.Side;
import cpw.mods.fml.relauncher.SideOnly;
Expand Down
2 changes: 1 addition & 1 deletion mods/eln/generic/GenericItemBlockUsingDamage.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class GenericItemBlockUsingDamage<Descriptor extends GenericItemBlockUsin
public GenericItemBlockUsingDamage(Block b) {
super(b);
setHasSubtypes(true);
// TODO Auto-generated constructor stub

}

public void setDefaultElement(Descriptor descriptor)
Expand Down
Loading

0 comments on commit 53e3e2c

Please sign in to comment.