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>
Before:
Before:<br>
<video controls src="https://i.imgur.com/BY0t3iG.mp4"/>
After:
<video controls src="https://i.imgur.com/4O7Fo8V.mp4" />
</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
**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**
A: Check the above answer

View File

@ -1,14 +1,24 @@
package xyz.pixelatedw.finalbeta;
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 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;
}
@ -20,8 +30,9 @@ public class WyHelper {
return val < min ? min : Math.min(val, max);
}
public static void cheatCommand(Player player) {
Random rand = new Random();
// public static void cheatCommand(Player player) {
// 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.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);
// player.level.spawnEntity(enemy);
player.level.setLevelTime(0);
player.level.getProperties().setRaining(false);
player.level.getProperties().setRainTime(0);
player.level.getProperties().setThundering(false);
player.level.getProperties().setThunderTime(0);
}
// player.level.setLevelTime(0);
// player.level.getProperties().setRaining(false);
// player.level.getProperties().setRainTime(0);
// player.level.getProperties().setThundering(false);
// 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.inventory.Inventory;
import xyz.pixelatedw.finalbeta.ModConfig;
import xyz.pixelatedw.finalbeta.WyHelper;
@Mixin(ClientPlayer.class)
public class ClientPlayerMixin {
@ -21,10 +20,10 @@ public class ClientPlayerMixin {
@Inject(method = "method_136", at = @At("TAIL"))
public void onKeyPressed(int key, boolean state, CallbackInfo ci) {
if (WyHelper.isDebug() && key == 25 && state) {
Player player = (Player) (Object) this;
WyHelper.cheatCommand(player);
}
// if (WyHelper.isDebug() && key == 25 && state) {
// Player player = (Player) (Object) this;
// WyHelper.cheatCommand(player);
// }
}
@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;
import org.lwjgl.opengl.GL11;
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;
import net.minecraft.client.colour.GrassColour;
import net.minecraft.client.render.Tessellator;
import net.minecraft.client.render.TileRenderer;
import net.minecraft.tile.Tile;
@ -16,6 +18,55 @@ public class TileRendererMixin {
@Shadow
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)
public void torchRenderer(Tile arg, double x, double y, double z, double w, double h, CallbackInfo ci) {
Tessellator tess = Tessellator.INSTANCE;

View File

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