Skip to content

Commit d6e3911

Browse files
authored
Release Patch 1.0.1 for LoTAS 1.8.9 to 1.12.2
2 parents d1c6920 + 42fecab commit d6e3911

File tree

47 files changed

+577
-463
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+577
-463
lines changed

Fabric-1.14.4/build.gradle

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,7 @@ dependencies {
2424
modImplementation "net.fabricmc:fabric-loader:0.11.1"
2525
implementation files ('libs/rLog.jar')
2626
implementation files ('libs/identifier_obfc.jar')
27-
compile group: 'net.bramp.ffmpeg', name: 'ffmpeg', version: '0.6.2'
28-
compile group: 'com.google.guava', name: 'guava', version: '22.0'
27+
implementation files ('libs/ffmpeg.jar')
2928
modImplementation "net.fabricmc.fabric-api:fabric-api:${project.fabric_version}"
3029
}
3130

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

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,6 @@
99
import java.net.URL;
1010
import java.time.Duration;
1111

12-
import javax.annotation.Nullable;
13-
1412
import org.lwjgl.glfw.GLFW;
1513
import org.spongepowered.asm.mixin.Mixin;
1614
import org.spongepowered.asm.mixin.Shadow;
@@ -227,7 +225,7 @@ public void keyPressedEvent(CallbackInfo ci) {
227225
}
228226
}
229227

230-
@Shadow @Nullable
228+
@Shadow
231229
public Screen currentScreen;
232230

233231
@ModifyVariable(method = "openScreen", at = @At("HEAD"), index = 1, ordinal = 0)
7.06 KB
Loading

