diff --git a/models/TestCar.tcn b/models/TestCar.tcn index 2916bb1a..027630c7 100644 Binary files a/models/TestCar.tcn and b/models/TestCar.tcn differ diff --git a/resources/assets/dark/textures/models/TestCar.png b/resources/assets/dark/textures/models/TestCar.png index 632cae0b..27b50644 100644 Binary files a/resources/assets/dark/textures/models/TestCar.png and b/resources/assets/dark/textures/models/TestCar.png differ diff --git a/src/dark/core/client/ClientProxy.java b/src/dark/core/client/ClientProxy.java index 537b2c75..8275e225 100644 --- a/src/dark/core/client/ClientProxy.java +++ b/src/dark/core/client/ClientProxy.java @@ -21,7 +21,6 @@ import dark.core.common.machines.TileEntityBatteryBox; import dark.core.common.machines.TileEntityCoalGenerator; import dark.core.common.machines.TileEntityElectricFurnace; import dark.core.prefab.ModPrefab; -import dark.core.prefab.vehicles.EntityDrivable; import dark.core.prefab.vehicles.EntityTestCar; @SideOnly(Side.CLIENT) diff --git a/src/dark/core/client/renders/RenderTestCar.java b/src/dark/core/client/renders/RenderTestCar.java index 35a11521..4d6f5bef 100644 --- a/src/dark/core/client/renders/RenderTestCar.java +++ b/src/dark/core/client/renders/RenderTestCar.java @@ -1,7 +1,6 @@ package dark.core.client.renders; import net.minecraft.client.model.ModelBase; -import net.minecraft.client.model.ModelBoat; import net.minecraft.client.renderer.entity.Render; import net.minecraft.entity.Entity; import net.minecraft.util.MathHelper; @@ -12,13 +11,13 @@ import org.lwjgl.opengl.GL11; import cpw.mods.fml.relauncher.Side; import cpw.mods.fml.relauncher.SideOnly; import dark.core.client.models.ModelTestCar; +import dark.core.common.DarkMain; import dark.core.prefab.EntityAdvanced; -import dark.core.prefab.vehicles.EntityDrivable; @SideOnly(Side.CLIENT) public class RenderTestCar extends Render { - private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/boat.pn"); + private static final ResourceLocation TEXTURE = new ResourceLocation(DarkMain.getInstance().DOMAIN, DarkMain.MODEL_DIRECTORY + "TestCar.png"); /** instance of ModelBoat for rendering */ protected ModelBase modelBoat; @@ -34,7 +33,7 @@ public class RenderTestCar extends Render { GL11.glPushMatrix(); - GL11.glTranslatef((float) rx, (float) ry + .8f, (float) rz); + GL11.glTranslatef((float) rx, (float) ry + 1.2f, (float) rz); GL11.glRotatef(180.0F - rYaw, 0.0F, 1.0F, 0.0F); if (entity instanceof EntityAdvanced) { diff --git a/src/dark/core/common/DarkMain.java b/src/dark/core/common/DarkMain.java index 3dd25096..1d0f4d22 100644 --- a/src/dark/core/common/DarkMain.java +++ b/src/dark/core/common/DarkMain.java @@ -68,7 +68,8 @@ import dark.core.prefab.ModPrefab; import dark.core.prefab.fluids.EnumGas; import dark.core.prefab.machine.BlockMulti; import dark.core.prefab.machine.TileEntityNBTContainer; -import dark.core.prefab.vehicles.EntityDrivable; +import dark.core.prefab.vehicles.EntityTestCar; +import dark.core.prefab.vehicles.EntityVehicle; import dark.core.prefab.vehicles.ItemVehicleSpawn; import dark.core.registration.ModObjectRegistry; @@ -137,8 +138,8 @@ public class DarkMain extends ModPrefab public void init(FMLInitializationEvent event) { super.init(event); - EntityRegistry.registerGlobalEntityID(EntityDrivable.class, "TestCar", EntityRegistry.findGlobalUniqueEntityId()); - EntityRegistry.registerModEntity(EntityDrivable.class, "TestCar", 60, this, 64, 1, true); + EntityRegistry.registerGlobalEntityID(EntityTestCar.class, "TestCar", EntityRegistry.findGlobalUniqueEntityId()); + EntityRegistry.registerModEntity(EntityTestCar.class, "TestCar", 60, this, 64, 1, true); for (EnumGas gas : EnumGas.values()) { diff --git a/src/dark/core/helpers/RayTraceHelper.java b/src/dark/core/helpers/RayTraceHelper.java index ca4e3003..fbaf7beb 100644 --- a/src/dark/core/helpers/RayTraceHelper.java +++ b/src/dark/core/helpers/RayTraceHelper.java @@ -74,22 +74,22 @@ public class RayTraceHelper AxisAlignedBB boxToScan = AxisAlignedBB.getBoundingBox(start.xCoord, start.zCoord, start.yCoord, end.xCoord, end.yCoord, end.zCoord); MovingObjectPosition pickedEntity = null; - List entitiesHit; + List entities; if (exclude == null) { - entitiesHit = world.getEntitiesWithinAABB(Entity.class, boxToScan); + entities = world.getEntitiesWithinAABB(Entity.class, boxToScan); } else { - entitiesHit = world.getEntitiesWithinAABBExcludingEntity(exclude, boxToScan); + entities = world.getEntitiesWithinAABBExcludingEntity(exclude, boxToScan); } double closestEntity = start.distanceTo(end); - if (entitiesHit == null || entitiesHit.isEmpty()) + if (entities == null || entities.isEmpty()) { return null; } - for (Entity entityHit : entitiesHit) + for (Entity entityHit : entities) { if (entityHit != null && entityHit.canBeCollidedWith() && entityHit.boundingBox != null) { diff --git a/src/dark/core/prefab/vehicles/EntityTestCar.java b/src/dark/core/prefab/vehicles/EntityTestCar.java index 6da4d6df..a6fcb45c 100644 --- a/src/dark/core/prefab/vehicles/EntityTestCar.java +++ b/src/dark/core/prefab/vehicles/EntityTestCar.java @@ -3,7 +3,7 @@ package dark.core.prefab.vehicles; import dark.core.common.CoreRecipeLoader; import net.minecraft.world.World; -public class EntityTestCar extends EntityDrivable +public class EntityTestCar extends EntityVehicle { public EntityTestCar(World world) diff --git a/src/dark/core/prefab/vehicles/EntityDrivable.java b/src/dark/core/prefab/vehicles/EntityVehicle.java similarity index 97% rename from src/dark/core/prefab/vehicles/EntityDrivable.java rename to src/dark/core/prefab/vehicles/EntityVehicle.java index 0dd1ea7d..6a6f2253 100644 --- a/src/dark/core/prefab/vehicles/EntityDrivable.java +++ b/src/dark/core/prefab/vehicles/EntityVehicle.java @@ -23,7 +23,7 @@ import dark.core.network.PacketManagerEntity; import dark.core.network.PacketManagerKeyEvent; import dark.core.prefab.EntityAdvanced; -public abstract class EntityDrivable extends EntityAdvanced implements IControlReceiver, ISimplePacketReceiver +public abstract class EntityVehicle extends EntityAdvanced implements IControlReceiver, ISimplePacketReceiver { //1m/tick is 80km/h or 50mi/h //0.5/tick is 40km/h @@ -32,18 +32,18 @@ public abstract class EntityDrivable extends EntityAdvanced implements IControlR public double boatX, boatY, boatZ, boatYaw, boatPitch; public int boatPosRotationIncrements; - public EntityDrivable(World world) + public EntityVehicle(World world) { super(world); this.setSize(0.98F, 0.7F); this.preventEntitySpawning = true; this.ignoreFrustumCheck = true; this.isImmuneToFire = true; - this.yOffset = 1.0f; + this.yOffset = 0.45f; PacketManagerKeyEvent.instance().register(this); } - public EntityDrivable(World world, double xx, double yy, double zz) + public EntityVehicle(World world, double xx, double yy, double zz) { this(world); this.setPosition(xx, yy + this.yOffset, zz); @@ -93,8 +93,8 @@ public abstract class EntityDrivable extends EntityAdvanced implements IControlR if (this.riddenByEntity != null) { //Changes the player's position based on the boats rotation - double deltaX = Math.cos(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.5D; - double deltaZ = Math.sin(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.5D; + double deltaX = Math.cos(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.23D; + double deltaZ = Math.sin(this.rotationYaw * Math.PI / 180.0D + 114.8) * -0.23D; this.riddenByEntity.setPosition(this.posX + deltaX, this.posY + this.riddenByEntity.getYOffset(), this.posZ + deltaZ); if (this.riddenByEntity.rotationYaw > this.rotationYaw + 30) @@ -112,7 +112,7 @@ public abstract class EntityDrivable extends EntityAdvanced implements IControlR public void onUpdate() { super.onUpdate(); - + this.applyFriction(); if (this.worldObj.isRemote) { this.worldObj.spawnParticle("mobSpell", this.posX, this.posY, this.posZ, 0, 0, 0); @@ -173,7 +173,6 @@ public abstract class EntityDrivable extends EntityAdvanced implements IControlR this.moveEntity(this.motionX, this.motionY, this.motionZ); } - this.applyFriction(); if (this.speed > this.maxSpeed) { this.speed = this.maxSpeed; @@ -419,7 +418,7 @@ public abstract class EntityDrivable extends EntityAdvanced implements IControlR @Override public double getMountedYOffset() { - return -.3; + return -.2; } @Override diff --git a/src/dark/core/prefab/vehicles/ItemVehicleSpawn.java b/src/dark/core/prefab/vehicles/ItemVehicleSpawn.java index ed758877..a438e944 100644 --- a/src/dark/core/prefab/vehicles/ItemVehicleSpawn.java +++ b/src/dark/core/prefab/vehicles/ItemVehicleSpawn.java @@ -97,7 +97,7 @@ public class ItemVehicleSpawn extends Item --y; } - EntityDrivable spawnedEntity = new EntityTestCar(world, hitObj.blockX + 0.5F, y + 1.0F, hitObj.blockZ + 0.5F); + EntityTestCar spawnedEntity = new EntityTestCar(world, hitObj.blockX + 0.5F, y + 1.0F, hitObj.blockZ + 0.5F); //Last collision check using the entities collision box if (!world.getCollidingBoundingBoxes(spawnedEntity, spawnedEntity.boundingBox.expand(-0.1D, -0.1D, -0.1D)).isEmpty())