Skip to content

Commit

Permalink
Update to 1.20, remove pushable budding amethyst gamerule temporarily
Browse files Browse the repository at this point in the history
  • Loading branch information
DragonEggBedrockBreaking committed Jun 7, 2023
1 parent cb00eda commit ed6ee20
Show file tree
Hide file tree
Showing 14 changed files with 73 additions and 48 deletions.
1 change: 0 additions & 1 deletion buildscript/src/main/java/Buildscript.java
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@ public void getModDependencies(ModDependencyCollector d) {
// Conditional Mixin
jij(d.addMaven("https://jitpack.io/", new MavenId("com.github.Fallen-Breath", "conditional-mixin", Versions.CONDITIONAL_MIXIN_VERSION), ModDependencyFlag.COMPILE, ModDependencyFlag.RUNTIME));
// LazyDFU
d.addMaven("https://api.modrinth.com/maven/", new MavenId("maven.modrinth", "lazydfu", Versions.LAZYDFU_VERSION), ModDependencyFlag.RUNTIME);
}

@Override
Expand Down
7 changes: 3 additions & 4 deletions buildscript/src/main/java/Versions.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
public class Versions {
public static final String MINECRAFT_VERSION = "1.19.4";
public static final String FABRIC_LOADER_VERSION = "0.14.17";
public static final String MINECRAFT_VERSION = "1.20";
public static final String FABRIC_LOADER_VERSION = "0.14.21";
public static final int JAVA_VERSION = 17;
public static final String QUILTFLOWER_VERSION = "1.9.0";
public static final String FABRIC_GAMERULE_API_VERSION = "1.0.32+a1ccd7bff4";
public static final String FABRIC_GAMERULE_API_VERSION = "1.0.38+b04edc7a27";
public static final String CAFFEINE_CONFIG_VERSION = "1.0.0";
public static final String LAZYDFU_VERSION = "0.1.3";
public static final String MIXIN_EXTRAS_VERSION = "0.2.0-beta.4";
public static final String CONDITIONAL_MIXIN_VERSION = "v0.3.2";
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ public abstract class MixinItemEntity {

@Inject(method = "tick", at = @At("HEAD"))
private void discardItem(CallbackInfo ci) {
if (this.age >= Gamerules.ITEM_DESPAWN_TIME.getInt() * 20 && !(((Entity) (Object) this).getLevel().isClientSide())) {
if (this.age >= Gamerules.ITEM_DESPAWN_TIME.getInt() * 20 && !(((Entity) (Object) this).level().isClientSide())) {
((Entity) (Object) this).discard();
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@

@Mixin(Entity.class)
public abstract class MixinEntity {
@Shadow
public Level level;
@Shadow
private BlockPos blockPosition;

Expand All @@ -27,13 +25,15 @@ public abstract class MixinEntity {
@Shadow
public abstract EntityType<?> getType();

@Shadow public abstract Level level();

@Inject(method = "onInsideBlock", at = @At("HEAD"))
private void killOnHorizontalCollision(CallbackInfo ci) {
if (Gamerules.OLD_BOATS.getBool() && this.getType().equals(EntityType.BOAT)) {
for (Direction direction : Direction.Plane.HORIZONTAL) {
BlockState blockState = this.level.getBlockState(this.blockPosition.relative(direction));
if (blockState.getMaterial().isSolid()) {
if (!this.hurt(level.damageSources().generic(), Float.MAX_VALUE)) return;
BlockState blockState = this.level().getBlockState(this.blockPosition.relative(direction));
if (blockState.isSolid()) {
if (!this.hurt(this.level().damageSources().generic(), Float.MAX_VALUE)) return;
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ private boolean editRestockFrequency(boolean original) {
int villagerDailyRestocks = Gamerules.VILLAGER_DAILY_RESTOCKS.getInt();
if (villagerDailyRestocks == 0) return original;
long restockTimeLimit = 4800L / villagerDailyRestocks;
return this.numberOfRestocksToday == 0 | this.numberOfRestocksToday < 2 && ((Entity) (Object) this).level.getGameTime() > this.lastRestockGameTime + restockTimeLimit;
return this.numberOfRestocksToday == 0 | this.numberOfRestocksToday < 2 && ((Entity) (Object) this).level().getGameTime() > this.lastRestockGameTime + restockTimeLimit;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
@Mixin(Zombie.class)
public abstract class MixinZombie {
@ModifyExpressionValue(
method = "wasKilled",
method = "killedEntity",
at = @At(
value = "INVOKE",
target = "Lnet/minecraft/server/level/ServerLevel;getDifficulty()Lnet/minecraft/world/Difficulty;"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public static void langFileFallback() throws IOException {
if (inputUrl != null) {
Files.copy(inputUrl, dest, StandardCopyOption.REPLACE_EXISTING);
}
String content = "{\"pack\":{\"pack_format\":13,\"description\":\"Vanilla Disable Language File\"}}";
String content = "{\"pack\":{\"pack_format\":15,\"description\":\"Vanilla Disable Language File\"}}";
String mcmetaPath = new File(outerrpackdir + "/pack.mcmeta").toString();
FileWriter mcmetaWriter = new FileWriter(mcmetaPath);
mcmetaWriter.write(content);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ public enum Gamerules {
RECIPE_COMMAND(VD_COMMANDS, true, true),
RELOAD_COMMAND(VD_COMMANDS, true, true),
RESET_CHUNKS_COMMAND(VD_COMMANDS, true, true),
RETURN_COMMAND(VD_COMMANDS, true, true),
RIDE_COMMAND(VD_COMMANDS, true, true),
SAY_COMMAND(VD_COMMANDS, true, true),
SCHEDULE_COMMAND(VD_COMMANDS, true, true),
Expand Down Expand Up @@ -201,6 +202,7 @@ public enum Gamerules {

ALLAYS_ENABLED(VD_MOB_TOGGLES, true, true),
BATS_ENABLED(VD_MOB_TOGGLES, true, true),
CAMELS_ENABLED(VD_MOB_TOGGLES, true, true),
CATS_ENABLED(VD_MOB_TOGGLES, true, true),
CHICKENS_ENABLED(VD_MOB_TOGGLES, true, true),
CODS_ENABLED(VD_MOB_TOGGLES, true, true),
Expand All @@ -219,6 +221,7 @@ public enum Gamerules {
SALMONS_ENABLED(VD_MOB_TOGGLES, true, true),
SHEEP_ENABLED(VD_MOB_TOGGLES, true, true),
SKELETON_HORSES_ENABLED(VD_MOB_TOGGLES, true, true),
SNIFFERS_ENABLED(VD_MOB_TOGGLES, true, true),
SNOW_GOLEMS_ENABLED(VD_MOB_TOGGLES, true, true),
SQUIDS_ENABLED(VD_MOB_TOGGLES, true, true),
STRIDERS_ENABLED(VD_MOB_TOGGLES, true, true),
Expand Down Expand Up @@ -372,6 +375,7 @@ public enum Gamerules {
SHIPWRECK_GENERATION(VD_WORLDGEN, true, true),
STRONGHOLD_GENERATION(VD_WORLDGEN, true, true),
SWAMP_HUT_GENERATION(VD_WORLDGEN, true, true),
TRAIL_RUINS_GENERATION(VD_WORLDGEN, true, true),
VILLAGE_GENERATION(VD_WORLDGEN, true, true),
END_VEGETATION(VD_WORLDGEN, true, true),
NETHER_VEGETATION(VD_WORLDGEN, true, true),
Expand Down Expand Up @@ -430,6 +434,7 @@ public enum Gamerules {
PISTON_ENABLED(VD_REDSTONE, true, true),
SCULK_SENSOR_ENABLED(VD_REDSTONE, true, true),
JUKEBOX_EMITS_REDSTONE(VD_REDSTONE, true, true),
CHISELED_BOOKSHELF_EMITS_REDSTONE(VD_REDSTONE, true, true),

BEE_AI(VD_AI, true, true),
BLAZE_AI(VD_AI, true, true),
Expand Down Expand Up @@ -469,7 +474,6 @@ public enum Gamerules {
BEACONS_ENABLED(VD_BLOCKS, true, true),
CONDUITS_ENABLED(VD_BLOCKS, true, true),
CREATIVE_SWORD_CAN_BREAK_BLOCKS(VD_BLOCKS, false, true),
PUSHABLE_BUDDING_AMETHYST(VD_BLOCKS, true, true),
CONTAINER_OPENING_BLOCKED(VD_BLOCKS, true, true),
OLD_TNT(VD_BLOCKS, false, true),
DEFAULT_BLOCK_FRICTION_FACTOR(VD_BLOCKS, 0.6, Double.MAX_VALUE),
Expand Down Expand Up @@ -811,6 +815,9 @@ public enum Gamerules {
ADVENTURE_ADVANCEMENT_CAVES_AND_CLIFFS(VD_ADVANCEMENT, true, true),
ADVENTURE_ADVANCEMENT_IT_SPREADS(VD_ADVANCEMENT, true, true),
ADVENTURE_ADVANCEMENT_SNEAK_100(VD_ADVANCEMENT, true, true),
ADVENTURE_ADVANCEMENT_RESPECTING_THE_REMNANTS(VD_ADVANCEMENT, true, true),
ADVENTURE_ADVANCEMENT_CAREEFUL_RESTORATION(VD_ADVANCEMENT, true, true),
ADVENTURE_ADVANCEMENT_THE_POWER_OF_BOOKS(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_HUSBANDRY(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_SEEDY_PLACE(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_PARROTS_AND_BATS(VD_ADVANCEMENT, true, true),
Expand All @@ -834,6 +841,11 @@ public enum Gamerules {
HUSBANDRY_ADVANCEMENT_GLOW_AND_BEHOLD(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_FRIEND_IN_ME(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_BIRTHDAY_SONG(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_SMELLS_FUNNY(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_LITTLE_SNIFFS(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_PLANTING_THE_PAST(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_CRAFTING_A_NEW_LOOK(VD_ADVANCEMENT, true, true),
HUSBANDRY_ADVANCEMENT_SMITHING_WITH_STYLE(VD_ADVANCEMENT, true, true),
NETHER_ADVANCEMENT_NETHER(VD_ADVANCEMENT, true, true),
NETHER_ADVANCEMENT_RETURN_TO_SENDER(VD_ADVANCEMENT, true, true),
NETHER_ADVANCEMENT_TERRIBLE_FORTRESS(VD_ADVANCEMENT, true, true),
Expand Down Expand Up @@ -969,6 +981,7 @@ public enum Gamerules {
BAMBOO_JUNGLE_BIOME(VD_BIOME, true, true),
BEACH_BIOME(VD_BIOME, true, true),
BIRCH_FOREST_BIOME(VD_BIOME, true, true),
CHERRY_GROVE_BIOME(VD_BIOME, true, true),
COLD_OCEAN_BIOME(VD_BIOME, true, true),
DARK_FOREST_BIOME(VD_BIOME, true, true),
DEEP_COLD_OCEAN_BIOME(VD_BIOME, true, true),
Expand Down
18 changes: 18 additions & 0 deletions src/main/java/uk/debb/vanilla_disable/util/maps/PopulateMaps.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,12 @@
import net.minecraft.world.entity.animal.*;
import net.minecraft.world.entity.animal.allay.Allay;
import net.minecraft.world.entity.animal.axolotl.Axolotl;
import net.minecraft.world.entity.animal.camel.Camel;
import net.minecraft.world.entity.animal.frog.Frog;
import net.minecraft.world.entity.animal.frog.Tadpole;
import net.minecraft.world.entity.animal.goat.Goat;
import net.minecraft.world.entity.animal.horse.*;
import net.minecraft.world.entity.animal.sniffer.Sniffer;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.entity.boss.wither.WitherBoss;
import net.minecraft.world.entity.decoration.PaintingVariants;
Expand Down Expand Up @@ -185,6 +187,8 @@ public static void populateMaps() {
biomeGenerationSettingsStringMap.put(TreePlacements.FANCY_OAK_BEES.toString(), TREE_GENERATION);
biomeGenerationSettingsStringMap.put(TreePlacements.MANGROVE_CHECKED.toString(), TREE_GENERATION);
biomeGenerationSettingsStringMap.put(TreePlacements.TALL_MANGROVE_CHECKED.toString(), TREE_GENERATION);
biomeGenerationSettingsStringMap.put(TreePlacements.CHERRY_BEES_005.toString(), TREE_GENERATION);
biomeGenerationSettingsStringMap.put(TreePlacements.CHERRY_CHECKED.toString(), TREE_GENERATION);
biomeGenerationSettingsStringMap.put(VillagePlacements.PILE_HAY_VILLAGE.toString(), VILLAGE_GENERATION);
biomeGenerationSettingsStringMap.put(VillagePlacements.PILE_ICE_VILLAGE.toString(), VILLAGE_GENERATION);
biomeGenerationSettingsStringMap.put(VillagePlacements.PILE_MELON_VILLAGE.toString(), VILLAGE_GENERATION);
Expand Down Expand Up @@ -568,6 +572,7 @@ public static void populateMaps() {
structureCheckStringMap.put("minecraft:ancient_city/city_center", ANCIENT_CITY_GENERATION);
structureCheckStringMap.put("minecraft:bastion/starts", BASTION_REMNANT_GENERATION);
structureCheckStringMap.put("minecraft:pillager_outpost/base_plates", PILLAGER_OUTPOST_GENERATION);
structureCheckStringMap.put("minecraft:trail_ruins/tower", TRAIL_RUINS_GENERATION);
structureCheckStringMap.put("minecraft:village/desert/town_centers", VILLAGE_GENERATION);
structureCheckStringMap.put("minecraft:village/plains/town_centers", VILLAGE_GENERATION);
structureCheckStringMap.put("minecraft:village/savanna/town_centers", VILLAGE_GENERATION);
Expand Down Expand Up @@ -802,6 +807,7 @@ public static void populateMaps() {
commandsStringMap.put("recipe", RECIPE_COMMAND);
commandsStringMap.put("reload", RELOAD_COMMAND);
commandsStringMap.put("resetchunks", RESET_CHUNKS_COMMAND);
commandsStringMap.put("return", RETURN_COMMAND);
commandsStringMap.put("ride", RIDE_COMMAND);
commandsStringMap.put("say", SAY_COMMAND);
commandsStringMap.put("schedule", SCHEDULE_COMMAND);
Expand Down Expand Up @@ -1024,6 +1030,7 @@ public static void populateMaps() {
mobClassMapToggle.put(Allay.class, ALLAYS_ENABLED);
mobClassMapToggle.put(Bat.class, BATS_ENABLED);
mobClassMapToggle.put(Cat.class, CATS_ENABLED);
mobClassMapToggle.put(Camel.class, CAMELS_ENABLED);
mobClassMapToggle.put(Chicken.class, CHICKENS_ENABLED);
mobClassMapToggle.put(Cod.class, CODS_ENABLED);
mobClassMapToggle.put(Cow.class, COWS_ENABLED);
Expand Down Expand Up @@ -1082,6 +1089,7 @@ public static void populateMaps() {
mobClassMapToggle.put(Silverfish.class, SILVERFISH_ENABLED);
mobClassMapToggle.put(Skeleton.class, SKELETONS_ENABLED);
mobClassMapToggle.put(Slime.class, SLIMES_ENABLED);
mobClassMapToggle.put(Sniffer.class, SNIFFERS_ENABLED);
mobClassMapToggle.put(Stray.class, STRAYS_ENABLED);
mobClassMapToggle.put(Vex.class, VEXES_ENABLED);
mobClassMapToggle.put(Vindicator.class, VINDICATORS_ENABLED);
Expand Down Expand Up @@ -1124,6 +1132,9 @@ public static void populateMaps() {
playerAdvancementsStringMap.put("advancements.adventure.fall_from_world_height.title", ADVENTURE_ADVANCEMENT_CAVES_AND_CLIFFS);
playerAdvancementsStringMap.put("advancements.adventure.kill_mob_near_sculk_catalyst.title", ADVENTURE_ADVANCEMENT_IT_SPREADS);
playerAdvancementsStringMap.put("advancements.adventure.avoid_vibration.title", ADVENTURE_ADVANCEMENT_SNEAK_100);
playerAdvancementsStringMap.put("advancements.adventure.salvage_sherd.title", ADVENTURE_ADVANCEMENT_RESPECTING_THE_REMNANTS);
playerAdvancementsStringMap.put("advancements.adventure.craft_decorated_pot_using_only_sherds.title", ADVENTURE_ADVANCEMENT_CAREEFUL_RESTORATION);
playerAdvancementsStringMap.put("advancements.adventure.read_power_from_chiseled_bookshelf.title", ADVENTURE_ADVANCEMENT_THE_POWER_OF_BOOKS);
playerAdvancementsStringMap.put("advancements.husbandry.root.title", HUSBANDRY_ADVANCEMENT_HUSBANDRY);
playerAdvancementsStringMap.put("advancements.husbandry.plant_seed.title", HUSBANDRY_ADVANCEMENT_SEEDY_PLACE);
playerAdvancementsStringMap.put("advancements.husbandry.breed_an_animal.title", HUSBANDRY_ADVANCEMENT_PARROTS_AND_BATS);
Expand All @@ -1147,6 +1158,11 @@ public static void populateMaps() {
playerAdvancementsStringMap.put("advancements.husbandry.make_a_sign_glow.title", HUSBANDRY_ADVANCEMENT_GLOW_AND_BEHOLD);
playerAdvancementsStringMap.put("advancements.husbandry.allay_deliver_item_to_player.title", HUSBANDRY_ADVANCEMENT_FRIEND_IN_ME);
playerAdvancementsStringMap.put("advancements.husbandry.allay_deliver_cake_to_note_block.title", HUSBANDRY_ADVANCEMENT_BIRTHDAY_SONG);
playerAdvancementsStringMap.put("advancements.husbandry.obtain_sniffer_egg.title", HUSBANDRY_ADVANCEMENT_SMELLS_FUNNY);
playerAdvancementsStringMap.put("advancements.husbandry.feed_snifflet.title", HUSBANDRY_ADVANCEMENT_LITTLE_SNIFFS);
playerAdvancementsStringMap.put("advancements.husbandry.plant_any_sniffer_seed.title", HUSBANDRY_ADVANCEMENT_PLANTING_THE_PAST);
playerAdvancementsStringMap.put("advancements.adventure.trim_with_any_armor_pattern.title", HUSBANDRY_ADVANCEMENT_CRAFTING_A_NEW_LOOK);
playerAdvancementsStringMap.put("advancements.adventure.trim_with_all_exclusive_armor_patterns.title", HUSBANDRY_ADVANCEMENT_SMITHING_WITH_STYLE);
playerAdvancementsStringMap.put("advancements.nether.root.title", NETHER_ADVANCEMENT_NETHER);
playerAdvancementsStringMap.put("advancements.nether.return_to_sender.title", NETHER_ADVANCEMENT_RETURN_TO_SENDER);
playerAdvancementsStringMap.put("advancements.nether.find_fortress.title", NETHER_ADVANCEMENT_TERRIBLE_FORTRESS);
Expand Down Expand Up @@ -1444,6 +1460,7 @@ public static void populateMaps() {
blockStateBaseRedstoneBlocksMap.put(Blocks.TRAPPED_CHEST, TRAPPED_CHEST_ENABLED);
blockStateBaseRedstoneBlocksMap.put(Blocks.TRIPWIRE_HOOK, TRIPWIRE_HOOK_ENABLED);
blockStateBaseRedstoneBlocksMap.put(Blocks.JUKEBOX, JUKEBOX_EMITS_REDSTONE);
blockStateBaseRedstoneBlocksMap.put(Blocks.CHISELED_BOOKSHELF, CHISELED_BOOKSHELF_EMITS_REDSTONE);

itemItemMap.put(Items.BOW, BOW_DURABILITY);
itemItemMap.put(Items.CARROT_ON_A_STICK, CARROT_ON_STICK_DURABILITY);
Expand Down Expand Up @@ -1591,6 +1608,7 @@ public static void populateBiomeMap() {
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.BAMBOO_JUNGLE), BAMBOO_JUNGLE_BIOME);
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.BEACH), BEACH_BIOME);
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.BIRCH_FOREST), BIRCH_FOREST_BIOME);
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.CHERRY_GROVE), CHERRY_GROVE_BIOME);
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.COLD_OCEAN), COLD_OCEAN_BIOME);
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.DARK_FOREST), DARK_FOREST_BIOME);
biomeSourceBiomeHolderMap.put(biomeRegistry.getHolderOrThrow(Biomes.DEEP_COLD_OCEAN), DEEP_COLD_OCEAN_BIOME);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,10 @@ private static <T extends GameRules.Value<T>> int listGamerules(CommandSourceSta
if (!gamerules.isEmpty()) {
String joined = String.join("\n", gamerules);
joined = "Here are the gamerules for the category:\n\n" + joined;
source.sendSuccess(Component.literal(joined), true);
String finalJoined = joined;
source.sendSuccess(() -> Component.literal(finalJoined), true);
} else {
source.sendSuccess(Component.translatable("commands.gamerule.category.invalid"), true);
source.sendSuccess(() -> Component.translatable("commands.gamerule.category.invalid"), true);
}
return lv.getCommandResult();
}
Expand Down Expand Up @@ -196,13 +197,13 @@ private static <T extends GameRules.Value<T>> int queryRule(CommandSourceStack a
return GameRuleCommand.queryRule(arg, arg2);
}
if (!description.getString().equals(arg2.getDescriptionId() + ".description")) {
arg.sendSuccess(description, false);
arg.sendSuccess(() -> description, false);
}
arg.sendSuccess(Component.translatable("commands.gamerule.query", id, lv.toString()), false);
arg.sendSuccess(() -> Component.translatable("commands.gamerule.query", id, lv.toString()), false);
if (lv.toString().equals(defaultVal)) {
arg.sendSuccess(Component.translatable("commands.gamerule.already_default"), false);
arg.sendSuccess(() -> Component.translatable("commands.gamerule.already_default"), false);
} else {
arg.sendSuccess(Component.translatable("commands.gamerule.default", defaultVal), false);
arg.sendSuccess(() -> Component.translatable("commands.gamerule.default", defaultVal), false);
}
return lv.getCommandResult();
}
Expand Down
Loading

0 comments on commit ed6ee20

Please sign in to comment.