Skip to content

Commit

Permalink
Infinite Purified, Inspirations Fix
Browse files Browse the repository at this point in the history
Fix for inspirations cauldrons and canteens, whoops
Config option to make purified water infinite
  • Loading branch information
Charles445 committed Jan 19, 2022
1 parent 514f2c6 commit e7aec04
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 10 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ buildscript {
apply plugin: 'net.minecraftforge.gradle.forge'


version = "1.12.2-0.3.8"
version = "1.12.2-0.3.9"
group = "com.charles445.simpledifficulty" // http://maven.apache.org/guides/mini/guide-naming-conventions.html
archivesBaseName = "SimpleDifficulty"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class SimpleDifficulty
{
public static final String MODID = "simpledifficulty";
public static final String NAME = "SimpleDifficulty";
public static final String VERSION = "0.3.8";
public static final String VERSION = "0.3.9";

@Mod.Instance(SimpleDifficulty.MODID)
public static SimpleDifficulty instance;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ public enum ServerOptions implements IConfigOption
/*Boolean*/ TEMPERATURE_TE_ENABLED ("temperatureTEEnabled"),
/*Integer*/ CANTEEN_DOSES ("canteenDoses"),
/*Boolean*/ STRICT_HEATERS ("strictHeaters"),
/*Integer*/ IRON_CANTEEN_DOSES ("ironCanteenDoses");
/*Integer*/ IRON_CANTEEN_DOSES ("ironCanteenDoses"),
/*Boolean*/ INFINITE_PURIFIED_WATER ("infinitePurifiedWater");


String name;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -297,5 +297,11 @@ public SoundEvent getSound(ItemStack stack, boolean boiling, int level, Cauldron
{
return SoundEvents.ITEM_BUCKET_FILL;
}

@Override
public ItemStack transformInput(ItemStack stack, boolean boiling, int level, CauldronState state)
{
return stack;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ public static interface ICauldronRecipe

SoundEvent getSound(ItemStack stack, boolean boiling, int level, CauldronState state);

ItemStack transformInput(ItemStack stack, boolean boiling, int level, CauldronState state);

int getLevel(int level);

public class CauldronState
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
package com.charles445.simpledifficulty.config;


import java.util.ArrayList;
import java.util.LinkedList;
import java.util.List;

import com.charles445.simpledifficulty.SimpleDifficulty;
import com.charles445.simpledifficulty.api.config.ClientConfig;
import com.charles445.simpledifficulty.api.config.ClientOptions;
Expand Down Expand Up @@ -97,6 +93,10 @@ public static class ConfigServerConfig
@Config.RangeInt(min=1)
public int ironCanteenDoses = 8;

@Config.Comment("Whether purified water blocks are infinite")
@Config.Name("Infinite Purified Water")
public boolean infinitePurifiedWater = false;

@Config.Comment("Spams chat with debug messages, do not enable this unless you are testing!")
@Config.Name("DebugMode")
public boolean debug = false;
Expand Down Expand Up @@ -528,6 +528,7 @@ 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.INFINITE_PURIFIED_WATER, server.infinitePurifiedWater);
}

private static MessageUpdateConfig getNewConfigMessage()
Expand All @@ -544,6 +545,7 @@ 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.INFINITE_PURIFIED_WATER.getName(), ""+server.infinitePurifiedWater);

return new MessageUpdateConfig(compound);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,11 @@ public static ThirstEnumBlockPos traceWaterToDrink(EntityPlayer player)

if(traceResult.thirstEnum == ThirstEnum.PURIFIED)
{
if(ServerConfig.instance.getBoolean(ServerOptions.THIRST_DRINK_BLOCKS))
player.world.setBlockToAir(traceResult.pos);
else
if(!ServerConfig.instance.getBoolean(ServerOptions.THIRST_DRINK_BLOCKS))
return null;

if(!ServerConfig.instance.getBoolean(ServerOptions.INFINITE_PURIFIED_WATER))
player.world.setBlockToAir(traceResult.pos);
}
else if(traceResult.thirstEnum == ThirstEnum.RAIN && !ServerConfig.instance.getBoolean(ServerOptions.THIRST_DRINK_RAIN))
{
Expand Down

0 comments on commit e7aec04

Please sign in to comment.