stuff
This commit is contained in:
parent
4956604f36
commit
c8a67a5a1f
26 changed files with 499 additions and 12 deletions
58
build.gradle
58
build.gradle
|
|
@ -114,6 +114,8 @@ mixin {
|
|||
sourceSets.main.resources { srcDir 'src/generated/resources' }
|
||||
|
||||
repositories {
|
||||
mavenCentral()
|
||||
|
||||
flatDir {
|
||||
dir 'libs'
|
||||
}
|
||||
|
|
@ -135,10 +137,42 @@ repositories {
|
|||
url "https://maven.squiddev.cc"
|
||||
}
|
||||
|
||||
mavenCentral()
|
||||
maven {
|
||||
name = 'GeckoLib'
|
||||
url 'https://dl.cloudsmith.io/public/geckolib3/geckolib/maven/'
|
||||
}
|
||||
|
||||
maven {
|
||||
name = "Valkyrien Skies Internal"
|
||||
url = 'https://maven.valkyrienskies.org'
|
||||
content {
|
||||
includeGroup "org.valkyrienskies.core"
|
||||
includeGroup "org.valkyrienskies"
|
||||
includeGroup "com.github.Rubydesic"
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
maven {
|
||||
name = 'Kotlin for Forge'
|
||||
url = 'https://thedarkcolour.github.io/KotlinForForge/'
|
||||
content { includeGroup "thedarkcolour" }
|
||||
}
|
||||
|
||||
maven {
|
||||
name = 'GTCEu Maven'
|
||||
url = 'https://maven.gtceu.com'
|
||||
content {
|
||||
includeGroup 'com.gregtechceu.gtceu'
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
dependencies {
|
||||
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
|
||||
compileOnly(annotationProcessor("io.github.llamalad7:mixinextras-common:0.5.0"))
|
||||
implementation(jarJar("io.github.llamalad7:mixinextras-forge:0.5.0")) {
|
||||
jarJar.ranged(it, "[0.5.0,)")
|
||||
|
|
@ -153,11 +187,29 @@ dependencies {
|
|||
implementation fg.deobf("curse.maven:curios-309927:5367944")
|
||||
implementation fg.deobf("curse.maven:tacz-1028108:6654541")
|
||||
implementation fg.deobf("maven.modrinth:prototype-pain:2.7.2")
|
||||
implementation fg.deobf("maven.modrinth:warium:1.2.7")
|
||||
implementation fg.deobf("software.bernie.geckolib:geckolib-forge-1.20.1:4.8.3")
|
||||
implementation fg.deobf("com.gregtechceu.gtceu:gtceu-1.20.1:7.5.2") { transitive = false }
|
||||
|
||||
|
||||
|
||||
implementation("thedarkcolour:kotlinforforge:4.12.0")
|
||||
implementation fg.deobf("org.valkyrienskies:valkyrienskies-120-forge:2.4.10+d5a58dc1f2") { transitive = false }
|
||||
implementation("org.valkyrienskies.core:api:1.1.0+1d4a7373e9")
|
||||
implementation("org.valkyrienskies.core:util:1.1.0+1d4a7373e9")
|
||||
implementation("org.valkyrienskies.core:internal:1.1.0+1d4a7373e9")
|
||||
implementation("org.valkyrienskies.core:impl:1.1.0+1d4a7373e9")
|
||||
implementation "org.joml:joml:1.10.5"
|
||||
|
||||
implementation fg.deobf("maven.modrinth:interactive:EScBvcOc")
|
||||
implementation fg.deobf("maven.modrinth:create-radars:0.3.5")
|
||||
|
||||
implementation fg.deobf("maven.modrinth:valkyrien-warium:1.0.0")
|
||||
|
||||
implementation fg.deobf("com.simibubi.create:create-${minecraft_version}:${create_version}:slim")
|
||||
implementation fg.deobf("dev.engine-room.flywheel:flywheel-forge-${minecraft_version}:${flywheel_version}")
|
||||
implementation(fg.deobf("net.createmod.ponder:Ponder-Forge-${minecraft_version}:${ponder_version}"))
|
||||
implementation(fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}"))
|
||||
//implementation(fg.deobf("com.tterrag.registrate:Registrate:${registrate_version}"))
|
||||
|
||||
compileOnly fg.deobf("cc.tweaked:cc-tweaked-$minecraft_version-core-api:$cc_version")
|
||||
compileOnly fg.deobf("cc.tweaked:cc-tweaked-$minecraft_version-forge-api:$cc_version")
|
||||
|
|
@ -167,7 +219,7 @@ dependencies {
|
|||
// compileOnly fg.deobf("curse.maven:prototype_pain-1333811:7393939") //returns a 403 for whatever reason
|
||||
implementation fg.deobf("curse.maven:prototype-physics-1380559:7206624")
|
||||
|
||||
annotationProcessor 'org.spongepowered:mixin:0.8.5:processor'
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ forge_version_range=[47,)
|
|||
loader_version_range=[47,)
|
||||
|
||||
# Dependencies
|
||||
create_version=6.0.7-281
|
||||
create_version=6.0.8-288
|
||||
flywheel_version=1.0.5
|
||||
registrate_version=MC1.20-1.3.3
|
||||
ponder_version=1.0.91
|
||||
|
|
|
|||
25
src/main/java/xyz/illuc/neuralgiacore/MedicalEffects.java
Normal file
25
src/main/java/xyz/illuc/neuralgiacore/MedicalEffects.java
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
package xyz.illuc.neuralgiacore;
|
||||
|
||||
import net.adinvas.prototype_pain.PlayerHealthProvider;
|
||||
import net.adinvas.prototype_pain.fluid_system.MedicalEffect;
|
||||
import net.adinvas.prototype_pain.limbs.Limb;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
|
||||
public class MedicalEffects {
|
||||
public static final MedicalEffect BLOOD = new MedicalEffect() {
|
||||
@Override
|
||||
public void applyInjected(ServerPlayer player, float ml, Limb limb) {
|
||||
player.getCapability(PlayerHealthProvider.PLAYER_HEALTH_DATA).ifPresent(h -> {
|
||||
h.setBloodVolume(h.getBloodVolume() + ml/1000);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
public static final MedicalEffect WEAK_ALCOHOL = new MedicalEffect() {
|
||||
|
||||
};
|
||||
|
||||
public static final MedicalEffect ETHANOL = new MedicalEffect() {
|
||||
|
||||
};
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package xyz.illuc.neuralgiacore;
|
||||
|
||||
import net.adinvas.prototype_pain.PrototypePain;
|
||||
import net.adinvas.prototype_pain.item.INbtDrivenDurability;
|
||||
import net.adinvas.prototype_pain.item.multi_tank.MultiTankFluidItem;
|
||||
import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.world.item.CreativeModeTab;
|
||||
import net.minecraft.world.item.Item;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterItems;
|
||||
|
||||
public class NeuralgiaCoreCreativeTab {
|
||||
public static final DeferredRegister<CreativeModeTab> CREATIVE_TABS =
|
||||
DeferredRegister.create(Registries.CREATIVE_MODE_TAB, NeuralgiaCoreMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<CreativeModeTab> NEURALGIA_TAB = CREATIVE_TABS.register("neuralgiatab",
|
||||
() -> CreativeModeTab.builder()
|
||||
.title(Component.translatable("itemGroup.neuralgia"))
|
||||
.icon(() -> new ItemStack(RegisterItems.Syringe.get()))
|
||||
.displayItems((parameters, output) -> {
|
||||
for (RegistryObject<Item> itemRegistryObject : RegisterItems.ITEMS.getEntries()){
|
||||
if (itemRegistryObject.get() instanceof INbtDrivenDurability nbt){
|
||||
ItemStack stack = new ItemStack(itemRegistryObject.get());
|
||||
nbt.setupDefaults(stack);
|
||||
output.accept(stack);
|
||||
continue;
|
||||
}
|
||||
if (itemRegistryObject.get() instanceof MultiTankFluidItem multiTankFluidItem){
|
||||
ItemStack stack = new ItemStack(itemRegistryObject.get());
|
||||
multiTankFluidItem.setupDefault(stack);
|
||||
output.accept(stack);
|
||||
continue;
|
||||
}
|
||||
output.accept(itemRegistryObject.get());
|
||||
|
||||
}
|
||||
})
|
||||
.build()
|
||||
);
|
||||
}
|
||||
|
|
@ -28,6 +28,7 @@ import xyz.illuc.neuralgiacore.entities.OfflinePlayerEntity;
|
|||
import xyz.illuc.neuralgiacore.entities.OfflinePlayerRenderer;
|
||||
import xyz.illuc.neuralgiacore.peripherals.BearingPeripheral;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterItems;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterMedicalFluids;
|
||||
|
||||
|
||||
@Mod(NeuralgiaCoreMod.MOD_ID)
|
||||
|
|
@ -56,6 +57,8 @@ public class NeuralgiaCoreMod {
|
|||
IEventBus modEventBus = FMLJavaModLoadingContext.get().getModEventBus();
|
||||
|
||||
RegisterItems.ITEMS.register(modEventBus);
|
||||
RegisterMedicalFluids.register(modEventBus);
|
||||
NeuralgiaCoreCreativeTab.CREATIVE_TABS.register(modEventBus);
|
||||
|
||||
ENTITY_TYPES.register(modEventBus);
|
||||
|
||||
|
|
|
|||
|
|
@ -9,10 +9,7 @@ import net.minecraft.network.syncher.SynchedEntityData;
|
|||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.EntityType;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.HumanoidArm;
|
||||
import net.minecraft.world.entity.Pose;
|
||||
import net.minecraft.world.entity.*;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
|
|
@ -124,6 +121,11 @@ public class OfflinePlayerEntity extends LivingEntity {
|
|||
return HumanoidArm.RIGHT;
|
||||
}
|
||||
|
||||
@Override
|
||||
public EntityDimensions getDimensions(Pose pose) {
|
||||
return EntityDimensions.scalable(0.6F, 1.8F);
|
||||
}
|
||||
|
||||
public void setPlayerUUID(UUID uuid) {
|
||||
this.entityData.set(DATA_PLAYER_UUID, Optional.ofNullable(uuid));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ import net.minecraft.client.renderer.entity.EntityRendererProvider;
|
|||
import net.minecraft.client.renderer.entity.LivingEntityRenderer;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.level.block.entity.SkullBlockEntity;
|
||||
import net.minecraft.world.phys.Vec3;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
|
@ -19,7 +20,7 @@ import java.util.UUID;
|
|||
public class OfflinePlayerRenderer extends LivingEntityRenderer<OfflinePlayerEntity, PlayerModel<OfflinePlayerEntity>> {
|
||||
|
||||
public OfflinePlayerRenderer(EntityRendererProvider.Context context) {
|
||||
super(context, new PlayerModel<>(context.bakeLayer(ModelLayers.PLAYER), false), 0.5F);
|
||||
super(context, new PlayerModel<>(context.bakeLayer(ModelLayers.PLAYER), false), 0.0F);
|
||||
}
|
||||
|
||||
private static HashMap<String, GameProfile> players = new HashMap<>();
|
||||
|
|
@ -52,6 +53,13 @@ public class OfflinePlayerRenderer extends LivingEntityRenderer<OfflinePlayerEnt
|
|||
@Override
|
||||
public void render(OfflinePlayerEntity entity, float entityYaw, float partialTicks,
|
||||
PoseStack matrixStack, MultiBufferSource buffer, int packedLightIn) {
|
||||
matrixStack.translate(1f, 0.2f, 0f);
|
||||
super.render(entity, entityYaw, partialTicks, matrixStack, buffer, packedLightIn);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
protected boolean shouldShowName(OfflinePlayerEntity p_115333_) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,43 @@
|
|||
package xyz.illuc.neuralgiacore.items;
|
||||
|
||||
|
||||
import net.adinvas.prototype_pain.PlayerHealthProvider;
|
||||
import net.adinvas.prototype_pain.fluid_system.ModFluids;
|
||||
import net.adinvas.prototype_pain.fluid_system.MultiTankHelper;
|
||||
import net.minecraft.sounds.SoundEvents;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.InteractionResultHolder;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.level.Level;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterMedicalFluids;
|
||||
|
||||
public class BloodBagItem extends SyringeItem {
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return 1000;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setupDefault(ItemStack pStack) {
|
||||
MultiTankHelper.addMedicalFluid(pStack,
|
||||
1000,
|
||||
RegisterMedicalFluids.BLOOD.getId().toString(),
|
||||
new FluidStack(ModFluids.SRC_MEDICAL.get().getSource(),1));
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public InteractionResultHolder<ItemStack> use(Level level, Player player, InteractionHand hand) {
|
||||
ItemStack stack = player.getItemInHand(hand);
|
||||
player.getCapability(PlayerHealthProvider.PLAYER_HEALTH_DATA).ifPresent(h->{
|
||||
h.setBloodVolume(h.getBloodVolume() - 0.1f);
|
||||
MultiTankHelper.addFluid(stack, 100, RegisterMedicalFluids.BLOOD.get().getAsStack(1));
|
||||
player.playSound(SoundEvents.FISH_SWIM, 1.0F, 1.0F);
|
||||
|
||||
});
|
||||
return InteractionResultHolder.sidedSuccess(stack, level.isClientSide);
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,9 @@
|
|||
package xyz.illuc.neuralgiacore.items;
|
||||
|
||||
import net.minecraft.world.item.Item;
|
||||
|
||||
public class SimpleItem extends Item {
|
||||
public SimpleItem() {
|
||||
super(new Properties());
|
||||
}
|
||||
}
|
||||
39
src/main/java/xyz/illuc/neuralgiacore/items/SyringeItem.java
Normal file
39
src/main/java/xyz/illuc/neuralgiacore/items/SyringeItem.java
Normal file
|
|
@ -0,0 +1,39 @@
|
|||
package xyz.illuc.neuralgiacore.items;
|
||||
|
||||
import net.adinvas.prototype_pain.client.MinigameOpener;
|
||||
import net.adinvas.prototype_pain.item.IMedicalMinigameUsable;
|
||||
import net.adinvas.prototype_pain.item.multi_tank.MultiTankFluidItem;
|
||||
import net.adinvas.prototype_pain.limbs.Limb;
|
||||
import net.minecraft.world.InteractionHand;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.api.distmarker.Dist;
|
||||
import net.minecraftforge.fml.DistExecutor;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
public class SyringeItem extends MultiTankFluidItem implements IMedicalMinigameUsable {
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return 250;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openMinigameScreen(Player target, ItemStack stack, @Nullable Limb limb, InteractionHand hand) {
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,() -> () ->{
|
||||
MinigameOpener.OpenSyringeMinigame(target,stack,limb,hand);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void openMinigameBagScreen(Player target, ItemStack stack, ItemStack bagStack, int slot, @Nullable Limb limb, InteractionHand hand) {
|
||||
DistExecutor.unsafeRunWhenOn(Dist.CLIENT,() -> () ->{
|
||||
MinigameOpener.OpenSyringeMinigame(target,stack,bagStack,slot,limb,hand);
|
||||
});
|
||||
}
|
||||
|
||||
@Override
|
||||
public void useMinigameAction(float durability, Player target, @Nullable Limb limb) {
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,42 @@
|
|||
package xyz.illuc.neuralgiacore.items;
|
||||
|
||||
import net.adinvas.prototype_pain.Util;
|
||||
import net.adinvas.prototype_pain.fluid_system.MedicalFluid;
|
||||
import net.adinvas.prototype_pain.fluid_system.MultiTankHelper;
|
||||
import net.adinvas.prototype_pain.item.ISimpleMedicalUsable;
|
||||
import net.adinvas.prototype_pain.item.multi_tank.MultiTankFluidItem;
|
||||
import net.adinvas.prototype_pain.limbs.Limb;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraftforge.fluids.FluidStack;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class ToweletteItem extends MultiTankFluidItem implements ISimpleMedicalUsable {
|
||||
public int getOnSkinAmount(){
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getCapacity() {
|
||||
return 100;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ItemStack onMedicalUse(Limb limb, ServerPlayer source, ServerPlayer target, ItemStack stack) {
|
||||
int max = (int) Math.min(MultiTankHelper.getFilledTotal(stack),getOnSkinAmount());
|
||||
List<FluidStack> drained = MultiTankHelper.drain(stack,max);
|
||||
for (FluidStack fs : drained){
|
||||
MedicalFluid MF;
|
||||
MF = Util.getFallback(fs.getFluid());
|
||||
if (fs.hasTag()){
|
||||
if (fs.getTag().contains("MedicalId")){
|
||||
MF = MedicalFluid.getFromId(fs.getTag().getString("MedicalId"));
|
||||
}
|
||||
}
|
||||
MF.getMedicalEffect().applyOnSkin(target,fs.getAmount(),limb);
|
||||
}
|
||||
stack.shrink(1);
|
||||
return stack;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,41 @@
|
|||
package xyz.illuc.neuralgiacore.mixin.PrototypePain;
|
||||
|
||||
import net.adinvas.prototype_pain.ModMedicalFluids;
|
||||
import net.adinvas.prototype_pain.Util;
|
||||
import net.adinvas.prototype_pain.fluid_system.MedicalFluid;
|
||||
import net.minecraft.tags.TagKey;
|
||||
import net.minecraft.world.level.material.Fluid;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Inject;
|
||||
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
|
||||
import xyz.illuc.neuralgiacore.registers.RegisterMedicalFluids;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.stream.Stream;
|
||||
|
||||
@Mixin(Util.class)
|
||||
public class MixinModdedMedicalFluids {
|
||||
/**
|
||||
* @author
|
||||
* @reason
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
public static MedicalFluid getFallback(Fluid fs) {
|
||||
return switch (fs.getFluidType().toString()) {
|
||||
case "gtceu:ethanol" -> RegisterMedicalFluids.ETHANOL.get();
|
||||
default -> {
|
||||
Stream<TagKey<Fluid>> tags = fs.defaultFluidState().getTags();
|
||||
if (tags.anyMatch(n -> {
|
||||
System.out.println(n.toString());
|
||||
return n.toString().equals("TagKey[minecraft:fluid / tfc:alcohols]");
|
||||
})) {
|
||||
yield RegisterMedicalFluids.WEAK_ALCOHOL.get();
|
||||
}
|
||||
yield ModMedicalFluids.VANILLA_WATER.get();
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,10 @@
|
|||
package xyz.illuc.neuralgiacore.mixin.PrototypePain;
|
||||
|
||||
import net.adinvas.prototype_pain.limbs.PlayerHealthData;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
|
||||
@Mixin(PlayerHealthData.class)
|
||||
public class MixinTemperatureDamage {
|
||||
//TODO make heatstroke reduce consciousness
|
||||
//TODO make frostbite damage skin and reduce consciousness
|
||||
}
|
||||
|
|
@ -0,0 +1,22 @@
|
|||
package xyz.illuc.neuralgiacore.mixin.TfcAmbiental;
|
||||
|
||||
import com.lumintorious.tfcambiental.capability.TemperatureCapability;
|
||||
import net.minecraft.world.damagesource.DamageSource;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.Redirect;
|
||||
|
||||
@Mixin(TemperatureCapability.class)
|
||||
public class MixinDisableTemperatureDamage {
|
||||
@Redirect(
|
||||
method = "update",
|
||||
at = @At(
|
||||
value = "INVOKE",
|
||||
target = "Lnet/minecraft/world/entity/player/Player;hurt(Lnet/minecraft/world/damagesource/DamageSource;F)Z"
|
||||
)
|
||||
)
|
||||
private boolean disableTemperatureDamage(Player player, DamageSource source, float amount) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,18 @@
|
|||
package xyz.illuc.neuralgiacore.mixin.TfcAmbiental;
|
||||
|
||||
import com.lumintorious.tfcambiental.TFCAmbientalGuiRenderer;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.Overwrite;
|
||||
|
||||
@Mixin(TFCAmbientalGuiRenderer.class)
|
||||
public class MixinSkipVignette {
|
||||
/**
|
||||
* @author
|
||||
* @reason
|
||||
*/
|
||||
@Overwrite(remap = false)
|
||||
private static void drawTemperatureVignettes(int width, int height, Player player) {
|
||||
//no lol
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,69 @@
|
|||
package xyz.illuc.neuralgiacore.moodles;
|
||||
|
||||
|
||||
import net.adinvas.prototype_pain.PlayerHealthProvider;
|
||||
import net.adinvas.prototype_pain.client.moodles.AbstractMoodleVisual;
|
||||
import net.adinvas.prototype_pain.client.moodles.MoodleStatus;
|
||||
import net.minecraft.ChatFormatting;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
import xyz.illuc.neuralgiacore.interfaces.IPlayerHealthDataAccessor;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
public class RadiationSicknessMoodle extends AbstractMoodleVisual {
|
||||
public RadiationSicknessMoodle() {
|
||||
}
|
||||
//noinspection ConstantConditions
|
||||
@Override
|
||||
public MoodleStatus calculateStatus(Player player) {
|
||||
if (!player.isLocalPlayer()) return MoodleStatus.NONE;
|
||||
|
||||
return player.getCapability(PlayerHealthProvider.PLAYER_HEALTH_DATA).map(ph -> {
|
||||
IPlayerHealthDataAccessor accessor = (IPlayerHealthDataAccessor) ph;
|
||||
float radiationSickness = accessor.getRadiationSickness();
|
||||
|
||||
|
||||
if (radiationSickness > 80F) {
|
||||
return MoodleStatus.CRITICAL;
|
||||
} else if (radiationSickness > 50F) {
|
||||
return MoodleStatus.HEAVY;
|
||||
} else if (radiationSickness > 10F){
|
||||
return MoodleStatus.NORMAL;
|
||||
} else {
|
||||
return MoodleStatus.NONE;
|
||||
}
|
||||
}).orElse(MoodleStatus.NONE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ResourceLocation renderIcon(GuiGraphics ms, float partialTicks, int x, int y) {
|
||||
ResourceLocation tex = new ResourceLocation("neuralgia", "textures/moodles/radiation.png");
|
||||
ms.blit(tex, x, y, 0.0F, 0.0F, 16, 16, 16, 16);
|
||||
return tex;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Component> getTooltip(Player player) {
|
||||
List<Component> componentList = new ArrayList();
|
||||
switch (this.getMoodleStatus()) {
|
||||
case NORMAL:
|
||||
componentList.add(Component.translatable("neuralgia.gui.moodle.radiation.title1").withStyle(ChatFormatting.YELLOW));
|
||||
componentList.add(Component.translatable("neuralgia.gui.moodle.radiation.description1").withStyle(ChatFormatting.GRAY));
|
||||
break;
|
||||
case HEAVY:
|
||||
componentList.add(Component.translatable("neuralgia.gui.moodle.radiation.title2").withStyle(ChatFormatting.GOLD));
|
||||
componentList.add(Component.translatable("neuralgia.gui.moodle.radiation.description2").withStyle(ChatFormatting.GRAY));
|
||||
break;
|
||||
case CRITICAL:
|
||||
componentList.add(Component.translatable("neuralgia.gui.moodle.radiation.title3").withStyle(ChatFormatting.RED));
|
||||
componentList.add(Component.translatable("neuralgia.gui.moodle.radiation.description3").withStyle(ChatFormatting.GRAY));
|
||||
}
|
||||
|
||||
return componentList;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -5,12 +5,19 @@ import net.minecraftforge.registries.DeferredRegister;
|
|||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import xyz.illuc.neuralgiacore.NeuralgiaCoreMod;
|
||||
import xyz.illuc.neuralgiacore.items.LinenBandage;
|
||||
import xyz.illuc.neuralgiacore.items.*;
|
||||
|
||||
public class RegisterItems {
|
||||
public static final DeferredRegister<Item> ITEMS =
|
||||
DeferredRegister.create(ForgeRegistries.ITEMS, NeuralgiaCoreMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<Item> LinenBandage = ITEMS.register("bandage", LinenBandage::new);
|
||||
public static final RegistryObject<Item> Towelette = ITEMS.register("towelette", ToweletteItem::new);
|
||||
public static final RegistryObject<Item> Syringe = ITEMS.register("syringe", SyringeItem::new);
|
||||
public static final RegistryObject<Item> BloodBag = ITEMS.register("blood_bag", BloodBagItem::new);
|
||||
|
||||
public static final RegistryObject<Item> OpiumPowder = ITEMS.register("opium_powder", SimpleItem::new);
|
||||
public static final RegistryObject<Item> MorphinePowder = ITEMS.register("morphine_powder", SimpleItem::new);
|
||||
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -0,0 +1,24 @@
|
|||
package xyz.illuc.neuralgiacore.registers;
|
||||
|
||||
import net.adinvas.prototype_pain.ModMedicalRegistry;
|
||||
import net.adinvas.prototype_pain.fluid_system.MedicalFluid;
|
||||
import net.minecraftforge.eventbus.api.IEventBus;
|
||||
import net.minecraftforge.registries.DeferredRegister;
|
||||
import net.minecraftforge.registries.RegistryObject;
|
||||
import xyz.illuc.neuralgiacore.MedicalEffects;
|
||||
import xyz.illuc.neuralgiacore.NeuralgiaCoreMod;
|
||||
|
||||
public class RegisterMedicalFluids {
|
||||
|
||||
public static final DeferredRegister<MedicalFluid> MEDICAL_FLUIDS =
|
||||
DeferredRegister.create(ModMedicalRegistry.MEDICAL_FLUIDS_KEY, NeuralgiaCoreMod.MOD_ID);
|
||||
|
||||
public static final RegistryObject<MedicalFluid> BLOOD = MEDICAL_FLUIDS.register("blood",() -> new MedicalFluid(MedicalEffects.BLOOD, 0x8a0303));
|
||||
public static final RegistryObject<MedicalFluid> WEAK_ALCOHOL = MEDICAL_FLUIDS.register("weak_alcohol",() -> new MedicalFluid(MedicalEffects.WEAK_ALCOHOL, 0xC2A98F));
|
||||
public static final RegistryObject<MedicalFluid> ETHANOL = MEDICAL_FLUIDS.register("ethanol",() -> new MedicalFluid(MedicalEffects.ETHANOL, 0xE6E8F2));
|
||||
|
||||
|
||||
public static void register(IEventBus bus) {
|
||||
MEDICAL_FLUIDS.register(bus);
|
||||
}
|
||||
}
|
||||
|
|
@ -2,6 +2,9 @@
|
|||
"_": "---ITEMS---",
|
||||
"item.neuralgiacore.herbal_mixture": "Herbal Mixture",
|
||||
"item.neuralgiacore.bandage": "Linen Bandage",
|
||||
"item.neuralgiacore.blood_bag": "Blood Bag",
|
||||
"item.neuralgiacore.syringe": "Syringe",
|
||||
"item.neuralgiacore.towelette": "Towelette",
|
||||
|
||||
|
||||
"_": "---MOODLES---",
|
||||
|
|
@ -12,5 +15,11 @@
|
|||
"neuralgiacore.gui.moodle.sepsis.description2": "Increased heart rate, lowered blood pressure, lightheadedness and a strong fever. Signs of organ dysfunction. Likely to soon enter septic shock.",
|
||||
|
||||
"neuralgiacore.gui.moodle.sepsis.title3": "Septic shock",
|
||||
"neuralgiacore.gui.moodle.sepsis.description3": "Critically low blood pressure and multiple organ dysfunction syndrome caused by sepsis. Death is fast approaching."
|
||||
"neuralgiacore.gui.moodle.sepsis.description3": "Critically low blood pressure and multiple organ dysfunction syndrome caused by sepsis. Death is fast approaching.",
|
||||
|
||||
|
||||
"medical_fluid.neuralgiacore.blood": "Blood",
|
||||
"medical_fluid.neuralgiacore.blood.description": "Blood, used in blood transfusions.",
|
||||
|
||||
"itemGroup.neuralgia": "Neuralgia"
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "neuralgiacore:item/blood_bag"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "neuralgiacore:item/syringe"
|
||||
}
|
||||
}
|
||||
|
|
@ -0,0 +1,6 @@
|
|||
{
|
||||
"parent": "item/generated",
|
||||
"textures": {
|
||||
"layer0": "neuralgiacore:item/towelette"
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 915 B |
Binary file not shown.
|
After Width: | Height: | Size: 915 B |
Binary file not shown.
|
After Width: | Height: | Size: 915 B |
|
|
@ -7,6 +7,7 @@
|
|||
"mixins": [
|
||||
"PrototypePain.MixinAmbientTemperature",
|
||||
"PrototypePain.MixinLegUsePacket",
|
||||
"PrototypePain.MixinModdedMedicalFluids",
|
||||
"PrototypePain.MixinOverlayController",
|
||||
"PrototypePain.MixinPlayerHealthDataExtras",
|
||||
"PrototypePain.MixinSepsis",
|
||||
|
|
@ -14,9 +15,11 @@
|
|||
"PrototypePain.MixinSicknessOverlay",
|
||||
"Tfc.MixinFoodData",
|
||||
"Tfc.MixinHealthBar",
|
||||
"Tfc.MixinOptimizeClimateUpdate"
|
||||
"Tfc.MixinOptimizeClimateUpdate",
|
||||
"TfcAmbiental.MixinDisableTemperatureDamage"
|
||||
],
|
||||
"client": [
|
||||
"TfcAmbiental.MixinSkipVignette",
|
||||
"vanilla.MixinRemovePlayerNametag"
|
||||
],
|
||||
"injectors": {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue