Skip to content

Commit

Permalink
Made working Render
Browse files Browse the repository at this point in the history
  • Loading branch information
The2019 committed Nov 25, 2023
1 parent 1fd4173 commit 3292151
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package net.The2019.NewBase.features.render;

import net.fabricmc.fabric.api.client.rendering.v1.WorldRenderEvents;
import net.minecraft.block.entity.BeehiveBlockEntity;
import net.minecraft.block.entity.BlockEntity;
import net.minecraft.client.MinecraftClient;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Box;

import java.util.ArrayList;
import java.util.stream.Collectors;

import static net.The2019.NewBase.config.ModuleConfig.readModule;
import static net.The2019.NewBase.config.ModuleStates.beehiveRender;
import static net.The2019.NewBase.render.WorldRender.renderBlock;
import static net.The2019.NewBase.utils.ChunkStream.getBlockEntities;

public class BeeHiveHelper {

private static final MinecraftClient mc = MinecraftClient.getInstance();


public static void register() {
WorldRenderEvents.END.register(context -> {
if(readModule(beehiveRender)){
if (mc.player != null ){
for (BlockEntity blockEntity : getBlockEntities().collect(Collectors.toCollection(ArrayList::new))) {
if (blockEntity instanceof BeehiveBlockEntity) {
BlockPos blockEntityPos = blockEntity.getPos();
renderBlock(context, new Box(blockEntityPos));
}
}
}
}
});
}
}
20 changes: 20 additions & 0 deletions src/client/java/net/The2019/NewBase/mixin/BrightnessMixin.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
package net.The2019.NewBase.mixin;

import net.minecraft.client.render.LightmapTextureManager;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

import static net.The2019.NewBase.config.ModuleConfig.readModule;
import static net.The2019.NewBase.config.ModuleStates.fullBrightRender;

@Mixin(LightmapTextureManager.class)
abstract class BrightnessMixin{
@Inject(method = "getBrightness", at = @At("HEAD"), cancellable = true)
private static void onGetBrightness(CallbackInfoReturnable<Float> info) {
if(readModule(fullBrightRender)) {
info.setReturnValue(1f);
}
}
}
Binary file added src/client/resources/assets/newbase/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3292151

Please sign in to comment.