-
Notifications
You must be signed in to change notification settings - Fork 292
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split lootr integration into client/server
- Loading branch information
Showing
6 changed files
with
52 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/main/java/org/violetmoon/quark/integration/lootr/client/ClientLootrIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package org.violetmoon.quark.integration.lootr.client; | ||
|
||
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers; | ||
import net.minecraft.world.level.block.Block; | ||
import org.violetmoon.quark.base.Quark; | ||
import org.violetmoon.quark.base.QuarkClient; | ||
import org.violetmoon.quark.integration.lootr.LootrIntegration; | ||
import org.violetmoon.zeta.client.SimpleWithoutLevelRenderer; | ||
import org.violetmoon.zeta.client.event.load.ZClientSetup; | ||
|
||
public class ClientLootrIntegration implements IClientLootrIntegration { | ||
|
||
private final LootrIntegration real = (LootrIntegration) Quark.LOOTR_INTEGRATION; | ||
|
||
@Override | ||
public void clientSetup(ZClientSetup event) { | ||
BlockEntityRenderers.register(real.chestTEType, ctx -> new LootrVariantChestRenderer<>(ctx, false)); | ||
BlockEntityRenderers.register(real.trappedChestTEType, ctx -> new LootrVariantChestRenderer<>(ctx, true)); | ||
|
||
for(Block b : real.lootrRegularChests) | ||
QuarkClient.ZETA_CLIENT.setBlockEntityWithoutLevelRenderer(b.asItem(), new SimpleWithoutLevelRenderer(real.chestTEType, b.defaultBlockState())); | ||
for(Block b : real.lootrTrappedChests) | ||
QuarkClient.ZETA_CLIENT.setBlockEntityWithoutLevelRenderer(b.asItem(), new SimpleWithoutLevelRenderer(real.trappedChestTEType, b.defaultBlockState())); | ||
} | ||
|
||
} |
13 changes: 13 additions & 0 deletions
13
src/main/java/org/violetmoon/quark/integration/lootr/client/IClientLootrIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
package org.violetmoon.quark.integration.lootr.client; | ||
|
||
import org.violetmoon.zeta.client.event.load.ZClientSetup; | ||
|
||
public interface IClientLootrIntegration { | ||
|
||
default void clientSetup(ZClientSetup event) { | ||
|
||
} | ||
|
||
class Dummy implements IClientLootrIntegration { } | ||
|
||
} |