Skip to content

Commit

Permalink
test stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
Restioson committed Jun 16, 2024
1 parent f5e7a45 commit eaae6d7
Show file tree
Hide file tree
Showing 25 changed files with 688 additions and 357 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ version = project.mod_version
group = project.maven_group

loom {
accessWidenerPath = file("src/main/resources/siege.accesswidener")
accessWidenerPath = file("src/main/resources/siege.accesswidener")
}

repositories {
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ loader_version=0.15.1

# Dependencies
fabric_version=0.91.1+1.20.4
plasmid_version=0.5.102-SNAPSHOT+1.20.4
plasmid_version=0.5.9999-local+1.20.4

# Mod Properties
mod_version=1.0.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,51 +24,50 @@ public final class SiegeKitStandEntity extends ArmorStandEntity {
@Nullable
private final GameTeam team;

private final SiegeKit type;
private final SiegeKit kit;
private final SiegeActive game;

public SiegeKitStandEntity(World world, SiegeActive game, SiegeKitStandLocation stand) {
super(EntityType.ARMOR_STAND, world);
this.type = stand.type();
this.team = stand.team();
this.kit = stand.type();
this.controllingFlag = stand.flag();
this.team = this.controllingFlag != null ? this.controllingFlag.team : stand.team();
this.game = game;
this.setPose(EntityPose.CROUCHING);

this.updatePositionAndAngles(stand.pos().x, stand.pos().y, stand.pos().z, stand.yaw(), 0);

this.setCustomName(this.type.name);
this.setCustomName(this.kit.name());
this.setInvulnerable(true);
this.setCustomNameVisible(true);
this.setShowArms(true);
this.type.equipArmourStand(this);
this.kit.equipArmourStand(this);
}

public GameTeam getTeam() {
if (this.controllingFlag != null) {
return this.controllingFlag.team;
} else {
return this.team;
}
return this.controllingFlag != null ? this.controllingFlag.team : this.team;
}

public void onControllingFlagCaptured() {
this.type.equipArmourStand(this);
this.kit.equipArmourStand(this);
}

@Override
public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) {
SiegePlayer participant = this.game.participant((ServerPlayerEntity) player);
if (participant == null || ((ServerPlayerEntity) player).interactionManager.getGameMode() != GameMode.SURVIVAL) {
public ActionResult interactAt(PlayerEntity playerEntity, Vec3d hitPos, Hand hand) {
var player = (ServerPlayerEntity) playerEntity;
SiegePlayer participant = this.game.participant(player);

if (participant == null || player.interactionManager.getGameMode() != GameMode.SURVIVAL) {
return ActionResult.FAIL;
}

if (participant.team != this.getTeam()) {
return ActionResult.FAIL;
}

participant.kit = this.type;
this.type.equipPlayer((ServerPlayerEntity) player, participant, this.game.world, this.game.config);
participant.kit.returnResources(player, participant);
participant.kit = this.kit;
this.kit.equipPlayer(player, participant, this.game.config, player.getWorld().getTime());
return ActionResult.SUCCESS;
}

Expand All @@ -78,7 +77,7 @@ public boolean isImmobile() {
}

@Override
public void takeKnockback(double strength, double x, double z) {
super.takeKnockback(strength, x, z);
public boolean isMarker() {
return true;
}
}
Loading

0 comments on commit eaae6d7

Please sign in to comment.