Skip to content

Commit 17cc3d2

Browse files
authored
Release Patch 1.0.3 for LoTAS 1.8.9 to 1.12.2
2 parents 871123a + c02aea1 commit 17cc3d2

File tree

27 files changed

+103
-128
lines changed

27 files changed

+103
-128
lines changed

Fabric-1.14.4/src/main/java/de/pfannekuchen/lotas/mixin/server/MixinDropBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ private static ItemEntity haxInit(World w, double x, double y, double z, ItemSta
4040
if (ConfigManager.getBoolean("tools", "manipulateVelocityTowards")) {
4141
double pX = MinecraftClient.getInstance().player.x - x;
4242
double pZ = MinecraftClient.getInstance().player.z - z;
43-
it.setVelocity(Math.round(pX) * 0.03f, it.getVelocity().y, Math.round(pZ) * 0.03f);
43+
it.setVelocity(Math.min(Math.max(Math.round(pX), 1), -1) * 0.03f, it.getVelocity().y, Math.max(Math.round(pZ), 1) * 0.03f);
4444
} else if (ConfigManager.getBoolean("tools", "manipulateVelocityAway")) {
4545
double pX = MinecraftClient.getInstance().player.x - x;
4646
double pZ = MinecraftClient.getInstance().player.z - z;
47-
it.setVelocity(Math.round(pX) * -0.03f, it.getVelocity().y, Math.round(pZ) * -0.03f);
47+
it.setVelocity(Math.min(Math.max(Math.round(pX), 1), -1) * -0.03f, it.getVelocity().y, Math.max(Math.round(pZ), 1) * -0.03f);
4848
}
4949
} catch (Exception e) {
5050
// Ignore this Error

Fabric-1.14.4/src/main/java/de/pfannekuchen/lotas/mixin/server/MixinDropEntity.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ private static ItemEntity haxInit(World w, double x, double y, double z, ItemSta
4141
if (ConfigManager.getBoolean("tools", "manipulateVelocityTowards")) {
4242
double pX = MinecraftClient.getInstance().player.x - x;
4343
double pZ = MinecraftClient.getInstance().player.z - z;
44-
it.setVelocity(Math.round(pX) * 0.03f, it.getVelocity().y, Math.round(pZ) * 0.03f);
44+
it.setVelocity(Math.min(Math.max(Math.round(pX), 1), -1) * 0.03f, it.getVelocity().y, Math.max(Math.round(pZ), 1) * 0.03f);
4545
} else if (ConfigManager.getBoolean("tools", "manipulateVelocityAway")) {
4646
double pX = MinecraftClient.getInstance().player.x - x;
4747
double pZ = MinecraftClient.getInstance().player.z - z;
48-
it.setVelocity(Math.round(pX) * -0.03f, it.getVelocity().y, Math.round(pZ) * -0.03f);
48+
it.setVelocity(Math.min(Math.max(Math.round(pX), 1), -1) * -0.03f, it.getVelocity().y, Math.max(Math.round(pZ), 1) * -0.03f);
4949
}
5050
} catch (Exception e) {
5151
// Ignore this Error

Forge-1.10.2/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
apply plugin: 'net.minecraftforge.gradle.forge'
2020
apply plugin: 'org.spongepowered.mixin'
2121

22-
version = "1.0.2"
22+
version = "1.0.3"
2323
group = "de.pfannekuchen.lotas"
2424
archivesBaseName = "lotas"
2525

Forge-1.10.2/src/main/java/de/pfannekuchen/lotas/mixin/MixinDropBlock.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ private static EntityItem haxInit(World w, double x, double y, double z, ItemSta
2121
if (ConfigManager.getBoolean("tools", "manipulateVelocityTowards")) {
2222
double pX = Minecraft.getMinecraft().thePlayer.posX - x;
2323
double pZ = Minecraft.getMinecraft().thePlayer.posZ - z;
24-
it.motionX = Math.round(pX) * 0.03f;
25-
it.motionZ = Math.round(pZ) * 0.03f;
24+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * 0.03f;
25+
it.motionZ = Math.max(Math.round(pZ), 1) * 0.03f;
2626
} else if (ConfigManager.getBoolean("tools", "manipulateVelocityAway")) {
2727
double pX = Minecraft.getMinecraft().thePlayer.posX - x;
2828
double pZ = Minecraft.getMinecraft().thePlayer.posZ - z;
29-
it.motionX = Math.round(pX) * -0.03f;
30-
it.motionZ = Math.round(pZ) * -0.03f;
29+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * -0.03f;
30+
it.motionZ = Math.max(Math.round(pZ), 1) * -0.03f;
3131
}
3232
} catch (Exception e) {
3333
// Ignore this Error

Forge-1.10.2/src/main/java/de/pfannekuchen/lotas/mixin/MixinDropItem.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public EntityItem haxInit(World w, double x, double y, double z, ItemStack stack
2929
if (ConfigManager.getBoolean("tools", "manipulateVelocityTowards")) {
3030
double pX = Minecraft.getMinecraft().thePlayer.posX - posX;
3131
double pZ = Minecraft.getMinecraft().thePlayer.posZ - posZ;
32-
it.motionX = Math.round(pX) * 0.03f;
33-
it.motionZ = Math.round(pZ) * 0.03f;
32+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * 0.03f;
33+
it.motionZ = Math.max(Math.round(pZ), 1) * 0.03f;
3434
} else if (ConfigManager.getBoolean("tools", "manipulateVelocityAway")) {
3535
double pX = Minecraft.getMinecraft().thePlayer.posX - posX;
3636
double pZ = Minecraft.getMinecraft().thePlayer.posZ - posZ;
37-
it.motionX = Math.round(pX) * -0.03f;
38-
it.motionZ = Math.round(pZ) * -0.03f;
37+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * -0.03f;
38+
it.motionZ = Math.max(Math.round(pZ), 1) * -0.03f;
3939
}
4040
} catch (Exception e) {
4141

Forge-1.10.2/src/main/java/de/pfannekuchen/lotas/mixin/MixinMinecraft.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import de.pfannekuchen.lotas.Binds;
1515
import de.pfannekuchen.lotas.challenges.ChallengeLoader;
1616
import de.pfannekuchen.lotas.config.ConfigManager;
17+
import de.pfannekuchen.lotas.dupemod.DupeMod;
1718
import de.pfannekuchen.lotas.gui.GuiChallengeEscape;
1819
import de.pfannekuchen.lotas.savestate.SavestateMod;
1920
import de.pfannekuchen.lotas.tickratechanger.TickrateChanger;
@@ -58,6 +59,13 @@ public class MixinMinecraft {
5859
@Shadow
5960
private boolean isGamePaused;
6061

62+
@Inject(at = @At("HEAD"), method = "stopIntegratedServer")
63+
private static void injectstopIntegratedServer(CallbackInfo ci) {
64+
DupeMod.items.clear();
65+
DupeMod.trackedObjects.clear();
66+
DupeMod.tileentities.clear();
67+
}
68+
6169
@Inject(method = "loadWorld", at = @At("HEAD"))
6270
public void injectloadWorld(WorldClient worldClientIn, CallbackInfo ci) {
6371
isLoadingWorld = ConfigManager.getBoolean("tools", "hitEscape") && worldClientIn != null;

Forge-1.11.2/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ plugins {
1919
apply plugin: 'net.minecraftforge.gradle.forge'
2020
apply plugin: 'org.spongepowered.mixin'
2121

22-
version = "1.0.2"
22+
version = "1.0.3"
2323
group = "de.pfannekuchen.lotas"
2424
archivesBaseName = "lotas"
2525

Forge-1.11.2/src/main/java/de/pfannekuchen/lotas/mixin/MixinDropBlock.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ private static EntityItem haxInit(World w, double x, double y, double z, ItemSta
2121
if (ConfigManager.getBoolean("tools", "manipulateVelocityTowards")) {
2222
double pX = Minecraft.getMinecraft().player.posX - x;
2323
double pZ = Minecraft.getMinecraft().player.posZ - z;
24-
it.motionX = Math.round(pX) * 0.03f;
25-
it.motionZ = Math.round(pZ) * 0.03f;
24+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * 0.03f;
25+
it.motionZ = Math.max(Math.round(pZ), 1) * 0.03f;
2626
} else if (ConfigManager.getBoolean("tools", "manipulateVelocityAway")) {
2727
double pX = Minecraft.getMinecraft().player.posX - x;
2828
double pZ = Minecraft.getMinecraft().player.posZ - z;
29-
it.motionX = Math.round(pX) * -0.03f;
30-
it.motionZ = Math.round(pZ) * -0.03f;
29+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * -0.03f;
30+
it.motionZ = Math.max(Math.round(pZ), 1) * -0.03f;
3131
}
3232
} catch (Exception e) {
3333
// Ignore this Error

Forge-1.11.2/src/main/java/de/pfannekuchen/lotas/mixin/MixinDropItem.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,13 @@ public EntityItem haxInit(World w, double x, double y, double z, ItemStack stack
2929
if (ConfigManager.getBoolean("tools", "manipulateVelocityTowards")) {
3030
double pX = Minecraft.getMinecraft().player.posX - posX;
3131
double pZ = Minecraft.getMinecraft().player.posZ - posZ;
32-
it.motionX = Math.round(pX) * 0.03f;
33-
it.motionZ = Math.round(pZ) * 0.03f;
32+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * 0.03f;
33+
it.motionZ = Math.max(Math.round(pZ), 1) * 0.03f;
3434
} else if (ConfigManager.getBoolean("tools", "manipulateVelocityAway")) {
3535
double pX = Minecraft.getMinecraft().player.posX - posX;
3636
double pZ = Minecraft.getMinecraft().player.posZ - posZ;
37-
it.motionX = Math.round(pX) * -0.03f;
38-
it.motionZ = Math.round(pZ) * -0.03f;
37+
it.motionX = Math.min(Math.max(Math.round(pX), 1), -1) * -0.03f;
38+
it.motionZ = Math.max(Math.round(pZ), 1) * -0.03f;
3939
}
4040
} catch (Exception e) {
4141

Forge-1.11.2/src/main/java/de/pfannekuchen/lotas/mixin/MixinMinecraft.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
import de.pfannekuchen.lotas.Binds;
1515
import de.pfannekuchen.lotas.challenges.ChallengeLoader;
1616
import de.pfannekuchen.lotas.config.ConfigManager;
17+
import de.pfannekuchen.lotas.dupemod.DupeMod;
1718
import de.pfannekuchen.lotas.gui.GuiChallengeEscape;
1819
import de.pfannekuchen.lotas.savestate.SavestateMod;
1920
import de.pfannekuchen.lotas.tickratechanger.TickrateChanger;
@@ -56,7 +57,14 @@ public class MixinMinecraft {
5657
public EntityPlayerSP player;
5758

5859
@Shadow
59-
private boolean isGamePaused;
60+
private boolean isGamePaused;
61+
62+
@Inject(at = @At("HEAD"), method = "stopIntegratedServer")
63+
private static void injectstopIntegratedServer(CallbackInfo ci) {
64+
DupeMod.items.clear();
65+
DupeMod.trackedObjects.clear();
66+
DupeMod.tileentities.clear();
67+
}
6068

6169
@Inject(method = "loadWorld", at = @At("HEAD"))
6270
public void injectloadWorld(WorldClient worldClientIn, CallbackInfo ci) {

0 commit comments

Comments
 (0)