Skip to content

Commit 262780f

Browse files
committed
Changed whitespace and updated docs.
1 parent 3d63402 commit 262780f

File tree

122 files changed

+2876
-2880
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+2876
-2880
lines changed

src/main/java/net/darkhax/bookshelf/Bookshelf.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -69,23 +69,23 @@
6969

7070
@Mod(Bookshelf.MOD_ID)
7171
public final class Bookshelf {
72-
72+
7373
public static Bookshelf instance;
74-
74+
7575
// System Constants
7676
public static final Random RANDOM = new Random();
77-
77+
7878
public static final String NEW_LINE = System.getProperty("line.separator");
79-
79+
8080
// Mod Constants
8181
public static final String MOD_ID = "bookshelf";
82-
82+
8383
public static final String MOD_NAME = "Bookshelf";
84-
84+
8585
public static final Logger LOG = LogManager.getLogger(MOD_NAME);
86-
86+
8787
private final RegistryHelper registry = new RegistryHelper(MOD_ID, LOG);
88-
88+
8989
public final LootConditionType conditionIsMob;
9090
public final LootConditionType conditionCheckVillage;
9191
public final LootConditionType conditionCheckStructure;
@@ -99,17 +99,17 @@ public final class Bookshelf {
9999
public final LootConditionType conditionCheckEnchantability;
100100
public final LootConditionType conditionCheckBiomeTag;
101101
public final LootConditionType conditionCheckDimension;
102-
103-
public Bookshelf() {
104-
102+
103+
public Bookshelf () {
104+
105105
// Commands
106106
new BookshelfCommands(this.registry);
107-
107+
108108
// Command arguments
109109
this.registry.commands.registerCommandArgument("enum", ArgumentTypeHandOutput.class, new ArgumentTypeHandOutput.Serialzier());
110110
this.registry.commands.registerCommandArgument("mod", ArgumentTypeMod.class, new ArgumentSerializer<>( () -> ArgumentTypeMod.INSTACE));
111111
this.registry.commands.registerCommandArgument("loot", ArgumentTypeLootTable.class, new ArgumentSerializer<>( () -> ArgumentTypeLootTable.INSTACE));
112-
112+
113113
// Loot Modifier
114114
this.registry.lootModifiers.register(ModifierClear.SERIALIZER, "clear");
115115
this.registry.lootModifiers.register(ModifierSilkTouch.SERIALIZER, "silk_touch");
@@ -122,7 +122,7 @@ public Bookshelf() {
122122
this.registry.lootModifiers.register(ModifierRecipe.STONECUT, "stonecutting");
123123
this.registry.lootModifiers.register(ModifierRecipe.SMITHING, "smithing");
124124
this.registry.lootModifiers.register(ModifierAddItem.SERIALIZER, "add_item");
125-
125+
126126
// Loot Conditions
127127
this.conditionIsMob = this.registry.lootConditions.register(EntityIsMob.SERIALIZER, "is_mob");
128128
this.conditionCheckVillage = this.registry.lootConditions.register(CheckVillage.SERIALIZER, "check_village");
@@ -137,18 +137,18 @@ public Bookshelf() {
137137
this.conditionCheckEnchantability = this.registry.lootConditions.register(CheckEnchantability.SERIALIZER, "check_enchantability");
138138
this.conditionCheckBiomeTag = this.registry.lootConditions.register(CheckBiomeTag.SERIALIZER, "check_biome_tag");
139139
this.conditionCheckDimension = this.registry.lootConditions.register(CheckDimensionId.SERIALIZER, "check_dimension");
140-
140+
141141
// Item Predicates
142142
ItemPredicate.register(new ResourceLocation("bookshelf", "modid"), ItemPredicateModid::fromJson);
143143
ItemPredicate.register(new ResourceLocation("bookshelf", "ingredient"), ItemPredicateIngredient::fromJson);
144-
144+
145145
// Recipe Serializers
146146
this.registry.recipeSerializers.register(ShapedRecipeDamaging.SERIALIZER, "crafting_shaped_with_damage");
147147
this.registry.recipeSerializers.register(ShapelessRecipeDamage.SERIALIZER, "crafting_shapeless_with_damage");
148148
this.registry.recipeSerializers.register(SmithingRecipeFont.SERIALIZER, "smithing_font");
149149
this.registry.recipeSerializers.register(SmithingRecipeRepairCost.SERIALIZER, "smithing_repair_cost");
150150
this.registry.recipeSerializers.register(SmithingRecipeEnchantment.SERIALIZER, "smithing_enchant");
151-
151+
152152
// Ingredients
153153
this.registry.ingredients.register("potion", IngredientPotion.SERIALIZER);
154154
this.registry.ingredients.register("modid", IngredientModid.SERIALIZER);
@@ -158,7 +158,7 @@ public Bookshelf() {
158158
this.registry.ingredients.register("any_shovel", IngredientToolType.create(i -> i instanceof ShovelItem, ToolType.SHOVEL));
159159
this.registry.ingredients.register("any_sword", IngredientToolType.create(i -> i instanceof SwordItem, null));
160160
this.registry.ingredients.register("any_shear", IngredientToolType.create(i -> i instanceof ShearsItem, null));
161-
161+
162162
this.registry.ingredients.register("enchant_armor", IngredientEnchantmentType.create(EnchantmentType.ARMOR));
163163
this.registry.ingredients.register("enchant_armor_feet", IngredientEnchantmentType.create(EnchantmentType.ARMOR_FEET));
164164
this.registry.ingredients.register("enchant_armor_legs", IngredientEnchantmentType.create(EnchantmentType.ARMOR_LEGS));
@@ -173,14 +173,14 @@ public Bookshelf() {
173173
this.registry.ingredients.register("enchant_wearable", IngredientEnchantmentType.create(EnchantmentType.WEARABLE));
174174
this.registry.ingredients.register("enchant_crossbow", IngredientEnchantmentType.create(EnchantmentType.CROSSBOW));
175175
this.registry.ingredients.register("enchant_vanishable", IngredientEnchantmentType.create(EnchantmentType.VANISHABLE));
176-
176+
177177
// Block Ingredients
178178
BlockIngredient.register(BlockIngredientAny.SERIALIZER, BlockIngredientAny.ID);
179179
BlockIngredient.register(BlockIngredientCheckState.SERIALIZER, BlockIngredientCheckState.ID);
180180
BlockIngredient.register(BlockIngredientCheckBlock.SERIALIZER, BlockIngredientCheckBlock.ID);
181181
BlockIngredient.register(BlockIngredientCheckTag.SERIALIZER, BlockIngredientCheckTag.ID);
182182
BlockIngredient.register(BlockIngredientTestState.SERIALIZER, BlockIngredientTestState.ID);
183-
183+
184184
this.registry.initialize(FMLJavaModLoadingContext.get().getModEventBus());
185185
}
186186
}

src/main/java/net/darkhax/bookshelf/block/DisplayableBlockState.java

Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -22,119 +22,119 @@
2222
import net.minecraftforge.api.distmarker.OnlyIn;
2323

2424
public class DisplayableBlockState {
25-
25+
2626
public static ISerializer<DisplayableBlockState> SERIALIZER = new Serializer();
27-
27+
2828
private BlockState state;
2929
private Optional<Vector3f> scale;
3030
private Optional<Vector3f> offset;
3131
private boolean renderFluid;
32-
33-
public DisplayableBlockState(BlockState state) {
34-
32+
33+
public DisplayableBlockState (BlockState state) {
34+
3535
this(state, Optional.empty(), Optional.empty(), true);
3636
}
37-
38-
public DisplayableBlockState(BlockState state, Optional<Vector3f> scale, Optional<Vector3f> offset, boolean renderFluid) {
39-
37+
38+
public DisplayableBlockState (BlockState state, Optional<Vector3f> scale, Optional<Vector3f> offset, boolean renderFluid) {
39+
4040
this.state = state;
4141
this.scale = scale;
4242
this.offset = offset;
4343
this.renderFluid = renderFluid;
4444
}
45-
45+
4646
public BlockState getState () {
47-
47+
4848
return this.state;
4949
}
50-
50+
5151
public void setState (BlockState state) {
52-
52+
5353
this.state = state;
5454
}
55-
55+
5656
public Optional<Vector3f> getScale () {
57-
57+
5858
return this.scale;
5959
}
60-
60+
6161
public void setScale (Optional<Vector3f> scale) {
62-
62+
6363
this.scale = scale;
6464
}
65-
65+
6666
public Optional<Vector3f> getOffset () {
67-
67+
6868
return this.offset;
6969
}
70-
70+
7171
public void setOffset (Optional<Vector3f> offset) {
72-
72+
7373
this.offset = offset;
7474
}
75-
75+
7676
public boolean isRenderFluid () {
77-
77+
7878
return this.renderFluid;
7979
}
80-
80+
8181
public void setRenderFluid (boolean renderFluid) {
82-
82+
8383
this.renderFluid = renderFluid;
8484
}
85-
85+
8686
@OnlyIn(Dist.CLIENT)
8787
public void render (World world, BlockPos pos, MatrixStack matrix, IRenderTypeBuffer buffer, int light, int overlay, Direction... preferredSides) {
88-
88+
8989
matrix.pushPose();
9090
this.getScale().ifPresent(vec -> matrix.scale(vec.x(), vec.y(), vec.z()));
9191
this.getOffset().ifPresent(vec -> matrix.translate(vec.x(), vec.y(), vec.z()));
9292
RenderUtils.renderState(this.state, world, pos, matrix, buffer, light, overlay, this.renderFluid, preferredSides);
9393
matrix.popPose();
9494
}
95-
95+
9696
static class Serializer implements ISerializer<DisplayableBlockState> {
97-
97+
9898
@Override
9999
public DisplayableBlockState read (JsonElement json) {
100-
100+
101101
if (json.isJsonObject()) {
102-
102+
103103
final JsonObject obj = json.getAsJsonObject();
104104
final BlockState state = Serializers.BLOCK_STATE.read(obj);
105105
final Optional<Vector3f> scale = Serializers.VEC3F.readOptional(obj, "scale");
106106
final Optional<Vector3f> offset = Serializers.VEC3F.readOptional(obj, "offset");
107107
final boolean renderFluid = Serializers.BOOLEAN.read(obj, "renderFluid", true);
108108
return new DisplayableBlockState(state, scale, offset, renderFluid);
109109
}
110-
110+
111111
throw new JsonParseException("Expected properties to be an object. Recieved " + JSONUtils.getType(json));
112112
}
113-
113+
114114
@Override
115115
public JsonElement write (DisplayableBlockState toWrite) {
116-
116+
117117
final JsonElement json = Serializers.BLOCK_STATE.write(toWrite.getState());
118118
final JsonObject obj = (JsonObject) json;
119119
toWrite.getScale().ifPresent(v -> obj.add("scale", Serializers.VEC3F.writeOptional(toWrite.getScale())));
120120
toWrite.getOffset().ifPresent(v -> obj.add("offset", Serializers.VEC3F.writeOptional(toWrite.getOffset())));
121121
obj.addProperty("renderFluid", toWrite.isRenderFluid());
122122
return obj;
123123
}
124-
124+
125125
@Override
126126
public DisplayableBlockState read (PacketBuffer buffer) {
127-
127+
128128
final BlockState state = Serializers.BLOCK_STATE.read(buffer);
129129
final Optional<Vector3f> scale = Serializers.VEC3F.readOptional(buffer);
130130
final Optional<Vector3f> offset = Serializers.VEC3F.readOptional(buffer);
131131
final boolean renderFluid = Serializers.BOOLEAN.read(buffer);
132132
return new DisplayableBlockState(state, scale, offset, renderFluid);
133133
}
134-
134+
135135
@Override
136136
public void write (PacketBuffer buffer, DisplayableBlockState toWrite) {
137-
137+
138138
Serializers.BLOCK_STATE.write(buffer, toWrite.getState());
139139
Serializers.VEC3F.writeOptional(buffer, toWrite.getScale());
140140
Serializers.VEC3F.writeOptional(buffer, toWrite.getOffset());

src/main/java/net/darkhax/bookshelf/block/IBookshelfBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@
55
import net.minecraft.item.Item;
66

77
public interface IBookshelfBlock {
8-
8+
99
@Nullable
1010
default Item.Properties getItemBlockProperties () {
11-
11+
1212
return new Item.Properties();
1313
}
1414
}

0 commit comments

Comments
 (0)