mirror of
https://github.com/architectury/architectury-api.git
synced 2026-03-28 03:56:59 -05:00
Merge remote-tracking branch 'architectury/1.16' into 1.17
Signed-off-by: shedaniel <daniel@shedaniel.me> # Conflicts: # .github/workflows/publish.yml # .github/workflows/snapshot.yml # build.gradle # common/src/main/resources/architectury-common.mixins.json # fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinLevelChunk.java # fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerGamePacketListenerImpl.java # fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/MixinServerLevel.java # fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinMouseHandler.java # fabric/src/main/java/me/shedaniel/architectury/mixin/fabric/client/MixinScreen.java # forge/gradle.properties # gradle.properties # gradle/wrapper/gradle-wrapper.properties # testmod-fabric/build.gradle # testmod-forge/gradle.properties
This commit is contained in:
@@ -28,6 +28,7 @@ import me.shedaniel.architectury.test.gamerule.TestGameRules;
|
||||
import me.shedaniel.architectury.test.registry.TestRegistries;
|
||||
import me.shedaniel.architectury.test.registry.client.TestKeybinds;
|
||||
import me.shedaniel.architectury.test.tags.TestTags;
|
||||
import me.shedaniel.architectury.test.trade.TestTrades;
|
||||
import me.shedaniel.architectury.utils.Env;
|
||||
import me.shedaniel.architectury.utils.EnvExecutor;
|
||||
|
||||
@@ -40,6 +41,7 @@ public class TestMod {
|
||||
TestRegistries.initialize();
|
||||
TestGameRules.init();
|
||||
TestTags.initialize();
|
||||
TestTrades.init();
|
||||
if (Platform.getEnvironment() == Env.CLIENT)
|
||||
TestKeybinds.initialize();
|
||||
}
|
||||
|
||||
@@ -29,7 +29,6 @@ import me.shedaniel.architectury.platform.Platform;
|
||||
import me.shedaniel.architectury.utils.Env;
|
||||
import net.fabricmc.api.EnvType;
|
||||
import net.fabricmc.api.Environment;
|
||||
import net.minecraft.client.gui.screens.ChatScreen;
|
||||
import net.minecraft.client.gui.screens.inventory.AnvilScreen;
|
||||
import net.minecraft.core.Position;
|
||||
import net.minecraft.core.Vec3i;
|
||||
|
||||
@@ -28,11 +28,12 @@ import static me.shedaniel.architectury.registry.GameRuleRegistry.register;
|
||||
|
||||
public class TestGameRules {
|
||||
private static final Logger LOGGER = LogManager.getLogger();
|
||||
|
||||
|
||||
public static final GameRules.Key<GameRules.BooleanValue> SIMPLE_BOOL = register("simpleBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true));
|
||||
public static final GameRules.Key<GameRules.IntegerValue> SIMPLE_INT = register("simpleInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10));
|
||||
public static final GameRules.Key<GameRules.BooleanValue> CALLBACK_BOOL = register("callbackBool", GameRules.Category.MISC, GameRuleFactory.createBooleanRule(true, (server, value) -> LOGGER.info("changed to {}", value.get())));
|
||||
public static final GameRules.Key<GameRules.IntegerValue> CALLBACK_INT = register("callbackInt", GameRules.Category.MISC, GameRuleFactory.createIntRule(10, (server, value) -> LOGGER.info("changed to {}", value.get())));
|
||||
|
||||
public static void init() {}
|
||||
|
||||
public static void init() {
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,42 @@
|
||||
/*
|
||||
* 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 me.shedaniel.architectury.test.trade;
|
||||
|
||||
import me.shedaniel.architectury.registry.trade.SimpleTrade;
|
||||
import me.shedaniel.architectury.registry.trade.TradeRegistry;
|
||||
import net.minecraft.core.Registry;
|
||||
import net.minecraft.world.entity.npc.VillagerProfession;
|
||||
import net.minecraft.world.entity.npc.VillagerTrades;
|
||||
import net.minecraft.world.item.ItemStack;
|
||||
import net.minecraft.world.item.Items;
|
||||
|
||||
public class TestTrades {
|
||||
public static void init() {
|
||||
for (VillagerProfession villagerProfession : Registry.VILLAGER_PROFESSION) {
|
||||
TradeRegistry.registerVillagerTrade(villagerProfession, 1, TestTrades.createTrades());
|
||||
}
|
||||
TradeRegistry.registerTradeForWanderingTrader(false, TestTrades.createTrades());
|
||||
}
|
||||
|
||||
private static VillagerTrades.ItemListing[] createTrades() {
|
||||
SimpleTrade trade = new SimpleTrade(Items.APPLE.getDefaultInstance(), ItemStack.EMPTY, Items.ACACIA_BOAT.getDefaultInstance(), 1, 0, 1.0F);
|
||||
return new VillagerTrades.ItemListing[]{trade};
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:emerald_block"
|
||||
]
|
||||
"replace": false,
|
||||
"values": [
|
||||
"minecraft:emerald_block"
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user