Skip to content

Commit

Permalink
Updated Limlib + 1.19
Browse files Browse the repository at this point in the history
  • Loading branch information
LudoCrypt committed Jul 25, 2022
1 parent 982e69d commit de2ac37
Show file tree
Hide file tree
Showing 66 changed files with 385 additions and 1,062 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
plugins {
id 'fabric-loom' version '0.10-SNAPSHOT'
id 'fabric-loom' version '0.12-SNAPSHOT'
id 'maven-publish'
}

Expand Down
18 changes: 9 additions & 9 deletions gradle.properties
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
org.gradle.jvmargs=-Xmx10G

minecraft_version=1.18.2
yarn_mappings=1.18.2+build.3
loader_version=0.13.3
fabric_version=0.51.1+1.18.2
config_version=6.2.57
modmenu_version=3.2.1
satin_version=1.7.2
limlib_version=5.2.1
minecraft_version=1.19
yarn_mappings=1.19+build.4
loader_version=0.14.8
fabric_version=0.58.0+1.19
config_version=7.0.73
modmenu_version=4.0.4
satin_version=1.9.0
limlib_version=6.3.0

mod_version = 1.2.2
mod_version = 1.2.3
maven_group = net.ludocrypt
archives_base_name = the-corners
8 changes: 3 additions & 5 deletions src/main/java/net/ludocrypt/corners/TheCorners.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,13 @@
import org.apache.logging.log4j.Logger;

