fixed stuff from the merge from petra, and fixed raycasts to work without a player.

This commit is contained in:
Talia-12 2023-07-12 18:26:19 +10:00
parent dd77b14c59
commit 717dd3e5ad
8 changed files with 31 additions and 50 deletions

View file

@ -12,13 +12,8 @@ class MishapAlreadyBrainswept(val mob: Mob) : Mishap() {
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
dyeColor(DyeColor.GREEN)
<<<<<<< HEAD
override fun execute(env: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
mob.hurt(HexDamageSources.overcastDamageFrom(env.caster), mob.health)
=======
override fun execute(ctx: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
mob.hurt(mob.damageSources().source(HexDamageTypes.OVERCAST, ctx.caster), mob.health)
>>>>>>> talia-1.20/1.20.1
}
override fun particleSpray(ctx: CastingEnvironment) =

View file

@ -16,13 +16,8 @@ class MishapBadBlock(val pos: BlockPos, val expected: Component) : Mishap() {
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
dyeColor(DyeColor.LIME)
<<<<<<< HEAD
override fun execute(env: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
env.world.explode(null, pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, 0.25f, Explosion.BlockInteraction.NONE)
=======
override fun execute(ctx: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
ctx.world.explode(null, pos.x + 0.5, pos.y + 0.5, pos.z + 0.5, 0.25f, Level.ExplosionInteraction.NONE)
>>>>>>> talia-1.20/1.20.1
}
override fun particleSpray(ctx: CastingEnvironment) =

View file

@ -14,13 +14,8 @@ class MishapBadBrainsweep(val mob: Mob, val pos: BlockPos) : Mishap() {
override fun accentColor(ctx: CastingEnvironment, errorCtx: Context): FrozenPigment =
dyeColor(DyeColor.GREEN)
<<<<<<< HEAD
override fun execute(env: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
trulyHurt(mob, HexDamageSources.overcastDamageFrom(env.caster), 1f)
=======
override fun execute(ctx: CastingEnvironment, errorCtx: Context, stack: MutableList<Iota>) {
trulyHurt(mob, mob.damageSources().source(HexDamageTypes.OVERCAST, ctx.caster), 1f)
>>>>>>> talia-1.20/1.20.1
}
override fun particleSpray(ctx: CastingEnvironment): ParticleSpray {

View file

@ -105,29 +105,22 @@ public class ListPerWorldPatternsCommand {
var stack = new ItemStack(HexItems.SCROLL_LARGE);
stack.setTag(tag);
<<<<<<< HEAD:Common/src/main/java/at/petrak/hexcasting/common/command/ListPerWorldPatternsCommand.java
for (var player : targets) {
var stackEntity = player.drop(stack, false);
if (stackEntity != null) {
stackEntity.setNoPickUpDelay();
stackEntity.setOwner(player.getUUID());
stackEntity.setThrower(player.getUUID());
}
=======
for (var player : targets) {
var stackEntity = player.drop(stack, false);
if (stackEntity != null) {
stackEntity.setNoPickUpDelay();
stackEntity.setThrower(player.getUUID());
>>>>>>> talia-1.20/1.20.1:Common/src/main/java/at/petrak/hexcasting/common/command/ListPatternsCommand.java
}
count++;
count++;
}
}
}
int finalCount = count;
source.sendSuccess(() ->
Component.translatable("command.hexcasting.pats.all",
count,
finalCount,
targets.size() == 1 ? targets.iterator().next().getDisplayName() : targets.size()),
true);
return count;

View file

@ -304,19 +304,11 @@ public class HexplatRecipes extends PaucalRecipeProvider {
.unlockedBy("has_item", hasItem(HexTags.Items.EDIFIED_LOGS)).save(recipes);
for (var log : EDIFIED_LOGS) {
<<<<<<< HEAD
ShapedRecipeBuilder.shaped(log, 3)
.define('W', log)
.pattern("WW")
.pattern("WW")
.unlockedBy("has_item", hasItem(log)).save(recipes);
=======
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, log, 3)
.define('W', log)
.pattern("WW")
.pattern("WW")
.unlockedBy("has_item", hasItem(log)).save(recipes);
>>>>>>> talia-1.20/1.20.1
}
ShapedRecipeBuilder.shaped(RecipeCategory.BUILDING_BLOCKS, HexBlocks.STRIPPED_EDIFIED_WOOD, 3)
@ -483,23 +475,13 @@ public class HexplatRecipes extends PaucalRecipeProvider {
// FD compat
for (var log : EDIFIED_LOGS) {
this.conditions.apply(new FarmersDelightCuttingRecipeBuilder()
<<<<<<< HEAD
.withInput(log)
.withTool(ingredients.axeStrip())
.withOutput(HexBlocks.STRIPPED_EDIFIED_LOG)
.withOutput("farmersdelight:tree_bark")
.withSound(SoundEvents.AXE_STRIP))
.whenModLoaded("farmersdelight")
.save(recipes, modLoc("compat/farmersdelight/cutting/" + Registry.BLOCK.getKey(log).getPath()));
=======
.withInput(log)
.withTool(ingredients.axeStrip())
.withOutput(HexBlocks.STRIPPED_EDIFIED_LOG)
.withOutput("farmersdelight:tree_bark")
.withSound(SoundEvents.AXE_STRIP))
.whenModLoaded("farmersdelight")
.save(recipes, modLoc("compat/farmersdelight/cutting/" + BuiltInRegistries.BLOCK.getKey(log).getPath()));
>>>>>>> talia-1.20/1.20.1
.save(recipes, modLoc("compat/farmersdelight/cutting/" + BuiltInRegistries.BLOCK.getKey(log).getPath()));
}
this.conditions.apply(new FarmersDelightCuttingRecipeBuilder()

View file

@ -3,13 +3,9 @@ package at.petrak.hexcasting.datagen.tag;
import at.petrak.hexcasting.api.casting.ActionRegistryEntry;
import at.petrak.hexcasting.api.mod.HexTags;
import at.petrak.hexcasting.xplat.IXplatAbstractions;
<<<<<<< HEAD
import at.petrak.hexcasting.xplat.Platform;
import net.minecraft.data.DataGenerator;
=======
import net.minecraft.core.HolderLookup;
import net.minecraft.data.PackOutput;
>>>>>>> talia-1.20/1.20.1
import net.minecraft.data.tags.TagsProvider;
import net.minecraft.resources.ResourceKey;
import net.minecraft.resources.ResourceLocation;

View file

@ -0,0 +1,24 @@
package at.petrak.hexcasting.fabric.mixin;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.level.ClipContext;
import net.minecraft.world.phys.shapes.CollisionContext;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Redirect;
@Mixin(ClipContext.class)
public abstract class FabricClipContextMixin {
@Redirect(method = "<init>",
at = @At(
value = "INVOKE_ASSIGN",
target = "Lnet/minecraft/world/phys/shapes/CollisionContext;of" +
"(Lnet/minecraft/world/entity/Entity;)Lnet/minecraft/world/phys/shapes/CollisionContext;"))
public CollisionContext hex$getCollisionContext(Entity entity) {
if (entity == null)
return CollisionContext.empty();
return CollisionContext.of(entity);
}
}

View file

@ -7,6 +7,7 @@
"mixins": [
"FabricAxeItemMixin",
"FabricBlockBehaviorMixin",
"FabricClipContextMixin",
"FabricEnchantmentTableBlockMixin",
"FabricItemEntityMixin",
"FabricLivingEntityMixin",