25w45a
This commit is contained in:
1 parent
2ddfdddb89
commit
0a146e1d4e
36 files changed
+115
-115
No files matched your search
@@ -27,6 +27,6 @@ public class EntityTools
|
||||
float u = e.getYRot() * 0.017453292F; // yaw
|
||||
e.setDeltaMovement(e.getDeltaMovement().add((-Mth.sin(g) * 0.2F), 0.0D, (Mth.cos(u) * 0.2F)));
|
||||
}
|
||||
e.hasImpulse = true;
|
||||
e.needsSync = true;
|
||||
}
|
||||
}
|
||||
@@ -9,7 +9,7 @@ import carpet.script.value.ValueConversions;
|
||||
import com.google.common.collect.ImmutableList;
|
||||
import com.mojang.datafixers.util.Pair;
|
||||
import com.mojang.serialization.DynamicOps;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.commands.Commands;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.Registry;
|
||||
|
||||
@@ -23,7 +23,7 @@ import net.minecraft.core.registries.Registries;
|
||||
import net.minecraft.data.worldgen.Pools;
|
||||
import net.minecraft.data.worldgen.ProcessorLists;
|
||||
import net.minecraft.data.worldgen.placement.PlacementUtils;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.server.level.ServerChunkCache;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.tags.BiomeTags;
|
||||
@@ -75,7 +75,7 @@ public class FeatureGenerator
|
||||
{
|
||||
return custom.apply(world).plop(world, pos);
|
||||
}
|
||||
ResourceLocation id = ResourceLocation.parse(featureName);
|
||||
Identifier id = Identifier.parse(featureName);
|
||||
Structure structure = world.registryAccess().lookupOrThrow(Registries.STRUCTURE).getValue(id);
|
||||
if (structure != null)
|
||||
{
|
||||
@@ -129,7 +129,7 @@ public class FeatureGenerator
|
||||
@Nullable
|
||||
public static Structure resolveConfiguredStructure(String name, ServerLevel world, BlockPos pos)
|
||||
{
|
||||
ResourceLocation id = ResourceLocation.parse(name);
|
||||
Identifier id = Identifier.parse(name);
|
||||
Structure configuredStructureFeature = world.registryAccess().lookupOrThrow(Registries.STRUCTURE).getValue(id);
|
||||
if (configuredStructureFeature != null)
|
||||
{
|
||||
|
||||
@@ -4,8 +4,8 @@ import carpet.script.exception.InternalExpressionException;
|
||||
|
||||
import java.util.Locale;
|
||||
|
||||
import net.minecraft.ResourceLocationException;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.IdentifierException;
|
||||
import net.minecraft.resources.Identifier;
|
||||
|
||||
public class InputValidator
|
||||
{
|
||||
@@ -19,13 +19,13 @@ public class InputValidator
|
||||
return simplified;
|
||||
}
|
||||
|
||||
public static ResourceLocation identifierOf(String string)
|
||||
public static Identifier identifierOf(String string)
|
||||
{
|
||||
try
|
||||
{
|
||||
return ResourceLocation.parse(string);
|
||||
return Identifier.parse(string);
|
||||
}
|
||||
catch (ResourceLocationException iie)
|
||||
catch (IdentifierException iie)
|
||||
{
|
||||
throw new InternalExpressionException("Incorrect identifier format '" + string + "': " + iie.getMessage());
|
||||
}
|
||||
|
||||
@@ -2,7 +2,7 @@ package carpet.script.utils;
|
||||
|
||||
import net.minecraft.core.registries.BuiltInRegistries;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.util.context.ContextMap;
|
||||
import net.minecraft.world.item.crafting.Recipe;
|
||||
import net.minecraft.world.item.crafting.RecipeManager;
|
||||
@@ -16,7 +16,7 @@ import java.util.List;
|
||||
|
||||
public class RecipeHelper
|
||||
{
|
||||
public static List<Recipe<?>> getRecipesForOutput(RecipeManager recipeManager, RecipeType<?> type, ResourceLocation id, Level level)
|
||||
public static List<Recipe<?>> getRecipesForOutput(RecipeManager recipeManager, RecipeType<?> type, Identifier id, Level level)
|
||||
{
|
||||
List<Recipe<?>> results = new ArrayList<>();
|
||||
|
||||
@@ -28,7 +28,7 @@ public class RecipeHelper
|
||||
for (RecipeDisplay recipeDisplay : r.value().display())
|
||||
{
|
||||
recipeDisplay.result().resolveForStacks(context).forEach(stack -> {
|
||||
if (BuiltInRegistries.ITEM.wrapAsHolder(stack.getItem()).unwrapKey().map(ResourceKey::location).orElseThrow(IllegalStateException::new).equals(id))
|
||||
if (BuiltInRegistries.ITEM.wrapAsHolder(stack.getItem()).unwrapKey().map(ResourceKey::identifier).orElseThrow(IllegalStateException::new).equals(id))
|
||||
{
|
||||
results.add(r.value());
|
||||
}
|
||||
@@ -39,7 +39,7 @@ public class RecipeHelper
|
||||
return results;
|
||||
}
|
||||
|
||||
public static List<Recipe<?>> getRecipesForOutput(RecipeManager recipeManager, ResourceLocation id, Level level)
|
||||
public static List<Recipe<?>> getRecipesForOutput(RecipeManager recipeManager, Identifier id, Level level)
|
||||
{
|
||||
List<Recipe<?>> results = new ArrayList<>();
|
||||
|
||||
@@ -48,7 +48,7 @@ public class RecipeHelper
|
||||
for (RecipeDisplay recipeDisplay : r.value().display())
|
||||
{
|
||||
recipeDisplay.result().resolveForStacks(context).forEach(stack -> {
|
||||
if (BuiltInRegistries.ITEM.wrapAsHolder(stack.getItem()).unwrapKey().map(ResourceKey::location).orElseThrow(IllegalStateException::new).equals(id))
|
||||
if (BuiltInRegistries.ITEM.wrapAsHolder(stack.getItem()).unwrapKey().map(ResourceKey::identifier).orElseThrow(IllegalStateException::new).equals(id))
|
||||
{
|
||||
results.add(r.value());
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ import net.minecraft.nbt.NumericTag;
|
||||
import net.minecraft.network.chat.Component;
|
||||
import net.minecraft.resources.RegistryOps;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -119,7 +119,7 @@ public class ShapeDispatcher
|
||||
}
|
||||
params = ShapeDispatcher.parseParams(paramList);
|
||||
}
|
||||
params.putIfAbsent("dim", new StringValue(world.dimension().location().toString()));
|
||||
params.putIfAbsent("dim", new StringValue(world.dimension().identifier().toString()));
|
||||
params.putIfAbsent("duration", duration);
|
||||
|
||||
if (params.containsKey("player"))
|
||||
@@ -395,7 +395,7 @@ public class ShapeDispatcher
|
||||
|
||||
key = 0;
|
||||
followEntity = -1;
|
||||
shapeDimension = ResourceKey.create(Registries.DIMENSION, ResourceLocation.parse(options.get("dim").getString()));
|
||||
shapeDimension = ResourceKey.create(Registries.DIMENSION, Identifier.parse(options.get("dim").getString()));
|
||||
if (options.containsKey("follow"))
|
||||
{
|
||||
followEntity = NumericValue.asNumber(options.getOrDefault("follow", optional.get("follow"))).getInt();
|
||||
|
||||
@@ -430,7 +430,7 @@ public class ShapesRenderer
|
||||
float blue = (color & 0xFF) / 255.0F;
|
||||
RenderType type;
|
||||
if (blockState.getBlock() instanceof LeavesBlock && !Minecraft.getInstance().options.cutoutLeaves().get()) {
|
||||
type = RenderTypes.solid();
|
||||
type = RenderTypes.solidMovingBlock();
|
||||
} else {
|
||||
type = ItemBlockRenderTypes.getRenderType(blockState);
|
||||
}
|
||||
|
||||
@@ -60,7 +60,7 @@ public class SystemInfo
|
||||
String tlf = serverPath.getName(nodeCount - 2).toString();
|
||||
return StringValue.of(tlf);
|
||||
});
|
||||
put("world_dimensions", c -> ListValue.wrap(c.server().levelKeys().stream().map(k -> ValueConversions.of(k.location()))));
|
||||
put("world_dimensions", c -> ListValue.wrap(c.server().levelKeys().stream().map(k -> ValueConversions.of(k.identifier()))));
|
||||
put("world_spawn_point", c -> ValueConversions.of(c.server().overworld().getLevelData().getRespawnData().pos()));
|
||||
|
||||
put("world_bottom", c -> new NumericValue(c.level().getMinY()));
|
||||
|
||||
@@ -4,14 +4,14 @@ package carpet.script.utils;
|
||||
import carpet.script.external.Vanilla;
|
||||
//import net.fabricmc.api.EnvType;
|
||||
//import net.fabricmc.api.Environment;
|
||||
import net.minecraft.Util;
|
||||
import net.minecraft.util.Util;
|
||||
import net.minecraft.core.BlockPos;
|
||||
import net.minecraft.core.Holder;
|
||||
import net.minecraft.core.MappedRegistry;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.network.protocol.game.ClientboundLevelChunkWithLightPacket;
|
||||
import net.minecraft.resources.ResourceKey;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.resources.Identifier;
|
||||
import net.minecraft.server.MinecraftServer;
|
||||
import net.minecraft.server.level.ServerLevel;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -93,7 +93,7 @@ public class WorldTools
|
||||
/*
|
||||
public static boolean createWorld(MinecraftServer server, String worldKey, Long seed)
|
||||
{
|
||||
ResourceLocation worldId = new ResourceLocation(worldKey);
|
||||
Identifier worldId = new Identifier(worldKey);
|
||||
ServerLevel overWorld = server.overworld();
|
||||
|
||||
Set<ResourceKey<Level>> worldKeys = server.levelKeys();
|
||||
|
||||
Reference in new issue
Block a user