use of eu.pb4.tatercart.entity.minecart.storage.ShulkerMinecartEntity in project TaterCart by Patbox.
the class AbstractMinecartEntityMixin method tatercart_onCreate.
@Inject(method = "create", at = @At("HEAD"), cancellable = true)
private static void tatercart_onCreate(World world, double x, double y, double z, AbstractMinecartEntity.Type type, CallbackInfoReturnable<AbstractMinecartEntity> cir) {
var dyeColor = CustomMinecartType.COLORED.inverse().getOrDefault(type, null);
AbstractMinecartEntity entity;
if (dyeColor != null) {
entity = new ColoredMinecartEntity(TcEntities.COLORED_MINECART.get(dyeColor), world);
} else if (type == CustomMinecartType.SLIME) {
entity = new SlimeMinecartEntity(TcEntities.SLIME_MINECART, world);
} else if (type == CustomMinecartType.BARREL) {
entity = new BarrelMinecartEntity(TcEntities.BARREL_MINECART, world);
} else if (type == CustomMinecartType.SHULKER) {
entity = new ShulkerMinecartEntity(TcEntities.SHULKER_MINECART, world);
} else if (type == CustomMinecartType.DISPENSER) {
entity = new DispenserMinecartEntity(TcEntities.DISPENSER_MINECART, world);
} else if (type == CustomMinecartType.DROPPER) {
entity = new DropperMinecartEntity(TcEntities.DROPPER_MINECART, world);
} else {
entity = null;
}
if (entity != null) {
entity.setPosition(x, y, z);
cir.setReturnValue(entity);
}
}
Aggregations