mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-19 19:59:42 +00:00
Revert fluid change to use Material, fixes server crash
This commit is contained in:
1 parent
1933d05e36
commit
dec91dec68
7 files changed
+61
-44
No files matched your search
@@ -46,6 +46,7 @@ import net.minecraft.resources.IResourceManager;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.world.World;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
import net.minecraftforge.registries.ForgeRegistries;
|
||||
import net.minecraftforge.resource.IResourceType;
|
||||
@@ -188,8 +189,7 @@ public final class ModelDynBucket implements IModelGeometry<ModelDynBucket>
|
||||
|
||||
TransformationMatrix transform = state.func_225615_b_();
|
||||
|
||||
Material fluidLocation = fluid != Fluids.EMPTY ? fluid.getAttributes().getStillMaterial() : null;
|
||||
TextureAtlasSprite fluidSprite = fluidLocation != null ? spriteGetter.apply(fluidLocation) : null;
|
||||
TextureAtlasSprite fluidSprite = fluid != Fluids.EMPTY ? spriteGetter.apply(ForgeHooksClient.getBlockMaterial(fluid.getAttributes().getStillTexture())) : null;
|
||||
|
||||
if (particleSprite == null) particleSprite = fluidSprite;
|
||||
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
package net.minecraftforge.client.model;
|
||||
|
||||
import java.util.function.Function;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumMap;
|
||||
import java.util.List;
|
||||
@@ -43,6 +44,7 @@ import net.minecraft.fluid.Fluids;
|
||||
import net.minecraft.util.Direction;
|
||||
import net.minecraft.util.ResourceLocation;
|
||||
import net.minecraft.util.math.MathHelper;
|
||||
import net.minecraftforge.client.ForgeHooksClient;
|
||||
import net.minecraftforge.client.model.data.IModelData;
|
||||
import net.minecraftforge.client.model.geometry.IModelGeometry;
|
||||
import net.minecraftforge.client.model.pipeline.IVertexConsumer;
|
||||
@@ -74,10 +76,7 @@ public final class ModelFluid implements IModelGeometry<ModelFluid>
|
||||
@Override
|
||||
public Collection<Material> getTextures(IModelConfiguration owner, Function<ResourceLocation, IUnbakedModel> modelGetter, Set<com.mojang.datafixers.util.Pair<String, String>> missingTextureErrors)
|
||||
{
|
||||
FluidAttributes attrs = fluid.getAttributes();
|
||||
return attrs.getOverlayMaterial() != null
|
||||
? ImmutableSet.of(attrs.getStillMaterial(), attrs.getFlowingMaterial(), attrs.getOverlayMaterial())
|
||||
: ImmutableSet.of(attrs.getStillMaterial(), attrs.getFlowingMaterial());
|
||||
return ForgeHooksClient.getFluidMaterials(fluid).collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -89,9 +88,9 @@ public final class ModelFluid implements IModelGeometry<ModelFluid>
|
||||
PerspectiveMapWrapper.getTransforms(sprite),
|
||||
modelLocation,
|
||||
attrs.getColor(),
|
||||
spriteGetter.apply(attrs.getStillMaterial()),
|
||||
spriteGetter.apply(attrs.getFlowingMaterial()),
|
||||
Optional.ofNullable(attrs.getOverlayMaterial()).map(spriteGetter),
|
||||
spriteGetter.apply(ForgeHooksClient.getBlockMaterial(attrs.getStillTexture())),
|
||||
spriteGetter.apply(ForgeHooksClient.getBlockMaterial(attrs.getFlowingTexture())),
|
||||
Optional.ofNullable(attrs.getOverlayTexture()).map(ForgeHooksClient::getBlockMaterial).map(spriteGetter),
|
||||
attrs.isLighterThanAir(),
|
||||
null
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user