Compare commits

..

3 Commits

6 changed files with 138 additions and 27 deletions

View File

@ -190,18 +190,41 @@ After:
<details><summary>Fixes furnaces consuming the buckets as well when using lava buckets</summary> <details><summary>Fixes furnaces consuming the buckets as well when using lava buckets</summary>
Before: Before:<br>
<video controls src="https://i.imgur.com/BY0t3iG.mp4"/> <video controls src="https://i.imgur.com/BY0t3iG.mp4"/>
After: After:
<video controls src="https://i.imgur.com/4O7Fo8V.mp4" /> <video controls src="https://i.imgur.com/4O7Fo8V.mp4" />
</details> </details>
<br>
As well as a bunch of other minor issues not worth having before/after images such as grass block items being rendered incorrectly or the useless 10mb array wasting resources.
## Install
### Vanilla Launcher
- Download the Vanilla Launcher installer of Cursed Legacy Fabric from [https://minecraft-cursed-legacy.github.io/downloads.html](https://minecraft-cursed-legacy.github.io/downloads.html)
- Run the installer and let it finish
- Download the latest version of the mod
- Navigate your .minecraft > b1.7.3 > mods folder and drop the mod .jar file there
- Start the launcher and make sure you pick the Cursed Fabric profile before starting the game
### MultiMC / Prism Launcher
- Download the MultiMC archive of Cursed Legacy Fabric from [https://minecraft-cursed-legacy.github.io/downloads.html](https://minecraft-cursed-legacy.github.io/downloads.html)
- Open your MultiMC / Prism Launcher
- Drag the .zip file into the launcher (you can also choose a different name for this profile now) and click Ok
- Download the latest version of the mod
- Navigate to the newly created instance's location (easier way to do this is from your launcher right click on the profile and select Folder)
- Go in the .minecraft > mods folder and drop the mod .jar file there
- Go back to your launcher and start the Cursed Fabric profile you've just installed
## Troubleshooting ## Troubleshooting
**Q: My achievements screen is all messed up** **Q: My achievements screen is all messed up**
A: Its very likely you have the Cursed Legacy API installed, you do not need it for this mod to work and it might cause more problems by itself A: Its very likely you have the Cursed Legacy API installed, you do not need it for this mod to work and it actually causes more problems when installed (at least at the time of writing this)
**Q: Torches have corrupted textures**
A: Check the above answer
**Q: Entities and items don't seem to burn** **Q: Entities and items don't seem to burn**
A: Check the above answer A: Check the above answer

View File

@ -1,14 +1,24 @@
package xyz.pixelatedw.finalbeta; package xyz.pixelatedw.finalbeta;
import java.lang.management.ManagementFactory; import java.lang.management.ManagementFactory;
import java.util.Random; import java.lang.reflect.Field;
import net.minecraft.entity.player.Player; import net.minecraft.client.Minecraft;
public class WyHelper { public class WyHelper {
public static boolean isDebug() public static Minecraft getInstance() {
{ try {
Field f = Minecraft.class.getDeclaredField("instance");
f.setAccessible(true);
return (Minecraft) f.get(null);
} catch (NoSuchFieldException | SecurityException | IllegalArgumentException | IllegalAccessException e) {
e.printStackTrace();
}
return null;
}
public static boolean isDebug() {
return ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0; return ManagementFactory.getRuntimeMXBean().getInputArguments().toString().indexOf("-agentlib:jdwp") > 0;
} }
@ -20,8 +30,9 @@ public class WyHelper {
return val < min ? min : Math.min(val, max); return val < min ? min : Math.min(val, max);
} }
public static void cheatCommand(Player player) { // public static void cheatCommand(Player player) {
Random rand = new Random(); // player.dropItem(new ItemInstance(Tile.SNOW));
// Random rand = new Random();
// player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F); // player.level.playSound(player, "random.break", 1, (rand.nextFloat() - rand.nextFloat()) * 0.2F + 1.0F);
// player.dropItem(new ItemInstance(ItemType.hatchetDiamond, 1), false); // player.dropItem(new ItemInstance(ItemType.hatchetDiamond, 1), false);
@ -43,10 +54,10 @@ public class WyHelper {
// enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f); // enemy.setPositionAndAngles(player.x + 2, player.y, player.z, 0.0f, 0.0f);
// player.level.spawnEntity(enemy); // player.level.spawnEntity(enemy);
player.level.setLevelTime(0); // player.level.setLevelTime(0);
player.level.getProperties().setRaining(false); // player.level.getProperties().setRaining(false);
player.level.getProperties().setRainTime(0); // player.level.getProperties().setRainTime(0);
player.level.getProperties().setThundering(false); // player.level.getProperties().setThundering(false);
player.level.getProperties().setThunderTime(0); // player.level.getProperties().setThunderTime(0);
} // }
} }

View File

@ -12,7 +12,6 @@ import net.minecraft.entity.player.ClientPlayer;
import net.minecraft.entity.player.Player; import net.minecraft.entity.player.Player;
import net.minecraft.inventory.Inventory; import net.minecraft.inventory.Inventory;
import xyz.pixelatedw.finalbeta.ModConfig; import xyz.pixelatedw.finalbeta.ModConfig;
import xyz.pixelatedw.finalbeta.WyHelper;
@Mixin(ClientPlayer.class) @Mixin(ClientPlayer.class)
public class ClientPlayerMixin { public class ClientPlayerMixin {
@ -21,10 +20,10 @@ public class ClientPlayerMixin {
@Inject(method = "method_136", at = @At("TAIL")) @Inject(method = "method_136", at = @At("TAIL"))
public void onKeyPressed(int key, boolean state, CallbackInfo ci) { public void onKeyPressed(int key, boolean state, CallbackInfo ci) {
if (WyHelper.isDebug() && key == 25 && state) { // if (WyHelper.isDebug() && key == 25 && state) {
Player player = (Player) (Object) this; // Player player = (Player) (Object) this;
WyHelper.cheatCommand(player); // WyHelper.cheatCommand(player);
} // }
} }
@Inject(method = "openChestScreen", at = @At("TAIL")) @Inject(method = "openChestScreen", at = @At("TAIL"))

View File

@ -0,0 +1,26 @@
package xyz.pixelatedw.finalbeta.mixin;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;
import net.minecraft.tile.Tile;
@Mixin(Tile.class)
public class TileMixin {
@Inject(method = "getTextureForSide(I)I", at = @At("HEAD"), cancellable = true)
public void getTextureForSide(int i, CallbackInfoReturnable<Integer> ci) {
Tile tile = (Tile) (Object) this;
if (tile.id == Tile.GRASS.id) {
if (i == 1) {
ci.setReturnValue(0);
} else if (i == 0) {
ci.setReturnValue(2);
} else {
ci.setReturnValue(tile.tex);
}
}
}
}

View File

@ -1,11 +1,13 @@
package xyz.pixelatedw.finalbeta.mixin; package xyz.pixelatedw.finalbeta.mixin;
import org.lwjgl.opengl.GL11;
import org.spongepowered.asm.mixin.Mixin; import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow; import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At; import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject; import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import net.minecraft.client.colour.GrassColour;
import net.minecraft.client.render.Tessellator; import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.TileRenderer; import net.minecraft.client.render.TileRenderer;
import net.minecraft.tile.Tile; import net.minecraft.tile.Tile;
@ -16,6 +18,55 @@ public class TileRendererMixin {
@Shadow @Shadow
private int field_83; private int field_83;
// Grass block texture using side textures for top fix
@Inject(method = "method_48", at = @At("HEAD"), cancellable = true)
public void grassBlockRenderer(Tile arg, int i, float f, CallbackInfo ci) {
// Normal Blocks are rendered using this the 0 type, we're using this
// just as a safenet in case the tile is not grass
int type = arg.method_1621();
if (arg.id == Tile.GRASS.id && type == 0) {
Tessellator tess = Tessellator.INSTANCE;
TileRenderer renderer = (TileRenderer) (Object) this;
arg.method_1605();
GL11.glTranslatef(-0.5F, -0.5F, -0.5F);
tess.start();
tess.method_1697(0.0F, -1.0F, 0.0F);
renderer.method_46(arg, 0.0D, 0.0D, 0.0D, arg.getTextureForSide(0, i));
tess.draw();
// This bit controls the top texture specifically
float r = (GrassColour.getColour(0.96, 0.44) >> 16 & 255) / 255.0F;
float g = (GrassColour.getColour(0.96, 0.44) >> 8 & 255) / 255.0F;
float b = (GrassColour.getColour(0.96, 0.44) & 255) / 255.0F;
tess.start();
tess.method_1697(0.0F, 1.0F, 0.0F);
tess.colour(r * f, g * f, b * f);
renderer.method_55(arg, 0.0D, 0.0D, 0.0D, arg.getTextureForSide(1, i));
tess.draw();
tess.start();
tess.method_1697(0.0F, 0.0F, -1.0F);
renderer.method_61(arg, 0.0D, 0.0D, 0.0D, arg.getTextureForSide(2, i));
tess.draw();
tess.start();
tess.method_1697(0.0F, 0.0F, 1.0F);
renderer.method_65(arg, 0.0D, 0.0D, 0.0D, arg.getTextureForSide(3, i));
tess.draw();
tess.start();
tess.method_1697(-1.0F, 0.0F, 0.0F);
renderer.method_67(arg, 0.0D, 0.0D, 0.0D, arg.getTextureForSide(4, i));
tess.draw();
tess.start();
tess.method_1697(1.0F, 0.0F, 0.0F);
renderer.method_69(arg, 0.0D, 0.0D, 0.0D, arg.getTextureForSide(5, i));
tess.draw();
GL11.glTranslatef(0.5F, 0.5F, 0.5F);
ci.cancel();
}
}
// Torch rendering with a bottom texture fix
@Inject(method = "method_45", at = @At("HEAD"), cancellable = true) @Inject(method = "method_45", at = @At("HEAD"), cancellable = true)
public void torchRenderer(Tile arg, double x, double y, double z, double w, double h, CallbackInfo ci) { public void torchRenderer(Tile arg, double x, double y, double z, double w, double h, CallbackInfo ci) {
Tessellator tess = Tessellator.INSTANCE; Tessellator tess = Tessellator.INSTANCE;
@ -42,38 +93,38 @@ public class TileRendererMixin {
double var34 = z + 0.5D; double var34 = z + 0.5D;
double var36 = 0.0625D; double var36 = 0.0625D;
double var38 = 0.625D; double var38 = 0.625D;
tess.vertex(x + w * (1.0D - var38) - var36, y + var38, z + h * (1.0D - var38) - var36, var20, var22); tess.vertex(x + w * (1.0D - var38) - var36, y + var38, z + h * (1.0D - var38) - var36, var20, var22);
tess.vertex(x + w * (1.0D - var38) - var36, y + var38, z + h * (1.0D - var38) + var36, var20, var26); tess.vertex(x + w * (1.0D - var38) - var36, y + var38, z + h * (1.0D - var38) + var36, var20, var26);
tess.vertex(x + w * (1.0D - var38) + var36, y + var38, z + h * (1.0D - var38) + var36, var24, var26); tess.vertex(x + w * (1.0D - var38) + var36, y + var38, z + h * (1.0D - var38) + var36, var24, var26);
tess.vertex(x + w * (1.0D - var38) + var36, y + var38, z + h * (1.0D - var38) - var36, var24, var22); tess.vertex(x + w * (1.0D - var38) + var36, y + var38, z + h * (1.0D - var38) - var36, var24, var22);
tess.vertex(x - var36, y + 1.0D, var32, u, v); tess.vertex(x - var36, y + 1.0D, var32, u, v);
tess.vertex(x - var36 + w, y + 0.0D, var32 + h, u, v2); tess.vertex(x - var36 + w, y + 0.0D, var32 + h, u, v2);
tess.vertex(x - var36 + w, y + 0.0D, var34 + h, u2, v2); tess.vertex(x - var36 + w, y + 0.0D, var34 + h, u2, v2);
tess.vertex(x - var36, y + 1.0D, var34, u2, v); tess.vertex(x - var36, y + 1.0D, var34, u2, v);
tess.vertex(x + var36, y + 1.0D, var34, u, v); tess.vertex(x + var36, y + 1.0D, var34, u, v);
tess.vertex(x + w + var36, y + 0.0D, var34 + h, u, v2); tess.vertex(x + w + var36, y + 0.0D, var34 + h, u, v2);
tess.vertex(x + w + var36, y + 0.0D, var32 + h, u2, v2); tess.vertex(x + w + var36, y + 0.0D, var32 + h, u2, v2);
tess.vertex(x + var36, y + 1.0D, var32, u2, v); tess.vertex(x + var36, y + 1.0D, var32, u2, v);
tess.vertex(var28, y + 1.0D, z + var36, u, v); tess.vertex(var28, y + 1.0D, z + var36, u, v);
tess.vertex(var28 + w, y + 0.0D, z + var36 + h, u, v2); tess.vertex(var28 + w, y + 0.0D, z + var36 + h, u, v2);
tess.vertex(var30 + w, y + 0.0D, z + var36 + h, u2, v2); tess.vertex(var30 + w, y + 0.0D, z + var36 + h, u2, v2);
tess.vertex(var30, y + 1.0D, z + var36, u2, v); tess.vertex(var30, y + 1.0D, z + var36, u2, v);
tess.vertex(var30, y + 1.0D, z - var36, u, v); tess.vertex(var30, y + 1.0D, z - var36, u, v);
tess.vertex(var30 + w, y + 0.0D, z - var36 + h, u, v2); tess.vertex(var30 + w, y + 0.0D, z - var36 + h, u, v2);
tess.vertex(var28 + w, y + 0.0D, z - var36 + h, u2, v2); tess.vertex(var28 + w, y + 0.0D, z - var36 + h, u2, v2);
tess.vertex(var28, y + 1.0D, z - var36, u2, v); tess.vertex(var28, y + 1.0D, z - var36, u2, v);
double u3 = u + 0.02734375D; double u3 = u + 0.02734375D;
double v3 = v + 0.0434375D; double v3 = v + 0.0434375D;
double u4 = u + 0.03515625D; double u4 = u + 0.03515625D;
double v4 = v + 0.05125D; double v4 = v + 0.05125D;
double w2 = 0.0625D; double w2 = 0.0625D;
tess.vertex(x + w * 1.0D - w2, y, z + h * 1.0D + w2, u3, v3); tess.vertex(x + w * 1.0D - w2, y, z + h * 1.0D + w2, u3, v3);
tess.vertex(x + w * 1.0D - w2, y, z + h * 1.0D - w2, u3, v4); tess.vertex(x + w * 1.0D - w2, y, z + h * 1.0D - w2, u3, v4);
tess.vertex(x + w * 1.0D + w2, y, z + h * 1.0D - w2, u4, v4); tess.vertex(x + w * 1.0D + w2, y, z + h * 1.0D - w2, u4, v4);

View File

@ -26,7 +26,8 @@
"LivingEntityMixin", "LivingEntityMixin",
"FurnaceEntityMixin", "FurnaceEntityMixin",
"WorldRendererMixin", "WorldRendererMixin",
"VideoSettingsScreenMixin" "VideoSettingsScreenMixin",
"TileMixin"
], ],
"injectors": { "injectors": {
"defaultRequire": 1 "defaultRequire": 1