This commit is contained in:
SD 2021-05-10 09:44:54 +05:30
commit 7f6239201e
31 changed files with 131 additions and 20 deletions

View file

@ -156,6 +156,7 @@ public final class ModConfig implements ConfigData {
@Tooltip @EnumHandler(option = BUTTON) public ExtendedResourcePackActivationType classicPocketsResourcePackActivationType = ExtendedResourcePackActivationType.DEFAULT_ENABLED;
@Tooltip @EnumHandler(option = BUTTON) public ExtendedResourcePackActivationType defaultPocketsResourcePackActivationType = ExtendedResourcePackActivationType.DEFAULT_ENABLED;
@Tooltip public boolean asyncWorldEditPocketLoading = true;
@Tooltip public boolean canUseRiftSignatureInPrivatePockets = true;
}
public static class World {

View file

@ -149,6 +149,18 @@ public final class ModBlocks {
@RegistryEntry("eternal_fluid")
public static final Block ETERNAL_FLUID = register(new EternalFluidBlock(FabricBlockSettings.of(Material.STONE, MapColor.RED).luminance(15)));
@RegistryEntry("decayed_block")
public static final Block DECAYED_BLOCK = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE, MapColor.BLACK).ticksRandomly().luminance(15)));
@RegistryEntry("unfolded_block")
public static final Block UNFOLDED_BLOCK = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE, MapColor.BLACK).ticksRandomly().luminance(15)));
@RegistryEntry("unwarped_block")
public static final Block UNWARPED_BLOCK = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE, MapColor.BLACK).ticksRandomly().luminance(15)));
@RegistryEntry("unravelled_block")
public static final Block UNRAVELLED_BLOCK = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE, MapColor.BLACK).ticksRandomly().luminance(15)));
@RegistryEntry("unravelled_fabric")
public static final Block UNRAVELLED_FABRIC = register(new UnravelledFabricBlock(FabricBlockSettings.of(Material.STONE, MapColor.BLACK).ticksRandomly().luminance(15)));

View file

@ -42,9 +42,4 @@ public class UnravelledFabricBlock extends Block {
}
return state;
}
@Override
public boolean hasRandomTicks(BlockState state) {
return true;
}
}

View file

@ -37,7 +37,7 @@ public class DetachedRiftBlockEntityRenderer implements BlockEntityRenderer<Deta
}
}
// this.renderCrack(vcs.getBuffer(MyRenderLayer.CRACK), matrices, rift); TODO
this.renderCrack(vcs.getBuffer(MyRenderLayer.CRACK), matrices, rift);
}
private void renderCrack(VertexConsumer vc, MatrixStack matrices, DetachedRiftBlockEntity rift) {

View file

@ -22,13 +22,14 @@ public class MonolithModel extends EntityModel<MonolithEntity> {
private final ModelPart body;
public MonolithModel(EntityRendererFactory.Context context) {
super(MyRenderLayer::getMonolith);
this.body = context.getPart(ModEntityModelLayers.MONOLITH);
}
public static TexturedModelData getTexturedModelData() {
ModelData modelData = new ModelData();
ModelPartData modelPartData = modelData.getRoot();
modelPartData.addChild("body", ModelPartBuilder.create().uv(0, 0).cuboid(-23.5F, -23.5F, 0, 49.0F, 4.90F, 1.0F, false), ModelTransform.NONE);
modelPartData.addChild("body", ModelPartBuilder.create().uv(0, 0).cuboid(-23.5F, -23.5F, 0, 49.0F, 49.0F, 1.0F, false), ModelTransform.NONE);
return TexturedModelData.of(modelData, 102, 51);
}

View file

@ -6,18 +6,21 @@ import java.util.stream.Stream;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.render.entity.MobEntityRenderer;
import org.dimdev.dimdoors.entity.MonolithEntity;
import net.minecraft.client.render.RenderLayer;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.util.Identifier;
import org.jetbrains.annotations.Nullable;
@Environment(EnvType.CLIENT)
public class MonolithRenderer extends MobEntityRenderer<MonolithEntity, MonolithModel> {
public static final List<RenderLayer> MONOLITH_TEXTURES = Stream.of(
public static final List<Identifier> MONOLITH_TEXTURES = Stream.of(
new Identifier("dimdoors:textures/mob/monolith/monolith0.png"),
new Identifier("dimdoors:textures/mob/monolith/monolith1.png"),
new Identifier("dimdoors:textures/mob/monolith/monolith2.png"),
@ -37,23 +40,21 @@ public class MonolithRenderer extends MobEntityRenderer<MonolithEntity, Monolith
new Identifier("dimdoors:textures/mob/monolith/monolith16.png"),
new Identifier("dimdoors:textures/mob/monolith/monolith17.png"),
new Identifier("dimdoors:textures/mob/monolith/monolith18.png")
).map(MyRenderLayer::getMonolith).collect(Collectors.toList());
).collect(Collectors.toList());
private static MonolithModel INSTANCE;
public MonolithRenderer(EntityRendererFactory.Context ctx) {
super(ctx, INSTANCE = new MonolithModel(ctx), 0);
}
public static MonolithModel getInstance() {
return INSTANCE;
}
@Nullable
@Override
protected RenderLayer getRenderLayer(MonolithEntity entity, boolean showBody, boolean translucent, boolean showOutline) {
return MonolithRenderer.MONOLITH_TEXTURES.get(entity.getTextureState());
public void render(MonolithEntity mobEntity, float f, float g, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int i) {
super.render(mobEntity, f, g, matrixStack, vertexConsumerProvider, i);
}
@Override
@ -63,6 +64,6 @@ public class MonolithRenderer extends MobEntityRenderer<MonolithEntity, Monolith
@Override
public Identifier getTexture(MonolithEntity entity) {
return null;
return MonolithRenderer.MONOLITH_TEXTURES.get(entity.getTextureState());
}
}

View file

@ -46,6 +46,7 @@ public class MyRenderLayer extends RenderLayer {
RenderSystem.defaultBlendFunc();
})
)
.shader(RenderPhase.COLOR_SHADER)
.build(false)
);
@ -63,6 +64,7 @@ public class MyRenderLayer extends RenderLayer {
false)
)
// .alpha(Alpha.HALF_ALPHA)
.shader(RenderPhase.POSITION_COLOR_TEXTURE_SHADER)
.build(false)
);