Fabric-1.14.4/src/main/resources/fabric.mod.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
"website": "mgnet.work"
1212
},
1313
"license": "MIT",
14-
"icon": "assets/lotas/icon.png",
14+
"icon": "assets/lotas/potion_small.png",
1515
"environment": "*",
1616
"accessWidener" : "lotas.accesswidener",
1717
"entrypoints": {

Forge-1.10.2/build.gradle

Lines changed: 5 additions & 5 deletions
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.0"
22+
version = "1.0.1"
2323
group = "de.pfannekuchen.lotas"
2424
archivesBaseName = "lotas"
2525

@@ -45,7 +45,7 @@ minecraft {
4545
}
4646

4747
dependencies {
48-
compile('org.spongepowered:mixin:0.7.10-SNAPSHOT') {
48+
implementation('org.spongepowered:mixin:0.7.10-SNAPSHOT') {
4949
exclude module: 'launchwrapper'
5050
exclude module: 'guava'
5151
exclude module: 'gson'
@@ -54,9 +54,9 @@ dependencies {
5454
}
5555
implementation files ('libs/rLog.jar')
5656
implementation files ('libs/identifier_obfc.jar')
57-
compile files ('libs/ffmpeg.jar')
58-
compile 'org.msgpack:msgpack-core:0.8.16'
59-
compile 'org.msgpack:jackson-dataformat-msgpack:0.8.16'
57+
implementation files ('libs/ffmpeg.jar')
58+
implementation 'org.msgpack:msgpack-core:0.8.16'
59+
implementation 'org.msgpack:jackson-dataformat-msgpack:0.8.16'
6060
}
6161
jar {
6262
manifest {

Forge-1.10.2/src/main/java/de/pfannekuchen/lotas/dupemod/DupeMod.java

Lines changed: 89 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -28,98 +28,114 @@ public class DupeMod {
2828
*/
2929

3030
public static void loadChests() {
31-
logDebug("[DupeMod] Trying to load Chests");
32-
Minecraft mc = Minecraft.getMinecraft();
33-
if (DupeMod.tileentities == null) return;
34-
for (TileEntity tileentity : DupeMod.tileentities) {
35-
mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).getTileEntity(tileentity.getPos()).deserializeNBT(((TileEntityChest) tileentity).serializeNBT());
36-
logDebug("[DupeMod] Loaded Chest at " + tileentity.getPos());
31+
try {
32+
logDebug("[DupeMod] Trying to load Chests");
33+
Minecraft mc = Minecraft.getMinecraft();
34+
if (DupeMod.tileentities == null) return;
35+
for (TileEntity tileentity : DupeMod.tileentities) {
36+
mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).getTileEntity(tileentity.getPos()).deserializeNBT(((TileEntityChest) tileentity).serializeNBT());
37+
logDebug("[DupeMod] Loaded Chest at " + tileentity.getPos());
38+
}
39+
logDebug("[DupeMod] Chests loaded");
40+
} catch (Exception e) {
41+
e.printStackTrace();
3742
}
38-
logDebug("[DupeMod] Chests loaded");
3943
}
4044

4145
public static void loadItems() {
42-
logDebug("[DupeMod] Trying to load Items");
43-
Minecraft mc = Minecraft.getMinecraft();
44-
45-
mc.thePlayer.motionX = 0;
46-
mc.thePlayer.motionY = 0;
47-
mc.thePlayer.motionZ = 0;
48-
49-
if (DupeMod.items != null) {
50-
if (!DupeMod.items.isEmpty()) {
51-
mc.displayGuiScreen((GuiScreen)null);
52-
mc.setIngameFocus();
53-
for (Entity entity : new ArrayList<Entity>(mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).loadedEntityList)) {
54-
if (entity instanceof EntityItem) mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).removeEntity(entity);
55-
}
56-
for (EntityItem item : DupeMod.items) {
57-
WorldServer w = mc.getIntegratedServer().getPlayerList().getPlayerList().get(0).getServerWorld();
58-
EntityItem itemDupe = new EntityItem(w, item.posX, item.posY, item.posZ, item.getEntityItem().copy());
59-
itemDupe.motionX = item.motionX;
60-
itemDupe.motionY = item.motionY;
61-
itemDupe.motionZ = item.motionZ;
62-
itemDupe.setPickupDelay(item.delayBeforeCanPickup);
63-
itemDupe.setAgeToCreativeDespawnTime();
64-
itemDupe.setOwner(mc.thePlayer.getName());
65-
itemDupe.setNoPickupDelay();
66-
itemDupe.rotationYaw = item.rotationYaw;
67-
itemDupe.rotationPitch = item.rotationPitch;
68-
w.spawnEntityInWorld(itemDupe);
69-
logDebug("[DupeMod] Loaded Item at " + item.getPosition());
46+
try {
47+
logDebug("[DupeMod] Trying to load Items");
48+
Minecraft mc = Minecraft.getMinecraft();
49+
50+
mc.thePlayer.motionX = 0;
51+
mc.thePlayer.motionY = 0;
52+
mc.thePlayer.motionZ = 0;
53+
54+
if (DupeMod.items != null) {
55+
if (!DupeMod.items.isEmpty()) {
56+
mc.displayGuiScreen((GuiScreen)null);
57+
mc.setIngameFocus();
58+
for (Entity entity : new ArrayList<Entity>(mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).loadedEntityList)) {
59+
if (entity instanceof EntityItem) mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).removeEntity(entity);
60+
}
61+
for (EntityItem item : DupeMod.items) {
62+
WorldServer w = mc.getIntegratedServer().getPlayerList().getPlayerList().get(0).getServerWorld();
63+
EntityItem itemDupe = new EntityItem(w, item.posX, item.posY, item.posZ, item.getEntityItem().copy());
64+
itemDupe.motionX = item.motionX;
65+
itemDupe.motionY = item.motionY;
66+
itemDupe.motionZ = item.motionZ;
67+
itemDupe.setPickupDelay(item.delayBeforeCanPickup);
68+
itemDupe.setAgeToCreativeDespawnTime();
69+
itemDupe.setOwner(mc.thePlayer.getName());
70+
itemDupe.setNoPickupDelay();
71+
itemDupe.rotationYaw = item.rotationYaw;
72+
itemDupe.rotationPitch = item.rotationPitch;
73+
w.spawnEntityInWorld(itemDupe);
74+
logDebug("[DupeMod] Loaded Item at " + item.getPosition());
75+
}
7076
}
7177
}
78+
logDebug("[DupeMod] Items loaded");
79+
} catch (Exception e) {
80+
e.printStackTrace();
7281
}
73-
logDebug("[DupeMod] Items loaded");
7482
}
7583

7684
public static void saveItems() {
77-
logDebug("[DupeMod] Trying to save Items");
78-
Minecraft mc = Minecraft.getMinecraft();
79-
double pX = mc.thePlayer.posX;
80-
double pY = mc.thePlayer.posY;
81-
double pZ = mc.thePlayer.posZ;
85+
try {
86+
logDebug("[DupeMod] Trying to save Items");
87+
Minecraft mc = Minecraft.getMinecraft();
88+
double pX = mc.thePlayer.posX;
89+
double pY = mc.thePlayer.posY;
90+
double pZ = mc.thePlayer.posZ;
8291

83-
mc.thePlayer.motionX = 0;
84-
mc.thePlayer.motionY = 0;
85-
mc.thePlayer.motionZ = 0;
86-
87-
DupeMod.items = new LinkedList<EntityItem>();
88-
for (EntityItem item : mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pX - 16, pY - 16, pZ - 16, pX + 16, pY + 16, pZ + 16))) {
89-
EntityItem itemDupe = new EntityItem(item.worldObj, item.posX, item.posY, item.posZ, item.getEntityItem().copy());
90-
itemDupe.motionX = item.motionX;
91-
itemDupe.setPickupDelay(item.delayBeforeCanPickup);
92-
itemDupe.motionY = item.motionY;
93-
itemDupe.motionZ = item.motionZ;
94-
itemDupe.rotationYaw = item.rotationYaw;
95-
itemDupe.rotationPitch = item.rotationPitch;
96-
DupeMod.items.add(itemDupe);
97-
logDebug("[DupeMod] Saved Item at " + item.getPosition());
92+
mc.thePlayer.motionX = 0;
93+
mc.thePlayer.motionY = 0;
94+
mc.thePlayer.motionZ = 0;
95+
96+
DupeMod.items = new LinkedList<EntityItem>();
97+
for (EntityItem item : mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).getEntitiesWithinAABB(EntityItem.class, new AxisAlignedBB(pX - 16, pY - 16, pZ - 16, pX + 16, pY + 16, pZ + 16))) {
98+
EntityItem itemDupe = new EntityItem(item.worldObj, item.posX, item.posY, item.posZ, item.getEntityItem().copy());
99+
itemDupe.motionX = item.motionX;
100+
itemDupe.setPickupDelay(item.delayBeforeCanPickup);
101+
itemDupe.motionY = item.motionY;
102+
itemDupe.motionZ = item.motionZ;
103+
itemDupe.rotationYaw = item.rotationYaw;
104+
itemDupe.rotationPitch = item.rotationPitch;
105+
DupeMod.items.add(itemDupe);
106+
logDebug("[DupeMod] Saved Item at " + item.getPosition());
107+
}
108+
logDebug("[DupeMod] Items saved");
109+
} catch (Exception e) {
110+
e.printStackTrace();
98111
}
99-
logDebug("[DupeMod] Items saved");
100112
}
101113

102114
public static void saveChests() {
103-
logDebug("[DupeMod] Trying to save Chests");
104-
Minecraft mc = Minecraft.getMinecraft();
105-
WorldServer world = mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension);
106-
BlockPos playerPos = mc.thePlayer.getPosition();
107-
108-
DupeMod.tileentities = new LinkedList<TileEntity>();
109-
for (int x =- 5; x <= 5; x++) {
110-
for (int y =- 5; y <= 5; y++) {
111-
for (int z =- 5; z <= 5; z++) {
112-
if (mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).getBlockState(playerPos.add(x, y, z)).getBlock() == Blocks.CHEST || world.getBlockState(playerPos.add(x, y, z)).getBlock() == Blocks.TRAPPED_CHEST) {
113-
TileEntityChest foundchest = (TileEntityChest) world.getTileEntity(playerPos.add(x,y,z));
114-
TileEntityChest newchest = new TileEntityChest(((TileEntityChest) world.getTileEntity(playerPos.add(x,y,z))).getChestType());
115-
newchest.deserializeNBT(foundchest.serializeNBT());
116-
tileentities.add(newchest);
117-
logDebug("[DupeMod] Saved Chest at " + foundchest.getPos());
115+
try {
116+
logDebug("[DupeMod] Trying to save Chests");
117+
Minecraft mc = Minecraft.getMinecraft();
118+
WorldServer world = mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension);
119+
BlockPos playerPos = mc.thePlayer.getPosition();
120+
121+
DupeMod.tileentities = new LinkedList<TileEntity>();
122+
for (int x =- 5; x <= 5; x++) {
123+
for (int y =- 5; y <= 5; y++) {
124+
for (int z =- 5; z <= 5; z++) {
125+
if (mc.getIntegratedServer().worldServerForDimension(mc.thePlayer.dimension).getBlockState(playerPos.add(x, y, z)).getBlock() == Blocks.CHEST || world.getBlockState(playerPos.add(x, y, z)).getBlock() == Blocks.TRAPPED_CHEST) {
126+
TileEntityChest foundchest = (TileEntityChest) world.getTileEntity(playerPos.add(x,y,z));
127+
TileEntityChest newchest = new TileEntityChest(((TileEntityChest) world.getTileEntity(playerPos.add(x,y,z))).getChestType());
128+
newchest.deserializeNBT(foundchest.serializeNBT());
129+
tileentities.add(newchest);
130+
logDebug("[DupeMod] Saved Chest at " + foundchest.getPos());
131+
}
118132
}
119133
}
120134
}
135+
logDebug("[DupeMod] Chests saved");
136+
} catch (Exception e) {
137+
e.printStackTrace();
121138
}
122-
logDebug("[DupeMod] Chests saved");
123139
}
124140

125141
}

Forge-1.10.2/src/main/java/de/pfannekuchen/lotas/gui/GuiEntitySpawner.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,9 @@ protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOEx
127127
e = entity.getEntity(mc.theIntegratedServer.worldServerForDimension(mc.thePlayer.dimension));
128128
e.setPositionAndRotation(spawnX, spawnY, spawnZ, 0, 0);
129129
if (e instanceof EntityMob) {
130-
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && ((EntityMob) e).getBlockPathWeight(new BlockPos(e.posX, e.getEntityBoundingBox().minY, e.posZ)) >= 0.0F && e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e) && isValidLightLevel(e);
130+
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && ((EntityMob) e).getBlockPathWeight(new BlockPos(e.posX, e.getEntityBoundingBox().minY, e.posZ)) >= 0.0F && e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e) && isValidLightLevel(e) && !e.worldObj.collidesWithAnyBlock(e.getEntityBoundingBox());
131131
} else {
132-
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e);
132+
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e) && !e.worldObj.collidesWithAnyBlock(e.getEntityBoundingBox());
133133
}
134134
}
135135

