Skip to content

Commit eaae6d7

Browse files
committed
test stuff
1 parent f5e7a45 commit eaae6d7

25 files changed

+688
-357
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ version = project.mod_version
1010
group = project.maven_group
1111

1212
loom {
13-
accessWidenerPath = file("src/main/resources/siege.accesswidener")
13+
accessWidenerPath = file("src/main/resources/siege.accesswidener")
1414
}
1515

1616
repositories {

gradle.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ loader_version=0.15.1
88

99
# Dependencies
1010
fabric_version=0.91.1+1.20.4
11-
plasmid_version=0.5.102-SNAPSHOT+1.20.4
11+
plasmid_version=0.5.9999-local+1.20.4
1212

1313
# Mod Properties
1414
mod_version=1.0.0

src/main/java/io/github/restioson/siege/entity/SiegeKitStandEntity.java

+17-18
Original file line numberDiff line numberDiff line change
@@ -24,51 +24,50 @@ public final class SiegeKitStandEntity extends ArmorStandEntity {
2424
@Nullable
2525
private final GameTeam team;
2626

27-
private final SiegeKit type;
27+
private final SiegeKit kit;
2828
private final SiegeActive game;
2929

3030
public SiegeKitStandEntity(World world, SiegeActive game, SiegeKitStandLocation stand) {
3131
super(EntityType.ARMOR_STAND, world);
32-
this.type = stand.type();
33-
this.team = stand.team();
32+
this.kit = stand.type();
3433
this.controllingFlag = stand.flag();
34+
this.team = this.controllingFlag != null ? this.controllingFlag.team : stand.team();
3535
this.game = game;
3636
this.setPose(EntityPose.CROUCHING);
3737

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

40-
this.setCustomName(this.type.name);
40+
this.setCustomName(this.kit.name());
4141
this.setInvulnerable(true);
4242
this.setCustomNameVisible(true);
4343
this.setShowArms(true);
44-
this.type.equipArmourStand(this);
44+
this.kit.equipArmourStand(this);
4545
}
4646

4747
public GameTeam getTeam() {
48-
if (this.controllingFlag != null) {
49-
return this.controllingFlag.team;
50-
} else {
51-
return this.team;
52-
}
48+
return this.controllingFlag != null ? this.controllingFlag.team : this.team;
5349
}
5450

5551
public void onControllingFlagCaptured() {
56-
this.type.equipArmourStand(this);
52+
this.kit.equipArmourStand(this);
5753
}
5854

5955
@Override
60-
public ActionResult interactAt(PlayerEntity player, Vec3d hitPos, Hand hand) {
61-
SiegePlayer participant = this.game.participant((ServerPlayerEntity) player);
62-
if (participant == null || ((ServerPlayerEntity) player).interactionManager.getGameMode() != GameMode.SURVIVAL) {
56+
public ActionResult interactAt(PlayerEntity playerEntity, Vec3d hitPos, Hand hand) {
57+
var player = (ServerPlayerEntity) playerEntity;
58+
SiegePlayer participant = this.game.participant(player);
59+
60+
if (participant == null || player.interactionManager.getGameMode() != GameMode.SURVIVAL) {
6361
return ActionResult.FAIL;
6462
}
6563

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

70-
participant.kit = this.type;
71-
this.type.equipPlayer((ServerPlayerEntity) player, participant, this.game.world, this.game.config);
68+
participant.kit.returnResources(player, participant);
69+
participant.kit = this.kit;
70+
this.kit.equipPlayer(player, participant, this.game.config, player.getWorld().getTime());
7271
return ActionResult.SUCCESS;
7372
}
7473

@@ -78,7 +77,7 @@ public boolean isImmobile() {
7877
}
7978

8079
@Override
81-
public void takeKnockback(double strength, double x, double z) {
82-
super.takeKnockback(strength, x, z);
80+
public boolean isMarker() {
81+
return true;
8382
}
8483
}

0 commit comments

Comments
 (0)