-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
57 additions
and
0 deletions.
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
src/client/java/net/The2019/NewBase/features/render/BeeHiveHelper.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,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
20
src/client/java/net/The2019/NewBase/mixin/BrightnessMixin.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,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); | ||
} | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.