Skip to content

Commit 50ab122

Browse files
committed
replace all uses of holder.get() with holder.value()
1 parent 9a41f89 commit 50ab122

19 files changed

+64
-62
lines changed

src/main/java/com/simibubi/create/content/contraptions/bearing/BearingContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public boolean assemble(Level world, BlockPos pos) throws AssemblyException {
4949

5050
@Override
5151
public ContraptionType getType() {
52-
return AllContraptionTypes.BEARING.get();
52+
return AllContraptionTypes.BEARING.value();
5353
}
5454

5555
@Override

src/main/java/com/simibubi/create/content/contraptions/bearing/ClockworkContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ public class ClockworkContraption extends Contraption {
2626

2727
@Override
2828
public ContraptionType getType() {
29-
return AllContraptionTypes.CLOCKWORK.get();
29+
return AllContraptionTypes.CLOCKWORK.value();
3030
}
3131

3232
private void ignoreBlocks(Set<BlockPos> blocks, BlockPos anchor) {

src/main/java/com/simibubi/create/content/contraptions/bearing/StabilizedContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ protected boolean isAnchoringBlockAt(BlockPos pos) {
3838

3939
@Override
4040
public ContraptionType getType() {
41-
return AllContraptionTypes.STABILIZED.get();
41+
return AllContraptionTypes.STABILIZED.value();
4242
}
4343

4444
@Override

src/main/java/com/simibubi/create/content/contraptions/elevator/ElevatorContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ public void readNBT(Level world, CompoundTag nbt, boolean spawnData) {
174174

175175
@Override
176176
public ContraptionType getType() {
177-
return AllContraptionTypes.ELEVATOR.get();
177+
return AllContraptionTypes.ELEVATOR.value();
178178
}
179179

180180
public void setClientYTarget(int clientYTarget) {

src/main/java/com/simibubi/create/content/contraptions/gantry/GantryContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ protected boolean isAnchoringBlockAt(BlockPos pos) {
5050

5151
@Override
5252
public ContraptionType getType() {
53-
return AllContraptionTypes.GANTRY.get();
53+
return AllContraptionTypes.GANTRY.value();
5454
}
5555

5656
public Direction getFacing() {

src/main/java/com/simibubi/create/content/contraptions/mounted/MountedContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ public MountedContraption(CartMovementMode mode) {
4949

5050
@Override
5151
public ContraptionType getType() {
52-
return AllContraptionTypes.MOUNTED.get();
52+
return AllContraptionTypes.MOUNTED.value();
5353
}
5454

5555
@Override

src/main/java/com/simibubi/create/content/contraptions/piston/PistonContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class PistonContraption extends TranslatingContraption {
4848

4949
@Override
5050
public ContraptionType getType() {
51-
return AllContraptionTypes.PISTON.get();
51+
return AllContraptionTypes.PISTON.value();
5252
}
5353

5454
public PistonContraption() {

src/main/java/com/simibubi/create/content/contraptions/pulley/PulleyContraption.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ public class PulleyContraption extends TranslatingContraption {
1515

1616
@Override
1717
public ContraptionType getType() {
18-
return AllContraptionTypes.PULLEY.get();
18+
return AllContraptionTypes.PULLEY.value();
1919
}
2020

2121
public PulleyContraption() {}

src/main/java/com/simibubi/create/content/decoration/steamWhistle/WhistleBlock.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ public static void incrementSize(LevelAccessor pLevel, BlockPos pPos) {
138138
for (int i = 1; i <= 6; i++) {
139139
BlockState blockState = pLevel.getBlockState(currentPos);
140140
float pVolume = (soundtype.getVolume() + 1.0F) / 2.0F;
141-
SoundEvent growSound = SoundEvents.NOTE_BLOCK_XYLOPHONE.get();
141+
SoundEvent growSound = SoundEvents.NOTE_BLOCK_XYLOPHONE.value();
142142
SoundEvent hitSound = soundtype.getHitSound();
143143

144144
if (AllBlocks.STEAM_WHISTLE_EXTENSION.has(blockState)) {

src/main/java/com/simibubi/create/content/equipment/potatoCannon/AllPotatoProjectileBlockHitActions.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@
2424
import net.minecraftforge.registries.ForgeRegistries;
2525

2626
public class AllPotatoProjectileBlockHitActions {
27-
27+
2828
static {
2929
register("plant_crop", PlantCrop.CODEC);
3030
register("place_block_on_ground", PlaceBlockOnGround.CODEC);
3131
}
32-
32+
3333
public static void init() {
3434
}
3535

@@ -61,12 +61,12 @@ public boolean execute(LevelAccessor level, ItemStack projectile, BlockHitResult
6161
if (!level.getBlockState(placePos)
6262
.canBeReplaced())
6363
return false;
64-
if (!(cropBlock.get() instanceof IPlantable))
64+
if (!(cropBlock.value() instanceof IPlantable))
6565
return false;
6666
BlockState blockState = level.getBlockState(hitPos);
67-
if (!blockState.canSustainPlant(level, hitPos, face, (IPlantable) cropBlock.get()))
67+
if (!blockState.canSustainPlant(level, hitPos, face, (IPlantable) cropBlock.value()))
6868
return false;
69-
level.setBlock(placePos, cropBlock.get()
69+
level.setBlock(placePos, cropBlock.value()
7070
.defaultBlockState(), 3);
7171
return true;
7272
}
@@ -111,7 +111,7 @@ public boolean execute(LevelAccessor levelAccessor, ItemStack projectile, BlockH
111111
y = Math.max(y, placePos.getY());
112112

113113
FallingBlockEntity falling = FallingBlockEntityAccessor.create$callInit(level, placePos.getX() + 0.5, y,
114-
placePos.getZ() + 0.5, block.get().defaultBlockState());
114+
placePos.getZ() + 0.5, block.value().defaultBlockState());
115115
falling.time = 1;
116116
level.addFreshEntity(falling);
117117
}

src/main/java/com/simibubi/create/content/equipment/potatoCannon/PotatoCannonItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ public static Ammo getAmmo(Player player, ItemStack heldStack) {
7272
return null;
7373
}
7474

75-
return new Ammo(ammoStack, optionalType.get().get());
75+
return new Ammo(ammoStack, optionalType.get().value());
7676
}
7777

7878
@Override

src/main/java/com/simibubi/create/content/fluids/potion/PotionMixingRecipes.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import net.minecraft.world.item.alchemy.PotionBrewing;
2222
import net.minecraft.world.item.alchemy.Potions;
2323
import net.minecraft.world.item.crafting.Ingredient;
24+
2425
import net.minecraftforge.common.brewing.BrewingRecipe;
2526
import net.minecraftforge.common.brewing.BrewingRecipeRegistry;
2627
import net.minecraftforge.common.brewing.IBrewingRecipe;
@@ -52,19 +53,19 @@ private static List<MixingRecipe> createRecipes() {
5253
for (Item container : allowedSupportedContainers) {
5354
BottleType bottleType = PotionFluidHandler.bottleTypeFromItem(container);
5455
for (PotionBrewing.Mix<Potion> mix : PotionBrewing.POTION_MIXES) {
55-
FluidStack fromFluid = PotionFluidHandler.getFluidFromPotion(mix.from.get(), bottleType, 1000);
56-
FluidStack toFluid = PotionFluidHandler.getFluidFromPotion(mix.to.get(), bottleType, 1000);
56+
FluidStack fromFluid = PotionFluidHandler.getFluidFromPotion(mix.from.value(), bottleType, 1000);
57+
FluidStack toFluid = PotionFluidHandler.getFluidFromPotion(mix.to.value(), bottleType, 1000);
5758

5859
mixingRecipes.add(createRecipe("potion_mixing_vanilla_" + recipeIndex++, mix.ingredient, fromFluid, toFluid));
5960
}
6061
}
6162

6263
for (PotionBrewing.Mix<Item> mix : PotionBrewing.CONTAINER_MIXES) {
63-
Item from = mix.from.get();
64+
Item from = mix.from.value();
6465
if (!allowedSupportedContainers.contains(from)) {
6566
continue;
6667
}
67-
Item to = mix.to.get();
68+
Item to = mix.to.value();
6869
if (!allowedSupportedContainers.contains(to)) {
6970
continue;
7071
}

src/main/java/com/simibubi/create/content/kinetics/clock/CuckooClockBlockEntity.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
import com.simibubi.create.foundation.damageTypes.CreateDamageSources;
99

1010
import net.createmod.catnip.animation.AnimationTickHolder;
11-
import net.createmod.catnip.nbt.NBTHelper;
12-
import net.createmod.catnip.math.VecHelper;
1311
import net.createmod.catnip.animation.LerpedFloat;
1412
import net.createmod.catnip.animation.LerpedFloat.Chaser;
13+
import net.createmod.catnip.math.VecHelper;
14+
import net.createmod.catnip.nbt.NBTHelper;
1515
import net.minecraft.core.BlockPos;
1616
import net.minecraft.core.particles.ParticleTypes;
1717
import net.minecraft.nbt.CompoundTag;
@@ -82,9 +82,9 @@ public void tick() {
8282
moveHands(hours, minutes);
8383

8484
if (AnimationTickHolder.getTicks() % 6 == 0)
85-
playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 2f);
85+
playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 2f);
8686
else if (AnimationTickHolder.getTicks() % 3 == 0)
87-
playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 1.5f);
87+
playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 1.5f);
8888
}
8989
return;
9090
}
@@ -117,9 +117,9 @@ else if (AnimationTickHolder.getTicks() % 3 == 0)
117117

118118
if (animationType == Animation.NONE) {
119119
if (AnimationTickHolder.getTicks() % 32 == 0)
120-
playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 2f);
120+
playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 2f);
121121
else if (AnimationTickHolder.getTicks() % 16 == 0)
122-
playSound(SoundEvents.NOTE_BLOCK_HAT.get(), 1 / 16f, 1.5f);
122+
playSound(SoundEvents.NOTE_BLOCK_HAT.value(), 1 / 16f, 1.5f);
123123
} else {
124124

125125
boolean isSurprise = animationType == Animation.SURPRISE;
@@ -131,9 +131,9 @@ else if (AnimationTickHolder.getTicks() % 16 == 0)
131131
// sounds
132132

133133
if (value == 1)
134-
playSound(SoundEvents.NOTE_BLOCK_CHIME.get(), 2, .5f);
134+
playSound(SoundEvents.NOTE_BLOCK_CHIME.value(), 2, .5f);
135135
if (value == 21)
136-
playSound(SoundEvents.NOTE_BLOCK_CHIME.get(), 2, 0.793701f);
136+
playSound(SoundEvents.NOTE_BLOCK_CHIME.value(), 2, 0.793701f);
137137

138138
if (value > 30 && isSurprise) {
139139
Vec3 pos = VecHelper.offsetRandomly(VecHelper.getCenterOf(this.worldPosition), level.random, .5f);

src/main/java/com/simibubi/create/content/logistics/factoryBoard/FactoryPanelScreen.java

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
import net.minecraft.world.item.crafting.CraftingRecipe;
4747
import net.minecraft.world.item.crafting.Ingredient;
4848
import net.minecraft.world.item.crafting.RecipeType;
49+
4950
import net.minecraftforge.common.crafting.IShapedRecipe;
5051
import net.minecraftforge.items.ItemHandlerHelper;
5152

@@ -128,15 +129,15 @@ public static List<BigItemStack> convertRecipeToPackageOrderContext(CraftingReci
128129
if (ingredient.test(bigItemStack.stack))
129130
craftingIngredient = new BigItemStack(bigItemStack.stack, 1);
130131
craftingIngredients.add(craftingIngredient);
131-
132+
132133
if (width < 3 && (i + 1) % width == 0)
133134
for (int j = 0; j < 3 - width; j++)
134135
craftingIngredients.add(emptyIngredient);
135136
}
136137

137138
while (craftingIngredients.size() < 9)
138139
craftingIngredients.add(emptyIngredient);
139-
140+
140141
return craftingIngredients;
141142
}
142143

@@ -191,15 +192,15 @@ protected void init() {
191192
});
192193
newInputButton.setToolTip(CreateLang.translate("gui.factory_panel.connect_input")
193194
.component());
194-
195+
195196
relocateButton = new IconButton(x + 31, y + 67, AllIcons.I_MOVE_GAUGE);
196197
relocateButton.withCallback(() -> {
197198
FactoryPanelConnectionHandler.startRelocating(behaviour);
198199
minecraft.setScreen(null);
199200
});
200201
relocateButton.setToolTip(CreateLang.translate("gui.factory_panel.relocate")
201202
.component());
202-
203+
203204
if (!restocker) {
204205
addRenderableWidget(newInputButton);
205206
addRenderableWidget(relocateButton);
@@ -440,7 +441,7 @@ private void renderInputItem(GuiGraphics graphics, int slot, BigItemStack itemSt
440441
mouseX, mouseY);
441442
return;
442443
}
443-
444+
444445
if (itemStack.stack.isEmpty()) {
445446
graphics.renderComponentTooltip(font, List.of(CreateLang.translate("gui.factory_panel.empty_panel")
446447
.color(ScrollInput.HEADER_RGB)
@@ -566,7 +567,7 @@ public boolean mouseClicked(double mouseX, double mouseY, int pButton) {
566567
playButtonSound();
567568
return true;
568569
}
569-
570+
570571
// remove redstone connections
571572
itemX = x + 9;
572573
itemY = y + windowHeight - 24;
@@ -583,14 +584,14 @@ public boolean mouseClicked(double mouseX, double mouseY, int pButton) {
583584
public void playButtonSound() {
584585
Minecraft.getInstance()
585586
.getSoundManager()
586-
.play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK.get(), 1.0f, 0.25f));
587+
.play(SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK.value(), 1.0f, 0.25f));
587588
}
588589

589590
@Override
590591
public boolean mouseScrolled(double mouseX, double mouseY, double pDelta) {
591592
int x = guiLeft;
592593
int y = guiTop;
593-
594+
594595
if (addressBox.mouseScrolled(mouseX, mouseY, pDelta))
595596
return true;
596597

src/main/java/com/simibubi/create/content/logistics/stockTicker/StockKeeperCategoryScreen.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,22 +119,22 @@ protected void stopEditing() {
119119
if (editingItem == null)
120120
return;
121121

122-
playUiSound(SoundEvents.UI_BUTTON_CLICK.get(), 1, 1);
122+
playUiSound(SoundEvents.UI_BUTTON_CLICK.value(), 1, 1);
123123

124124
removeWidget(editorConfirm);
125125
removeWidget(editorEditBox);
126126

127127
ItemStack stackInSlot = menu.proxyInventory.getStackInSlot(0)
128128
.copy();
129129
boolean empty = stackInSlot.isEmpty();
130-
130+
131131
if (empty && editingIndex != -1)
132132
schedule.remove(editingIndex);
133-
133+
134134
if (!empty) {
135135
String value = editorEditBox.getValue();
136136
stackInSlot.setHoverName(value.isBlank() ? null : Component.literal(value));
137-
137+
138138
if (editingIndex == -1)
139139
schedule.add(stackInSlot);
140140
else
@@ -348,7 +348,7 @@ public boolean action(@Nullable GuiGraphics graphics, double mouseX, double mous
348348
renderActionTooltip(graphics, ImmutableList.of(CreateLang.translate("gui.stock_ticker.new_category")
349349
.component()), mx, my);
350350
if (click == 0) {
351-
playUiSound(SoundEvents.UI_BUTTON_CLICK.get(), 1f, 1f);
351+
playUiSound(SoundEvents.UI_BUTTON_CLICK.value(), 1f, 1f);
352352
startEditing(-1);
353353
}
354354
}
@@ -368,7 +368,7 @@ public boolean mouseClicked(double pMouseX, double pMouseY, int pButton) {
368368
return true;
369369
}
370370
if (action(null, pMouseX, pMouseY, pButton)) {
371-
playUiSound(SoundEvents.UI_BUTTON_CLICK.get(), 1f, 1f);
371+
playUiSound(SoundEvents.UI_BUTTON_CLICK.value(), 1f, 1f);
372372
return true;
373373
}
374374

0 commit comments

Comments
 (0)