1.15 port

This commit is contained in:
yueh
2020-05-18 14:02:45 +02:00
parent 0ea86c939c
commit 16d6d55d7f
630 changed files with 4211 additions and 12664 deletions
@@ -48,27 +48,26 @@ import com.google.gson.JsonParseException;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.tuple.ImmutablePair;
import org.apache.commons.lang3.tuple.Pair;
import org.lwjgl.util.vector.Vector3f;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.BlockFaceUV;
import net.minecraft.client.renderer.block.model.BlockPart;
import net.minecraft.client.renderer.block.model.BlockPartFace;
import net.minecraft.client.renderer.block.model.BlockPartRotation;
import net.minecraft.client.renderer.block.model.FaceBakery;
import net.minecraft.client.renderer.block.model.IBakedModel;
import net.minecraft.client.renderer.block.model.ItemCameraTransforms;
import net.minecraft.client.renderer.block.model.ItemOverride;
import net.minecraft.client.renderer.block.model.ItemTransformVec3f;
import net.minecraft.client.renderer.block.model.ModelBakery;
import net.minecraft.client.renderer.Vector3f;
import net.minecraft.client.renderer.block.model.ModelBlock;
import net.minecraft.client.renderer.model.BakedQuad;
import net.minecraft.client.renderer.model.BlockFaceUV;
import net.minecraft.client.renderer.model.BlockPart;
import net.minecraft.client.renderer.model.BlockPartFace;
import net.minecraft.client.renderer.model.BlockPartRotation;
import net.minecraft.client.renderer.model.FaceBakery;
import net.minecraft.client.renderer.model.IBakedModel;
import net.minecraft.client.renderer.model.ItemCameraTransforms;
import net.minecraft.client.renderer.model.ItemOverride;
import net.minecraft.client.renderer.model.ItemTransformVec3f;
import net.minecraft.client.renderer.model.ModelBakery;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.renderer.vertex.VertexFormat;
import net.minecraft.client.resources.IResource;
import net.minecraft.client.resources.IResourceManager;
import net.minecraft.util.EnumFacing;
import net.minecraft.util.JsonUtils;
import net.minecraft.resources.IResource;
import net.minecraft.resources.IResourceManager;
import net.minecraft.util.Direction;
import net.minecraft.util.ResourceLocation;
import net.minecraftforge.client.model.ICustomModelLoader;
import net.minecraftforge.client.model.IModel;
@@ -191,7 +190,7 @@ public enum UVLModelLoader implements ICustomModelLoader
modelPath = modelPath.substring( "models/".length() );
}
try( InputStreamReader io = new InputStreamReader( Minecraft.getMinecraft()
try( InputStreamReader io = new InputStreamReader( Minecraft.getInstance()
.getResourceManager()
.getResource( new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) )
.getInputStream() ) )
@@ -246,7 +245,7 @@ public enum UVLModelLoader implements ICustomModelLoader
{
String s = modelLocation.getResourcePath();
iresource = Minecraft.getMinecraft()
iresource = Minecraft.getInstance()
.getResourceManager()
.getResource(
new ResourceLocation( modelLocation.getResourceDomain(), "models/" + modelPath + ".json" ) );
@@ -304,11 +303,11 @@ public enum UVLModelLoader implements ICustomModelLoader
public BlockPartFace deserialize( JsonElement p_deserialize_1_, Type p_deserialize_2_, JsonDeserializationContext p_deserialize_3_ ) throws JsonParseException
{
JsonObject jsonobject = p_deserialize_1_.getAsJsonObject();
EnumFacing enumfacing = this.parseCullFace( jsonobject );
Direction Direction = this.parseCullFace( jsonobject );
int i = this.parseTintIndex( jsonobject );
String s = this.parseTexture( jsonobject );
BlockFaceUV blockfaceuv = (BlockFaceUV) p_deserialize_3_.deserialize( jsonobject, BlockFaceUV.class );
BlockPartFace blockFace = new BlockPartFace( enumfacing, i, s, blockfaceuv );
BlockPartFace blockFace = new BlockPartFace( Direction, i, s, blockfaceuv );
UVLModelWrapper.this.uvlightmap.put( blockFace, this.parseUVL( jsonobject ) );
return blockFace;
}
@@ -324,10 +323,10 @@ public enum UVLModelLoader implements ICustomModelLoader
}
@Nullable
private EnumFacing parseCullFace( JsonObject object )
private Direction parseCullFace( JsonObject object )
{
String s = JsonUtils.getString( object, "cullface", "" );
return EnumFacing.byName( s );
return Direction.byName( s );
}
protected Pair<Float, Float> parseUVL( JsonObject object )
@@ -345,7 +344,7 @@ public enum UVLModelLoader implements ICustomModelLoader
{
@Override
public BakedQuad makeBakedQuad( Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, EnumFacing facing, ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade )
public BakedQuad makeBakedQuad( Vector3f posFrom, Vector3f posTo, BlockPartFace face, TextureAtlasSprite sprite, Direction facing, ITransformation modelRotationIn, BlockPartRotation partRotation, boolean uvLocked, boolean shade )
{
BakedQuad quad = super.makeBakedQuad( posFrom, posTo, face, sprite, facing, modelRotationIn, partRotation, uvLocked, shade );
@@ -354,7 +353,7 @@ public enum UVLModelLoader implements ICustomModelLoader
{
VertexFormat newFormat = VertexFormats.getFormatWithLightMap( quad.getFormat() );
UnpackedBakedQuad.Builder builder = new UnpackedBakedQuad.Builder( newFormat );
VertexLighterFlat trans = new VertexLighterFlat( Minecraft.getMinecraft().getBlockColors() )
VertexLighterFlat trans = new VertexLighterFlat( Minecraft.getInstance().getBlockColors() )
{
@Override