UPPER -> LOWER
This commit is contained in:
parent
8f6e37ca48
commit
9aae18a623
5 changed files with 10 additions and 7 deletions
|
@ -88,7 +88,7 @@ dependencies {
|
||||||
includeCompile("com.flowpowered", "flow-math", "1.0.3")
|
includeCompile("com.flowpowered", "flow-math", "1.0.3")
|
||||||
includeCompile("org.jgrapht", "jgrapht-core", "1.1.0")
|
includeCompile("org.jgrapht", "jgrapht-core", "1.1.0")
|
||||||
includeCompile("com.github.DimensionalDevelopment", "poly2tri.java", "0.1.1")
|
includeCompile("com.github.DimensionalDevelopment", "poly2tri.java", "0.1.1")
|
||||||
includeCompile("io.github.BoogieMonster1O1", "OpenWorlds", "d487eaa")
|
includeCompile("io.github.BoogieMonster1O1", "OpenWorlds", "c57e3ef")
|
||||||
includeCompile("io.github.cottonmc", "LibGui", "3.3.2+1.16.4")
|
includeCompile("io.github.cottonmc", "LibGui", "3.3.2+1.16.4")
|
||||||
includeCompile("me.shedaniel.cloth", "config-2", "5.0.0")
|
includeCompile("me.shedaniel.cloth", "config-2", "5.0.0")
|
||||||
includeCompile("io.github.onyxstudios", "Cardinal-Components-API", "3.0.0-nightly.20w48a")
|
includeCompile("io.github.onyxstudios", "Cardinal-Components-API", "3.0.0-nightly.20w48a")
|
||||||
|
|
|
@ -58,7 +58,7 @@ public class DimensionalDoorBlock extends DoorBlock implements RiftProvider<Entr
|
||||||
@Nullable
|
@Nullable
|
||||||
@Override
|
@Override
|
||||||
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
public BlockEntity createBlockEntity(BlockPos pos, BlockState state) {
|
||||||
if (state.get(DoorBlock.HALF) == DoubleBlockHalf.LOWER) {
|
if (state.get(DoorBlock.HALF) == DoubleBlockHalf.UPPER) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
return new EntranceRiftBlockEntity(pos, state);
|
return new EntranceRiftBlockEntity(pos, state);
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class RiftConfigurationToolItem extends Item {
|
||||||
EntityUtils.chat(player, Text.of("Rift stripped of data and set to invalid id: -1"));
|
EntityUtils.chat(player, Text.of("Rift stripped of data and set to invalid id: -1"));
|
||||||
}
|
}
|
||||||
} else if (Counter.get(stack).count() != -1) {
|
} else if (Counter.get(stack).count() != -1) {
|
||||||
Counter.get(stack).set(-1);
|
// Counter.get(stack).set(-1); TODO
|
||||||
((RiftConfigurationToolItem) stack.getItem()).sync(stack, player, hand);
|
((RiftConfigurationToolItem) stack.getItem()).sync(stack, player, hand);
|
||||||
|
|
||||||
EntityUtils.chat(player, Text.of("Counter has been reset."));
|
EntityUtils.chat(player, Text.of("Counter has been reset."));
|
||||||
|
@ -141,7 +141,7 @@ public class RiftConfigurationToolItem extends Item {
|
||||||
@Override
|
@Override
|
||||||
public ItemStack getDefaultStack() {
|
public ItemStack getDefaultStack() {
|
||||||
ItemStack defaultStack = super.getDefaultStack();
|
ItemStack defaultStack = super.getDefaultStack();
|
||||||
Counter.get(defaultStack).set(-1);
|
// Counter.get(defaultStack).set(-1); TODO
|
||||||
return defaultStack;
|
return defaultStack;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -90,16 +90,15 @@ public class PocketTemplate {
|
||||||
BlockState state = schematic.palette.get(schematic.blockData[x][y][z]);
|
BlockState state = schematic.palette.get(schematic.blockData[x][y][z]);
|
||||||
|
|
||||||
CompoundTag newNBT = new CompoundTag();
|
CompoundTag newNBT = new CompoundTag();
|
||||||
EntranceRiftBlockEntity rift = ModBlockEntityTypes.ENTRANCE_RIFT.instantiate();
|
EntranceRiftBlockEntity rift = ModBlockEntityTypes.ENTRANCE_RIFT.instantiate(new BlockPos(x, y, z), state);
|
||||||
|
|
||||||
String placeholder = tileEntityNBT.getString("placeholder");
|
String placeholder = tileEntityNBT.getString("placeholder");
|
||||||
|
|
||||||
if(placeholderMap.containsKey(placeholder)) {
|
if(placeholderMap.containsKey(placeholder)) {
|
||||||
rift.setPos(new BlockPos(x, y, z));
|
|
||||||
placeholderMap.get(placeholder).accept(rift);
|
placeholderMap.get(placeholder).accept(rift);
|
||||||
newNBT = rift.toTag(newNBT);
|
newNBT = rift.toTag(newNBT);
|
||||||
} else
|
} else
|
||||||
throw new RuntimeException("Unknown tile entity placeholder: " + tileEntityNBT.getString("placeholder"));
|
throw new RuntimeException("Unknown block entity placeholder: " + tileEntityNBT.getString("placeholder"));
|
||||||
|
|
||||||
// TODO: allow overriding some placeholder properties by copying other properties (not placeholder and x/y/z) to the new nbt
|
// TODO: allow overriding some placeholder properties by copying other properties (not placeholder and x/y/z) to the new nbt
|
||||||
tileEntities.add(newNBT);
|
tileEntities.add(newNBT);
|
||||||
|
|
|
@ -18,6 +18,10 @@ public class Counter implements Component {
|
||||||
return this.counter;
|
return this.counter;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int count() {
|
||||||
|
return this.counter;
|
||||||
|
}
|
||||||
|
|
||||||
public static <T> Counter get(T provider) {
|
public static <T> Counter get(T provider) {
|
||||||
return DimensionalDoorsComponents.COUNTER_COMPONENT_KEY.get(provider);
|
return DimensionalDoorsComponents.COUNTER_COMPONENT_KEY.get(provider);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue