Skip to content

Commit f7a69b0

Browse files
authored
Inconsistent trailing newlines in codeblocks (FabricMC#528)
* removed trailing newlines to fix codeblocks * some more fixes * fixed some odd syntax that showed section comments, not a very elegant solution though. Assuming `timeSinceDropped` was not supposed to be shown * More fixes * Fixed `// :::foo-bar` comments appearing in vitepress codeblocks. Used a workaround since file refrencing didn't seem possible. Someone should improve this. * Revert; changes already in another pr This reverts commit 8f7b73f. * fixed `package-lock.json` * fixed whitespace * One more whitespace fix * Final fixes plus an indentation error * removed whitespace
1 parent 00c07d7 commit f7a69b0

26 files changed

+31
-74
lines changed

develop/loom/tasks.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ tasks.register("enigma", net.fabricmc.loom.task.tool.ModEnigmaTask) {
6363
The `net.fabricmc.loom.task.ValidateMixinNameTask` is a task that can be used to validate that the Mixin class name matches the name of the target class.
6464

6565
```groovy
66-
tasks.register('validateMixinNames', net.fabricmc.loom.task.ValidateMixinNameTask) {
67-
source(sourceSets.main.output)
68-
}
66+
tasks.register('validateMixinNames', net.fabricmc.loom.task.ValidateMixinNameTask) {
67+
source(sourceSets.main.output)
68+
}
6969
70-
check.dependsOn "validateMixinNames"
70+
check.dependsOn "validateMixinNames"
7171
```

reference/latest/src/client/java/com/example/docs/datagen/ExampleModDataGenerator.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ public void onInitializeDataGenerator(FabricDataGenerator fabricDataGenerator) {
6363

6464
// :::datagen-setup:generator
6565
}
66-
6766
// :::datagen-setup:generator
67+
6868
// :::datagen-enchantments:bootstrap
6969
@Override
7070
public void buildRegistry(RegistrySetBuilder registryBuilder) {

reference/latest/src/client/java/com/example/docs/datagen/ExampleModEnchantmentTagProvider.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,5 @@ protected void addTags(HolderLookup.Provider wrapperLookup) {
3030
// :::curse-tag
3131
// :::provider
3232
}
33-
// :::provider
3433
}
3534
// :::provider

reference/latest/src/client/java/com/example/docs/datagen/ExampleModModelProvider.java

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,6 @@ public static void registerScaled2x(Item item, ItemModelGenerators generator) {
180180
Identifier itemModel = SCALED2X.create(item, TextureMapping.singleSlot(TextureSlot.LAYER0, ModelLocationUtils.getModelLocation(item)), generator.modelOutput);
181181
generator.itemModelOutput.accept(item, ItemModelUtils.plainModel(itemModel));
182182
}
183-
184183
//:::custom-item-datagen-method
185184

186185
@SuppressWarnings("SameParameterValue")
@@ -189,7 +188,6 @@ public static void registerScaled2x(Item item, ItemModelGenerators generator) {
189188
private static ModelTemplate item(String parent, TextureSlot requiredTextureKeys) {
190189
return new ModelTemplate(Optional.of(Identifier.fromNamespaceAndPath(ExampleMod.MOD_ID, "item/" + parent)), Optional.empty(), requiredTextureKeys);
191190
}
192-
193191
//:::custom-item-model:::
194192
}
195193
// :::custom-item-model-generator:::
@@ -209,7 +207,6 @@ private static ModelTemplate block(String parent, TextureSlot... requiredTexture
209207
private static ModelTemplate block(String parent, String variant, TextureSlot... requiredTextureKeys) {
210208
return new ModelTemplate(Optional.of(Identifier.fromNamespaceAndPath(ExampleMod.MOD_ID, "block/" + parent)), Optional.of(variant), requiredTextureKeys);
211209
}
212-
213210
// :::custom-model
214211

215212
// :::custom-texture-map
@@ -219,7 +216,6 @@ public static TextureMapping blockAndTopForEnds(Block block) {
219216
.put(TextureSlot.BOTTOM, ModelLocationUtils.getModelLocation(block, "_top"))
220217
.put(TextureSlot.SIDE, ModelLocationUtils.getModelLocation(block));
221218
}
222-
223219
// :::custom-texture-map
224220

225221
// :::custom-supplier
@@ -238,7 +234,6 @@ private static BlockModelDefinitionGenerator createVerticalSlabBlockStates(Block
238234
.select(Direction.WEST, false, fullBlockModel.with(BlockModelGenerators.UV_LOCK))
239235
);
240236
}
241-
242237
// :::custom-supplier
243238

244239
// :::custom-gen
@@ -248,7 +243,6 @@ public static void registerVerticalSlab(BlockModelGenerators generator, Block ve
248243
generator.blockStateOutput.accept(createVerticalSlabBlockStates(vertSlabBlock, slabModel, fullBlockModel));
249244
generator.registerSimpleItemModel(vertSlabBlock, slabModel);
250245
}
251-
252246
// :::custom-gen
253247
}
254248
// :::custom-blockstate-model-generator

reference/latest/src/client/java/com/example/docs/network/ReceiveS2C.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ private static void handleS2CEngineSoundPacket(EngineSoundInstancePacket packet,
4040
soundManager.getPlayingSoundInstance(CustomSounds.ENGINE_LOOP).ifPresent(AbstractDynamicSoundInstance::end);
4141
}
4242
}
43-
4443
// :::1
4544

4645
public static void initialize() {

reference/latest/src/client/java/com/example/docs/rendering/HudRenderingEntrypoint.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,5 +38,4 @@ private static void render(GuiGraphics graphics, DeltaTracker tickCounter) {
3838
graphics.fill(0, 0, 10, 10, lerpedColor);
3939
}
4040
}
41-
4241
// :::1

reference/latest/src/client/java/com/example/docs/rendering/screens/CustomWidget.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,17 @@ protected void renderWidget(GuiGraphics graphics, int mouseX, int mouseY, float
1717
// x1, y1, x2, y2, startColor, endColor
1818
int startColor = 0xFF00FF00; // Green
1919
int endColor = 0xFF0000FF; // Blue
20-
2120
// :::1
21+
2222
// :::2
2323
// This is in the "renderWidget" method, so we can check if the mouse is hovering over the widget.
2424
if (isHovered()) {
2525
startColor = 0xFFFF0000; // Red
2626
endColor = 0xFF00FFFF; // Cyan
2727
}
28-
2928
// :::2
3029
// :::1
30+
3131
graphics.fillGradient(getX(), getY(), getX() + this.width, getY() + this.height, startColor, endColor);
3232
}
3333

reference/latest/src/client/java/com/example/docs/sound/AbstractDynamicSoundInstance.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ public boolean canStartSilent() {
6565
// or add your own condition to the SoundInstance, if necessary
6666
return true;
6767
}
68-
6968
// :::3
7069

7170
// :::4
@@ -104,7 +103,6 @@ public void tick() {
104103
// apply volume and pitch modulation here,
105104
// if you use a normal SoundInstance class
106105
}
107-
108106
// :::4
109107

110108
// :::5
@@ -123,7 +121,6 @@ protected void modulateSoundForTransition() {
123121
protected void modulateSoundForStress() {
124122
this.pitch = Mth.lerp(this.soundSource.getNormalizedStress(), this.minPitch, this.maxPitch);
125123
}
126-
127124
// :::5
128125

129126
// :::6
@@ -139,7 +136,6 @@ protected void setPositionToEntity() {
139136
public void end() {
140137
this.transitionState = TransitionState.ENDING;
141138
}
142-
143139
// :::6
144140
// :::1
145141
}

reference/latest/src/client/java/com/example/docs/sound/DynamicSoundManager.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@ public static DynamicSoundManager getInstance() {
3333

3434
return instance;
3535
}
36-
3736
// :::1
3837

3938
// :::2
@@ -63,7 +62,6 @@ public Optional<AbstractDynamicSoundInstance> getPlayingSoundInstance(SoundEvent
6362

6463
return Optional.empty();
6564
}
66-
6765
// :::2
6866

6967
// :::1

reference/latest/src/main/java/com/example/docs/advancement/UseToolCriterion.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ public class UseToolCriterion extends SimpleCriterionTrigger<UseToolCriterion.Co
1515
public void trigger(ServerPlayer player) {
1616
trigger(player, Conditions::requirementsMet);
1717
}
18-
1918
// :::datagen-advancements:criterion-trigger
2019
// :::datagen-advancements:criterion-base
2120

@@ -32,13 +31,12 @@ public record Conditions(Optional<ContextAwarePredicate> playerPredicate) implem
3231
public Optional<ContextAwarePredicate> player() {
3332
return playerPredicate;
3433
}
35-
3634
// :::datagen-advancements:criterion-base
35+
3736
// :::datagen-advancements:conditions-test
3837
public boolean requirementsMet() {
3938
return true; // AbstractCriterion#trigger helpfully checks the playerPredicate for us.
4039
}
41-
4240
// :::datagen-advancements:conditions-test
4341
// :::datagen-advancements:criterion-base
4442
}

0 commit comments

Comments
 (0)