Fixed some bugs

This commit is contained in:
Danil Venikov
2022-11-24 19:51:01 +02:00
parent 1a4278539b
commit 97c24c4b36
16 changed files with 79 additions and 3133 deletions

View File

@@ -33,7 +33,7 @@ import java.util.UUID;
import java.util.stream.Collectors;
// The value here should match an entry in the META-INF/mods.toml file
@Mod("siegemachines")
@Mod(SiegeMachines.ID)
public class SiegeMachines
{
public static final String ID = "siegemachines";

View File

@@ -26,10 +26,11 @@ import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class Ballista extends ShootingMachine implements IAnimatable
{
private final AnimationFactory factory = new AnimationFactory(this);
private final AnimationFactory factory = GeckoLibUtil.createFactory(this);
static AnimationBuilder SHOOTING_ANIM = new AnimationBuilder().addAnimation("Shooting", true);
static AnimationBuilder RELOADING_ANIM = new AnimationBuilder().addAnimation("Reloading", true);

View File

@@ -26,11 +26,12 @@ import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class BatteringRam extends Machine implements IAnimatable
{
private final AnimationFactory factory = new AnimationFactory(this);
private final AnimationFactory factory = GeckoLibUtil.createFactory(this);
static AnimationBuilder MOVING_ANIM = new AnimationBuilder().addAnimation("Moving", true);
static AnimationBuilder HITTING_ANIM = new AnimationBuilder().addAnimation("Hitting", true);

View File

@@ -25,10 +25,11 @@ import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class Catapult extends ShootingMachine implements IAnimatable
{
private final AnimationFactory factory = new AnimationFactory(this);
private final AnimationFactory factory = GeckoLibUtil.createFactory(this);
static AnimationBuilder SHOOTING_ANIM = new AnimationBuilder().addAnimation("Shooting", true);
static AnimationBuilder RELOADING_ANIM = new AnimationBuilder().addAnimation("Reloading", true);

View File

@@ -29,10 +29,11 @@ import software.bernie.geckolib3.core.event.SoundKeyframeEvent;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class Culverin extends ShootingMachine implements IAnimatable, IReloading
{
private final AnimationFactory factory = new AnimationFactory(this);
private final AnimationFactory factory = GeckoLibUtil.createFactory(this);
static AnimationBuilder MOVING_ANIM = new AnimationBuilder().addAnimation("Moving", true);
// static AnimationBuilder TILTING_ANIM = new AnimationBuilder().addAnimation("Tilting", true);

View File

@@ -35,10 +35,11 @@ import software.bernie.geckolib3.core.event.SoundKeyframeEvent;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class Mortar extends ShootingMachine implements IAnimatable, IReloading
{
private final AnimationFactory factory = new AnimationFactory(this);
private final AnimationFactory factory = GeckoLibUtil.createFactory(this);
static AnimationBuilder MOVING_ANIM = new AnimationBuilder().addAnimation("Moving", true);

View File

@@ -25,10 +25,11 @@ import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
import software.bernie.geckolib3.util.GeckoLibUtil;
public class Trebuchet extends ShootingMachine implements IAnimatable
{
private final AnimationFactory factory = new AnimationFactory(this);
private final AnimationFactory factory = GeckoLibUtil.createFactory(this);
static AnimationBuilder SHOOTING_ANIM = new AnimationBuilder().addAnimation("Shooting", true);
static AnimationBuilder RELOADING_ANIM = new AnimationBuilder().addAnimation("Reloading", true);

View File

@@ -51,7 +51,7 @@ public class MachineItem extends Item implements IAnimatable
private final String entitykey;
private final String typekey;
public MachineItem(Item.Properties prop, String entitykey, String typekey)
public MachineItem(Properties prop, String entitykey, String typekey)
{
super(prop.stacksTo(1));
this.entitykey = entitykey;
@@ -152,7 +152,7 @@ public class MachineItem extends Item implements IAnimatable
public Entity spawn(EntityType<?> entitytype, ServerWorld p_220342_1_, @Nullable CompoundNBT p_220342_2_, @Nullable ITextComponent p_220342_3_, @Nullable PlayerEntity p_220342_4_, BlockPos p_220342_5_, SpawnReason p_220342_6_, boolean p_220342_7_, boolean p_220342_8_, float yaw) {
Entity t = this.create(entitytype, p_220342_1_, p_220342_2_, p_220342_3_, p_220342_4_, p_220342_5_, p_220342_6_, p_220342_7_, p_220342_8_, yaw);
if (t != null) {
if (t instanceof net.minecraft.entity.MobEntity && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((net.minecraft.entity.MobEntity) t, p_220342_1_, p_220342_5_.getX(), p_220342_5_.getY(), p_220342_5_.getZ(), null, p_220342_6_)) return null;
if (t instanceof MobEntity && net.minecraftforge.event.ForgeEventFactory.doSpecialSpawn((MobEntity) t, p_220342_1_, p_220342_5_.getX(), p_220342_5_.getY(), p_220342_5_.getZ(), null, p_220342_6_)) return null;
p_220342_1_.addFreshEntityWithPassengers(t);
}