Skip to content

Commit 0a58139

Browse files
committed
Fix code errors
1 parent 3378cae commit 0a58139

File tree

5 files changed

+117
-117
lines changed

5 files changed

+117
-117
lines changed

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ dependencies {
223223
// The group id is ignored when searching -- in this case, it is "blank"
224224
implementation fg.deobf("blank:copycats-${copycats_minecraft_version}:${copycats_version}")
225225
// implementation fg.deobf("maven.modrinth:create-garnished:${garnished_version}+${garnished_minecraft_version}")
226-
// implementation fg.deobf("maven.modrinth:create-dreams-and-desires:${dreams_desires_minecraft_version}-${dreams_desires_version}")
226+
// implementation fg.deobf("maven.modrinth:create-dreams-and-desires:${dreams_desires_version}")
227227

228228
// For more info:
229229
// http://www.gradle.org/docs/current/userguide/artifact_dependencies_tutorial.html

src/main/java/com/hlysine/create_connected/CCBlocks.java

+4-4
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public class CCBlocks {
117117

118118
public static final BlockEntry<CrankWheelBlock.Small> CRANK_WHEEL = REGISTRATE.block("crank_wheel", CrankWheelBlock.Small::new)
119119
.initialProperties(SharedProperties::wooden)
120-
.properties(p -> p.mapColor(MapColor.PODZOL))
120+
.properties(p -> p.color(MaterialColor.PODZOL))
121121
.transform(axeOrPickaxe())
122122
.blockstate(BlockStateGen.directionalBlockProvider(true))
123123
.transform(BlockStressDefaults.setCapacity(8.0))
@@ -131,7 +131,7 @@ public class CCBlocks {
131131

132132
public static final BlockEntry<CrankWheelBlock.Large> LARGE_CRANK_WHEEL = REGISTRATE.block("large_crank_wheel", CrankWheelBlock.Large::new)
133133
.initialProperties(SharedProperties::wooden)
134-
.properties(p -> p.mapColor(MapColor.PODZOL))
134+
.properties(p -> p.color(MaterialColor.PODZOL))
135135
.transform(axeOrPickaxe())
136136
.blockstate(BlockStateGen.directionalBlockProvider(true))
137137
.transform(BlockStressDefaults.setCapacity(8.0))
@@ -460,7 +460,7 @@ public class CCBlocks {
460460
public static final BlockEntry<WrenchableBlock> FAN_FREEZING_CATALYST = REGISTRATE.block("fan_freezing_catalyst", WrenchableBlock::new)
461461
.initialProperties(() -> Blocks.IRON_BLOCK)
462462
.properties(p -> p
463-
.mapColor(MapColor.TERRACOTTA_YELLOW)
463+
.color(MaterialColor.TERRACOTTA_YELLOW)
464464
.requiresCorrectToolForDrops()
465465
.noOcclusion()
466466
.isRedstoneConductor((state, level, pos) -> false)
@@ -506,7 +506,7 @@ public class CCBlocks {
506506
public static final BlockEntry<FluidVesselBlock> CREATIVE_FLUID_VESSEL =
507507
REGISTRATE.block("creative_fluid_vessel", FluidVesselBlock::creative)
508508
.initialProperties(SharedProperties::copperMetal)
509-
.properties(p -> p.noOcclusion().mapColor(MapColor.COLOR_PURPLE))
509+
.properties(p -> p.noOcclusion().color(MaterialColor.COLOR_PURPLE))
510510
.transform(pickaxeOnly())
511511
.transform(FeatureToggle.registerDependent(FLUID_VESSEL))
512512
.tag(AllTags.AllBlockTags.SAFE_NBT.tag)

src/main/java/com/hlysine/create_connected/content/fluidvessel/FluidVesselItem.java

+106-106
Original file line numberDiff line numberDiff line change
@@ -21,122 +21,122 @@
2121

2222
public class FluidVesselItem extends BlockItem {
2323

24-
public FluidVesselItem(Block p_i48527_1_, Properties p_i48527_2_) {
25-
super(p_i48527_1_, p_i48527_2_);
26-
}
24+
public FluidVesselItem(Block p_i48527_1_, Properties p_i48527_2_) {
25+
super(p_i48527_1_, p_i48527_2_);
26+
}
2727

28-
@Override
29-
public InteractionResult place(BlockPlaceContext ctx) {
30-
InteractionResult initialResult = super.place(ctx);
31-
if (!initialResult.consumesAction())
32-
return initialResult;
33-
tryMultiPlace(ctx);
34-
return initialResult;
35-
}
28+
@Override
29+
public InteractionResult place(BlockPlaceContext ctx) {
30+
InteractionResult initialResult = super.place(ctx);
31+
if (!initialResult.consumesAction())
32+
return initialResult;
33+
tryMultiPlace(ctx);
34+
return initialResult;
35+
}
3636

37-
@Override
38-
protected boolean updateCustomBlockEntityTag(BlockPos p_195943_1_, Level p_195943_2_, Player p_195943_3_,
39-
ItemStack p_195943_4_, BlockState p_195943_5_) {
40-
MinecraftServer minecraftserver = p_195943_2_.getServer();
41-
if (minecraftserver == null)
42-
return false;
43-
CompoundTag nbt = p_195943_4_.getTagElement("BlockEntityTag");
44-
if (nbt != null) {
45-
nbt.remove("Luminosity");
46-
nbt.remove("Size");
47-
nbt.remove("Height");
48-
nbt.remove("Controller");
49-
nbt.remove("LastKnownPos");
50-
if (nbt.contains("TankContent")) {
51-
FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt.getCompound("TankContent"));
52-
if (!fluid.isEmpty()) {
53-
fluid.setAmount(Math.min(FluidVesselBlockEntity.getCapacityMultiplier(), fluid.getAmount()));
54-
nbt.put("TankContent", fluid.writeToNBT(new CompoundTag()));
55-
}
56-
}
57-
}
58-
return super.updateCustomBlockEntityTag(p_195943_1_, p_195943_2_, p_195943_3_, p_195943_4_, p_195943_5_);
59-
}
37+
@Override
38+
protected boolean updateCustomBlockEntityTag(BlockPos p_195943_1_, Level p_195943_2_, Player p_195943_3_,
39+
ItemStack p_195943_4_, BlockState p_195943_5_) {
40+
MinecraftServer minecraftserver = p_195943_2_.getServer();
41+
if (minecraftserver == null)
42+
return false;
43+
CompoundTag nbt = p_195943_4_.getTagElement("BlockEntityTag");
44+
if (nbt != null) {
45+
nbt.remove("Luminosity");
46+
nbt.remove("Size");
47+
nbt.remove("Height");
48+
nbt.remove("Controller");
49+
nbt.remove("LastKnownPos");
50+
if (nbt.contains("TankContent")) {
51+
FluidStack fluid = FluidStack.loadFluidStackFromNBT(nbt.getCompound("TankContent"));
52+
if (!fluid.isEmpty()) {
53+
fluid.setAmount(Math.min(FluidVesselBlockEntity.getCapacityMultiplier(), fluid.getAmount()));
54+
nbt.put("TankContent", fluid.writeToNBT(new CompoundTag()));
55+
}
56+
}
57+
}
58+
return super.updateCustomBlockEntityTag(p_195943_1_, p_195943_2_, p_195943_3_, p_195943_4_, p_195943_5_);
59+
}
6060

61-
private void tryMultiPlace(BlockPlaceContext ctx) {
62-
Player player = ctx.getPlayer();
63-
if (player == null)
64-
return;
65-
if (player.isShiftKeyDown())
66-
return;
67-
Direction face = ctx.getClickedFace();
68-
if (!face.getAxis()
69-
.isHorizontal())
70-
return;
71-
ItemStack stack = ctx.getItemInHand();
72-
Level world = ctx.getLevel();
73-
BlockPos pos = ctx.getClickedPos();
74-
BlockPos placedOnPos = pos.relative(face.getOpposite());
75-
BlockState placedOnState = world.getBlockState(placedOnPos);
61+
private void tryMultiPlace(BlockPlaceContext ctx) {
62+
Player player = ctx.getPlayer();
63+
if (player == null)
64+
return;
65+
if (player.isShiftKeyDown())
66+
return;
67+
Direction face = ctx.getClickedFace();
68+
if (!face.getAxis()
69+
.isHorizontal())
70+
return;
71+
ItemStack stack = ctx.getItemInHand();
72+
Level world = ctx.getLevel();
73+
BlockPos pos = ctx.getClickedPos();
74+
BlockPos placedOnPos = pos.relative(face.getOpposite());
75+
BlockState placedOnState = world.getBlockState(placedOnPos);
7676

77-
if (!FluidVesselBlock.isVessel(placedOnState))
78-
return;
79-
boolean creative = getBlock().equals(CCBlocks.CREATIVE_FLUID_VESSEL.get());
80-
FluidVesselBlockEntity tankAt = ConnectivityHandler.partAt(
81-
creative ? CCBlockEntityTypes.CREATIVE_FLUID_VESSEL.get() : CCBlockEntityTypes.FLUID_VESSEL.get(), world, placedOnPos
82-
);
83-
if (tankAt == null)
84-
return;
85-
FluidVesselBlockEntity controllerBE = tankAt.getControllerBE();
86-
if (controllerBE == null)
87-
return;
77+
if (!FluidVesselBlock.isVessel(placedOnState))
78+
return;
79+
boolean creative = getBlock().equals(CCBlocks.CREATIVE_FLUID_VESSEL.get());
80+
FluidVesselBlockEntity tankAt = ConnectivityHandler.partAt(
81+
creative ? CCBlockEntityTypes.CREATIVE_FLUID_VESSEL.get() : CCBlockEntityTypes.FLUID_VESSEL.get(), world, placedOnPos
82+
);
83+
if (tankAt == null)
84+
return;
85+
FluidVesselBlockEntity controllerBE = tankAt.getControllerBE();
86+
if (controllerBE == null)
87+
return;
8888

89-
int width = controllerBE.getWidth();
90-
if (width == 1)
91-
return;
89+
int width = controllerBE.getWidth();
90+
if (width == 1)
91+
return;
9292

93-
int tanksToPlace = 0;
94-
Axis vesselAxis = placedOnState.getOptionalValue(FluidVesselBlock.AXIS).orElse(null);
95-
if (vesselAxis == null)
96-
return;
97-
if (face.getAxis() != vesselAxis)
98-
return;
93+
int tanksToPlace = 0;
94+
Axis vesselAxis = placedOnState.getOptionalValue(FluidVesselBlock.AXIS).orElse(null);
95+
if (vesselAxis == null)
96+
return;
97+
if (face.getAxis() != vesselAxis)
98+
return;
9999

100-
Direction vesselFacing = Direction.fromAxisAndDirection(vesselAxis, Direction.AxisDirection.POSITIVE);
101-
BlockPos startPos = face == vesselFacing.getOpposite()
102-
? controllerBE.getBlockPos().relative(vesselFacing.getOpposite())
103-
: controllerBE.getBlockPos().relative(vesselFacing, controllerBE.getHeight());
100+
Direction vesselFacing = Direction.fromAxisAndDirection(vesselAxis, Direction.AxisDirection.POSITIVE);
101+
BlockPos startPos = face == vesselFacing.getOpposite()
102+
? controllerBE.getBlockPos().relative(vesselFacing.getOpposite())
103+
: controllerBE.getBlockPos().relative(vesselFacing, controllerBE.getHeight());
104104

105-
if (VecHelper.getCoordinate(startPos, vesselAxis) != VecHelper.getCoordinate(pos, vesselAxis))
106-
return;
105+
if (VecHelper.getCoordinate(startPos, vesselAxis) != VecHelper.getCoordinate(pos, vesselAxis))
106+
return;
107107

108-
for (int xOffset = 0; xOffset < width; xOffset++) {
109-
for (int zOffset = 0; zOffset < width; zOffset++) {
110-
BlockPos offsetPos = vesselAxis == Axis.X
111-
? startPos.offset(0, xOffset, zOffset)
112-
: startPos.offset(xOffset, zOffset, 0);
113-
BlockState blockState = world.getBlockState(offsetPos);
114-
if (FluidVesselBlock.isVessel(blockState))
115-
continue;
116-
if (!blockState.canBeReplaced())
117-
return;
118-
tanksToPlace++;
119-
}
120-
}
108+
for (int xOffset = 0; xOffset < width; xOffset++) {
109+
for (int zOffset = 0; zOffset < width; zOffset++) {
110+
BlockPos offsetPos = vesselAxis == Axis.X
111+
? startPos.offset(0, xOffset, zOffset)
112+
: startPos.offset(xOffset, zOffset, 0);
113+
BlockState blockState = world.getBlockState(offsetPos);
114+
if (FluidVesselBlock.isVessel(blockState))
115+
continue;
116+
if (!blockState.getMaterial().isReplaceable())
117+
return;
118+
tanksToPlace++;
119+
}
120+
}
121121

122-
if (!player.isCreative() && stack.getCount() < tanksToPlace)
123-
return;
122+
if (!player.isCreative() && stack.getCount() < tanksToPlace)
123+
return;
124124

125-
for (int xOffset = 0; xOffset < width; xOffset++) {
126-
for (int zOffset = 0; zOffset < width; zOffset++) {
127-
BlockPos offsetPos = vesselAxis == Axis.X
128-
? startPos.offset(0, xOffset, zOffset)
129-
: startPos.offset(xOffset, zOffset, 0);
130-
BlockState blockState = world.getBlockState(offsetPos);
131-
if (FluidVesselBlock.isVessel(blockState))
132-
continue;
133-
BlockPlaceContext context = BlockPlaceContext.at(ctx, offsetPos, face);
134-
player.getPersistentData()
135-
.putBoolean("SilenceVesselSound", true);
136-
super.place(context);
137-
player.getPersistentData().remove("SilenceVesselSound");
138-
}
139-
}
140-
}
125+
for (int xOffset = 0; xOffset < width; xOffset++) {
126+
for (int zOffset = 0; zOffset < width; zOffset++) {
127+
BlockPos offsetPos = vesselAxis == Axis.X
128+
? startPos.offset(0, xOffset, zOffset)
129+
: startPos.offset(xOffset, zOffset, 0);
130+
BlockState blockState = world.getBlockState(offsetPos);
131+
if (FluidVesselBlock.isVessel(blockState))
132+
continue;
133+
BlockPlaceContext context = BlockPlaceContext.at(ctx, offsetPos, face);
134+
player.getPersistentData()
135+
.putBoolean("SilenceVesselSound", true);
136+
super.place(context);
137+
player.getPersistentData().remove("SilenceVesselSound");
138+
}
139+
}
140+
}
141141

142142
}

src/main/java/com/hlysine/create_connected/datagen/recipes/CCStandardRecipes.java

+5-5
Original file line numberDiff line numberDiff line change
@@ -57,15 +57,15 @@ public class CCStandardRecipes extends CreateRecipeProvider {
5757
GeneratedRecipe CRANK_WHEEL = create(CCBlocks.CRANK_WHEEL).unlockedBy(AllBlocks.COGWHEEL::get)
5858
.requiresResultFeature()
5959
.viaShapeless(b -> b
60-
.requires(AllBlocks.HAND_CRANK)
61-
.requires(AllBlocks.COGWHEEL)
60+
.requires(AllBlocks.HAND_CRANK.get())
61+
.requires(AllBlocks.COGWHEEL.get())
6262
);
6363

6464
GeneratedRecipe LARGE_CRANK_WHEEL = create(CCBlocks.LARGE_CRANK_WHEEL).unlockedBy(AllBlocks.LARGE_COGWHEEL::get)
6565
.requiresResultFeature()
6666
.viaShapeless(b -> b
67-
.requires(AllBlocks.HAND_CRANK)
68-
.requires(AllBlocks.LARGE_COGWHEEL)
67+
.requires(AllBlocks.HAND_CRANK.get())
68+
.requires(AllBlocks.LARGE_COGWHEEL.get())
6969
);
7070

7171
GeneratedRecipe INVERTED_CLUTCH_CYCLE =
@@ -192,7 +192,7 @@ public class CCStandardRecipes extends CreateRecipeProvider {
192192

193193
GeneratedRecipe FLUID_VESSEL = create(CCBlocks.FLUID_VESSEL).unlockedByTag(() -> Tags.Items.BARRELS_WOODEN)
194194
.requiresResultFeature()
195-
.viaShaped(b -> b.define('B', AllItems.COPPER_SHEET)
195+
.viaShaped(b -> b.define('B', AllItems.COPPER_SHEET.get())
196196
.define('C', Tags.Items.BARRELS_WOODEN)
197197
.pattern("BCB"));
198198

src/main/java/com/hlysine/create_connected/datagen/recipes/ItemApplicationRecipeGen.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ public class ItemApplicationRecipeGen extends ProcessingRecipeGen {
2020
GeneratedRecipe HAUNTING_CATALYST = fanCatalystFromEmpty(
2121
"haunting_catalyst", Items.SOUL_SAND::asItem, CCBlocks.FAN_HAUNTING_CATALYST.get()::asItem);
2222
GeneratedRecipe FREEZING_CATALYST = fanCatalystFromEmpty(
23-
"freezing_catalyst", Items.POWDER_SNOW_BUCKET::asItem, CCBlocks.FAN_FREEZING_CATALYST::asItem);
23+
"freezing_catalyst", Items.POWDER_SNOW_BUCKET::asItem, CCBlocks.FAN_FREEZING_CATALYST.get()::asItem);
2424

2525
protected GeneratedRecipe fanCatalystFromEmpty(String type, Supplier<ItemLike> ingredient, Supplier<ItemLike> output) {
2626
return create(type + "_from_empty", b -> b.require(CCBlocks.EMPTY_FAN_CATALYST.get())

0 commit comments

Comments
 (0)