-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0e899f6
commit 403620c
Showing
48 changed files
with
386 additions
and
432 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
10 changes: 10 additions & 0 deletions
10
winterly-common/src/main/java/ru/pinkgoosik/winterly/block/base/BaseTransparentBlock.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 |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package ru.pinkgoosik.winterly.block.base; | ||
|
||
import net.minecraft.world.level.block.TransparentBlock; | ||
|
||
public class BaseTransparentBlock extends TransparentBlock { | ||
|
||
public BaseTransparentBlock(Properties properties) { | ||
super(properties); | ||
} | ||
} |
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
3 changes: 2 additions & 1 deletion
3
winterly-common/src/main/java/ru/pinkgoosik/winterly/extension/DecoratedMob.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,6 +1,7 @@ | ||
package ru.pinkgoosik.winterly.extension; | ||
|
||
public interface DecoratedMob { | ||
boolean winterly$decorated(); | ||
boolean winterly$isDecorated(); | ||
int winterly$getIndex(); | ||
void winterly$setDecoration(int index); | ||
} |
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
42 changes: 42 additions & 0 deletions
42
winterly-common/src/main/java/ru/pinkgoosik/winterly/mixin/common/AbstractSkeletonMixin.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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
package ru.pinkgoosik.winterly.mixin.common; | ||
|
||
import net.minecraft.world.DifficultyInstance; | ||
import net.minecraft.world.entity.EntityType; | ||
import net.minecraft.world.entity.MobSpawnType; | ||
import net.minecraft.world.entity.SpawnGroupData; | ||
import net.minecraft.world.entity.monster.AbstractSkeleton; | ||
import net.minecraft.world.entity.monster.Monster; | ||
import net.minecraft.world.entity.monster.RangedAttackMob; | ||
import net.minecraft.world.entity.monster.Skeleton; | ||
import net.minecraft.world.level.Level; | ||
import net.minecraft.world.level.ServerLevelAccessor; | ||
import org.spongepowered.asm.mixin.Mixin; | ||
import org.spongepowered.asm.mixin.injection.At; | ||
import org.spongepowered.asm.mixin.injection.Inject; | ||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; | ||
import ru.pinkgoosik.winterly.Winterly; | ||
import ru.pinkgoosik.winterly.extension.DecoratedMob; | ||
import ru.pinkgoosik.winterly.util.HolidayUtils; | ||
|
||
@Mixin(AbstractSkeleton.class) | ||
abstract class AbstractSkeletonMixin extends Monster implements RangedAttackMob { | ||
|
||
protected AbstractSkeletonMixin(EntityType<? extends Monster> entityType, Level level) { | ||
super(entityType, level); | ||
} | ||
|
||
@Inject(method = "finalizeSpawn", at = @At("RETURN")) | ||
void finalizeSpawn(ServerLevelAccessor level, DifficultyInstance difficulty, MobSpawnType spawnType, SpawnGroupData spawnGroupData, CallbackInfoReturnable<SpawnGroupData> cir) { | ||
|
||
if((Object)this instanceof Skeleton skeleton && skeleton instanceof DecoratedMob decorated && !spawnType.equals(MobSpawnType.SPAWNER) && !spawnType.equals(MobSpawnType.CHUNK_GENERATION)) { | ||
if(Winterly.config.mobDecorations.enabled && HolidayUtils.isWinterHolidays() || !Winterly.config.mobDecorations.onlyInWinter) { | ||
if(!this.level().dimension().equals(Level.NETHER)) { | ||
int chance = Winterly.config.mobDecorations.chance; | ||
if(chance > 0 && Math.random() < (double)chance / 100) { | ||
decorated.winterly$setDecoration(level.getRandom().nextInt(5)); | ||
} | ||
} | ||
} | ||
} | ||
} | ||
} |
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
44 changes: 0 additions & 44 deletions
44
winterly-common/src/main/java/ru/pinkgoosik/winterly/mixin/common/MiningToolItemMixin.java
This file was deleted.
Oops, something went wrong.
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
Oops, something went wrong.