Added the config back and made the build recipe create a fat zip with all extra libs used
parent
8921671f23
commit
9399090571
3
justfile
3
justfile
|
@ -49,4 +49,5 @@ build:
|
|||
just create-patches
|
||||
./recompile.sh
|
||||
./reobfuscate.sh
|
||||
(cd ./reobf/minecraft && zip -r "../../builds/${modName}-${modVersion}-modloader.zip" ./*)
|
||||
for file in $(fd . ./lib ".jar"); do unzip -qo "$file" -d "./reobf/minecraft/"; done
|
||||
(cd ./reobf/minecraft && zip -qr "../../builds/${modName}-${modVersion}-modloader.zip" ./*)
|
||||
|
|
|
@ -1,10 +1,18 @@
|
|||
--- BlockBed.java.bak 2025-04-04 22:37:36.783594000 +0300
|
||||
+++ BlockBed.java 2025-04-05 00:03:29.834894265 +0300
|
||||
@@ -22,6 +22,9 @@
|
||||
+++ BlockBed.java 2025-04-05 20:34:45.887405008 +0300
|
||||
@@ -5,6 +5,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.*;
|
||||
+import net.minecraft.src.finalbeta.ModConfig;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// Block, Material, World, WorldProvider,
|
||||
@@ -22,6 +23,9 @@
|
||||
|
||||
public boolean blockActivated(World world, int i, int j, int k, EntityPlayer entityplayer)
|
||||
{
|
||||
+ if (true) {
|
||||
+ if (ModConfig.DISABLE_BEDS.get()) {
|
||||
+ return false;
|
||||
+ }
|
||||
if(world.multiplayerWorld)
|
||||
|
|
|
@ -1,11 +1,20 @@
|
|||
--- BlockReed.java.bak 2025-04-04 22:55:28.995768000 +0300
|
||||
+++ BlockReed.java 2025-04-05 00:03:29.836894244 +0300
|
||||
@@ -50,7 +50,7 @@
|
||||
+++ BlockReed.java 2025-04-05 20:34:20.143731179 +0300
|
||||
@@ -5,6 +5,7 @@
|
||||
package net.minecraft.src;
|
||||
|
||||
import java.util.Random;
|
||||
+import net.minecraft.src.finalbeta.ModConfig;
|
||||
|
||||
// Referenced classes of package net.minecraft.src:
|
||||
// Block, Material, World, BlockGrass,
|
||||
@@ -50,7 +51,8 @@
|
||||
{
|
||||
return true;
|
||||
}
|
||||
- if(l != Block.grass.blockID && l != Block.dirt.blockID)
|
||||
+ if(l != Block.grass.blockID && l != Block.dirt.blockID && l != Block.sand.blockID)
|
||||
+ boolean canPlaceOnSand = ModConfig.SUGAR_CANE_ON_SAND.get() && l == Block.sand.blockID;
|
||||
+ if(l != Block.grass.blockID && l != Block.dirt.blockID && !canPlaceOnSand)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,138 @@
|
|||
package net.minecraft.src.finalbeta;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import com.electronwill.nightconfig.core.file.CommentedFileConfig;
|
||||
import com.electronwill.nightconfig.core.file.CommentedFileConfigBuilder;
|
||||
|
||||
public class ModConfig {
|
||||
private static final String CONFIG_PATH = "config/finalbeta.toml";
|
||||
private static final List<Option> OPTIONS = new ArrayList<>();
|
||||
|
||||
private CommentedFileConfig fileConfig;
|
||||
|
||||
public static final Option<Boolean> SUGAR_CANE_ON_SAND = make("Sugar Cane on sand", true, "Allows sugar canes to be placed on sand");
|
||||
public static final Option<Boolean> ADD_MORE_SOUNDS =
|
||||
make("Add more sounds", true, "Links a few more sounds from your local 'resources' folder with the game, namely for item breaking, minecarts and chests");
|
||||
public static final Option<Boolean> ENABLE_CLOUDS = make("Enable Clouds", true, "Enables the rendering of clouds");
|
||||
public static final Option<Boolean> DISABLE_ID_TAGS = make("Disable ID Tags", true, "Disables id tags showing above entities in F3 mode");
|
||||
public static final Option<Boolean> FENCE_SLIM_HITBOX =
|
||||
make("Slim Hitbox for Fences", true, "Uses slim hitbox for fences on the X and Z axies (the height of the fence is not changed)");
|
||||
public static final Option<Boolean> FENCE_CONNECT = make("Fence connections", true, "Visually connects fences with nearby solid blocks");
|
||||
public static final Option<Boolean> REMOVE_NIGHTMARES = make("Remove Nightmares", false, "Removes nightmares completely");
|
||||
public static final Option<Boolean> DISABLE_BEDS = make("Disable Beds", false,
|
||||
"Disables bed mechanics such as setting spawn points and skipping the night, does NOT delete already placed blocks nor does it disable the crafting or placing of beds as decorative blocks");
|
||||
public static final Option<Integer> BOAT_BREAKING_LOGIC = make("Boat Breaking Logic", 2,
|
||||
"0 - Vanilla behavior\n1 - Boats will never break regardless of their speed\n2 - Boats will only break when crashing with almost max speed");
|
||||
public static final Option<Boolean> STACK_DROP =
|
||||
make("Drop Held Stack", true, "Allows the player to drop the entire stack they're holding using Shift + Q (or whatever drop key they have set)");
|
||||
public static final Option<Boolean> ENABLE_TIME_TRACKING =
|
||||
make("Enable Time Tracking", true, "Adds a Days Played entry in the F3 overlay displaying number of ingame days and real life days played in that world");
|
||||
public static final Option<Boolean> ENABLE_REPAIR =
|
||||
make("Enable Item Repair", true, "Allows 2 or more items of the same type to be repaired using a crafting table using the same formula as modern day vanilla uses");
|
||||
public static final Option<Boolean> ENABLE_WHITE_WOOL_RECIPE = make("Enable White Wool Recipe", true, "Allows dyed wool to be dyed back white using bone meal");
|
||||
public static final Option<Boolean> ENABLE_GHASTS_INSTA_DEATH =
|
||||
make("Enable Ghast Insta Death", true, "Allows ghasts to die in 1 shot when their fireballs get reflected at them");
|
||||
public static final Option<Double> MINECART_MAX_SPEED = make("Minecart maximum speed limit", 0.5, "Maximum allowed speed for minecarts\nVanilla default is 0.4");
|
||||
public static final Option<Double> MINECART_POWERED_BOOST =
|
||||
make("Powered rails speed boost", 1.15, "Extra speed modifier when minecarts go over powered rails\nVanilla default is 1.0");
|
||||
public static final Option<Boolean> FURNACE_MINECART_PUSH =
|
||||
make("Enable furnace minecarts push", true, "Enables furance minecarts to push forward the first minecart it comes in contact with");
|
||||
public static final Option<Boolean> FURNACE_MINECART_CHUNK_LOADING =
|
||||
make("Enable furnace minecarts to load chunks", true, "Name says it all, furnace minecarts will load chunks as they go on tracks.");
|
||||
public static final Option<Double> CLOUDS_HEIGHT =
|
||||
make("Clouds Height", 0.0, "Clouds height modifier, goes from 0.0, meaning the default 108 blocks height, to 1.0, meaning a 324 blocks height.");
|
||||
public static final Option<Boolean> ENABLE_COAL_AND_REDSTONE_BLOCKS_RECIPE =
|
||||
make("Enable Coal and Redstone Blocks Recipe", false, "Allows crafting coal and redstone as blocks for better storage");
|
||||
public static final Option<Boolean> DISABLE_EATING_WHEN_MAX_HP =
|
||||
make("Disable eating when at max HP", false, "Makes it so players can no longer eat if they're at max HP so they don't accidently waste food");
|
||||
public static final Option<Double> APPLE_DROP_RATE = make("Apple Drop Rate", 0.0, "Chance for apples to drop from leaves (decimal between 0.0 and 1.0)");
|
||||
|
||||
public static final Option<Boolean> FIX_BOW_MODEL = make("Fix bow model", true, "Makes the box model held by players and skeletons bigger and facing forward");
|
||||
public static final Option<Boolean> FIX_MINECART_FLICKERING = make("Fix minecart flickering", true, "Fixes minecarts flickering when looking at their backs as a passanger");
|
||||
public static final Option<Boolean> FIX_MINECART_STOPPING_ON_ITEMS =
|
||||
make("Fix minecart stopping on items", true, "Fixes minecarts getting stopped by arrows and dropped items on tracks");
|
||||
public static final Option<Boolean> FIX_FISHING = make("Fix fishing", true, "Fixes fishes going above the player's head when fishing");
|
||||
public static final Option<Boolean> FIX_LEG_ARMOR_ON_VEHICLES =
|
||||
make("Fix leg armor on vehicles", true, "Fixes leg armor not properly getting updated when switching poses (start/stop riding a vehicle)");
|
||||
public static final Option<Boolean> FIX_STAIRS_DROPS = make("Fix stairs drops", true, "Fix stairs not dropping themselves when mined");
|
||||
public static final Option<Boolean> FIX_PICKAXE_EFFECTIVENESS =
|
||||
make("Fix pickaxe effectiveness", true, "Fixes pickaxes not being effective agaist certain blocks that it should be effective on");
|
||||
public static final Option<Boolean> FIX_AXE_EFFECTIVENESS =
|
||||
make("Fix axe effectiveness", true, "Fixes axes not being effective agaist certain blocks that it should be effective on");
|
||||
public static final Option<Boolean> FIX_SHOVEL_EFFECTIVENESS =
|
||||
make("Fix shovel effectiveness", true, "Fixes shovels not being effective agaist certain blocks that it should be effective on");
|
||||
public static final Option<Boolean> FIX_SADDLES_NOT_DROPPING = make("Fix saddles not dropping", true, "Fixes saddles not dropping when killing saddled pigs");
|
||||
public static final Option<Boolean> FIX_FURNACE_LAVA_BUCKET = make("Fix furnace lava bucket", true, "Fixes furnaces consuming the bucket when using lava buckets as fuel");
|
||||
public static final Option<Boolean> FIX_BOOKSHELVES_DROP = make("Fix Bookshelves Drops", true, "Drops 3 books when breaking a bookshelf");
|
||||
public static final Option<Boolean> FIX_DOUBLE_DOORS =
|
||||
make("Fix Double Doors", true, "Fixes double doors not being in their correct state when pressure plates are used to open them");
|
||||
public static final Option<Boolean> FIX_SLABS_RECIPE =
|
||||
make("Fix Slabs Recipe", true, "Givs two slabs for every block, since 1 block = 2 slabs => 3 blocks = 6 slabs (instead of 3)");
|
||||
public static final Option<Boolean> FIX_SLIME_SPLITS = make("Fix Slime Splits", true, "Fixes slimes not splitting if their HP is not exactly zero");
|
||||
public static final Option<Boolean> FIX_BOW_DURABILITY = make("Bow Durability", true, "Enables durability stat on bows (385 uses)");
|
||||
|
||||
private static ModConfig instance = new ModConfig();
|
||||
|
||||
public static final ModConfig instance() {
|
||||
return instance;
|
||||
}
|
||||
|
||||
public ModConfig() {
|
||||
CommentedFileConfigBuilder builder = CommentedFileConfig.builder(CONFIG_PATH);
|
||||
this.fileConfig = builder.autosave().autoreload().build();
|
||||
|
||||
this.fileConfig.load();
|
||||
|
||||
for (Option o : OPTIONS) {
|
||||
if (!this.fileConfig.contains(o.name)) {
|
||||
this.fileConfig.add(o.name, o.defaultValue);
|
||||
this.fileConfig.setComment(o.name, o.description);
|
||||
}
|
||||
else if (!WyHelper.isNullOrEmpty(o.description) && this.fileConfig.contains(o.name) && !this.fileConfig.containsComment(o.name)) {
|
||||
this.fileConfig.setComment(o.name, o.description);
|
||||
}
|
||||
}
|
||||
|
||||
this.fileConfig.close();
|
||||
}
|
||||
|
||||
public static <T> Option<T> make(String name, T defaultValue, String description) {
|
||||
Option<T> option = new Option(name, defaultValue, description);
|
||||
OPTIONS.add(option);
|
||||
return option;
|
||||
}
|
||||
|
||||
public <T> T get(Option<T> o) {
|
||||
return this.fileConfig.getOrElse(o.name, o.defaultValue);
|
||||
}
|
||||
|
||||
public <T> T set(Option<T> o, T value) {
|
||||
return this.fileConfig.set(o.name, value);
|
||||
}
|
||||
|
||||
public static class Option<T> {
|
||||
private String name;
|
||||
private String description;
|
||||
private T defaultValue;
|
||||
|
||||
public Option(String name, T defaultValue, String description) {
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
this.description = description;
|
||||
}
|
||||
|
||||
public Option(String name, T defaultValue) {
|
||||
this.name = name;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
|
||||
public T get() {
|
||||
return ModConfig.instance().get(this);
|
||||
}
|
||||
|
||||
public void set(T value) {
|
||||
ModConfig.instance().set(this, value);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,78 @@
|
|||
package net.minecraft.src.finalbeta;
|
||||
|
||||
import org.lwjgl.opengl.GL11;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.GuiButton;
|
||||
|
||||
public class ModSlider extends GuiButton {
|
||||
public float value = 1.0F;
|
||||
public boolean dragged = false;
|
||||
public final String defaultText;
|
||||
private final IChanceValue changeEvent;
|
||||
|
||||
public ModSlider(int id, int x, int y, String label, float initialValue, IChanceValue changeEvent) {
|
||||
super(id, x, y, 150, 20, label);
|
||||
this.value = initialValue;
|
||||
this.defaultText = label;
|
||||
this.changeEvent = changeEvent;
|
||||
this.displayString = this.defaultText + "" + String.format("%.2f", this.value);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int getHoverState(boolean flag) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void drawButton(Minecraft minecraft, int i, int j) {
|
||||
if (this.enabled2) {
|
||||
if (this.dragged) {
|
||||
this.value = (float) (i - (this.xPosition + 4)) / (float) (this.width - 8);
|
||||
if (this.value < 0.0F) {
|
||||
this.value = 0.0F;
|
||||
}
|
||||
|
||||
if (this.value > 1.0F) {
|
||||
this.value = 1.0F;
|
||||
}
|
||||
|
||||
this.changeEvent.changeValue(this.value);
|
||||
this.displayString = this.defaultText + "" + String.format("%.2f", this.value);
|
||||
}
|
||||
|
||||
GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
this.drawTexturedModalRect(this.xPosition + (int) (this.value * (this.width - 8)), this.yPosition, 0, 66, 4, 20);
|
||||
this.drawTexturedModalRect(this.xPosition + (int) (this.value * (this.width - 8)) + 4, this.yPosition, 196, 66, 4, 20);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean mousePressed(Minecraft minecraft, int i, int j) {
|
||||
if (super.mousePressed(minecraft, i, j)) {
|
||||
this.value = (float) (i - (this.xPosition + 4)) / (float) (this.width - 8);
|
||||
if (this.value < 0.0F) {
|
||||
this.value = 0.0F;
|
||||
}
|
||||
|
||||
if (this.value > 1.0F) {
|
||||
this.value = 1.0F;
|
||||
}
|
||||
|
||||
this.changeEvent.changeValue(this.value);
|
||||
this.displayString = this.defaultText + "" + String.format("%.2f", this.value);
|
||||
this.dragged = true;
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void mouseReleased(int i, int j) {
|
||||
this.dragged = false;
|
||||
}
|
||||
|
||||
public interface IChanceValue {
|
||||
void changeValue(float value);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,41 @@
|
|||
package net.minecraft.src.finalbeta;
|
||||
|
||||
import java.time.Duration;
|
||||
import net.minecraft.src.ModLoader;
|
||||
|
||||
public class WyHelper {
|
||||
public static final String SPAWN_TIME_TAG = "SpawnTime";
|
||||
public static final String PLAY_TIME_TAG = "PlayTime";
|
||||
|
||||
public static long playTime;
|
||||
|
||||
public static long getRealDaysPlayed() {
|
||||
long seconds = WyHelper.playTime / 20;
|
||||
return Duration.ofSeconds(seconds).toDays();
|
||||
}
|
||||
|
||||
public static long getGameDaysPlayed() {
|
||||
long seconds = ModLoader.getMinecraftInstance().theWorld.getWorldTime() / 20;
|
||||
return Duration.ofSeconds(seconds).toMinutes() / 20;
|
||||
}
|
||||
|
||||
public static float lerp(float delta, float start, float end) {
|
||||
return start + delta * (end - start);
|
||||
}
|
||||
|
||||
public static float clamp(float val, float min, float max) {
|
||||
return val < min ? min : Math.min(val, max);
|
||||
}
|
||||
|
||||
public static int clamp(int val, int min, int max) {
|
||||
return val < min ? min : Math.min(val, max);
|
||||
}
|
||||
|
||||
public static boolean isNullOrEmpty(String s) {
|
||||
if (s == null || s.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -1,18 +1,24 @@
|
|||
package net.minecraft.src;
|
||||
|
||||
import java.util.logging.Logger;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.src.finalbeta.ModConfig;
|
||||
|
||||
public class mod_FinalBeta extends BaseMod {
|
||||
|
||||
public static final Logger LOGGER = Logger.getLogger("FinalBeta");
|
||||
|
||||
public mod_FinalBeta() {
|
||||
// ModLoader.SetInGameHook(this, true, true);
|
||||
ModConfig.instance();
|
||||
|
||||
ModLoader.SetInGameHook(this, true, true);
|
||||
}
|
||||
|
||||
public boolean OnTickInGame(Minecraft minecraft) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String Version() {
|
||||
return "1.4.0";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue