Skip to content

Commit

Permalink
Use settings
Browse files Browse the repository at this point in the history
  • Loading branch information
TreeOfSelf committed Dec 22, 2024
1 parent 15ad6c9 commit c4e0fb3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.jsorrell.carpetskyadditions.mixin;

import com.jsorrell.carpetskyadditions.settings.SkyAdditionsSettings;
import net.minecraft.world.entity.*;
import net.minecraft.world.entity.monster.Blaze;
import net.minecraft.world.level.Level;
Expand All @@ -15,10 +16,12 @@ public abstract class BlazeToBreezeMixin {
at = @At(value = "INVOKE", target = "Lnet/minecraft/world/entity/EntityType;create(Lnet/minecraft/world/level/Level;Lnet/minecraft/world/entity/EntitySpawnReason;)Lnet/minecraft/world/entity/Entity;")
)
private Entity redirectEntityCreation(EntityType<?> entityType, Level level, EntitySpawnReason reason) {
if ((Object) this instanceof Blaze) {
Blaze blaze = (Blaze)(Object) this;
if (blaze.level().dimension() == Level.NETHER && !blaze.hasCustomName()) {
return EntityType.BREEZE.create(level, reason);
if (SkyAdditionsSettings.blazeToBreeze) {
if ((Object) this instanceof Blaze) {
Blaze blaze = (Blaze) (Object) this;
if (blaze.level().dimension() == Level.NETHER && !blaze.hasCustomName()) {
return EntityType.BREEZE.create(level, reason);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.jsorrell.carpetskyadditions.mixin;

import com.jsorrell.carpetskyadditions.advancements.criterion.SkyAdditionsCriteriaTriggers;
import com.jsorrell.carpetskyadditions.settings.SkyAdditionsSettings;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.server.level.ServerPlayer;
Expand Down Expand Up @@ -33,7 +34,8 @@ public class PaleOakSaplingMixin {
)
public void advanceTree(ServerLevel level, BlockPos pos, BlockState state, RandomSource random, CallbackInfo ci) {
// Ensure the block is the Pale Oak Sapling
if (state.getBlock() == Blocks.PALE_OAK_SAPLING) {
if ( SkyAdditionsSettings.paleBlossomCreakingHeart &&
state.getBlock() == Blocks.PALE_OAK_SAPLING) {
boolean eyeBlossomNearby = false;

int range = 3;
Expand Down

0 comments on commit c4e0fb3

Please sign in to comment.