Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/buildmod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ name: Build SimpleDifficulty Mod

on:
push:
branches: [ 'main', 'master', 'testing' ]
branches-ignore:
- '1.16.5-development'
workflow_dispatch:

permissions:
Expand All @@ -18,7 +19,7 @@ jobs:
uses: actions/checkout@v7.0.1

- name: Set up JDK 25 for Gradle
uses: actions/setup-java@v5.6.0
uses: actions/setup-java@v5.7.0
with:
distribution: 'temurin'
java-version: '25'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,4 @@ public class SDItems {

/** Ice armor boots. Provides cooling for the feet. */
public static Item ice_boots;

public static Item frost_powder;
public static Item frost_rod;
public static Item dragonCanteen;
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ public enum ServerOptions implements IConfigOption
/*Integer*/ CANTEEN_DOSES ("canteenDoses"),
/*Boolean*/ STRICT_HEATERS ("strictHeaters"),
/*Integer*/ IRON_CANTEEN_DOSES ("ironCanteenDoses"),
/*Integer*/ DRAGON_CANTEEN_DOSES ("dragonCanteenDoses"),
/*Boolean*/ INFINITE_PURIFIED_WATER ("infinitePurifiedWater"),
/*Boolean*/ PURIFIED_WATER_OPACITY ("purifiedWaterOpacity"),
/*Double*/ THIRST_EXHAUSTION_MULTIPLIER ("thirstExhaustionMultiplier"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,11 +91,6 @@ public static class ConfigServerConfig
@Config.Name("IronCanteenDoses")
@Config.RangeInt(min=1)
public int ironCanteenDoses = 8;

@Config.Comment("Maximum number of doses in a dragon canteen")
@Config.Name("DragonCanteenDoses")
@Config.RangeInt(min=1)
public int dragonCanteenDoses = 30;

@Config.Comment("Whether purified water blocks are infinite")
@Config.Name("Infinite Purified Water")
Expand Down Expand Up @@ -545,7 +540,6 @@ public static void sendLocalServerConfigToAPI()
ServerConfig.instance.put(ServerOptions.CANTEEN_DOSES, server.canteenDoses);
ServerConfig.instance.put(ServerOptions.STRICT_HEATERS, server.strictHeaters);
ServerConfig.instance.put(ServerOptions.IRON_CANTEEN_DOSES, server.ironCanteenDoses);
ServerConfig.instance.put(ServerOptions.DRAGON_CANTEEN_DOSES, server.dragonCanteenDoses);
ServerConfig.instance.put(ServerOptions.INFINITE_PURIFIED_WATER, server.infinitePurifiedWater);
ServerConfig.instance.put(ServerOptions.PURIFIED_WATER_OPACITY, server.purifiedWaterOpacity);
ServerConfig.instance.put(ServerOptions.SALT_WATER_THIRST, server.thirst.saltWaterThirst);
Expand All @@ -565,7 +559,6 @@ private static MessageUpdateConfig getNewConfigMessage()
compound.setString(ServerOptions.CANTEEN_DOSES.getName(), ""+server.canteenDoses);
compound.setString(ServerOptions.STRICT_HEATERS.getName(), ""+server.strictHeaters);
compound.setString(ServerOptions.IRON_CANTEEN_DOSES.getName(), ""+server.ironCanteenDoses);
compound.setString(ServerOptions.DRAGON_CANTEEN_DOSES.getName(), ""+server.dragonCanteenDoses);
compound.setString(ServerOptions.INFINITE_PURIFIED_WATER.getName(), ""+server.infinitePurifiedWater);
compound.setString(ServerOptions.PURIFIED_WATER_OPACITY.getName(), ""+server.purifiedWaterOpacity);
compound.setString(ServerOptions.SALT_WATER_THIRST.getName(), ""+server.thirst.saltWaterThirst);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
package com.charles445.simpledifficulty.item;

import com.charles445.simpledifficulty.SimpleDifficulty;
import com.charles445.simpledifficulty.api.config.ServerConfig;
import com.charles445.simpledifficulty.api.config.ServerOptions;
import com.charles445.simpledifficulty.api.item.IItemCanteen;
import com.charles445.simpledifficulty.api.thirst.ThirstEnum;
import com.charles445.simpledifficulty.config.json.ExtraItem;
import net.minecraft.creativetab.CreativeTabs;
import net.minecraft.item.ItemStack;
import net.minecraft.nbt.NBTTagInt;
Expand All @@ -13,11 +12,20 @@

public class ItemDragonCanteen extends ItemCanteen {

public static final String EI_CAPACITY = "capacity";

private static final ThirstEnum[] THIRST_VALUES = ThirstEnum.values();

public int capacity = 10;

public ItemDragonCanteen() {
public ItemDragonCanteen(ExtraItem extraItem) {
super();

Integer oCapacity = extraItem.getInteger(EI_CAPACITY);
if (oCapacity != null) {
this.capacity = oCapacity.intValue();
}

addPropertyOverride(new ResourceLocation("contain"), (stack, worldIn, entityIn) -> {
if (stack.getItem() instanceof IItemCanteen) {
IItemCanteen canteen = (IItemCanteen) stack.getItem();
Expand All @@ -29,7 +37,7 @@ public ItemDragonCanteen() {

@Override
public int getMaxDoses(ItemStack stack) {
return ServerConfig.instance.getInteger(ServerOptions.DRAGON_CANTEEN_DOSES);
return this.capacity;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,6 @@ public static void registerItems(RegistryEvent.Register<Item> event)
ice_chestplate = registerAs("ice_chestplate", new ItemArmorTemperature(iceArmorMaterial, EntityEquipmentSlot.CHEST), registry);
ice_leggings = registerAs("ice_leggings", new ItemArmorTemperature(iceArmorMaterial, EntityEquipmentSlot.LEGS), registry);
ice_boots = registerAs("ice_boots", new ItemArmorTemperature(iceArmorMaterial, EntityEquipmentSlot.FEET), registry);

frost_powder = registerAs("frost_powder", new Item(), registry);
frost_rod = registerAs("frost_rod", new Item(), registry);

// Dragon Canteen
dragonCanteen = registerAs("dragon_canteen", new ItemDragonCanteen(), registry);

//Extra Items

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import com.charles445.simpledifficulty.api.config.ServerOptions;
import com.charles445.simpledifficulty.api.thirst.*;
import com.charles445.simpledifficulty.config.ModConfig;
import com.charles445.simpledifficulty.compat.mod.Weather2Compat;
import net.minecraft.block.Block;
import net.minecraft.entity.player.EntityPlayer;
import net.minecraft.init.Blocks;
Expand Down Expand Up @@ -107,7 +108,7 @@ public ThirstEnumBlockPos traceWater(EntityPlayer player)
//Check if player is looking up, if it's raining, if they can see sky, and if THIRST_DRINK_RAIN is enabled
//This essentially means rain can't be a trace result for drinking or for a canteen

if(player.rotationPitch < -75.0f && player.world.isRainingAt(player.getPosition()) && player.world.canSeeSky(player.getPosition()) && ServerConfig.instance.getBoolean(ServerOptions.THIRST_DRINK_RAIN))
if(player.rotationPitch < -75.0f && Weather2Compat.isRainingAt(player.world, player.getPosition()) && player.world.canSeeSky(player.getPosition()) && ServerConfig.instance.getBoolean(ServerOptions.THIRST_DRINK_RAIN))
{
//Drinking rain
return new ThirstEnumBlockPos(ThirstEnum.RAIN, player.getPosition());
Expand Down