Skip to content

Commit 8aca181

Browse files
committed
Update to new Oraxen version b8daf9f42d (1.149.0)
Took 12 minutes
1 parent 91c6933 commit 8aca181

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed

custom-ore-generator/src/main/java/de/derfrzocker/custom/ore/generator/impl/customdata/OraxenCustomData.java

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,22 @@
4040
import de.derfrzocker.custom.ore.generator.impl.v1_19_R1.customdata.OraxenApplier_v1_19_R1;
4141
import de.derfrzocker.custom.ore.generator.impl.v1_19_R2.customdata.OraxenApplier_v1_19_R2;
4242
import de.derfrzocker.spigot.utils.Version;
43-
import io.th0rgal.oraxen.compatibilities.provided.itembridge.OraxenItemBridge;
44-
import io.th0rgal.oraxen.items.OraxenItems;
45-
import io.th0rgal.oraxen.mechanics.provided.gameplay.block.BlockMechanic;
43+
import io.th0rgal.oraxen.api.OraxenItems;
4644
import io.th0rgal.oraxen.mechanics.provided.gameplay.block.BlockMechanicFactory;
4745
import io.th0rgal.oraxen.mechanics.provided.gameplay.noteblock.NoteBlockMechanicFactory;
4846
import io.th0rgal.oraxen.mechanics.provided.gameplay.stringblock.StringBlockMechanicFactory;
49-
import io.th0rgal.oraxen.utils.Utils;
5047
import org.bukkit.Bukkit;
5148
import org.bukkit.Material;
49+
import org.bukkit.block.BlockFace;
5250
import org.bukkit.block.BlockState;
5351
import org.bukkit.block.data.BlockData;
5452
import org.bukkit.block.data.MultipleFacing;
5553
import org.bukkit.block.data.type.NoteBlock;
5654
import org.bukkit.block.data.type.Tripwire;
5755
import org.jetbrains.annotations.NotNull;
5856

57+
import java.util.Arrays;
58+
import java.util.List;
5959
import java.util.function.Function;
6060

6161
public class OraxenCustomData extends AbstractCustomData<CustomDataApplier> {
@@ -91,7 +91,7 @@ public boolean hasCustomData(@NotNull BlockState blockState) {
9191

9292
// Check for block mechanic
9393
if (blockState.getType() == Material.MUSHROOM_STEM) {
94-
return BlockMechanicFactory.getBlockMechanic(BlockMechanic.getCode((MultipleFacing) blockData)) != null;
94+
return BlockMechanicFactory.getBlockMechanic(getCode((MultipleFacing) blockData)) != null;
9595
}
9696

9797
// Check for note block mechanic
@@ -115,7 +115,7 @@ public Object getCustomData(@NotNull BlockState blockState) {
115115

116116
// Check for block mechanic
117117
if (blockState.getType() == Material.MUSHROOM_STEM) {
118-
return BlockMechanicFactory.getBlockMechanic(BlockMechanic.getCode((MultipleFacing) blockData)).getItemID();
118+
return BlockMechanicFactory.getBlockMechanic(getCode((MultipleFacing) blockData)).getItemID();
119119
}
120120

121121
// Check for note block mechanic
@@ -132,6 +132,17 @@ public Object getCustomData(@NotNull BlockState blockState) {
132132
return false;
133133
}
134134

135+
private int getCode(MultipleFacing blockData) {
136+
int sum = 0;
137+
List<BlockFace> properties = Arrays.asList(BlockFace.EAST, BlockFace.WEST, BlockFace.SOUTH, BlockFace.NORTH, BlockFace.DOWN, BlockFace.UP);
138+
139+
for (BlockFace blockFace : blockData.getFaces()) {
140+
sum += Math.pow(2.0, properties.indexOf(blockFace));
141+
}
142+
143+
return sum;
144+
}
145+
135146
@NotNull
136147
@Override
137148
protected CustomDataApplier getCustomDataApplier0() {

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<version.non-maven1>1.0.0</version.non-maven1>
3333
<spigot-utils.version>cog-3</spigot-utils.version>
3434
<ItemMods.version>2.0.0-alpha.1</ItemMods.version>
35-
<Oraxen.version>b8daf9f42d</Oraxen.version>
35+
<Oraxen.version>ebd90cfbb2</Oraxen.version>
3636
</properties>
3737

3838
<repositories>

0 commit comments

Comments
 (0)