Update to Loom 0.10.0 and add Mixins

This commit is contained in:
shedaniel
2021-09-22 23:03:07 +08:00
parent 88dbf04c9b
commit c3ffa8d976
28 changed files with 123 additions and 126 deletions

View File

@@ -1,5 +1,5 @@
loom {
accessWidener = file("src/main/resources/architectury.accessWidener")
accessWidenerPath = file("src/main/resources/architectury.accessWidener")
}
dependencies {
@@ -14,21 +14,23 @@ architectury {
afterEvaluate {
remapJar {
remapAccessWidener.set false
remapAccessWidener = false
}
}
configurations {
dev
}
artifacts {
dev(jar)
}
publishing {
publications {
mavenCommon(MavenPublication) {
artifactId = rootProject.archivesBaseName
artifact(remapJar)
afterEvaluate {
artifact(remapSourcesJar.output) {
builtBy remapSourcesJar
classifier "sources"
}
}
from components.java
}
}

View File

@@ -1,52 +0,0 @@
/*
* This file is part of architectury.
* Copyright (C) 2020, 2021 architectury
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 3 of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program; if not, write to the Free Software Foundation,
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
package dev.architectury.mixin;
import dev.architectury.event.events.common.BlockEvent;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.EntityType;
import net.minecraft.world.entity.item.FallingBlockEntity;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.state.BlockState;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfo;
import org.spongepowered.asm.mixin.injection.callback.LocalCapture;
@Mixin(FallingBlockEntity.class)
public abstract class MixinFallingBlockEntity extends Entity {
public MixinFallingBlockEntity(EntityType<?> entityType, Level level) {
super(entityType, level);
}
@Shadow
private BlockState blockState;
@Inject(method = "tick", at = @At(value = "INVOKE",
target = "Lnet/minecraft/world/level/block/Fallable;onLand(Lnet/minecraft/world/level/Level;Lnet/minecraft/core/BlockPos;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/level/block/state/BlockState;Lnet/minecraft/world/entity/item/FallingBlockEntity;)V"),
locals = LocalCapture.CAPTURE_FAILHARD)
public void handleLand(CallbackInfo ci, Block block, BlockPos blockPos2, boolean bl, boolean bl2, BlockState blockState) {
BlockEvent.FALLING_LAND.invoker().onLand(this.level, blockPos2, this.blockState, blockState, (FallingBlockEntity) (Object) this);
}
}

View File

@@ -20,9 +20,11 @@
package dev.architectury.registry.block;
public interface BlockPropertiesExtension {
@Deprecated
default BlockProperties tool(ToolType type) {
return tool(type, 0);
}
@Deprecated
BlockProperties tool(ToolType type, int level);
}

View File

@@ -7,7 +7,6 @@
],
"mixins": [
"FluidTagsAccessor",
"MixinFallingBlockEntity",
"MixinLightningBolt"
],
"injectors": {