@@ -140,9 +140,9 @@ protected void mouseReleased(int mouseX, int mouseY, int state) {
140140
e.setPositionAndRotation(spawnX, spawnY, spawnZ, 0, 0);
141141

142142
if (e instanceof EntityMob) {
143-
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && ((EntityMob) e).getBlockPathWeight(new BlockPos(e.posX, e.getEntityBoundingBox().minY, e.posZ)) >= 0.0F && e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e) && isValidLightLevel(e);
143+
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getDifficulty() != EnumDifficulty.PEACEFUL && ((EntityMob) e).getBlockPathWeight(new BlockPos(e.posX, e.getEntityBoundingBox().minY, e.posZ)) >= 0.0F && e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e) && isValidLightLevel(e) && !e.worldObj.collidesWithAnyBlock(e.getEntityBoundingBox());
144144
} else {
145-
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e);
145+
this.buttonList.get(this.buttonList.size() - 2).enabled = e.worldObj.getBlockState((new BlockPos(e)).down()).canEntitySpawn(e) && !e.worldObj.collidesWithAnyBlock(e.getEntityBoundingBox());
146146
}
147147
}
148148

Forge-1.10.2/src/main/java/de/pfannekuchen/lotas/gui/parts/CustomEntitySlider.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import net.minecraft.entity.monster.EntityCreeper;
1414
import net.minecraft.entity.monster.EntityEnderman;
1515
import net.minecraft.entity.monster.EntityGhast;
16-
import net.minecraft.entity.monster.EntityIronGolem;
1716
import net.minecraft.entity.monster.EntityMagmaCube;
1817
import net.minecraft.entity.monster.EntitySkeleton;
1918
import net.minecraft.entity.monster.EntitySlime;
@@ -62,7 +61,7 @@ public EntityLiving getEntity(WorldServer world) {
6261
entity = new EntityGhast(world);
6362
break;
6463
case 6:
65-
entity = new EntityIronGolem(world);
64+
entity = new EntityGhast(world);
6665
break;
6766
case 7:
6867
entity = new EntityMagmaCube(world);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ public MixinEndPortal(World worldIn, GameProfile gameProfileIn) {
3030
super(worldIn, gameProfileIn);
3131
}
3232

33-
@Inject(at = @At(value = "INVOKE", shift = Shift.BEFORE, target = "Lnet/minecraft/server/management/PlayerList;changePlayerDimension(Lnet/minecraft/entity/player/EntityPlayerMP;I)V"), method = "changeDimension", cancellable = true, remap = false)
33+
@Inject(at = @At(value = "INVOKE", shift = Shift.BEFORE, target = "Lnet/minecraft/server/management/PlayerList;changePlayerDimension(Lnet/minecraft/entity/player/EntityPlayerMP;I)V", remap = false), method = "changeDimension", cancellable = true)
3434
public void injectHere(int dimensionIn, CallbackInfoReturnable<Entity> ci) {
3535
if (dimensionIn == 1 && ChallengeLoader.map != null) {
3636
setGameType(GameType.SPECTATOR);

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public int redirectRandom(Random rand, int chance) {
2121
return LeaveDropManipulation.dropSapling.isToggled() ? 0:rand.nextInt(chance);
2222
}
2323

24-
@Redirect(method = "getDrops", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockLeaves;dropApple(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;I)V"))
24+
@Redirect(remap = false, method = "getDrops", at = @At(value = "INVOKE", target = "Lnet/minecraft/block/BlockLeaves;dropApple(Lnet/minecraft/world/World;Lnet/minecraft/util/math/BlockPos;Lnet/minecraft/block/state/IBlockState;I)V"))
2525
public void redirectDropApple(BlockLeaves leaves, World world, BlockPos pos, IBlockState state, int chance) {
2626
this.dropApple((World)world, pos, state, !LeaveDropManipulation.dropApple.isToggled() ? chance : 1);
2727
}

0 commit comments

Comments
 (0)