train bounding box, fixes

This commit is contained in:
Boblet 2023-05-10 16:51:42 +02:00
parent adc651eecc
commit dcec262717
5 changed files with 15 additions and 2 deletions

View File

@ -14,6 +14,7 @@ import com.hbm.entity.mob.botprime.*;
import com.hbm.entity.mob.siege.*;
import com.hbm.entity.particle.*;
import com.hbm.entity.projectile.*;
import com.hbm.entity.train.EntityRailCarBase.BoundingBoxDummyEntity;
import com.hbm.entity.train.EntityRailCarRidable.SeatDummyEntity;
import com.hbm.entity.train.TrainCargoTram;
import com.hbm.main.MainRegistry;
@ -212,6 +213,7 @@ public class EntityMappings {
addEntity(EntityMist.class, "entity_mist", 1000);
addEntity(SeatDummyEntity.class, "entity_ntm_seat_dummy", 250, false);
addEntity(BoundingBoxDummyEntity.class, "entity_ntm_bounding_dummy", 250, false);
addEntity(TrainCargoTram.class, "entity_ntm_cargo_tram", 250, false);
addMob(EntityCreeperNuclear.class, "entity_mob_nuclear_creeper", 0x204131, 0x75CE00);

View File

@ -196,4 +196,14 @@ public abstract class EntityRailCarBase extends Entity {
this.velocityY = this.motionY = mY;
this.velocityZ = this.motionZ = mZ;
}
/** Invisible entities that make up the dynamic bounding structure of the train, moving as the train rotates. */
public static class BoundingBoxDummyEntity extends Entity {
public BoundingBoxDummyEntity(World world) { this(world, 1F, 1F); }
public BoundingBoxDummyEntity(World world, float width, float height) { super(world); this.setSize(width, height);}
@Override protected void entityInit() { }
@Override protected void writeEntityToNBT(NBTTagCompound nbt) { }
@Override public boolean writeToNBTOptional(NBTTagCompound nbt) { return false; }
@Override public void readEntityFromNBT(NBTTagCompound nbt) { this.setDead(); }
}
}

View File

@ -120,6 +120,7 @@ public abstract class EntityRailCarRidable extends EntityRailCarCargo {
public abstract Vec3[] getPassengerSeats();
/** Dynamic seats generated when a player clicks near a seat-spot, moves and rotates with the train as one would expect. */
public static class SeatDummyEntity extends Entity {
public SeatDummyEntity(World world) { super(world); this.setSize(0.5F, 0.1F);}
@Override protected void entityInit() { }

View File

@ -202,7 +202,7 @@ public class TileEntityMachinePress extends TileEntityMachineBase implements IGU
@Override
public int[] getAccessibleSlotsFromSide(int side) {
return side == 0 ? new int[] { 3 } : new int[] { 0, 1, 2 };
return new int[] { 0, 1, 2, 3 };
}
@Override

View File

@ -273,7 +273,7 @@ public class TileEntitySawmill extends TileEntityMachineBase {
}
if(names.contains("plankWood")) {
return new ItemStack(Items.stick, 4);
return new ItemStack(Items.stick, 6);
}
if(names.contains("treeSapling")) {