Few fixes

This commit is contained in:
SD 2022-01-14 14:22:57 +05:30
parent 306a5cc05f
commit 30c3875848
9 changed files with 26 additions and 15 deletions

View file

@ -31,13 +31,13 @@ public final class ModBlocks {
private static final Map<DyeColor, Block> ANCIENT_FABRIC_BLOCKS = new HashMap<>();
@RegistryEntry("stone_player")
public static final Block STONE_PLAYER = register(new Block(FabricBlockSettings.of(Material.STONE).strength(0.5F).breakByHand(true).breakByTool(FabricToolTags.PICKAXES).nonOpaque()));
public static final Block STONE_PLAYER = register(new Block(FabricBlockSettings.of(Material.STONE).strength(0.5F).breakByHand(true).nonOpaque()));
@RegistryEntry("gold_door")
public static final Block GOLD_DOOR = register(new DoorBlock(FabricBlockSettings.of(Material.METAL, MapColor.GOLD).strength(5.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES).nonOpaque()));
public static final Block GOLD_DOOR = register(new DoorBlock(FabricBlockSettings.of(Material.METAL, MapColor.GOLD).strength(5.0F).breakByHand(false).nonOpaque()));
@RegistryEntry("quartz_door")
public static final Block QUARTZ_DOOR = register(new DoorBlock(FabricBlockSettings.of(Material.STONE, MapColor.OFF_WHITE).strength(5.0F).breakByHand(false).breakByTool(FabricToolTags.PICKAXES).nonOpaque()));
public static final Block QUARTZ_DOOR = register(new DoorBlock(FabricBlockSettings.of(Material.STONE, MapColor.OFF_WHITE).strength(5.0F).breakByHand(false).nonOpaque()));
@RegistryEntry("wood_dimensional_trapdoor")
public static final Block OAK_DIMENSIONAL_TRAPDOOR = register(new DimensionalTrapdoorBlock(FabricBlockSettings.copyOf(Blocks.OAK_TRAPDOOR).luminance(state -> 10)));
@ -171,7 +171,7 @@ public final class ModBlocks {
public static final Block MARKING_PLATE = register(new MarkingPlateBlock(FabricBlockSettings.of(Material.METAL, DyeColor.BLACK).nonOpaque()));
@RegistryEntry("solid_static")
public static final Block SOLID_STATIC = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE).strength(7, 25).ticksRandomly().breakByTool(FabricToolTags.PICKAXES, 3).breakByHand(false).sounds(BlockSoundGroup.SAND)));
public static final Block SOLID_STATIC = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE).strength(7, 25).ticksRandomly().breakByHand(false).sounds(BlockSoundGroup.SAND)));
private static Block register(Block block) {
return block;

View file

@ -51,9 +51,9 @@ public class EntranceRiftBlockEntity extends RiftBlockEntity {
}
@Override
public NbtCompound writeNbt(NbtCompound nbt) {
public void writeNbt(NbtCompound nbt) {
nbt.putBoolean("locked", locked);
return super.writeNbt(nbt);
super.writeNbt(nbt);
}
@Override

View file

@ -41,7 +41,7 @@ public class ServerPlayNetworkHandlerMixin {
mutable.set(i, j, k);
BlockState blockState = player.world.getBlockState(mutable);
Block block = blockState.getBlock();
if (block instanceof AfterMoveCollidableBlock && ((AfterMoveCollidableBlock) block).onAfterMovePlayerCollision(blockState, player.getServerWorld(), mutable, player, player.getPos().subtract(lastTickX, lastTickY, lastTickZ)).isAccepted()) {
if (block instanceof AfterMoveCollidableBlock && ((AfterMoveCollidableBlock) block).onAfterMovePlayerCollision(blockState, player.getWorld(), mutable, player, player.getPos().subtract(lastTickX, lastTickY, lastTickZ)).isAccepted()) {
done = true;
}
if (done) {

View file

@ -76,7 +76,7 @@ public abstract class WorldRendererMixin {
matrices.push();
matrices.translate((double) pos.getX() - d, (double) pos.getY() - e, (double) pos.getZ() - f);
MatrixStack.Entry entry3 = matrices.peek();
VertexConsumer vertexConsumer2 = new OverlayVertexConsumer(this.bufferBuilders.getEffectVertexConsumers().getBuffer((RenderLayer) ModelLoader.BLOCK_DESTRUCTION_RENDER_LAYERS.get(stage)), entry3.getModel(), entry3.getNormal());
VertexConsumer vertexConsumer2 = new OverlayVertexConsumer(this.bufferBuilders.getEffectVertexConsumers().getBuffer((RenderLayer) ModelLoader.BLOCK_DESTRUCTION_RENDER_LAYERS.get(stage)), entry3.getPositionMatrix(), entry3.getNormalMatrix());
this.client.getBlockRenderManager().renderDamage(this.world.getBlockState(pos), pos, this.world, matrices, vertexConsumer2);
matrices.pop();
}

View file

@ -45,9 +45,4 @@ public enum LimboGateway implements Gateway {
private void placePortal(StructureWorldAccess world, BlockPos pos, Direction facing) {
world.setBlockState(pos, ModBlocks.DIMENSIONAL_PORTAL.getDefaultState(), 2);
}
@Override
public Set<RegistryKey<Biome>> getBiomes() {
return ImmutableSet.of(ModBiomes.LIMBO_KEY);
}
}

View file

@ -0,0 +1,9 @@
{
"replace": false,
"values": [
"dimdoors:stone_player",
"dimdoors:gold_door",
"dimdoors:quartz_door",
"dimdoors:solid_static"
]
}

View file

@ -0,0 +1,6 @@
{
"replace": false,
"values": [
"dimdoors:solid_static"
]
}

View file

@ -10,6 +10,7 @@ import net.minecraft.block.*;
import net.minecraft.server.world.ServerChunkManager;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.util.math.*;
import net.minecraft.util.registry.Registry;
import net.minecraft.world.chunk.Chunk;
import net.minecraft.world.chunk.ChunkSection;
import org.apache.logging.log4j.LogManager;
@ -159,7 +160,7 @@ public class RelativeBlockSample implements BlockView, ModifiableWorld {
int sectionY = chunk.getSectionIndex(blockPos.getY());
ChunkSection section = sections[sectionY];
if (section == null) {
section = new ChunkSection(sectionY);
section = new ChunkSection(sectionY, world.getRegistryManager().get(Registry.BIOME_KEY));
sections[sectionY] = section;
}
if(section.getBlockState(x, y, z).isAir()) {

View file

@ -44,7 +44,7 @@ public class Schematic {
Codec.BYTE_BUFFER.fieldOf("BlockData").forGetter(Schematic::getBlockData),
Codec.list(NbtCompound.CODEC).optionalFieldOf("BlockEntities", ImmutableList.of()).forGetter(Schematic::getBlockEntities),
Codec.list(NbtCompound.CODEC).optionalFieldOf("Entities", ImmutableList.of()).forGetter(Schematic::getEntities),
Codec.unboundedMap(BuiltinRegistries.BIOME, Codec.INT).optionalFieldOf("BiomePalette", Collections.emptyMap()).forGetter(Schematic::getBiomePalette),
Codec.unboundedMap(BuiltinRegistries.BIOME.getCodec(), Codec.INT).optionalFieldOf("BiomePalette", Collections.emptyMap()).forGetter(Schematic::getBiomePalette),
Codec.BYTE_BUFFER.optionalFieldOf("BiomeData", ByteBuffer.wrap(new byte[0])).forGetter(Schematic::getBlockData)
).apply(instance, Schematic::new));