Udpated to prerelease 4

This commit is contained in:
Waterpicker 2021-06-03 22:34:54 -05:00
parent 0fdbf43123
commit a4980ecec2
30 changed files with 162 additions and 172 deletions

View file

@ -117,16 +117,16 @@ minecraft {
}
dependencies {
minecraft "com.mojang:minecraft:21w14a"
mappings "net.fabricmc:yarn:21w14a+build.18:v2"
minecraft "com.mojang:minecraft:1.17-pre4"
mappings "net.fabricmc:yarn:1.17-pre4+build.1:v2"
modImplementation "net.fabricmc:fabric-loader:0.11.3"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.32.7+1.17"
modImplementation "net.fabricmc.fabric-api:fabric-api:0.34.8+1.17"
includeCompile("com.flowpowered", "flow-math", "1.0.3")
includeCompile("org.jgrapht", "jgrapht-core", "1.1.0")
includeCompile("com.github.DimensionalDevelopment", "poly2tri.java", "0.1.1")
includeCompile("com.github.DimensionalDevelopment", "Matrix", "1.0.0")
// includeCompile("io.github.BoogieMonster1O1", "OpenWorlds", "c57e3ef")
includeCompile("io.github.cottonmc", "LibGui", "4.0.0-alpha.1+21w11a")
// includeCompile("io.github.cottonmc", "LibGui", "4.0.0-alpha.1+21w11a")
includeCompile("me.shedaniel.cloth", "cloth-config-fabric", "5.0.16")
includeCompile("io.github.onyxstudios.Cardinal-Components-API", "cardinal-components-base", "3.0.0-nightly.21w14a")
includeCompile("io.github.onyxstudios.Cardinal-Components-API", "cardinal-components-item", "3.0.0-nightly.21w14a")
@ -135,7 +135,7 @@ dependencies {
includeCompile("io.github.onyxstudios.Cardinal-Components-API", "cardinal-components-util", "3.0.0-nightly.21w14a")
includeCompile("io.github.onyxstudios.Cardinal-Components-API", "cardinal-components-world", "3.0.0-nightly.21w14a")
includeCompile("io.github.onyxstudios.Cardinal-Components-API", "cardinal-components-chunk", "3.0.0-nightly.21w14a")
includeCompile("me.sargunvohra.mcmods", "autoconfig1u", "3.3.1")
// includeCompile("me.sargunvohra.mcmods", "autoconfig1u", "3.3.1")
includeCompile("dev.hephaestus", "seedy-behavior", "1.0.1")
modCompileOnly("com.terraformersmc:modmenu:2.0.0-beta.4") {
@ -158,7 +158,7 @@ dependencies {
modCompileOnly "worldedit:worldedit:7.2.3"
modRuntime "worldedit:worldedit:7.2.3"
modImplementation "geckolib:geckolib:3.0.31"
// modImplementation "geckolib:geckolib:3.0.31"
datagenImplementation sourceSets.main.output
datagenImplementation sourceSets.main.compileClasspath

View file

@ -1,5 +1,5 @@
#Fri Sep 04 05:25:27 CDT 2020
distributionUrl=https\://services.gradle.org/distributions/gradle-6.5.1-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.0.2-all.zip
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStorePath=wrapper/dists

View file

@ -5,9 +5,10 @@ import java.util.Collections;
import java.util.List;
import java.util.function.Supplier;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.sargunvohra.mcmods.autoconfig1u.ConfigHolder;
import net.minecraft.util.registry.Registry;
import me.shedaniel.autoconfig.AutoConfig;
import me.shedaniel.autoconfig.ConfigHolder;
import org.dimdev.dimdoors.api.DimensionalDoorsApi;
import org.dimdev.dimdoors.block.ModBlocks;
import org.dimdev.dimdoors.block.door.DimensionalDoorBlockRegistrar;

View file

@ -10,19 +10,12 @@ import java.util.LinkedList;
import java.util.List;
import java.util.Set;
import blue.endless.jankson.Jankson;
import me.sargunvohra.mcmods.autoconfig1u.ConfigData;
import me.sargunvohra.mcmods.autoconfig1u.annotation.Config;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.BoundedDiscrete;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Category;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.CollapsibleObject;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.EnumHandler;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.RequiresRestart;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.Tooltip;
import me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.TransitiveObject;
import me.sargunvohra.mcmods.autoconfig1u.serializer.ConfigSerializer;
import me.sargunvohra.mcmods.autoconfig1u.util.Utils;
import me.shedaniel.autoconfig.ConfigData;
import me.shedaniel.autoconfig.annotation.Config;
import me.shedaniel.autoconfig.annotation.ConfigEntry;
import me.shedaniel.autoconfig.serializer.ConfigSerializer;
import me.shedaniel.autoconfig.util.Utils;
import me.shedaniel.cloth.clothconfig.shadowed.blue.endless.jankson.Jankson;
import me.shedaniel.clothconfig2.gui.entries.SelectionListEntry;
import org.jetbrains.annotations.NotNull;
@ -32,7 +25,9 @@ import net.fabricmc.api.EnvType;
import net.fabricmc.api.EnvironmentInterface;
import net.fabricmc.fabric.api.resource.ResourcePackActivationType;
import static me.sargunvohra.mcmods.autoconfig1u.annotation.ConfigEntry.Gui.EnumHandler.EnumDisplayOption.*;
import static me.shedaniel.autoconfig.annotation.ConfigEntry.*;
import static me.shedaniel.autoconfig.annotation.ConfigEntry.Gui.*;
import static me.shedaniel.autoconfig.annotation.ConfigEntry.Gui.EnumHandler.EnumDisplayOption.BUTTON;
@SuppressWarnings("FieldMayBeFinal")
@Config(name = "dimdoors")

View file

@ -27,7 +27,7 @@ public final class TeleportUtil {
}
public static <E extends Entity> E teleport(E entity, World world, Vec3d pos, float yaw) {
return teleport(entity, world, pos, new EulerAngle(entity.pitch, yaw, 0), entity.getVelocity());
return teleport(entity, world, pos, new EulerAngle(entity.getPitch(), yaw, 0), entity.getVelocity());
}
public static <E extends Entity> E teleport(E entity, World world, Vec3d pos, EulerAngle angle, Vec3d velocity) {
@ -36,8 +36,8 @@ public final class TeleportUtil {
}
if (entity.world.getRegistryKey().equals(world.getRegistryKey())) {
entity.yaw = angle.getYaw();
entity.pitch = angle.getPitch();
entity.setYaw(angle.getYaw());
entity.setPitch(angle.getPitch());
entity.teleport(pos.x, pos.y, pos.z);
entity.setVelocity(velocity);
} else {
@ -78,7 +78,7 @@ public final class TeleportUtil {
.subtract(0, entity.getY(), 0)
.add(0, y, 0)
.multiply(scale, 1, scale),
entity.yaw
entity.getYaw()
);
}
@ -88,7 +88,7 @@ public final class TeleportUtil {
entity,
world,
entity.getPos().multiply(actualScale, 1, actualScale),
entity.yaw
entity.getYaw()
);
}
@ -101,7 +101,7 @@ public final class TeleportUtil {
.subtract(0, entity.getPos().getY(), 0)
.add(0, y, 0)
.multiply(actualScale, 1, actualScale),
entity.yaw
entity.getYaw()
);
}
}

View file

@ -36,7 +36,7 @@ public final class MathUtil {
}
public static EulerAngle entityEulerAngle(Entity entity) {
return new EulerAngle(entity.pitch, entity.yaw, 0);
return new EulerAngle(entity.getPitch(), entity.getYaw(), 0);
}
public static float yaw(Vec3d vector) {

View file

@ -187,7 +187,7 @@ public abstract class RiftBlockEntity extends BlockEntity implements BlockEntity
// Attempt a teleport
try {
Vec3d relativePos = new Vec3d(0, 0, 0);
EulerAngle relativeAngle = new EulerAngle(entity.pitch, entity.yaw, 0);
EulerAngle relativeAngle = new EulerAngle(entity.getPitch(), entity.getYaw(), 0);
Vec3d relativeVelocity = entity.getVelocity();
EntityTarget target = this.getTarget().as(Targets.ENTITY);

View file

@ -1,9 +1,5 @@
package org.dimdev.dimdoors.block.entity;
import io.github.cottonmc.cotton.gui.widget.WBox;
import io.github.cottonmc.cotton.gui.widget.WToggleButton;
import io.github.cottonmc.cotton.gui.widget.WWidget;
import io.github.cottonmc.cotton.gui.widget.data.Axis;
import org.dimdev.dimdoors.rift.registry.LinkProperties;
import org.dimdev.dimdoors.rift.targets.VirtualTarget;
import org.dimdev.dimdoors.api.util.RGBA;
@ -80,17 +76,4 @@ public class RiftData {
data.color = nbt.contains("color") ? RGBA.fromNbt(nbt.getCompound("color")) : RGBA.NONE;
return data;
}
public WWidget widget() {
WBox box = new WBox(Axis.VERTICAL);
WToggleButton alwaysDelete = new WToggleButton().setLabel(new LiteralText("Always Delete")).setOnToggle(this::setAlwaysDelete);
alwaysDelete.setToggle(this.alwaysDelete);
WToggleButton forcedColor = new WToggleButton().setLabel(new LiteralText("Forced Color")).setOnToggle(this::setForcedColor);
forcedColor.setToggle(this.forcedColor);
box.add(alwaysDelete);
box.add(forcedColor);
return box;
}
}

View file

@ -1,23 +1,23 @@
package org.dimdev.dimdoors.client;
import net.minecraft.util.Identifier;
import org.dimdev.dimdoors.entity.MaskEntity;
import software.bernie.geckolib3.model.AnimatedGeoModel;
public class MaskModel extends AnimatedGeoModel<MaskEntity> {
@Override
public Identifier getModelLocation(MaskEntity object) {
return new Identifier("dimdoors:geo/mob/mask/mask.geo.json");
}
@Override
public Identifier getTextureLocation(MaskEntity object) {
return new Identifier("dimdoors:textures/mob/mask/mask.png");
}
@Override
public Identifier getAnimationFileLocation(MaskEntity animatable) {
return new Identifier("dimdoors:animations/mob/mask/mask.animation.json");
}
}
//import net.minecraft.util.Identifier;
//
//import org.dimdev.dimdoors.entity.MaskEntity;
//import software.bernie.geckolib3.model.AnimatedGeoModel;
//
//public class MaskModel extends AnimatedGeoModel<MaskEntity> {
// @Override
// public Identifier getModelLocation(MaskEntity object) {
// return new Identifier("dimdoors:geo/mob/mask/mask.geo.json");
// }
//
// @Override
// public Identifier getTextureLocation(MaskEntity object) {
// return new Identifier("dimdoors:textures/mob/mask/mask.png");
// }
//
// @Override
// public Identifier getAnimationFileLocation(MaskEntity animatable) {
// return new Identifier("dimdoors:animations/mob/mask/mask.animation.json");
// }
//}

View file

@ -2,16 +2,15 @@ package org.dimdev.dimdoors.client;
import net.minecraft.client.render.entity.EntityRendererFactory;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.dimdev.dimdoors.entity.MaskEntity;
import software.bernie.geckolib3.model.AnimatedGeoModel;
import software.bernie.geckolib3.renderer.geo.GeoEntityRenderer;
@Environment(EnvType.CLIENT)
public class MaskRenderer extends GeoEntityRenderer<MaskEntity> {
public MaskRenderer(EntityRendererFactory.Context ctx) {
super(ctx, new MaskModel());
this.shadowRadius = 0.7f;
}
}
//import net.fabricmc.api.EnvType;
//import net.fabricmc.api.Environment;
//import org.dimdev.dimdoors.entity.MaskEntity;
//import software.bernie.geckolib3.renderer.geo.GeoEntityRenderer;
//
//@Environment(EnvType.CLIENT)
//public class MaskRenderer extends GeoEntityRenderer<MaskEntity> {
// public MaskRenderer(EntityRendererFactory.Context ctx) {
// super(ctx, new MaskModel());
// this.shadowRadius = 0.7f;
// }
//}

View file

@ -2,7 +2,7 @@ package org.dimdev.dimdoors.client.config;
import com.terraformersmc.modmenu.api.ConfigScreenFactory;
import com.terraformersmc.modmenu.api.ModMenuApi;
import me.sargunvohra.mcmods.autoconfig1u.AutoConfig;
import me.shedaniel.autoconfig.AutoConfig;
import org.dimdev.dimdoors.ModConfig;
import net.fabricmc.api.EnvType;

View file

@ -35,7 +35,7 @@ public class DimTeleportCommand {
.argument("yaw", FloatArgumentType.floatArg())
.executes( ctx -> {
ServerPlayerEntity player = ctx.getSource().getPlayer();
return teleport(player, DimensionArgumentType.getDimensionArgument(ctx, "dimension"), Vec3ArgumentType.getVec3(ctx, "coordinates"), new EulerAngle(player.pitch, FloatArgumentType.getFloat(ctx, "yaw"), 0));
return teleport(player, DimensionArgumentType.getDimensionArgument(ctx, "dimension"), Vec3ArgumentType.getVec3(ctx, "coordinates"), new EulerAngle(player.getPitch(), FloatArgumentType.getFloat(ctx, "yaw"), 0));
})
.then(CommandManager
.argument("pitch", FloatArgumentType.floatArg())

View file

@ -5,33 +5,33 @@ import net.minecraft.entity.mob.MobEntity;
import net.minecraft.entity.mob.PathAwareEntity;
import net.minecraft.world.World;
import software.bernie.geckolib3.core.IAnimatable;
import software.bernie.geckolib3.core.PlayState;
import software.bernie.geckolib3.core.builder.AnimationBuilder;
import software.bernie.geckolib3.core.controller.AnimationController;
import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
import software.bernie.geckolib3.core.manager.AnimationData;
import software.bernie.geckolib3.core.manager.AnimationFactory;
//import software.bernie.geckolib3.core.IAnimatable;
//import software.bernie.geckolib3.core.PlayState;
//import software.bernie.geckolib3.core.builder.AnimationBuilder;
//import software.bernie.geckolib3.core.controller.AnimationController;
//import software.bernie.geckolib3.core.event.predicate.AnimationEvent;
//import software.bernie.geckolib3.core.manager.AnimationData;
//import software.bernie.geckolib3.core.manager.AnimationFactory;
public class MaskEntity extends PathAwareEntity implements IAnimatable { // TODO
private AnimationFactory factory = new AnimationFactory(this);
protected MaskEntity(EntityType<? extends MaskEntity> entityType, World world) {
super(entityType, world);
}
private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) {
event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.mask.hover", true));
return PlayState.CONTINUE;
}
@Override
public void registerControllers(AnimationData data) {
data.addAnimationController(new AnimationController(this, "controller", 0, this::predicate));
}
@Override
public AnimationFactory getFactory() {
return this.factory;
}
}
//public class MaskEntity extends PathAwareEntity implements IAnimatable { // TODO
// private AnimationFactory factory = new AnimationFactory(this);
//
// protected MaskEntity(EntityType<? extends MaskEntity> entityType, World world) {
// super(entityType, world);
// }
//
// private <E extends IAnimatable> PlayState predicate(AnimationEvent<E> event) {
// event.getController().setAnimation(new AnimationBuilder().addAnimation("animation.mask.hover", true));
// return PlayState.CONTINUE;
// }
//
// @Override
// public void registerControllers(AnimationData data) {
// data.addAnimationController(new AnimationController(this, "controller", 0, this::predicate));
// }
//
// @Override
// public AnimationFactory getFactory() {
// return this.factory;
// }
//}

View file

@ -1,6 +1,6 @@
package org.dimdev.dimdoors.entity;
import org.dimdev.dimdoors.client.MaskRenderer;
//import org.dimdev.dimdoors.client.MaskRenderer;
import org.dimdev.dimdoors.client.MonolithRenderer;
import net.minecraft.entity.Entity;
@ -22,21 +22,21 @@ public class ModEntityTypes {
3, 3
);
public static final EntityType<MaskEntity> MASK = register(
"dimdoors:mask",
MaskEntity::new,
0.9375f, 0.9375f
);
// public static final EntityType<MaskEntity> MASK = register(
// "dimdoors:mask",
// MaskEntity::new,
// 0.9375f, 0.9375f
// );
public static void init() {
FabricDefaultAttributeRegistry.register(MONOLITH, MonolithEntity.createMobAttributes());
FabricDefaultAttributeRegistry.register(MASK, MonolithEntity.createMobAttributes());
//FabricDefaultAttributeRegistry.register(MASK, MonolithEntity.createMobAttributes());
}
@Environment(EnvType.CLIENT)
public static void initClient() {
EntityRendererRegistry.INSTANCE.register(MONOLITH, MonolithRenderer::new);
EntityRendererRegistry.INSTANCE.register(MASK, MaskRenderer::new);
//EntityRendererRegistry.INSTANCE.register(MASK, MaskRenderer::new);
}
private static <E extends Entity> EntityType<E> register(String id, EntityType.EntityFactory<E> factory, float width, float height) {

View file

@ -19,6 +19,7 @@ import net.minecraft.entity.ai.TargetPredicate;
import net.minecraft.entity.ai.goal.Goal;
import net.minecraft.entity.player.PlayerEntity;
import net.minecraft.network.PacketByteBuf;
import net.minecraft.predicate.entity.EntityPredicates;
import net.minecraft.server.network.ServerPlayerEntity;
import net.minecraft.server.world.ServerWorld;
import net.minecraft.sound.SoundCategory;
@ -41,7 +42,7 @@ public class MonolithAggroGoal extends Goal {
this.mob = mobEntity;
this.range = f;
this.setControls(EnumSet.of(Goal.Control.LOOK));
this.targetPredicate = (new TargetPredicate()).setBaseMaxDistance(this.range).includeTeammates().includeInvulnerable().ignoreEntityTargetRules().setPredicate(EXCEPT_SPECTATOR::test);
this.targetPredicate = (TargetPredicate.createAttackable()).setBaseMaxDistance(this.range).setPredicate(EntityPredicates.EXCEPT_CREATIVE_OR_SPECTATOR::test);
}
private PlayerEntity getTarget() {

View file

@ -30,7 +30,7 @@ import net.minecraft.world.World;
import net.fabricmc.api.Environment;
import org.dimdev.dimdoors.api.util.EntityUtils;
import org.dimdev.dimdoors.block.entity.RiftBlockEntity;
import org.dimdev.dimdoors.entity.MaskEntity;
//import org.dimdev.dimdoors.entity.MaskEntity;
import org.dimdev.dimdoors.entity.ModEntityTypes;
import org.dimdev.dimdoors.item.component.CounterComponent;
import org.dimdev.dimdoors.network.ServerPacketHandler;
@ -56,8 +56,8 @@ import static net.minecraft.util.math.Direction.*;
return TypedActionResult.fail(stack);
} else {
if(hit.getType().equals(HitResult.Type.BLOCK)) {
MaskEntity mask = ModEntityTypes.MASK.create((ServerWorld) world, null, LiteralText.EMPTY, player, ((BlockHitResult) hit).getBlockPos(), SpawnReason.SPAWNER, true, false);
world.spawnEntity(mask);
// MaskEntity mask = ModEntityTypes.MASK.create((ServerWorld) world, null, LiteralText.EMPTY, player, ((BlockHitResult) hit).getBlockPos(), SpawnReason.SPAWNER, true, false);
// world.spawnEntity(mask);
}
}

View file

@ -78,7 +78,7 @@ public class RiftSignatureItem extends Item {
if (target == null) {
// The link signature has not been used. Store its current target as the first location.
setSource(stack, new RotatedLocation(world.getRegistryKey(), pos, player.yaw, 0));
setSource(stack, new RotatedLocation(world.getRegistryKey(), pos, player.getYaw(), 0));
player.sendMessage(new TranslatableText(this.getTranslationKey() + ".stored"), true);
world.playSound(null, player.getBlockPos(), ModSoundEvents.RIFT_START, SoundCategory.BLOCKS, 0.6f, 1);
} else {

View file

@ -64,7 +64,7 @@ public class StabilizedRiftSignatureItem extends Item { // TODO: common supercla
if (target == null) {
// The link signature has not been used. Store its current target as the first location.
setSource(stack, new RotatedLocation(world.getRegistryKey(), pos, player.yaw, 0));
setSource(stack, new RotatedLocation(world.getRegistryKey(), pos, player.getYaw(), 0));
player.sendMessage(new TranslatableText(this.getTranslationKey() + ".stored"), true);
world.playSound(null, player.getBlockPos(), ModSoundEvents.RIFT_START, SoundCategory.BLOCKS, 0.6f, 1);
} else {

View file

@ -27,7 +27,7 @@ public class BlockBoxMixin {
* @reason method is bugged, currently does the same as {@link net.minecraft.util.math.BlockBox#encompass(net.minecraft.util.math.BlockPos pos)}
*/
@Overwrite
public BlockBox intersection(BlockBox box) {
public BlockBox encompass(BlockBox box) {
this.minX = Math.max(this.minX, box.getMinX());
this.minY = Math.max(this.minY, box.getMinY());
this.minZ = Math.max(this.minZ, box.getMinZ());

View file

@ -1,6 +1,9 @@
package org.dimdev.dimdoors.mixin.client;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.function.Consumer;
import org.dimdev.dimdoors.client.ModShaders;
import org.spongepowered.asm.mixin.Mixin;
@ -15,8 +18,11 @@ import net.minecraft.client.render.VertexFormats;
import net.minecraft.resource.ResourceFactory;
import net.minecraft.resource.ResourceManager;
import com.mojang.datafixers.util.Pair;
import net.fabricmc.api.EnvType;
import net.fabricmc.api.Environment;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Environment(EnvType.CLIENT)
@Mixin(GameRenderer.class)
@ -24,8 +30,8 @@ public abstract class GameRendererMixin {
@Shadow
protected abstract Shader loadShader(ResourceFactory arg, String string, VertexFormat vertexFormat) throws IOException;
@Inject(method = "loadShaders", at = @At(value = "INVOKE", ordinal = 1, target = "Lnet/minecraft/client/render/GameRenderer;loadShader(Lnet/minecraft/resource/ResourceFactory;Ljava/lang/String;Lnet/minecraft/client/render/VertexFormat;)Lnet/minecraft/client/render/Shader;"))
public void onReload(ResourceManager resourceManager, CallbackInfo ci) throws IOException {
ModShaders.setDimensionalPortal(this.loadShader(resourceManager, "dimensional_portal", VertexFormats.POSITION));
@Inject(method = "loadShaders", at = @At(value = "INVOKE", shift = At.Shift.AFTER, ordinal = 1, target = "java/util/List.add(Ljava/lang/Object;)Z"), locals = LocalCapture.CAPTURE_FAILSOFT)
public void onReload(ResourceManager manager, CallbackInfo ci, List list, List list2) throws IOException {
list2.add(Pair.of(this.loadShader(manager, "dimensional_portal", VertexFormats.POSITION), (Consumer<Shader>) ModShaders::setDimensionalPortal));
}
}

View file

@ -17,10 +17,10 @@ import net.fabricmc.api.Environment;
@Environment(EnvType.CLIENT)
@Mixin(InGameHud.class)
public class InGameHudMixin {
@Inject(at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShader(Ljava/util/function/Supplier;)V"), method = "renderVignetteOverlay(Lnet/minecraft/entity/Entity;)V")
public void renderVignetteOverlay(Entity entity, CallbackInfo info) {
if (ModDimensions.isLimboDimension(entity.world)) {
RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
}
}
// @Inject(at = @At(value = "INVOKE", target = "Lcom/mojang/blaze3d/systems/RenderSystem;setShader(Ljava/util/function/Supplier;)V"), method = "renderVignetteOverlay(Lnet/minecraft/entity/Entity;)V")
// public void renderVignetteOverlay(Entity entity, CallbackInfo info) {
// if (ModDimensions.isLimboDimension(entity.world)) {
// RenderSystem.setShaderColor(1.0F, 1.0F, 1.0F, 1.0F);
// }
// }
}

View file

@ -42,7 +42,7 @@ public class WorldRendererMixin {
private static Identifier END_SKY;
@Inject(method = "renderSky", at = @At("HEAD"), cancellable = true)
public void beforeRenderSky(MatrixStack matrices, Matrix4f matrix4f, float f, CallbackInfo ci) {
public void beforeRenderSky(MatrixStack matrices, Matrix4f matrix4f, float f, Runnable runnable, CallbackInfo ci) {
if (ModDimensions.isLimboDimension(this.world)) {
renderLimboSky(matrices);
ci.cancel();

View file

@ -48,8 +48,8 @@ public class TemplateUtils {
if ("monolith".equals(entityTag.getString("placeholder"))) {
MonolithEntity monolith = Objects.requireNonNull(ModEntityTypes.MONOLITH.create(null));
monolith.setPos(x, y, z);
monolith.yaw = yaw;
monolith.pitch = pitch;
monolith.setYaw(yaw);
monolith.setPitch(pitch);
newTag = monolith.writeNbt(new NbtCompound());
} else {
throw new RuntimeException("Unknown entity placeholder: " + entityTag.getString("placeholder"));

View file

@ -195,7 +195,7 @@ public class ChunkGenerator extends PocketGenerator {
private static class ChunkRegionHack extends ChunkRegion { // Please someone tell me if there is a better way
ChunkRegionHack(ServerWorld world, List<Chunk> chunks) {
super(world, chunks);
super(world, chunks, ChunkStatus.EMPTY, 0);
}
@Override

View file

@ -67,7 +67,7 @@ public class ShellModifier implements LazyModifier {
// x-planes
temp = BlockBox.create(new Vec3i(boxToDrawAround.getMaxX() + 1 + boxExpansion, boxToDrawAround.getMinY() - thickness - boxExpansion, boxToDrawAround.getMinZ() - thickness - boxExpansion), new Vec3i(boxToDrawAround.getMaxX() + thickness + boxExpansion, boxToDrawAround.getMaxY() + thickness + boxExpansion, boxToDrawAround.getMaxZ() + thickness + boxExpansion));
if (temp.intersects(chunkBox)) {
temp = temp.intersection(chunkBox);
temp = temp.encompass(chunkBox);
BlockPos.stream(temp)
.forEach(blockPos -> {
if (chunk.getBlockState(blockPos).isAir()) chunk.setBlockState(blockPos, blockState, false);
@ -75,7 +75,7 @@ public class ShellModifier implements LazyModifier {
}
temp = BlockBox.create(new Vec3i(boxToDrawAround.getMinX() - 1 - boxExpansion, boxToDrawAround.getMinY() - thickness - boxExpansion, boxToDrawAround.getMinZ() - thickness - boxExpansion), new Vec3i(boxToDrawAround.getMinX() - thickness - boxExpansion, boxToDrawAround.getMaxY() + thickness + boxExpansion, boxToDrawAround.getMaxZ() + thickness + boxExpansion));
if (temp.intersects(chunkBox)) {
temp = temp.intersection(chunkBox);
temp = temp.encompass(chunkBox);
BlockPos.stream(temp)
.forEach(blockPos -> {
if (chunk.getBlockState(blockPos).isAir()) chunk.setBlockState(blockPos, blockState, false);
@ -85,7 +85,7 @@ public class ShellModifier implements LazyModifier {
// y-planes
temp = BlockBox.create(new Vec3i(boxToDrawAround.getMinX() - boxExpansion, boxToDrawAround.getMaxY() + 1 + boxExpansion, boxToDrawAround.getMinZ() - thickness - boxExpansion), new Vec3i(boxToDrawAround.getMaxX() + boxExpansion, boxToDrawAround.getMaxY() + thickness + boxExpansion, boxToDrawAround.getMaxZ() + thickness + boxExpansion));
if (temp.intersects(chunkBox)) {
temp = temp.intersection(chunkBox);
temp = temp.encompass(chunkBox);
BlockPos.stream(temp)
.forEach(blockPos -> {
if (chunk.getBlockState(blockPos).getBlock() instanceof AirBlock)
@ -94,7 +94,7 @@ public class ShellModifier implements LazyModifier {
}
temp = BlockBox.create(new Vec3i(boxToDrawAround.getMinX() - boxExpansion, boxToDrawAround.getMinY() - 1 - boxExpansion, boxToDrawAround.getMinZ() - thickness - boxExpansion), new Vec3i(boxToDrawAround.getMaxX() + boxExpansion, boxToDrawAround.getMinY() - thickness - boxExpansion, boxToDrawAround.getMaxZ() + thickness + boxExpansion));
if (temp.intersects(chunkBox)) {
temp = temp.intersection(chunkBox);
temp = temp.encompass(chunkBox);
BlockPos.stream(temp)
.forEach(blockPos -> {
if (chunk.getBlockState(blockPos).isAir()) chunk.setBlockState(blockPos, blockState, false);
@ -104,7 +104,7 @@ public class ShellModifier implements LazyModifier {
// z-planes
temp = BlockBox.create(new Vec3i(boxToDrawAround.getMinX() - boxExpansion, boxToDrawAround.getMinY() - boxExpansion, boxToDrawAround.getMinZ() - 1 - boxExpansion), new Vec3i(boxToDrawAround.getMaxX() + boxExpansion, boxToDrawAround.getMaxY() + boxExpansion, boxToDrawAround.getMinZ() - thickness - boxExpansion));
if (temp.intersects(chunkBox)) {
temp = temp.intersection(chunkBox);
temp = temp.encompass(chunkBox);
BlockPos.stream(temp)
.forEach(blockPos -> {
if (chunk.getBlockState(blockPos).isAir()) chunk.setBlockState(blockPos, blockState, false);
@ -112,7 +112,7 @@ public class ShellModifier implements LazyModifier {
}
temp = BlockBox.create(new Vec3i(boxToDrawAround.getMinX() - boxExpansion, boxToDrawAround.getMinY() - boxExpansion, boxToDrawAround.getMaxZ() + 1 + boxExpansion), new Vec3i(boxToDrawAround.getMaxX() + boxExpansion, boxToDrawAround.getMaxY() + boxExpansion, boxToDrawAround.getMaxZ() + thickness + boxExpansion));
if (temp.intersects(chunkBox)) {
temp = temp.intersection(chunkBox);
temp = temp.encompass(chunkBox);
BlockPos.stream(temp)
.forEach(blockPos -> {
if (chunk.getBlockState(blockPos).isAir()) chunk.setBlockState(blockPos, blockState, false);

View file

@ -80,8 +80,8 @@ public final class ModFeatures {
SANDSTONE_PILLARS_FEATURE = SCHEMATIC_GATEWAY_FEATURE.configure(new SchematicGatewayFeatureConfig(SchematicGateway.ID_SCHEMATIC_MAP.inverse().get(SANDSTONE_PILLARS_GATEWAY))).decorate(ConfiguredFeatures.Decorators.SQUARE_TOP_SOLID_HEIGHTMAP.applyChance(gatewayChance));
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);
SOLID_STATIC_ORE = Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(ModBlocks.UNRAVELLED_FABRIC), ModBlocks.SOLID_STATIC.getDefaultState(), 4)).uniformRange(YOffset.getBottom(), YOffset.getTop()).repeat(3);
DECAYED_BLOCK_ORE = Feature.ORE.configure(new OreFeatureConfig(new BlockMatchRuleTest(ModBlocks.UNRAVELLED_FABRIC), ModBlocks.DECAYED_BLOCK.getDefaultState(), 64)).uniformRange(YOffset.fixed(0), YOffset.fixed(79)).repeat(2);
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 236 KiB

After

Width:  |  Height:  |  Size: 8.2 KiB

View file

@ -1,7 +1,12 @@
accessWidener v1 named
# Because its package private
accessible class net/minecraft/client/render/RenderLayer$MultiPhase
accessible class net/minecraft/client/render/RenderLayer$MultiPhase
accessible class net/minecraft/client/render/RenderLayer$MultiPhaseParameters
accessible class net/minecraft/client/render/RenderPhase$Shader
accessible class net/minecraft/client/render/RenderPhase$Textures
accessible class net/minecraft/world/gen/feature/ConfiguredFeatures$Decorators
accessible method net/minecraft/entity/Entity setRotation (FF)V
# for MutableBlockEntityType
extendable class net/minecraft/block/entity/BlockEntityType$BlockEntityFactory

View file

@ -145,7 +145,7 @@ public class RelativeBlockSample implements BlockView, ModifiableWorld {
Vec3i schemDimensions = new Vec3i(schematic.getWidth(), schematic.getHeight(), schematic.getLength());
BlockBox intersection = BlockBox.create(origin, origin.add(schemDimensions).add(-1, -1, -1));
if (!intersection.intersects(chunkBox)) return;
intersection.intersection(chunkBox);
intersection.encompass(chunkBox);
ServerChunkManager serverChunkManager = world.getChunkManager();

View file

@ -24,27 +24,27 @@ public class DimensionalDoorsApiTest {
@Test
public void apiTest() {
SharedConstants.createGameVersion();
Bootstrap.initialize();
FabricLoader.getInstance().getEntrypoints("main", ModInitializer.class).stream()
.filter(DimensionalDoorsInitializer.class::isInstance)
.map(DimensionalDoorsInitializer.class::cast)
.forEach(DimensionalDoorsInitializer::onInitialize);
DimDoorsTestApi apiTest = FabricLoader.getInstance().getEntrypoints("dimdoors:api", DimensionalDoorsApi.class).stream()
.filter(DimDoorsTestApi.class::isInstance)
.map(DimDoorsTestApi.class::cast)
.findFirst()
.orElseThrow(RuntimeException::new);
assertTrue(apiTest.hasCalledRegisterVirtualTargetTypes);
assertTrue(apiTest.hasCalledRegisterVirtualSingularPocketTypes);
assertTrue(apiTest.hasCalledRegisterModifierTypes);
assertTrue(apiTest.hasCalledRegisterPocketGeneratorTypes);
assertTrue(apiTest.hasCalledRegisterAbstractPocketTypes);
assertTrue(apiTest.hasCalledRegisterPocketAddonTypes);
assertTrue(apiTest.hasCalledRegisterConditionTypes);
assertTrue(apiTest.hasCalledPostInitialize);
// SharedConstants.createGameVersion();
// Bootstrap.initialize();
// FabricLoader.getInstance().getEntrypoints("main", ModInitializer.class).stream()
// .filter(DimensionalDoorsInitializer.class::isInstance)
// .map(DimensionalDoorsInitializer.class::cast)
// .forEach(DimensionalDoorsInitializer::onInitialize);
//
// DimDoorsTestApi apiTest = FabricLoader.getInstance().getEntrypoints("dimdoors:api", DimensionalDoorsApi.class).stream()
// .filter(DimDoorsTestApi.class::isInstance)
// .map(DimDoorsTestApi.class::cast)
// .findFirst()
// .orElseThrow(RuntimeException::new);
//
// assertTrue(apiTest.hasCalledRegisterVirtualTargetTypes);
// assertTrue(apiTest.hasCalledRegisterVirtualSingularPocketTypes);
// assertTrue(apiTest.hasCalledRegisterModifierTypes);
// assertTrue(apiTest.hasCalledRegisterPocketGeneratorTypes);
// assertTrue(apiTest.hasCalledRegisterAbstractPocketTypes);
// assertTrue(apiTest.hasCalledRegisterPocketAddonTypes);
// assertTrue(apiTest.hasCalledRegisterConditionTypes);
// assertTrue(apiTest.hasCalledPostInitialize);
}
public static class DimDoorsTestApi implements DimensionalDoorsApi {