import net.fabricmc.api.ModInitializer;
import net.ludocrypt.corners.client.render.sky.StrongLiminalShader;
import net.ludocrypt.corners.config.CornerConfig;
import net.ludocrypt.corners.client.render.StrongLiminalShader;
import net.ludocrypt.corners.init.CornerBiomes;
import net.ludocrypt.corners.init.CornerBlocks;
import net.ludocrypt.corners.init.CornerEntities;
import net.ludocrypt.corners.init.CornerItems;
import net.ludocrypt.corners.init.CornerPaintings;
import net.ludocrypt.corners.init.CornerSoundEvents;
import net.ludocrypt.corners.init.CornerWorld;
import net.ludocrypt.corners.packet.ClientToServerPackets;
import net.ludocrypt.limlib.impl.LimlibRegistries;
import net.minecraft.util.Identifier;
Expand All @@ -23,11 +22,10 @@ public class TheCorners implements ModInitializer {

@Override
public void onInitialize() {
CornerConfig.init();
CornerPaintings.init();
CornerBlocks.init();
CornerItems.init();
CornerWorld.init();
CornerBiomes.init();
CornerEntities.init();
CornerSoundEvents.init();
ClientToServerPackets.manageClientToServerPackets();
Expand Down

This file was deleted.

This file was deleted.

13 changes: 0 additions & 13 deletions src/main/java/net/ludocrypt/corners/access/ItemRendererAccess.java

This file was deleted.

11 changes: 11 additions & 0 deletions src/main/java/net/ludocrypt/corners/block/RailingBlock.java
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,15 @@ public BlockState getStateForNeighborUpdate(BlockState state, Direction directio
return defaultState;
}

@Override
public boolean isSideInvisible(BlockState state, BlockState stateFrom, Direction direction) {
if (state.get(RailingBlock.LAYERS) > 0) {
if (stateFrom.getBlock() instanceof RailingBlock) {
return stateFrom.get(RailingBlock.LAYERS) >= state.get(RailingBlock.LAYERS);
}
}

return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,24 @@

import net.fabricmc.api.ClientModInitializer;
import net.fabricmc.fabric.api.blockrenderlayer.v1.BlockRenderLayerMap;
import net.fabricmc.fabric.impl.client.rendering.EntityRendererRegistryImpl;
import net.ludocrypt.corners.client.render.CornerShaders;
import net.ludocrypt.corners.init.CornerBlocks;
import net.ludocrypt.corners.init.CornerEntities;
import net.ludocrypt.corners.mixin.MinecraftClientAccessor;
import net.ludocrypt.corners.packet.ServerToClientPackets;
import net.minecraft.client.MinecraftClient;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.entity.PaintingEntityRenderer;

public class TheCornersClient implements ClientModInitializer {

@Override
public void onInitializeClient() {
ServerToClientPackets.manageServerToClientPackets();
BlockRenderLayerMap.INSTANCE.putBlocks(RenderLayer.getCutout(), CornerBlocks.SNOWY_GLASS_PANE, CornerBlocks.SNOWY_GLASS);
CornerShaders.init();
EntityRendererRegistryImpl.register(CornerEntities.DIMENSIONAL_PAINTING_ENTITY, PaintingEntityRenderer::new);
}

public static float getTickDelta() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package net.ludocrypt.corners.client.render;

import net.ludocrypt.corners.TheCorners;
import net.ludocrypt.limlib.api.render.LiminalCoreShader;
import net.ludocrypt.limlib.api.render.LiminalQuadRenderer;
import net.ludocrypt.limlib.impl.LimlibRendering;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.util.registry.Registry;

public class CornerShaders {

public static final LiminalCoreShader SKYBOX_SHADER = Registry.register(LimlibRendering.LIMINAL_CORE_SHADER, TheCorners.id("skybox"), new LiminalCoreShader(VertexFormats.POSITION));
public static final LiminalQuadRenderer SKYBOX_QUAD_RENDERER = Registry.register(LimlibRendering.LIMINAL_QUAD_RENDERER, TheCorners.id("skybox"), new SkyboxQuadRenderer());

public static void init() {

}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
package net.ludocrypt.corners.client.render;

import org.jetbrains.annotations.Nullable;

import com.mojang.blaze3d.systems.RenderSystem;

import net.ludocrypt.limlib.api.render.LiminalQuadRenderer;
import net.minecraft.block.BlockState;
import net.minecraft.client.render.BufferBuilder;
import net.minecraft.client.render.Camera;
import net.minecraft.client.render.VertexFormat;
import net.minecraft.client.render.VertexFormat.DrawMode;
import net.minecraft.client.render.VertexFormats;
import net.minecraft.client.render.model.BakedModel;
import net.minecraft.client.render.model.BakedQuad;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Direction;
import net.minecraft.util.math.Matrix4f;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;

public class SkyboxQuadRenderer extends LiminalQuadRenderer {

@Override
public void renderQuad(BakedQuad quad, BufferBuilder bufferBuilder, Matrix4f matrix, Camera camera, World world, MatrixStack matrices, BakedModel model, @Nullable BlockState state, @Nullable Direction dir, Random random) {
RenderSystem.setShader(CornerShaders.SKYBOX_SHADER::getShader);

for (int i = 0; i < 6; i++) {
RenderSystem.setShaderTexture(i, new Identifier(quad.getSprite().getId().getNamespace(), "textures/" + quad.getSprite().getId().getPath() + "_" + i + ".png"));
}

LiminalQuadRenderer.quad((vec3f) -> bufferBuilder.vertex(vec3f.getX(), vec3f.getY(), vec3f.getZ()).next(), matrix, quad);
}

@Override
public boolean renderBehind() {
return true;
}

@Override
public VertexFormat vertexFormat() {
return VertexFormats.POSITION;
}

@Override
public DrawMode drawMode() {
return DrawMode.QUADS;
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package net.ludocrypt.corners.client.render.sky;
package net.ludocrypt.corners.client.render;

import com.mojang.serialization.Codec;
import com.mojang.serialization.codecs.RecordCodecBuilder;
Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import net.minecraft.sound.SoundCategory;
import net.minecraft.sound.SoundEvent;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.random.Random;
import net.minecraft.world.World;

public class LoopingPositionedSoundInstance extends PositionedSoundInstance implements TickableSoundInstance {
Expand All @@ -16,15 +17,15 @@ public class LoopingPositionedSoundInstance extends PositionedSoundInstance impl
private final BlockPos pos;
private boolean isDone = false;

public LoopingPositionedSoundInstance(World world, BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch, double x, double y, double z) {
super(sound, category, volume, pitch, x, y, z);
public LoopingPositionedSoundInstance(World world, BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch, Random random, double x, double y, double z) {
super(sound, category, volume, pitch, random, x, y, z);
this.world = world;
this.pos = pos;
}

public static void play(World world, BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch, double x, double y, double z) {
public static void play(World world, BlockPos pos, SoundEvent sound, SoundCategory category, float volume, float pitch, Random random, double x, double y, double z) {
MinecraftClient client = MinecraftClient.getInstance();
LoopingPositionedSoundInstance soundInstance = new LoopingPositionedSoundInstance(world, pos, sound, category, volume, pitch, x, y, z);
LoopingPositionedSoundInstance soundInstance = new LoopingPositionedSoundInstance(world, pos, sound, category, volume, pitch, random, x, y, z);
soundInstance.repeat = true;
soundInstance.repeatDelay = 0;
client.getSoundManager().play(soundInstance);
Expand Down
Loading

0 comments on commit de2ac37

Please sign in to comment.