Skip to content

Commit 6bc3e19

Browse files
authored
Release Patch 2.0.4
game bricking fix and more bug fixes
2 parents e877dda + f118cfa commit 6bc3e19

File tree

17 files changed

+107
-27
lines changed

17 files changed

+107
-27
lines changed

LoTAS-Fabric/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import groovy.json.JsonOutput
22

3-
version = "2.0.3"
3+
version = "2.0.4"
44
group = "de.pfannekuchen.lotas"
55

66
apply from: 'versions2/preprocessor.gradle'

LoTAS-Fabric/settings.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,8 @@ def versions2 = [
1717
'1.16.5',
1818
'1.17.1',
1919
'1.18.2',
20-
'1.19.0'
20+
'1.19.0',
21+
'1.19.2'
2122
]
2223
versions2.collect {":versions2:$it"}.each {
2324
include it

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/blockdrops/LeafDropManipulation.java

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import net.minecraft.world.entity.Entity;
1515
import net.minecraft.world.item.ItemStack;
1616
import net.minecraft.world.item.Items;
17+
import net.minecraft.world.level.block.Block;
1718
import net.minecraft.world.level.block.Blocks;
1819
import net.minecraft.world.level.block.state.BlockState;
1920

@@ -45,28 +46,33 @@ public String getName() {
4546
@Override
4647
public List<ItemStack> redirectDrops(BlockState block) {
4748
List<ItemStack> list = new ArrayList<>();
48-
if (Blocks.OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) {
49+
Block blockToCheck=block.getBlock().defaultBlockState().getBlock();
50+
if (Blocks.OAK_LEAVES.equals(blockToCheck)) {
4951
if (dropSapling.isToggled())
5052
list.add(new ItemStack(Items.OAK_SAPLING));
51-
} else if (Blocks.BIRCH_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) {
53+
} else if (Blocks.BIRCH_LEAVES.equals(blockToCheck)) {
5254
if (dropSapling.isToggled())
5355
list.add(new ItemStack(Items.BIRCH_SAPLING));
54-
} else if (Blocks.SPRUCE_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) {
56+
} else if (Blocks.SPRUCE_LEAVES.equals(blockToCheck)) {
5557
if (dropSapling.isToggled())
5658
list.add(new ItemStack(Items.SPRUCE_SAPLING));
57-
} else if (Blocks.JUNGLE_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) {
59+
} else if (Blocks.JUNGLE_LEAVES.equals(blockToCheck)) {
5860
if (dropSapling.isToggled())
5961
list.add(new ItemStack(Items.JUNGLE_SAPLING));
60-
} else if (Blocks.DARK_OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) {
62+
} else if (Blocks.DARK_OAK_LEAVES.equals(blockToCheck)) {
6163
if (dropSapling.isToggled())
6264
list.add(new ItemStack(Items.DARK_OAK_SAPLING));
63-
} else if (Blocks.ACACIA_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())) {
65+
} else if (Blocks.ACACIA_LEAVES.equals(blockToCheck)) {
6466
if (dropSapling.isToggled())
6567
list.add(new ItemStack(Items.ACACIA_SAPLING));
68+
//#if MC>=11900
69+
//$$ } else if (Blocks.MANGROVE_LEAVES.equals(blockToCheck)) {
70+
//$$ // Mangrove leaves don't drop saplings
71+
//#endif
6672
} else {
6773
return ImmutableList.of();
6874
}
69-
if (dropApple.isToggled() && (Blocks.OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock()) || Blocks.DARK_OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())))
75+
if (dropApple.isToggled() && (Blocks.OAK_LEAVES.equals(blockToCheck) || Blocks.DARK_OAK_LEAVES.equals(block.getBlock().defaultBlockState().getBlock())))
7076
list.add(new ItemStack(Items.APPLE));
7177
if (dropStick.isToggled())
7278
list.add(new ItemStack(Items.STICK, 2));

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/entitydrops/ZombieDropManipulation.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,12 @@ public List<ItemStack> redirectDrops(BlockState block) {
5757
@Override
5858
public List<ItemStack> redirectDrops(Entity entity, int lootingBonus) {
5959
List<ItemStack> list = new ArrayList<>();
60-
if (entity instanceof Zombie || entity instanceof Husk || entity instanceof ZombieVillager) {
60+
if (entity instanceof Zombie &&
61+
//#if MC>=11600
62+
//$$ !(entity instanceof net.minecraft.world.entity.monster.ZombifiedPiglin)) {
63+
//#else
64+
!(entity instanceof net.minecraft.world.entity.monster.PigZombie)) {
65+
//#endif
6166
list.add(new ItemStack(Items.ROTTEN_FLESH, 2 +lootingBonus));
6267

6368
if (dropIron.isToggled())

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/dropmanipulation/drops/rest/BarteringDropManipulation.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,8 +92,8 @@ public List<ItemStack> redirectDrops(Entity entity, int lootingBonus) {
9292
//$$ case "spectral arrow": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.SPECTRAL_ARROW, 16));
9393
//$$ case "arrow": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.ARROW, 12));
9494
//$$ case "gravel": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.GRAVEL, 16));
95-
//$$ case "magma cream": return ImmutableList.of();
96-
//$$ case "glowstone dust": return ImmutableList.of();
95+
//$$ case "magma cream": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.MAGMA_CREAM, 6));
96+
//$$ case "glowstone dust": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.GLOWSTONE_DUST, 12));
9797
//$$ case "blackstone": return ImmutableList.of(new ItemStack(net.minecraft.world.item.Items.BLACKSTONE, 16));
9898
//$$ default: return ImmutableList.of();
9999
//$$ }

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/binds/MixinTickrateChangerAchievements.java

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,20 @@
1010
public class MixinTickrateChangerAchievements {
1111

1212
//#if MC>=11601
13-
//$$ @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)
13+
//$$ @ModifyVariable(
14+
//#if MC>=11901
15+
//$$ method = "Lnet/minecraft/client/gui/components/toasts/ToastComponent$ToastInstance;render(ILcom/mojang/blaze3d/vertex/PoseStack;)Z",
16+
//#else
17+
//$$ method = "Lnet/minecraft/client/gui/components/toasts/ToastComponent$ToastInstance;render(IILcom/mojang/blaze3d/vertex/PoseStack;)Z",
18+
//#endif
19+
//$$
20+
//$$ at = @At(value = "STORE"), ordinal = 0,
21+
//$$
22+
//#if MC>=11901
23+
//$$ index = 3)
24+
//#else
25+
//$$ index = 4)
26+
//#endif
1427
//$$ public long modifyAnimationTime(long animationTimer) {
1528
//$$ return TickrateChangerMod.getMilliseconds();
1629
//$$ }

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinGuiIngameMenu.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,9 @@
44
import java.time.Duration;
55

66
import org.lwjgl.glfw.GLFW;
7+
import org.spongepowered.asm.mixin.Final;
78
import org.spongepowered.asm.mixin.Mixin;
9+
import org.spongepowered.asm.mixin.Shadow;
810
import org.spongepowered.asm.mixin.injection.At;
911
import org.spongepowered.asm.mixin.injection.Inject;
1012
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
@@ -42,11 +44,15 @@ protected MixinGuiIngameMenu(Component title) {
4244

4345
public EditBox savestateName;
4446
public EditBox tickrateField;
47+
48+
@Shadow @Final
49+
private boolean showPauseMenu;
4550

4651
SmallCheckboxWidget fw = null; // do not pay attention
4752

4853
@Inject(at = @At("RETURN"), method = "init")
4954
public void addCustomButtons(CallbackInfo ci) {
55+
if(!showPauseMenu) return;
5056
// Move Buttons higher
5157
for (int i=0;i<MCVer.getButtonSize(this); i++) {
5258
Button guiButton=(Button)MCVer.getButton(this, i);
@@ -181,6 +187,7 @@ public Button getButton(int index) {
181187
@Inject(method = "render", at = @At("TAIL"))
182188
public void drawScreen(int mouseX, int mouseY, float partialTicks, CallbackInfo ci) {
183189
//#endif
190+
if(!showPauseMenu) return;
184191
if (Keyboard.isKeyDown(GLFW.GLFW_KEY_LEFT_SHIFT)) {
185192
MCVer.setMessage(getButton(8), "\u00A76Name Savestate");
186193
MCVer.setMessage(getButton(9), "\u00A76Choose State");

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinGuiMainMenu.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import de.pfannekuchen.lotas.core.MCVer;
1111
import de.pfannekuchen.lotas.core.utils.ConfigUtils;
1212
import de.pfannekuchen.lotas.gui.ConfigurationScreen;
13+
import de.pfannekuchen.lotas.mods.TickrateChangerMod;
1314
import net.minecraft.client.Minecraft;
1415
import net.minecraft.client.gui.screens.Screen;
1516
import net.minecraft.client.gui.screens.TitleScreen;
@@ -33,6 +34,9 @@ protected MixinGuiMainMenu(Component title) {
3334

3435
@Inject(method="init", at = @At("HEAD"))
3536
private void changeSplash(CallbackInfo ci) {
37+
if (ConfigUtils.getBoolean("tools", "saveTickrate")) {
38+
TickrateChangerMod.updatePitch();
39+
}
3640
splash="TaS iS cHeAtInG !!1";
3741
}
3842

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mixin/render/gui/MixinInGameHud.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ public abstract class MixinInGameHud {
2323
private Minecraft minecraft;
2424

2525
@Inject(method="renderExperienceBar", at=@At(value="HEAD"))
26-
//#if MC>=11600
26+
//#if MC>=11601
2727
//$$ public void mixinRenderExperienceBar(com.mojang.blaze3d.vertex.PoseStack poseStack, int i, CallbackInfo ci) {
2828
//#else
2929
public void mixinRenderExperienceBar(CallbackInfo ci) {

LoTAS-Fabric/src/main/java/de/pfannekuchen/lotas/mods/TickrateChangerMod.java

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,10 +98,11 @@ public static void updateClientTickrate(float tickrateIn) {
9898
((AccessorTimer) ((AccessorMinecraftClient) Minecraft.getInstance()).getTimer()).setTickTime(Float.MAX_VALUE);
9999
}
100100
tickrate = tickrateIn;
101-
if (!ConfigUtils.getBoolean("ui", "hideTickrateMessages") && Minecraft.getInstance().gui != null)
102-
Minecraft.getInstance().gui.getChat().addMessage(MCVer.literal("Updated Tickrate to \u00A7b" + tickrateIn));
103-
104-
((SoundPitchDuck)((AccessorSoundEngine)Minecraft.getInstance().getSoundManager()).getSoundEngine()).updatePitch();
101+
if (!ConfigUtils.getBoolean("ui", "hideTickrateMessages") && Minecraft.getInstance().gui != null) {
102+
Minecraft mc=Minecraft.getInstance();
103+
mc.gui.getChat().addMessage(MCVer.literal("Updated Tickrate to \u00A7b" + tickrateIn));
104+
}
105+
updatePitch();
105106
}
106107

107108
/**
@@ -160,6 +161,20 @@ public static void resetAdvanceServer() {
160161
updateServerTickrate(0);
161162
}
162163
}
164+
165+
public static void updatePitch() {
166+
AccessorSoundEngine soundEngine = (AccessorSoundEngine)Minecraft.getInstance().getSoundManager();
167+
168+
if(soundEngine == null)
169+
return;
170+
171+
SoundPitchDuck soundManager=(SoundPitchDuck)soundEngine.getSoundEngine();
172+
173+
if(soundManager == null)
174+
return;
175+
176+
soundManager.updatePitch();
177+
}
163178

164179
//public static ResourceLocation streaming = new ResourceLocation("textures/gui/stream_indicator.png");
165180
public static boolean show = false;

0 commit comments

Comments
 (0)