View file

@ -2,7 +2,9 @@ package org.dimdev.dimdoors.item;
import java.util.Collections;
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.UnravelledFabricBlock;
import org.dimdev.dimdoors.entity.ModEntityTypes;
import org.dimdev.dimdoors.fluid.ModFluids;
import org.dimdev.dimdoors.rift.targets.RandomTarget;
@ -12,6 +14,8 @@ import org.dimdev.matrix.Registrar;
import org.dimdev.matrix.RegistryEntry;
import net.minecraft.block.Block;
import net.minecraft.block.MapColor;
import net.minecraft.block.Material;
import net.minecraft.entity.EquipmentSlot;
import net.minecraft.item.ArmorItem;
import net.minecraft.item.BlockItem;
@ -202,6 +206,17 @@ public final class ModItems {
@RegistryEntry("black_ancient_fabric")
public static final Item BLACK_ANCIENT_FABRIC = create(ModBlocks.BLACK_ANCIENT_FABRIC);
@RegistryEntry("decayed_block")
public static final Item DECAYED_BLOCK = create(ModBlocks.DECAYED_BLOCK);
@RegistryEntry("unfolded_block")
public static final Item UNFOLDED_BLOCK = create(ModBlocks.UNFOLDED_BLOCK);
@RegistryEntry("unwarped_block")
public static final Item UNWARPED_BLOCK = create(ModBlocks.UNWARPED_BLOCK);
@RegistryEntry("unravelled_block")
public static final Item UNRAVELLED_BLOCK = create(ModBlocks.UNRAVELLED_BLOCK);
@RegistryEntry("unravelled_fabric")
public static final Item UNRAVELLED_FABRIC = create(ModBlocks.UNRAVELLED_FABRIC);

View file

@ -2,13 +2,16 @@ package org.dimdev.dimdoors.item;
import java.util.List;
import net.fabricmc.api.ModInitializer;
import org.dimdev.dimdoors.DimensionalDoorsInitializer;
import org.dimdev.dimdoors.ModConfig;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.entity.DetachedRiftBlockEntity;
import org.dimdev.dimdoors.rift.targets.RiftReference;
import org.dimdev.dimdoors.sound.ModSoundEvents;
import org.dimdev.dimdoors.api.util.Location;
import org.dimdev.dimdoors.api.util.RotatedLocation;
import org.dimdev.dimdoors.world.ModDimensions;
import org.jetbrains.annotations.NotNull;
import net.minecraft.client.item.TooltipContext;
@ -23,6 +26,7 @@ import net.minecraft.sound.SoundCategory;
import net.minecraft.text.Text;
import net.minecraft.text.TranslatableText;
import net.minecraft.util.ActionResult;
import net.minecraft.util.Formatting;
import net.minecraft.util.Hand;
import net.minecraft.util.math.BlockPos;
import net.minecraft.util.math.Direction;
@ -65,6 +69,11 @@ public class RiftSignatureItem extends Item {
return ActionResult.SUCCESS;
}
if(ModDimensions.isPrivatePocketDimension(world) && !DimensionalDoorsInitializer.getConfig().getPocketsConfig().canUseRiftSignatureInPrivatePockets) {
player.sendMessage(new TranslatableText("tools.signature_blocked").formatted(Formatting.BLACK), true);
return ActionResult.FAIL;
}
RotatedLocation target = getSource(stack);
if (target == null) {

View file

@ -55,6 +55,13 @@ public class WorldRendererMixin {
}
}
@Inject(method = "renderClouds(Lnet/minecraft/client/util/math/MatrixStack;Lnet/minecraft/util/math/Matrix4f;FDDD)V", at = @At("HEAD"), cancellable = true)
public void beforeRendererCloud(MatrixStack matrices, Matrix4f matrix4f, float f, double d, double e, double g, CallbackInfo ci) {
if (ModDimensions.isLimboDimension(this.world) || ModDimensions.isPrivatePocketDimension(this.world) || ModDimensions.isPocketDimension(this.world)) {
ci.cancel();
}
}
@Unique
private void renderLimboSky(MatrixStack matrices) {
Matrix4f matrix4f = matrices.peek().getModel();

View file

@ -1,5 +1,6 @@
package org.dimdev.dimdoors.particle.client;
import org.dimdev.dimdoors.client.MonolithModel;
import org.dimdev.dimdoors.client.MonolithRenderer;
import org.jetbrains.annotations.Nullable;
@ -15,6 +16,7 @@ import net.minecraft.client.render.VertexConsumerProvider;
import net.minecraft.client.util.math.MatrixStack;
import net.minecraft.client.world.ClientWorld;
import net.minecraft.particle.DefaultParticleType;
import net.minecraft.util.Identifier;
import net.minecraft.util.math.Vec3f;
import net.fabricmc.api.EnvType;
@ -22,12 +24,10 @@ import net.fabricmc.api.Environment;
@Environment(EnvType.CLIENT)
public class MonolithParticle extends Particle {
private final RenderLayer layer;
public MonolithParticle(ClientWorld world, double x, double y, double z) {
super(world, x, y, z);
this.maxAge = 30;
this.layer = MonolithRenderer.MONOLITH_TEXTURES.get(14);
}
@Override
@ -39,7 +39,7 @@ public class MonolithParticle extends Particle {
matrices.scale(-1.0F, -1.0F, 1.0F);
matrices.translate(0.0D, -1.1009999513626099D, 1.5D);
VertexConsumerProvider.Immediate immediate = MinecraftClient.getInstance().getBufferBuilders().getEntityVertexConsumers();
VertexConsumer vertexConsumer2 = immediate.getBuffer(this.layer);
VertexConsumer vertexConsumer2 = immediate.getBuffer(MonolithRenderer.getInstance().getLayer(new Identifier("dimdoors:textures/mob/monolith/monolith14.png")));
MonolithRenderer.getInstance().render(matrices, vertexConsumer2, 0xf000f0, OverlayTexture.DEFAULT_UV, 1.0F, 1.0F, 1.0F, 1.0F);
immediate.draw();
}

View file

@ -89,7 +89,7 @@ public final class ModBiomes {
.depth(0.1f)
.downfall(0.0f)
.effects(new BiomeEffects.Builder()
.fogColor(0x000000)
.fogColor(0x404040)
.waterColor(0x101010)
.foliageColor(0)
.waterFogColor(0)
@ -108,11 +108,13 @@ public final class ModBiomes {
GenerationStep.Feature.UNDERGROUND_ORES,
ModFeatures.SOLID_STATIC_ORE
)
.feature(GenerationStep.Feature.UNDERGROUND_ORES,
ModFeatures.DECAYED_BLOCK_ORE)
.surfaceBuilder(
SurfaceBuilder.DEFAULT.withConfig(
new TernarySurfaceConfig(
ModBlocks.UNRAVELLED_FABRIC.getDefaultState(),
ModBlocks.UNRAVELLED_FABRIC.getDefaultState(),
ModBlocks.UNFOLDED_BLOCK.getDefaultState(),
ModBlocks.UNWARPED_BLOCK.getDefaultState(),
ModBlocks.ETERNAL_FLUID.getDefaultState()
)
))

View file

@ -18,6 +18,7 @@ import net.minecraft.world.biome.Biome;
import net.minecraft.world.gen.GenerationStep;
import net.minecraft.world.gen.YOffset;
import net.minecraft.world.gen.decorator.ChanceDecoratorConfig;
import net.minecraft.world.gen.decorator.Decoratable;
import net.minecraft.world.gen.decorator.Decorator;
import net.minecraft.world.gen.decorator.RangeDecoratorConfig;
import net.minecraft.world.gen.feature.ConfiguredFeature;
@ -42,6 +43,8 @@ public final class ModFeatures {
public static final ConfiguredFeature<?, ?> TWO_PILLARS_FEATURE;
public static final ConfiguredFeature<?, ?> LIMBO_GATEWAY_CONFIGURED_FEATURE;
public static final ConfiguredFeature<?, ?> SOLID_STATIC_ORE;
public static final ConfiguredFeature<?, ?> DECAYED_BLOCK_ORE;
@Deprecated public static final ConfiguredFeature<?, ?> ETERNAL_FLUID_LAKE = Feature.LAKE.configure(new SingleStateFeatureConfig(ModBlocks.ETERNAL_FLUID.getDefaultState())).decorate(ETERNAL_FLUID_LAKE_DECORATOR.configure(new ChanceDecoratorConfig(20)));
public static void init() {
@ -78,5 +81,7 @@ public final class ModFeatures {
TWO_PILLARS_FEATURE = SCHEMATIC_GATEWAY_FEATURE.configure(new SchematicGatewayFeatureConfig(SchematicGateway.ID_SCHEMATIC_MAP.inverse().get(TWO_PILLARS_GATEWAY))).decorate(ConfiguredFeatures.Decorators.SQUARE_TOP_SOLID_HEIGHTMAP.applyChance(gatewayChance));
LIMBO_GATEWAY_CONFIGURED_FEATURE = LIMBO_GATEWAY_FEATURE.configure(DefaultFeatureConfig.INSTANCE).decorate(ConfiguredFeatures.Decorators.SQUARE_TOP_SOLID_HEIGHTMAP.applyChance(gatewayChance));
SOLID_STATIC_ORE = Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(ModBlocks.UNRAVELLED_FABRIC), ModBlocks.SOLID_STATIC.getDefaultState(), 4)).range(new RangeDecoratorConfig(YOffset.getBottom(), YOffset.getTop())).repeat(3);
DECAYED_BLOCK_ORE = Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(ModBlocks.UNRAVELLED_FABRIC), ModBlocks.DECAYED_BLOCK.getDefaultState(), 64)).rangeOf(YOffset.fixed(0), YOffset.fixed(79)).repeat(2);
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "dimdoors:block/decayed_block"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "dimdoors:block/unfolded_block"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "dimdoors:block/unravelled_block"
}
}
}

View file

@ -0,0 +1,7 @@
{
"variants": {
"": {
"model": "dimdoors:block/unwarped_block"
}
}
}

View file

@ -44,6 +44,10 @@
"block.dimdoors.green_ancient_fabric": "Green Altered Ancient Fabric",
"block.dimdoors.red_ancient_fabric": "Red Altered Ancient Fabric",
"block.dimdoors.eternal_fabric": "Eternal Fabric",
"block.dimdoors.decayed_block": "Decayed Block",
"block.dimdoors.unfolded_block": "Unfolded Block",
"block.dimdoors.unwarped_block": "Unwarped Block",
"block.dimdoors.unravelled_block": "Unraveled Block",
"block.dimdoors.unravelled_fabric": "Unraveled Fabric",
"block.dimdoors.rift": "Rift Scar",
"block.dimdoors.eternal_fluid": "Eternal Fluid",
@ -154,6 +158,7 @@
"rifts.entrances.cannot_be_placed_on_rift": "This type of door can't be placed on a rift.",
"tools.rift_miss": "You can only use this item on a rift's core",
"tools.signature_blocked": "Usage of the signature was block",
"tools.target_became_block": "Failed, there is now a block at the stored location",
"text.autoconfig.dimdoors.category.general": "General Settings",

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:block/decayed_block" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:block/unfolded_block" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:block/unravelled_block" }
}

View file

@ -0,0 +1,4 @@
{
"parent": "block/cube_all",
"textures": { "all": "dimdoors:block/unwarped_block" }
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/decayed_block"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/unfolded_block"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/unravelled_block"
}

View file

@ -0,0 +1,3 @@
{
"parent": "dimdoors:block/unwarped_block"
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 528 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 431 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 417 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 527 B

After

Width:  |  Height:  |  Size: 370 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 439 B