Skip to content

Commit

Permalink
Formatting fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
FoundationGames committed Jun 3, 2024
1 parent 686cdbe commit c0666ed
Show file tree
Hide file tree
Showing 12 changed files with 24 additions and 26 deletions.
1 change: 0 additions & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,3 @@ arrp_version=0.8.1
modmenu_version=9.2.0-beta.2

sodium_version=mc1.20.4-0.5.8
indium_version=1.0.30+mc1.20.4
Original file line number Diff line number Diff line change
Expand Up @@ -49,32 +49,32 @@ public static void load() {
ResourceUtil.resetBasePack();
ResourceUtil.resetTopLevelPack();

if(CONFIG.renderEnhancedChests) {
if (CONFIG.renderEnhancedChests) {
EBESetup.setupChests();
EBESetup.setupRRPChests();
}

if(CONFIG.renderEnhancedSigns) {
if (CONFIG.renderEnhancedSigns) {
EBESetup.setupSigns();
EBESetup.setupRRPSigns();
}

if(CONFIG.renderEnhancedBells) {
if (CONFIG.renderEnhancedBells) {
EBESetup.setupBells();
EBESetup.setupRRPBells();
}

if(CONFIG.renderEnhancedBeds) {
if (CONFIG.renderEnhancedBeds) {
EBESetup.setupBeds();
EBESetup.setupRRPBeds();
}

if(CONFIG.renderEnhancedShulkerBoxes) {
if (CONFIG.renderEnhancedShulkerBoxes) {
EBESetup.setupShulkerBoxes();
EBESetup.setupRRPShulkerBoxes();
}

if(CONFIG.renderEnhancedDecoratedPots) {
if (CONFIG.renderEnhancedDecoratedPots) {
EBESetup.setupDecoratedPots();
EBESetup.setupRRPDecoratedPots();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public void onInitializeModelLoader(ModelLoadingPlugin.Context ctx) {

@Override
public @Nullable UnbakedModel resolveModel(ModelResolver.Context ctx) {
if(ctx.id().equals(this.id)) return this.model.get();
if (ctx.id().equals(this.id)) return this.model.get();
return null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public abstract class ModelSelector {
public static final ModelSelector STATE_HOLDER_SELECTOR = new ModelSelector() {
@Override
public void writeModelIndices(BlockRenderView view, BlockState state, BlockPos pos, Supplier<Random> rand, @Nullable RenderContext ctx, int[] indices) {
if(view.getBlockEntity(pos) instanceof AppearanceStateHolder stateHolder) {
if (view.getBlockEntity(pos) instanceof AppearanceStateHolder stateHolder) {
indices[0] = stateHolder.getModelState();
return;
}
Expand All @@ -37,7 +37,7 @@ public int getParticleModelIndex() {

@Override
public void writeModelIndices(BlockRenderView view, BlockState state, BlockPos pos, Supplier<Random> rand, @Nullable RenderContext ctx, int[] indices) {
if(view.getBlockEntity(pos) instanceof AppearanceStateHolder stateHolder) {
if (view.getBlockEntity(pos) instanceof AppearanceStateHolder stateHolder) {
indices[0] = stateHolder.getModelState() + this.getParticleModelIndex();
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
@FunctionalInterface
public interface BlockEntityRenderCondition {
BlockEntityRenderCondition NON_ZERO_STATE = entity -> {
if(entity instanceof AppearanceStateHolder stateHolder) {
if (entity instanceof AppearanceStateHolder stateHolder) {
return stateHolder.getRenderState() > 0;
}
return false;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,14 @@ public void readFrom(Properties properties) {
this.renderEnhancedShulkerBoxes = ConvUtil.defaultedBool(properties.getProperty(RENDER_ENHANCED_SHULKER_BOXES_KEY), true);
this.renderEnhancedDecoratedPots = ConvUtil.defaultedBool(properties.getProperty(RENDER_ENHANCED_DECORATED_POTS_KEY), true);
String pCC = properties.getProperty(CHRISTMAS_CHESTS_KEY);
if(pCC != null && (pCC.equals("allowed") || pCC.equals("forced") || pCC.equals("disabled"))) {
if (pCC != null && (pCC.equals("allowed") || pCC.equals("forced") || pCC.equals("disabled"))) {
this.christmasChests = pCC;
} else {
EnhancedBlockEntities.LOG.warn("Configuration option 'christmas_chests' must be one of: 'allowed', 'forced', 'disabled'");
this.christmasChests = "allowed";
}
String sST = properties.getProperty(SIGN_TEXT_RENDERING_KEY);
if(sST != null && (sST.equals("smart") || sST.equals("all") || sST.equals("most") || sST.equals("some") || sST.equals("few"))) {
if (sST != null && (sST.equals("smart") || sST.equals("all") || sST.equals("most") || sST.equals("some") || sST.equals("few"))) {
this.signTextRendering = sST;
} else {
EnhancedBlockEntities.LOG.warn("Configuration option 'sign_text_rendering' must be one of: 'smart', 'all', 'most', 'some', 'few'");
Expand All @@ -106,7 +106,7 @@ public void save() {
Properties properties = new Properties();
writeTo(properties);
Path configPath = FabricLoader.getInstance().getConfigDir().resolve("enhanced_bes.properties");
if(!Files.exists(configPath)) {
if (!Files.exists(configPath)) {
try {
Files.createFile(configPath);
} catch (IOException e) {
Expand All @@ -126,7 +126,7 @@ public void save() {
public void load() {
Properties properties = new Properties();
Path configPath = FabricLoader.getInstance().getConfigDir().resolve("enhanced_bes.properties");
if(!Files.exists(configPath)) {
if (!Files.exists(configPath)) {
try {
Files.createFile(configPath);
save();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

public enum EBEEvents {;
public static final Event<Reload> RELOAD_MODELS = EventFactory.createArrayBacked(Reload.class, (callbacks) -> (loader, manager, profiler) -> {
for(Reload event : callbacks) {
for (Reload event : callbacks) {
event.onReload(loader, manager, profiler);
}
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public abstract class AbstractBlockStateMixin {
@Inject(method = "getRenderType", at = @At("HEAD"), cancellable = true)
public void enhanced_bes$overrideRenderType(CallbackInfoReturnable<BlockRenderType> cir) {
Block block = this.getBlock();
if(EnhancedBlockEntityRegistry.BLOCKS.contains(block)) {
if (EnhancedBlockEntityRegistry.BLOCKS.contains(block)) {
cir.setReturnValue(BlockRenderType.MODEL);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ public class BlockEntityRenderDispatcherMixin {
cancellable = true
)
private static void enhanced_bes$renderOverrides(BlockEntityRenderer<BlockEntity> renderer, BlockEntity blockEntity, float tickDelta, MatrixStack matrices, VertexConsumerProvider vertexConsumers, CallbackInfo ci) {
if(EnhancedBlockEntityRegistry.ENTITIES.containsKey(blockEntity.getType()) && EnhancedBlockEntityRegistry.BLOCKS.contains(blockEntity.getCachedState().getBlock())) {
if (EnhancedBlockEntityRegistry.ENTITIES.containsKey(blockEntity.getType()) && EnhancedBlockEntityRegistry.BLOCKS.contains(blockEntity.getCachedState().getBlock())) {
Pair<BlockEntityRenderCondition, BlockEntityRendererOverride> entry = EnhancedBlockEntityRegistry.ENTITIES.get(blockEntity.getType());
if(entry.getLeft().shouldRender(blockEntity)) {
if (entry.getLeft().shouldRender(blockEntity)) {
entry.getRight().render(renderer, blockEntity, tickDelta, matrices, vertexConsumers, WorldRenderer.getLightmapCoordinates(blockEntity.getWorld(), blockEntity.getPos()), OverlayTexture.DEFAULT_UV);
}
ci.cancel();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
public enum DateUtil {;
public static boolean isChristmas() {
String config = EnhancedBlockEntities.CONFIG.christmasChests;
if(config.equals("disabled")) return false;
if(config.equals("forced")) return true;
if (config.equals("disabled")) return false;
if (config.equals("forced")) return true;
Calendar calendar = Calendar.getInstance();
return (calendar.get(Calendar.MONTH) + 1 == 12 && calendar.get(Calendar.DATE) >= 24 && calendar.get(Calendar.DATE) <= 26);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public enum EBEUtil {;
public static void renderBakedModel(VertexConsumerProvider vertexConsumers, BlockState state, MatrixStack matrices, BakedModel model, int light, int overlay) {
VertexConsumer vertices = vertexConsumers.getBuffer(RenderLayers.getEntityBlockLayer(state, false));
for (int i = 0; i <= 6; i++) {
for(BakedQuad q : model.getQuads(null, ModelHelper.faceFromIndex(i), dummy)) {
for (BakedQuad q : model.getQuads(null, ModelHelper.faceFromIndex(i), dummy)) {
vertices.quad(matrices.peek(), q, 1, 1, 1, light, overlay);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,13 @@ public enum WorldUtil implements ClientTickEvents.EndWorldTick {
private static final Map<RegistryKey<World>, Long2ObjectMap<Runnable>> TIMED_TASKS = new HashMap<>();

public static void rebuildChunk(World world, BlockPos pos) {
var bState = world.getBlockState(pos);
MinecraftClient.getInstance().worldRenderer.updateBlock(world, pos, bState, bState, 8);
var state = world.getBlockState(pos);
MinecraftClient.getInstance().worldRenderer.updateBlock(world, pos, state, state, 8);
}

public static void rebuildChunkAndThen(World world, BlockPos pos, Runnable action) {
var state = world.getBlockState(pos);
CHUNK_UPDATE_TASKS.computeIfAbsent(ChunkSectionPos.from(pos), k -> new ExecutableRunnableHashSet()).add(action);
MinecraftClient.getInstance().worldRenderer.updateBlock(world, pos, state, state, 8);
rebuildChunk(world, pos);
}

public static void scheduleTimed(World world, long time, Runnable action) {
Expand Down

0 comments on commit c0666ed

Please sign in to comment.