From f7eaf79bb061da34e8e2289ac39c62b8b2c8e3b6 Mon Sep 17 00:00:00 2001 From: PF94 <45898787+flickPF94@users.noreply.github.com> Date: Sun, 22 Nov 2020 18:36:04 -0500 Subject: [PATCH] ys --- src/com/mojang/minecraft/level/tile/Tile.java | 2 + .../minecraft/level/tile/WhiteCloth.java | 74 +++++++++++++++++++ 2 files changed, 76 insertions(+) create mode 100644 src/com/mojang/minecraft/level/tile/WhiteCloth.java diff --git a/src/com/mojang/minecraft/level/tile/Tile.java b/src/com/mojang/minecraft/level/tile/Tile.java index 40560ae..5edff8e 100644 --- a/src/com/mojang/minecraft/level/tile/Tile.java +++ b/src/com/mojang/minecraft/level/tile/Tile.java @@ -31,6 +31,7 @@ public class Tile public static final Tile calmWater; public static final Tile lava; public static final Tile calmLava; + public static final Tile WhiteCloth; public int tex; public final int id; protected float xx0; @@ -55,6 +56,7 @@ public class Tile calmWater = new CalmLiquidTile(9, 1); lava = new LiquidTile(10, 2); calmLava = new CalmLiquidTile(11, 2); + WhiteCloth = new WhiteCloth(12); } protected Tile(final int id) { diff --git a/src/com/mojang/minecraft/level/tile/WhiteCloth.java b/src/com/mojang/minecraft/level/tile/WhiteCloth.java new file mode 100644 index 0000000..7ccbc3b --- /dev/null +++ b/src/com/mojang/minecraft/level/tile/WhiteCloth.java @@ -0,0 +1,74 @@ +// +// Decompiled by Procyon v0.5.36 +// + +package com.mojang.minecraft.level.tile; + +import com.mojang.minecraft.phys.AABB; +import com.mojang.minecraft.renderer.Tesselator; +import java.util.Random; +import com.mojang.minecraft.level.Level; + +public class WhiteCloth extends Tile +{ + protected WhiteCloth(final int id) { + super(id); + this.tex = 15; + this.setTicking(true); + } + + @Override + public void tick(final Level level, final int x, final int y, final int z, final Random random) { + final int below = level.getTile(x, y - 1, z); + if (!level.isLit(x, y, z) || (below != Tile.dirt.id && below != Tile.grass.id)) { + level.setTile(x, y, z, 0); + } + } + + @Override + public void render(final Tesselator t, final Level level, final int layer, final int x, final int y, final int z) { + if (level.isLit(x, y, z) ^ layer != 1) { + return; + } + final int tex = this.getTexture(15); + final float u0 = tex % 16 / 16.0f; + final float u2 = u0 + 0.0624375f; + final float v0 = tex / 16 / 16.0f; + final float v2 = v0 + 0.0624375f; + final int rots = 2; + t.color(255, 255, 255); + for (int r = 0; r < rots; ++r) { + final float xa = (float)(Math.sin(r * 3.141592653589793 / rots + 0.7853981633974483) * 0.5); + final float za = (float)(Math.cos(r * 3.141592653589793 / rots + 0.7853981633974483) * 0.5); + final float x2 = x + 0.5f - xa; + final float x3 = x + 0.5f + xa; + final float y2 = y + 0.0f; + final float y3 = y + 1.0f; + final float z2 = z + 0.5f - za; + final float z3 = z + 0.5f + za; + t.vertexUV(x2, y3, z2, u2, v0); + t.vertexUV(x3, y3, z3, u0, v0); + t.vertexUV(x3, y2, z3, u0, v2); + t.vertexUV(x2, y2, z2, u2, v2); + t.vertexUV(x3, y3, z3, u2, v0); + t.vertexUV(x2, y3, z2, u0, v0); + t.vertexUV(x2, y2, z2, u0, v2); + t.vertexUV(x3, y2, z3, u2, v2); + } + } + + @Override + public AABB getAABB(final int x, final int y, final int z) { + return null; + } + + @Override + public boolean blocksLight() { + return false; + } + + @Override + public boolean isSolid() { + return false; + } +}