Skip to content

Commit

Permalink
Release Patch 2.0.4
Browse files Browse the repository at this point in the history
 game bricking fix and more bug fixes
  • Loading branch information
PancakeTAS authored Aug 12, 2022
2 parents e877dda + f118cfa commit 6bc3e19
Show file tree
Hide file tree
Showing 17 changed files with 107 additions and 27 deletions.
2 changes: 1 addition & 1 deletion LoTAS-Fabric/build.gradle
Original file line number Diff line number Diff line change
@@ -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'
Expand Down
3 changes: 2 additions & 1 deletion LoTAS-Fabric/settings.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -45,28 +46,33 @@ public String getName() {
@Override
public List<ItemStack> redirectDrops(BlockState block) {
List<ItemStack> 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));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,12 @@ public List<ItemStack> redirectDrops(BlockState block) {
@Override
public List<ItemStack> redirectDrops(Entity entity, int lootingBonus) {
List<ItemStack> 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())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ public List<ItemStack> 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();
//$$ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
//$$ }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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<MCVer.getButtonSize(this); i++) {
Button guiButton=(Button)MCVer.getButton(this, i);
Expand Down Expand Up @@ -181,6 +187,7 @@ public Button getButton(int index) {
@Inject(method = "render", at = @At("TAIL"))
public void drawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
//#endif
if(!showPauseMenu) return;
if (Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) {
MCVer.setMessage(getButton(8), "\u00A76Name Savestate");
MCVer.setMessage(getButton(9), "\u00A76Choose State");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
import de.pfannekuchen.lotas.core.MCVer;
import de.pfannekuchen.lotas.core.utils.ConfigUtils;
import de.pfannekuchen.lotas.gui.ConfigurationScreen;
import de.pfannekuchen.lotas.mods.TickrateChangerMod;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.TitleScreen;
Expand All @@ -33,6 +34,9 @@ protected MixinGuiMainMenu(Component title) {

@Inject(method="init", at = @At("HEAD"))
private void changeSplash(CallbackInfo ci) {
if (ConfigUtils.getBoolean("tools", "saveTickrate")) {
TickrateChangerMod.updatePitch();
}
splash="TaS iS cHeAtInG !!1";
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public abstract class MixinInGameHud {
private Minecraft minecraft;

@Inject(method="renderExperienceBar", at=@At(value="HEAD"))
//#if MC>=11600
//#if MC>=11601
//$$ public void mixinRenderExperienceBar(com.mojang.blaze3d.vertex.PoseStack poseStack, int i, CallbackInfo ci) {
//#else
public void mixinRenderExperienceBar(CallbackInfo ci) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

/**
Expand Down Expand Up @@ -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;
Expand Down
2 changes: 1 addition & 1 deletion LoTAS-Fabric/src/main/resources/fabric.mod.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
19 changes: 19 additions & 0 deletions LoTAS-Fabric/versions2/1.19.2/build.gradle
Original file line number Diff line number Diff line change
@@ -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"
}
2 changes: 1 addition & 1 deletion LoTAS-Fabric/versions2/common.gradle
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sourceCompatibility = 1.8
targetCompatibility = 1.8

version = "2.0.3"
version = "2.0.4"
group = "de.pfannekuchen.lotas"
archivesBaseName = "lotas"

Expand Down
17 changes: 13 additions & 4 deletions LoTAS-Fabric/versions2/fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -53,4 +55,11 @@ dependencies {
//#endif
//#endif
//#endif
//#endif

//#if MC>=11900
//$$ mappings loom.officialMojangMappings()
//#else
mappings minecraft.officialMojangMappings()
//#endif
}
2 changes: 1 addition & 1 deletion LoTAS-Forge/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import groovy.json.JsonOutput

version = "2.0.3"
version = "2.0.4"
group= "de.pfannekuchen.lotas"

subprojects {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -55,7 +56,7 @@ public String getName() {
@Override
public List<ItemStack> redirectDrops(Entity entity, int lootingValue) {
List<ItemStack> 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")));
Expand Down
2 changes: 1 addition & 1 deletion LoTAS-Forge/versions/common.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down

0 comments on commit 6bc3e19

Please sign in to comment.