Skip to content

Commit

Permalink
Working bug fix this time
Browse files Browse the repository at this point in the history
  • Loading branch information
thecatcore committed Aug 12, 2020
1 parent 94d7e24 commit 936053a
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ minecraft_version=1.16.2
yarn_mappings=1.16.2+build.6
loader_version=0.9.1+build.205
# Mod Properties
mod_version=1.1.8
mod_version=1.1.9
maven_group=fr.catcore
archives_base_name=deacoudre
# Dependencies
Expand Down
6 changes: 4 additions & 2 deletions src/main/java/fr/catcore/deacoudre/game/DeACoudreActive.java
Original file line number Diff line number Diff line change
Expand Up @@ -131,8 +131,10 @@ private void addPlayer(ServerPlayerEntity player) {

private boolean onPlayerDamage(ServerPlayerEntity player, DamageSource source, float amount) {
if (player == null) return true;
double playerY = player.getPos().y;
if (source == DamageSource.FALL && playerY < this.config.mapConfig.height + 1) {
Vec3d playerPos = player.getPos();
BlockBounds poolBounds = this.gameMap.getTemplate().getFirstRegion("pool");
boolean isInPool = poolBounds.contains((int)playerPos.x, (int)playerPos.y, (int)playerPos.z);
if (source == DamageSource.FALL && ((playerPos.y < 10 && playerPos.y > 6) || isInPool)) {

if (this.lifeMap.get(PlayerRef.of(player)) < 2) this.eliminatePlayer(player);
else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ private void buildPool(MapTemplate builder) {
shape.generatePool(this.config, builder, mutablePosWater, mutablePosBorder);

BlockBounds bounds = new BlockBounds(
new BlockPos(-config.radius, 2, -config.radius),
new BlockPos(config.radius, 2, config.radius)
new BlockPos(-config.radius - 1, 0, 4),
new BlockPos(config.radius + 1, 4, 6 + 2*config.radius)
);
builder.addRegion("pool", bounds);
}
Expand Down

0 comments on commit 936053a

Please sign in to comment.