generated from FabricMC/fabric-example-mod
-
Notifications
You must be signed in to change notification settings - Fork 182
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Nether spawn now hopefully works as in the 1.16.1 version again * Nether spawn now no longer prevents players from choosing origins of additional layers * Players are now invulnerable while choosing origins
- Loading branch information
Showing
9 changed files
with
57 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 9 additions & 9 deletions
18
src/main/java/io/github/apace100/origins/power/InvulnerablePower.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,20 @@ | ||
package io.github.apace100.origins.power; | ||
|
||
import net.minecraft.entity.damage.DamageSource; | ||
import net.minecraft.entity.player.PlayerEntity; | ||
|
||
import java.util.function.Predicate; | ||
|
||
public class InvulnerablePower extends Power { | ||
|
||
public InvulnerablePower(PowerType<?> type, PlayerEntity player) { | ||
super(type, player); | ||
} | ||
private final Predicate<DamageSource> damageSources; | ||
|
||
@Override | ||
public void onAdded() { | ||
player.setInvulnerable(true); | ||
public InvulnerablePower(PowerType<?> type, PlayerEntity player, Predicate<DamageSource> damageSourcePredicate) { | ||
super(type, player); | ||
this.damageSources = damageSourcePredicate; | ||
} | ||
|
||
@Override | ||
public void onRemoved() { | ||
player.setInvulnerable(player.isCreative() || player.isSpectator()); | ||
public boolean doesApply(DamageSource source) { | ||
return damageSources.test(source); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters