diff --git a/LoTAS-Fabric/build.gradle b/LoTAS-Fabric/build.gradle index 9dfe9f9e..c719fc68 100644 --- a/LoTAS-Fabric/build.gradle +++ b/LoTAS-Fabric/build.gradle @@ -1,6 +1,6 @@ import groovy.json.JsonOutput -version = "2.0.3" +version = "2.0.4" group = "de.pfannekuchen.lotas" apply from: 'versions2/preprocessor.gradle' diff --git a/LoTAS-Fabric/settings.gradle b/LoTAS-Fabric/settings.gradle index 7e3461e8..5d640092 100644 --- a/LoTAS-Fabric/settings.gradle +++ b/LoTAS-Fabric/settings.gradle @@ -17,7 +17,8 @@ def versions2 = [ '1.16.5', '1.17.1', '1.18.2', - '1.19.0' + '1.19.0', + '1.19.2' ] versions2.collect {":versions2:$it"}.each { include it diff --git a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/LeafDropManipulation.java b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/LeafDropManipulation.java index 94df0664..890b08d3 100644 --- a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/LeafDropManipulation.java +++ b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/LeafDropManipulation.java @@ -14,6 +14,7 @@ import net.minecraft.world.entity.Entity; import net.minecraft.world.item.ItemStack; import net.minecraft.world.item.Items; +import net.minecraft.world.level.block.Block; import net.minecraft.world.level.block.Blocks; import net.minecraft.world.level.block.state.BlockState; @@ -45,28 +46,33 @@ public String getName() { @Override public List redirectDrops(BlockState block) { List list = new ArrayList<>(); - if (Blocks.OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) { + Block blockToCheck=block.getBlock().defaultBlockState().getBlock(); + if (Blocks.OAK_LEAVES.equals(blockToCheck)) { if (dropSapling.isToggled()) list.add(new ItemStack(Items.OAK_SAPLING)); - } else if (Blocks.BIRCH_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) { + } else if (Blocks.BIRCH_LEAVES.equals(blockToCheck)) { if (dropSapling.isToggled()) list.add(new ItemStack(Items.BIRCH_SAPLING)); - } else if (Blocks.SPRUCE_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) { + } else if (Blocks.SPRUCE_LEAVES.equals(blockToCheck)) { if (dropSapling.isToggled()) list.add(new ItemStack(Items.SPRUCE_SAPLING)); - } else if (Blocks.JUNGLE_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) { + } else if (Blocks.JUNGLE_LEAVES.equals(blockToCheck)) { if (dropSapling.isToggled()) list.add(new ItemStack(Items.JUNGLE_SAPLING)); - } else if (Blocks.DARK_OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) { + } else if (Blocks.DARK_OAK_LEAVES.equals(blockToCheck)) { if (dropSapling.isToggled()) list.add(new ItemStack(Items.DARK_OAK_SAPLING)); - } else if (Blocks.ACACIA_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) { + } else if (Blocks.ACACIA_LEAVES.equals(blockToCheck)) { if (dropSapling.isToggled()) list.add(new ItemStack(Items.ACACIA_SAPLING)); + //#if MC>=11900 +//$$ } else if (Blocks.MANGROVE_LEAVES.equals(blockToCheck)) { +//$$ // Mangrove leaves don't drop saplings + //#endif } else { return ImmutableList.of(); } - if (dropApple.isToggled() && (Blocks.OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock()) || Blocks.DARK_OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock()))) + if (dropApple.isToggled() && (Blocks.OAK_LEAVES.equals(blockToCheck) || Blocks.DARK_OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock()))) list.add(new ItemStack(Items.APPLE)); if (dropStick.isToggled()) list.add(new ItemStack(Items.STICK, 2)); diff --git a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java index 8b416172..0877c8c4 100644 --- a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java +++ b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java @@ -57,7 +57,12 @@ public List redirectDrops(BlockState block) { @Override public List redirectDrops(Entity entity, int lootingBonus) { List list = new ArrayList<>(); - if (entity instanceof Zombie || entity instanceof Husk || entity instanceof ZombieVillager) { + if (entity instanceof Zombie && + //#if MC>=11600 +//$$ !(entity instanceof net.minecraft.world.entity.monster.ZombifiedPiglin)) { + //#else + !(entity instanceof net.minecraft.world.entity.monster.PigZombie)) { + //#endif list.add(new ItemStack(Items.ROTTEN_FLESH, 2 +lootingBonus)); if (dropIron.isToggled()) diff --git a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/rest/BarteringDropManipulation.java b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/rest/BarteringDropManipulation.java index 1d3d5dcb..5a5779d0 100644 --- a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/rest/BarteringDropManipulation.java +++ b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/rest/BarteringDropManipulation.java @@ -92,8 +92,8 @@ public List redirectDrops(Entity entity, int lootingBonus) { //$$ case "spectral arrow": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.SPECTRAL_ARROW, 16)); //$$ case "arrow": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.ARROW, 12)); //$$ case "gravel": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.GRAVEL, 16)); -//$$ case "magma cream": return ImmutableList.of(); -//$$ case "glowstone dust": return ImmutableList.of(); +//$$ case "magma cream": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.MAGMA_CREAM, 6)); +//$$ case "glowstone dust": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.GLOWSTONE_DUST, 12)); //$$ case "blackstone": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.BLACKSTONE, 16)); //$$ default: return ImmutableList.of(); //$$ } diff --git a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/binds/MixinTickrateChangerAchievements.java b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/binds/MixinTickrateChangerAchievements.java index 3a0afaf1..1933985b 100644 --- a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/binds/MixinTickrateChangerAchievements.java +++ b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/binds/MixinTickrateChangerAchievements.java @@ -10,7 +10,20 @@ public class MixinTickrateChangerAchievements { //#if MC>=11601 -//$$ @ModifyVariable(method = "Lnet/minecraft/client/gui/components/toasts/ToastComponent$ToastInstance;render(IILcom/mojang/blaze3d/vertex/PoseStack;)Z", at = @At(value = "STORE"), ordinal = 0, index = 4) +//$$ @ModifyVariable( + //#if MC>=11901 +//$$ method = "Lnet/minecraft/client/gui/components/toasts/ToastComponent$ToastInstance;render(ILcom/mojang/blaze3d/vertex/PoseStack;)Z", + //#else +//$$ method = "Lnet/minecraft/client/gui/components/toasts/ToastComponent$ToastInstance;render(IILcom/mojang/blaze3d/vertex/PoseStack;)Z", + //#endif +//$$ +//$$ at = @At(value = "STORE"), ordinal = 0, +//$$ + //#if MC>=11901 +//$$ index = 3) + //#else +//$$ index = 4) + //#endif //$$ public long modifyAnimationTime(long animationTimer) { //$$ return TickrateChangerMod.getMilliseconds(); //$$ } diff --git a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinGuiIngameMenu.java b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinGuiIngameMenu.java index 95eaf3c1..1d886c74 100644 --- a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinGuiIngameMenu.java +++ b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinGuiIngameMenu.java @@ -4,7 +4,9 @@ import java.time.Duration; import org.lwjgl.glfw.GLFW; +import org.spongepowered.asm.mixin.Final; import org.spongepowered.asm.mixin.Mixin; +import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; @@ -42,11 +44,15 @@ protected MixinGuiIngameMenu(Component title) { public EditBox savestateName; public EditBox tickrateField; + + @Shadow @Final + private boolean showPauseMenu; SmallCheckboxWidget fw = null; // do not pay attention @Inject(at = @At("RETURN"), method = "init") public void addCustomButtons(CallbackInfo ci) { + if(!showPauseMenu) return; // Move Buttons higher for (int i=0;i=11600 + //#if MC>=11601 //$$ public void mixinRenderExperienceBar(com.mojang.blaze3d.vertex.PoseStack poseStack, int i, CallbackInfo ci) { //#else public void mixinRenderExperienceBar(CallbackInfo ci) { diff --git a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mods/TickrateChangerMod.java b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mods/TickrateChangerMod.java index c8642327..64a699ea 100644 --- a/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mods/TickrateChangerMod.java +++ b/LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mods/TickrateChangerMod.java @@ -98,10 +98,11 @@ public static void updateClientTickrate(float tickrateIn) { ((AccessorTimer) ((AccessorMinecraftClient) Minecraft.getInstance()).getTimer()).setTickTime(Float.MAX_VALUE); } tickrate = tickrateIn; - if (!ConfigUtils.getBoolean("ui", "hideTickrateMessages") && Minecraft.getInstance().gui != null) - Minecraft.getInstance().gui.getChat().addMessage(MCVer.literal("Updated Tickrate to \u00A7b" + tickrateIn)); - - ((SoundPitchDuck)((AccessorSoundEngine)Minecraft.getInstance().getSoundManager()).getSoundEngine()).updatePitch(); + if (!ConfigUtils.getBoolean("ui", "hideTickrateMessages") && Minecraft.getInstance().gui != null) { + Minecraft mc=Minecraft.getInstance(); + mc.gui.getChat().addMessage(MCVer.literal("Updated Tickrate to \u00A7b" + tickrateIn)); + } + updatePitch(); } /** @@ -160,6 +161,20 @@ public static void resetAdvanceServer() { updateServerTickrate(0); } } + + public static void updatePitch() { + AccessorSoundEngine soundEngine = (AccessorSoundEngine)Minecraft.getInstance().getSoundManager(); + + if(soundEngine == null) + return; + + SoundPitchDuck soundManager=(SoundPitchDuck)soundEngine.getSoundEngine(); + + if(soundManager == null) + return; + + soundManager.updatePitch(); + } //public static ResourceLocation streaming = new ResourceLocation("textures/gui/stream_indicator.png"); public static boolean show = false; diff --git a/LoTAS-Fabric/src/main/resources/fabric.mod.json b/LoTAS-Fabric/src/main/resources/fabric.mod.json index 3739d784..354a5a2a 100644 --- a/LoTAS-Fabric/src/main/resources/fabric.mod.json +++ b/LoTAS-Fabric/src/main/resources/fabric.mod.json @@ -1,7 +1,7 @@ { "schemaVersion": 1, "id": "lotas", - "version": "2.0.3", + "version": "2.0.4", "name": "LoTAS", "description": "Low Optimization Tool Assisted Speedrun Mod", diff --git a/LoTAS-Fabric/versions2/1.19.2/build.gradle b/LoTAS-Fabric/versions2/1.19.2/build.gradle new file mode 100644 index 00000000..521d0701 --- /dev/null +++ b/LoTAS-Fabric/versions2/1.19.2/build.gradle @@ -0,0 +1,19 @@ +plugins { + id 'fabric-loom' version '0.12-SNAPSHOT' +} + +sourceCompatibility = JavaVersion.VERSION_17 +targetCompatibility = JavaVersion.VERSION_17 + +apply from: '../common.gradle' +archivesBaseName = "LoTAS1.19.2" + +loom { + accessWidenerPath = file("../../src/main/resources/lotas.accesswidener") +} + +dependencies { + minecraft "com.mojang:minecraft:1.19.2" + mappings loom.officialMojangMappings() + modImplementation "net.fabricmc:fabric-loader:0.14.8" +} \ No newline at end of file diff --git a/LoTAS-Fabric/versions2/common.gradle b/LoTAS-Fabric/versions2/common.gradle index fcad051a..4a059683 100644 --- a/LoTAS-Fabric/versions2/common.gradle +++ b/LoTAS-Fabric/versions2/common.gradle @@ -1,7 +1,7 @@ sourceCompatibility = 1.8 targetCompatibility = 1.8 -version = "2.0.3" +version = "2.0.4" group = "de.pfannekuchen.lotas" archivesBaseName = "lotas" diff --git a/LoTAS-Fabric/versions2/fabric/build.gradle b/LoTAS-Fabric/versions2/fabric/build.gradle index cd8eb040..a5f3ab31 100644 --- a/LoTAS-Fabric/versions2/fabric/build.gradle +++ b/LoTAS-Fabric/versions2/fabric/build.gradle @@ -22,11 +22,13 @@ sourceSets { } dependencies { - //#if MC>=11802 -//$$ minecraft "com.mojang:minecraft:1.19" -//$$ mappings loom.officialMojangMappings() + //#if MC>=11902 +//$$ minecraft "com.mojang:minecraft:1.19.2" +//$$ modImplementation "net.fabricmc:fabric-loader:0.14.8" + //#else + //#if MC>=11900 +//$$ minecraft "com.mojang:minecraft:1.19" //#else - mappings minecraft.officialMojangMappings() //#if MC>=11802 //$$ minecraft "com.mojang:minecraft:1.18.2" //#else @@ -53,4 +55,11 @@ dependencies { //#endif //#endif //#endif + //#endif + + //#if MC>=11900 +//$$ mappings loom.officialMojangMappings() + //#else + mappings minecraft.officialMojangMappings() + //#endif } diff --git a/LoTAS-Forge/build.gradle b/LoTAS-Forge/build.gradle index 5731b94d..d2ebcaff 100644 --- a/LoTAS-Forge/build.gradle +++ b/LoTAS-Forge/build.gradle @@ -1,6 +1,6 @@ import groovy.json.JsonOutput -version = "2.0.3" +version = "2.0.4" group= "de.pfannekuchen.lotas" subprojects { diff --git a/LoTAS-Forge/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java b/LoTAS-Forge/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java index dc4de2a7..5eeb9061 100644 --- a/LoTAS-Forge/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java +++ b/LoTAS-Forge/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java @@ -14,6 +14,7 @@ import net.minecraft.client.gui.Gui; import net.minecraft.client.renderer.GlStateManager; import net.minecraft.entity.Entity; +import net.minecraft.entity.monster.EntityPigZombie; import net.minecraft.entity.monster.EntityZombie; import net.minecraft.item.ItemStack; import net.minecraft.util.ResourceLocation; @@ -55,7 +56,7 @@ public String getName() { @Override public List redirectDrops(Entity entity, int lootingValue) { List list = new ArrayList<>(); - if (entity instanceof EntityZombie) { + if (entity instanceof EntityZombie && !(entity instanceof EntityPigZombie)) { list.add(new ItemStack(MCVer.getItem("ROTTEN_FLESH"), 2 + lootingValue)); if (dropIron.isToggled()) list.add(new ItemStack(MCVer.getItem("IRON_INGOT"))); diff --git a/LoTAS-Forge/versions/common.gradle b/LoTAS-Forge/versions/common.gradle index 662a5b71..14720162 100644 --- a/LoTAS-Forge/versions/common.gradle +++ b/LoTAS-Forge/versions/common.gradle @@ -15,7 +15,7 @@ apply plugin: 'org.spongepowered.mixin' sourceCompatibility = 1.8 targetCompatibility = 1.8 -version = "2.0.3" +version = "2.0.4" group= "de.pfannekuchen.lotas" archivesBaseName = "LoTAS"