merge: post merge fixes & porting

This commit is contained in:
IThundxr 2024-07-27 22:03:46 -04:00
parent 5e642245b7
commit 44c2f78458
No known key found for this signature in database
GPG Key ID: E291EC97BAF935E6
5 changed files with 8 additions and 6 deletions

View File

@ -42,7 +42,7 @@ import net.minecraft.world.phys.shapes.VoxelShape;
* The shadow will be cast on blocks at most {@code min(radius, 2 * strength)} blocks below the entity.</p> * The shadow will be cast on blocks at most {@code min(radius, 2 * strength)} blocks below the entity.</p>
*/ */
public final class ShadowComponent implements EntityComponent { public final class ShadowComponent implements EntityComponent {
private static final ResourceLocation SHADOW_TEXTURE = new ResourceLocation("textures/misc/shadow.png"); private static final ResourceLocation SHADOW_TEXTURE = ResourceLocation.withDefaultNamespace("textures/misc/shadow.png");
private static final Material SHADOW_MATERIAL = SimpleMaterial.builder() private static final Material SHADOW_MATERIAL = SimpleMaterial.builder()
.texture(SHADOW_TEXTURE) .texture(SHADOW_TEXTURE)
.mipmap(false) .mipmap(false)

View File

@ -32,7 +32,7 @@ import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3; import net.minecraft.world.phys.Vec3;
public class MinecartVisual<T extends AbstractMinecart> extends ComponentEntityVisual<T> implements SimpleTickableVisual, SimpleDynamicVisual { public class MinecartVisual<T extends AbstractMinecart> extends ComponentEntityVisual<T> implements SimpleTickableVisual, SimpleDynamicVisual {
private static final ResourceLocation TEXTURE = new ResourceLocation("textures/entity/minecart.png"); private static final ResourceLocation TEXTURE = ResourceLocation.withDefaultNamespace("textures/entity/minecart.png");
private static final Material MATERIAL = SimpleMaterial.builder() private static final Material MATERIAL = SimpleMaterial.builder()
.texture(TEXTURE) .texture(TEXTURE)
.mipmap(false) .mipmap(false)

View File

@ -6,6 +6,7 @@ import org.jetbrains.annotations.ApiStatus;
import net.minecraft.client.resources.model.BakedModel; import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation; import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.resources.ResourceLocation;
import net.neoforged.neoforge.client.event.ModelEvent; import net.neoforged.neoforge.client.event.ModelEvent;
@ApiStatus.Internal @ApiStatus.Internal
@ -15,7 +16,7 @@ public final class PartialModelEventHandler {
public static void onRegisterAdditional(ModelEvent.RegisterAdditional event) { public static void onRegisterAdditional(ModelEvent.RegisterAdditional event) {
for (ResourceLocation modelLocation : PartialModel.ALL.keySet()) { for (ResourceLocation modelLocation : PartialModel.ALL.keySet()) {
event.register(modelLocation); event.register(ModelResourceLocation.standalone(modelLocation));
} }
} }
@ -24,7 +25,7 @@ public final class PartialModelEventHandler {
Map<ModelResourceLocation, BakedModel> models = event.getModels(); Map<ModelResourceLocation, BakedModel> models = event.getModels();
for (PartialModel partial : PartialModel.ALL.values()) { for (PartialModel partial : PartialModel.ALL.values()) {
partial.bakedModel = models.get(partial.modelLocation()); partial.bakedModel = models.get(ModelResourceLocation.standalone(partial.modelLocation()));
} }
} }
} }

View File

@ -7,7 +7,7 @@ import net.neoforged.neoforge.common.NeoForge;
public class FlwImplXplatImpl implements FlwImplXplat { public class FlwImplXplatImpl implements FlwImplXplat {
@Override @Override
public void dispatchReloadLevelRendererEvent(ClientLevel level) { public void dispatchReloadLevelRendererEvent(ClientLevel level) {
MinecraftForge.EVENT_BUS.post(new ReloadLevelRendererEvent(level)); NeoForge.EVENT_BUS.post(new ReloadLevelRendererEvent(level));
} }
@Override @Override

View File

@ -19,6 +19,7 @@ import net.minecraft.client.renderer.block.BlockRenderDispatcher;
import net.minecraft.client.renderer.block.ModelBlockRenderer; import net.minecraft.client.renderer.block.ModelBlockRenderer;
import net.minecraft.client.resources.model.BakedModel; import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelManager; import net.minecraft.client.resources.model.ModelManager;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.core.BlockPos; import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceLocation; import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.level.BlockAndTintGetter; import net.minecraft.world.level.BlockAndTintGetter;
@ -30,7 +31,7 @@ public class FlwLibXplatImpl implements FlwLibXplat {
@Override @Override
@UnknownNullability @UnknownNullability
public BakedModel getBakedModel(ModelManager modelManager, ResourceLocation location) { public BakedModel getBakedModel(ModelManager modelManager, ResourceLocation location) {
return modelManager.getModel(location); return modelManager.getModel(ModelResourceLocation.standalone(location));
} }
@Override @Override