Skip to content

Commit

Permalink
port 1.19.3
Browse files Browse the repository at this point in the history
  • Loading branch information
MORIMORI0317 committed Dec 10, 2022
1 parent 9f3f2c6 commit 55388c8
Show file tree
Hide file tree
Showing 27 changed files with 567 additions and 101 deletions.
1 change: 1 addition & 0 deletions .architectury-transformer/debug.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[Architectury Transformer DEBUG] Closed File Systems for V:\dev\minecraft\BEStyleWither\common\build\libs\bestylewither-1.4.0.jar
Original file line number Diff line number Diff line change
@@ -1,9 +1,16 @@
package net.morimori0317.bestylewither;

import net.morimori0317.bestylewither.config.BESConfig;
import net.morimori0317.bestylewither.explatform.BSWExpectPlatform;

public class BEStyleWither {
public static final String MODID = "bestylewither";

public static void init() {

}

public static BESConfig getConfig() {
return BSWExpectPlatform.getConfig();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package net.morimori0317.bestylewither.config;

public interface BESConfig {
BESConfig DEFAULT = new DefaultBESConfig();

boolean isEnableBounceBlueWitherSkull();

boolean isEnableMoreInertialBlueWitherSkull();

boolean isEnableShootMoreBlueWitherSkull();

boolean isEnableSpinAndWhiteSummon();

boolean isEnableExplodeByHalfHealth();

boolean isEnableExplodeByDie();

boolean isEnableChargeAttack();

boolean isEnableDoubleHealth();

boolean isEnableMaintainWeakenedState();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
package net.morimori0317.bestylewither.config;

public class DefaultBESConfig implements BESConfig {
@Override
public boolean isEnableBounceBlueWitherSkull() {
return true;
}

@Override
public boolean isEnableMoreInertialBlueWitherSkull() {
return true;
}

@Override
public boolean isEnableShootMoreBlueWitherSkull() {
return true;
}

@Override
public boolean isEnableSpinAndWhiteSummon() {
return true;
}

@Override
public boolean isEnableExplodeByHalfHealth() {
return true;
}

@Override
public boolean isEnableExplodeByDie() {
return true;
}

@Override
public boolean isEnableChargeAttack() {
return true;
}

@Override
public boolean isEnableDoubleHealth() {
return true;
}

@Override
public boolean isEnableMaintainWeakenedState() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import net.minecraft.world.entity.boss.wither.WitherBoss;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.phys.Vec3;
import net.morimori0317.bestylewither.BEStyleWither;
import net.morimori0317.bestylewither.entity.BEWitherBoss;
import net.morimori0317.bestylewither.explatform.BSWExpectPlatform;

Expand Down Expand Up @@ -32,6 +33,9 @@ public boolean canUse() {
}

public boolean canUse(boolean randed) {
if (!BEStyleWither.getConfig().isEnableChargeAttack())
return false;

if (randed && mob.getRandom().nextInt(75) != 0)
return false;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import dev.architectury.injectables.annotations.ExpectPlatform;
import net.minecraft.world.level.chunk.LevelChunk;
import net.minecraft.world.phys.Vec3;
import net.morimori0317.bestylewither.config.BESConfig;

public class BSWExpectPlatform {
@ExpectPlatform
Expand All @@ -14,4 +15,9 @@ public static void sendWhitherSkullBouncePacket(LevelChunk chunk, int entityId,
public static void sendWhitherChargePacket(LevelChunk chunk, int entityId) {
throw new AssertionError();
}

@ExpectPlatform
public static BESConfig getConfig() {
throw new AssertionError();
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
package net.morimori0317.bestylewither.mixin;

import net.minecraft.world.entity.ai.attributes.Attribute;
import net.minecraft.world.entity.ai.attributes.AttributeInstance;
import net.minecraft.world.entity.ai.attributes.AttributeSupplier;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.gen.Accessor;

import java.util.Map;

@Mixin(AttributeSupplier.Builder.class)
public interface AttributeSupplierBuilderAccessor {
@Accessor
Map<Attribute, AttributeInstance> getBuilder();
}
Loading

0 comments on commit 55388c8

Please sign in to comment.