Skip to content

Commit dcdc06e

Browse files
authored
Merge pull request #280 from Mixinors/development-1.16.3
1.10.6
2 parents 33c79f2 + c1b630c commit dcdc06e

File tree

88 files changed

+481
-262
lines changed

Some content is hidden

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

88 files changed

+481
-262
lines changed

astromine-core/src/main/java/com/github/chainmailstudios/astromine/client/BaseRenderer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
import net.minecraft.util.Identifier;
3737

3838
import com.github.vini2003.blade.client.utilities.Layers;
39-
import com.github.vini2003.blade.common.data.Color;
39+
import com.github.vini2003.blade.common.miscellaneous.Color;
4040

4141
public class BaseRenderer {
4242
public static void drawQuad(MatrixStack matrices, VertexConsumerProvider provider, RenderLayer layer, float x, float y, float sX, float sY, Color color) {

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/block/base/BlockWithEntity.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,12 @@ public BlockState getPlacementState(ItemPlacementContext context) {
137137
}
138138

139139
@Override
140-
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack itemStack) {
141-
super.onPlaced(world, pos, state, placer, itemStack);
140+
public void onPlaced(World world, BlockPos pos, BlockState state, LivingEntity placer, ItemStack stack) {
141+
super.onPlaced(world, pos, state, placer, stack);
142142

143143
BlockEntity blockEntity = world.getBlockEntity(pos);
144144
if (blockEntity != null) {
145-
blockEntity.fromTag(state, itemStack.getOrCreateTag());
145+
blockEntity.fromTag(state, stack.getOrCreateTag());
146146
blockEntity.setPos(pos);
147147
}
148148
}

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/block/base/CableBlock.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ public BlockState getPlacementState(ItemPlacementContext context) {
106106
}
107107

108108
@Override
109-
public void onPlaced(World world, BlockPos position, BlockState stateA, LivingEntity placer, ItemStack itemStack) {
110-
super.onPlaced(world, position, stateA, placer, itemStack);
109+
public void onPlaced(World world, BlockPos position, BlockState stateA, LivingEntity placer, ItemStack stack) {
110+
super.onPlaced(world, position, stateA, placer, stack);
111111

112112
NetworkTracer.Tracer.INSTANCE.trace(getNetworkType(), WorldPos.of(world, position));
113113

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/component/inventory/FluidInventoryComponent.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,15 +84,15 @@ default boolean canInsert() {
8484
return true;
8585
}
8686

87-
default boolean canInsert(@Nullable Direction direction, FluidVolume fluid, int slot) {
87+
default boolean canInsert(@Nullable Direction direction, FluidVolume volume, int slot) {
8888
return true;
8989
}
9090

9191
default boolean canExtract() {
9292
return true;
9393
}
9494

95-
default boolean canExtract(@Nullable Direction direction, FluidVolume fluid, int slot) {
95+
default boolean canExtract(@Nullable Direction direction, FluidVolume volume, int slot) {
9696
return true;
9797
}
9898

@@ -179,7 +179,7 @@ default FluidVolume getFirstInsertableVolume(FluidVolume volume, Direction direc
179179

180180
@Nullable
181181
default FluidVolume getFirstInsertableVolume(Fluid fluid, Direction direction) {
182-
return getContents().entrySet().stream().filter((entry) -> canInsert(direction, entry.getValue(), entry.getKey()) && (entry.getValue().isEmpty() || (entry.getValue().getFluid() == fluid))).map(Map.Entry::getValue).findFirst().orElse(null);
182+
return getContents().entrySet().stream().filter((entry) -> canInsert(direction, entry.getValue(), entry.getKey()) && (entry.getValue().isEmpty() || (entry.getValue().getFluid() == fluid))).map(Map.Entry::getValue).findFirst().orElse(null);
183183
}
184184

185185
default TypedActionResult<FluidVolume> extract(Direction direction, int slot, Fraction fraction) {

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/component/inventory/SimpleFluidInventoryComponent.java

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,14 @@
2424

2525
package com.github.chainmailstudios.astromine.common.component.inventory;
2626

27+
import com.github.chainmailstudios.astromine.common.utilities.data.predicate.TriPredicate;
2728
import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap;
29+
import net.minecraft.item.ItemStack;
2830
import net.minecraft.nbt.CompoundTag;
2931

3032
import com.github.chainmailstudios.astromine.common.volume.fluid.FluidVolume;
33+
import net.minecraft.util.math.Direction;
34+
import org.jetbrains.annotations.Nullable;
3135

3236
import java.util.ArrayList;
3337
import java.util.HashMap;
@@ -40,6 +44,9 @@ public class SimpleFluidInventoryComponent implements FluidInventoryComponent {
4044

4145
private final List<Runnable> listeners = new ArrayList<>();
4246

47+
private TriPredicate<@Nullable Direction, FluidVolume, Integer> insertPredicate = (direction, volume, slot) -> true;
48+
private TriPredicate<@Nullable Direction, FluidVolume, Integer> extractPredicate = (direction, volume, integer) -> true;
49+
4350
private final int size;
4451

4552
public SimpleFluidInventoryComponent() {
@@ -53,6 +60,28 @@ public SimpleFluidInventoryComponent(int size) {
5360
}
5461
}
5562

63+
@Override
64+
public boolean canInsert(@Nullable Direction direction, FluidVolume volume, int slot) {
65+
return insertPredicate.test(direction, volume, slot);
66+
}
67+
68+
@Override
69+
public boolean canExtract(@Nullable Direction direction, FluidVolume volume, int slot) {
70+
return extractPredicate.test(direction, volume, slot);
71+
}
72+
73+
public SimpleFluidInventoryComponent withInsertPredicate(TriPredicate<@Nullable Direction, FluidVolume, Integer> predicate) {
74+
TriPredicate<Direction, FluidVolume, Integer> triPredicate = this.insertPredicate;
75+
this.insertPredicate = (direction, volume, integer) -> triPredicate.test(direction, volume, integer) && predicate.test(direction, volume, integer);
76+
return this;
77+
}
78+
79+
public SimpleFluidInventoryComponent withExtractPredicate(TriPredicate<@Nullable Direction, FluidVolume, Integer> predicate) {
80+
TriPredicate<Direction, FluidVolume, Integer> triPredicate = this.extractPredicate;
81+
this.extractPredicate = (direction, volume, integer) -> triPredicate.test(direction, volume, integer) && predicate.test(direction, volume, integer);
82+
return this;
83+
}
84+
5685
@Override
5786
public Map<Integer, FluidVolume> getContents() {
5887
return contents;

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/component/inventory/SimpleItemInventoryComponent.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ public class SimpleItemInventoryComponent implements ItemInventoryComponent {
4646
private final Int2ObjectOpenHashMap<ItemStack> contents = new Int2ObjectOpenHashMap<>();
4747

4848
private final List<Runnable> listeners = new ArrayList<>();
49-
private TriPredicate<@Nullable Direction, ItemStack, Integer> insertPredicate = (direction, itemStack, slot) -> true;
49+
50+
private TriPredicate<@Nullable Direction, ItemStack, Integer> insertPredicate = (direction, stack, slot) -> true;
5051
private TriPredicate<@Nullable Direction, ItemStack, Integer> extractPredicate = (direction, stack, integer) -> true;
5152

5253
private int size;
@@ -82,13 +83,13 @@ public boolean canExtract(Direction direction, ItemStack stack, int slot) {
8283

8384
public SimpleItemInventoryComponent withInsertPredicate(TriPredicate<@Nullable Direction, ItemStack, Integer> predicate) {
8485
TriPredicate<Direction, ItemStack, Integer> triPredicate = this.insertPredicate;
85-
this.insertPredicate = (direction, itemStack, integer) -> triPredicate.test(direction, itemStack, integer) && predicate.test(direction, itemStack, integer);
86+
this.insertPredicate = (direction, stack, integer) -> triPredicate.test(direction, stack, integer) && predicate.test(direction, stack, integer);
8687
return this;
8788
}
8889

8990
public SimpleItemInventoryComponent withExtractPredicate(TriPredicate<@Nullable Direction, ItemStack, Integer> predicate) {
9091
TriPredicate<Direction, ItemStack, Integer> triPredicate = this.extractPredicate;
91-
this.extractPredicate = (direction, itemStack, integer) -> triPredicate.test(direction, itemStack, integer) && predicate.test(direction, itemStack, integer);
92+
this.extractPredicate = (direction, stack, integer) -> triPredicate.test(direction, stack, integer) && predicate.test(direction, stack, integer);
9293
return this;
9394
}
9495

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/fluid/ExtendedFluid.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
import com.github.chainmailstudios.astromine.registry.AstromineBlocks;
5353
import com.github.chainmailstudios.astromine.registry.AstromineFluids;
5454
import com.github.chainmailstudios.astromine.registry.AstromineItems;
55-
import com.github.vini2003.blade.common.data.Color;
55+
import com.github.vini2003.blade.common.miscellaneous.Color;
5656
import org.jetbrains.annotations.Nullable;
5757

5858
public abstract class ExtendedFluid extends FlowableFluid {

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/inventory/BaseInventory.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,23 +92,23 @@ public ItemStack getStack(int slot) {
9292

9393
@Override
9494
public ItemStack removeStack(int slot, int amount) {
95-
ItemStack itemStack = Inventories.splitStack(this.stacks, slot, amount);
96-
if (!itemStack.isEmpty()) {
95+
ItemStack stack = Inventories.splitStack(this.stacks, slot, amount);
96+
if (!stack.isEmpty()) {
9797
this.markDirty();
9898
}
9999

100-
return itemStack;
100+
return stack;
101101
}
102102

103103
@Override
104104
public ItemStack removeStack(int slot) {
105-
ItemStack itemStack = this.stacks.get(slot);
106-
if (itemStack.isEmpty()) {
105+
ItemStack stack = this.stacks.get(slot);
106+
if (stack.isEmpty()) {
107107
return ItemStack.EMPTY;
108108
} else {
109109
this.stacks.set(slot, ItemStack.EMPTY);
110110
this.markDirty();
111-
return itemStack;
111+
return stack;
112112
}
113113
}
114114

@@ -138,7 +138,7 @@ public void clear() {
138138
}
139139

140140
public String toString() {
141-
return (this.stacks.stream().filter((itemStack) -> !itemStack.isEmpty()).collect(Collectors.toList())).toString();
141+
return (this.stacks.stream().filter((stack) -> !stack.isEmpty()).collect(Collectors.toList())).toString();
142142
}
143143

144144
@Override

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/item/DrillItem.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ public double getEnergy() {
120120
}
121121

122122
@Override
123-
public int getRadius(ItemStack itemStack) {
123+
public int getRadius(ItemStack stack) {
124124
return radius;
125125
}
126126

astromine-core/src/main/java/com/github/chainmailstudios/astromine/common/item/base/EnergyVolumeItem.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -66,14 +66,14 @@ public EnergyTier getTier() {
6666
}
6767

6868
@Override
69-
public double getDurabilityBarProgress(ItemStack itemStack) {
70-
if (!Energy.valid(itemStack) || getMaxStoredPower() == 0)
69+
public double getDurabilityBarProgress(ItemStack stack) {
70+
if (!Energy.valid(stack) || getMaxStoredPower() == 0)
7171
return 0;
72-
return 1 - Energy.of(itemStack).getEnergy() / getMaxStoredPower();
72+
return 1 - Energy.of(stack).getEnergy() / getMaxStoredPower();
7373
}
7474

7575
@Override
76-
public boolean hasDurabilityBar(ItemStack itemStack) {
76+
public boolean hasDurabilityBar(ItemStack stack) {
7777
return true;
7878
}
7979

@@ -86,9 +86,9 @@ public int getDurabilityBarColor(ItemStack stack) {
8686
public void appendStacks(ItemGroup group, DefaultedList<ItemStack> stacks) {
8787
super.appendStacks(group, stacks);
8888
if (this.isIn(group)) {
89-
ItemStack itemStack = new ItemStack(this);
90-
Energy.of(itemStack).set(getMaxStoredPower());
91-
stacks.add(itemStack);
89+
ItemStack stack = new ItemStack(this);
90+
Energy.of(stack).set(getMaxStoredPower());
91+
stacks.add(stack);
9292
}
9393
}
9494
}

0 commit comments

Comments
 (0)