Skip to content

Commit

Permalink
Refactor Elevator
Browse files Browse the repository at this point in the history
  • Loading branch information
Tarig0 committed Aug 6, 2014
1 parent 9ba35cb commit ec25f85
Show file tree
Hide file tree
Showing 8 changed files with 504 additions and 161 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -104,25 +104,21 @@ public IIcon getIcon(IBlockAccess iblockaccess, int i, int j, int k, int l) {

@Override
public IIcon[] registerBottomIcons(IIconRegister iconRegister) {
// TODO Auto-generated method stub
return null;
}

@Override
public IIcon[] registerTopIcons(IIconRegister iconRegister) {
// TODO Auto-generated method stub
return null;
}

@Override
public IIcon[] registerFrontIcons(IIconRegister iconRegister) {
// TODO Auto-generated method stub
return null;
}

@Override
public IIcon[] registerSideIcons(IIconRegister iconRegister) {
// TODO Auto-generated method stub
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
import net.slimevoid.dynamictransport.core.lib.ConfigurationLib;
import net.slimevoid.dynamictransport.core.lib.GuiLib;
import net.slimevoid.dynamictransport.core.lib.PacketLib;
import net.slimevoid.dynamictransport.entities.EntityElevator;
import net.slimevoid.dynamictransport.entities.EntityElevatorPart;
import net.slimevoid.dynamictransport.entities.EntityMasterElevator;
import net.slimevoid.dynamictransport.proxy.CommonProxy;
import net.slimevoid.dynamictransport.tileentity.TileEntityElevator;
import net.slimevoid.dynamictransport.tileentity.TileEntityElevatorComputer;
Expand Down Expand Up @@ -74,7 +75,7 @@ public void preInit() {

@Override
public void registerRenderInformation() {
RenderingRegistry.registerEntityRenderingHandler(EntityElevator.class,
RenderingRegistry.registerEntityRenderingHandler(EntityElevatorPart.class,
new net.slimevoid.dynamictransport.client.render.RenderElevator());
RenderingRegistry.registerBlockHandler( ConfigurationLib.ElevatorRenderId,
new BlockElevatorRenderer());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
import net.minecraft.world.World;
import net.slimevoid.dynamictransport.blocks.BlockTransportBase;
import net.slimevoid.dynamictransport.core.lib.ConfigurationLib;
import net.slimevoid.dynamictransport.entities.EntityElevator;

import net.slimevoid.dynamictransport.entities.EntityElevatorPart;
import org.lwjgl.opengl.GL11;

public class RenderElevator extends Render {
Expand Down Expand Up @@ -157,7 +157,7 @@ public void renderElevatorEntity(Block elevator, World world, int x, int y, int

}

public void doRenderElevator(EntityElevator elevator, double d, double d1, double d2, float f, float f1) {
public void doRenderElevator(EntityElevatorPart elevator, double d, double d1, double d2, float f, float f1) {
if (elevator.ticksExisted <= 1) return;
GL11.glPushMatrix();
Block block = ConfigurationLib.blockTransportBase;
Expand All @@ -169,7 +169,6 @@ public void doRenderElevator(EntityElevator elevator, double d, double d1, doubl
// GL11.glScalef(-1F, -1F, 1.0F); - ceilings?
bindTexture(TextureMap.locationBlocksTexture);

// int textureData[] = elevator.getTextureData();
ItemStack camoItem = elevator.getCamoItem();
IIcon textureData[] = new IIcon[6];
if (camoItem != null && camoItem.getItem() != null) {
Expand Down Expand Up @@ -200,7 +199,7 @@ public void doRenderElevator(EntityElevator elevator, double d, double d1, doubl

@Override
public void doRender(Entity entity, double d, double d1, double d2, float f, float f1) {
doRenderElevator((EntityElevator) entity,
doRenderElevator((EntityElevatorPart) entity,
d,
d1,
d2,
Expand Down
11 changes: 10 additions & 1 deletion src/main/java/net/slimevoid/dynamictransport/core/DTInit.java
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package net.slimevoid.dynamictransport.core;

import net.slimevoid.dynamictransport.core.lib.CoreLib;
import net.slimevoid.dynamictransport.entities.EntityElevatorPart;
import net.slimevoid.dynamictransport.entities.EntityMasterElevator;
import net.slimevoid.library.core.*;
import cpw.mods.fml.common.registry.EntityRegistry;

Expand All @@ -23,13 +25,20 @@ public static void preInitialize() {
}

public static void initialize() {
EntityRegistry.registerModEntity(net.slimevoid.dynamictransport.entities.EntityElevator.class,
EntityRegistry.registerModEntity(EntityMasterElevator.class,
"delv",
0,
DynamicTransportMod.instance,
400,
1,
true);
EntityRegistry.registerModEntity(EntityElevatorPart.class,
"delvp",
1,
DynamicTransportMod.instance,
400,
1,
true);

DynamicTransportMod.proxy.registerTickHandlers();
DynamicTransportMod.proxy.registerEventHandlers();
Expand Down
Loading

0 comments on commit ec25f85

Please sign in to comment.