updated spirit apple texture
fixed tigers eye shrine broken credit russian lang fixed queen music handler fixed permanent portals not placing corners and not finding exisitng portals fixed keybind conflict sprint conflicts added back cloud sea
This commit is contained in:
1 parent
93e2adbe12
commit
6e12612559
30 files changed
+460
-452
No files matched your search
@@ -38,8 +38,7 @@ dependencies {
|
||||
modImplementation "net.fabricmc:fabric-loader:${fabric_loader_version_1_21_1}"
|
||||
modApi "net.fabricmc.fabric-api:fabric-api:${fabric_api_version_1_21_1}"
|
||||
modImplementation "software.bernie.geckolib:geckolib-fabric-1.21.1:${geckolib_version}"
|
||||
// AntOS is developed beside Antarchy as a separate local project.
|
||||
modImplementation files("$rootDir/../AntOS/fabric-1.21.1/build/libs/antos-fabric-1.21.1-1.0.1.jar")
|
||||
modImplementation("curse.maven:antos-${antos_curseforge_id}:${antos_curseforge_file_id_fabric}")
|
||||
modCompileOnly("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_fabric}")
|
||||
modLocalRuntime("curse.maven:intapi-${intapi_curseforge_id}:${intapi_curseforge_file_id_fabric}")
|
||||
modLocalRuntime("dev.architectury:architectury-fabric:${architectury_api_version}")
|
||||
@@ -90,6 +89,7 @@ tasks.named('processResources', ProcessResources).configure {
|
||||
version : project.version,
|
||||
minecraft_version : "1.21.1",
|
||||
fabric_loader_version: fabric_loader_version_1_21_1,
|
||||
architectury_api_version: architectury_api_version,
|
||||
mod_id : mod_id,
|
||||
mod_name : mod_name,
|
||||
mod_description : mod_description,
|
||||
|
||||
@@ -111,6 +111,7 @@ public final class AntarchyFabricContent {
|
||||
AntarchyFabricMisc.ARMOR_MATERIALS.register();
|
||||
AntarchyFabricMisc.FLUIDS.register();
|
||||
AntarchyFabricBlocks.BLOCKS.register();
|
||||
AntarchyFabricBlocks.registerStripping();
|
||||
AntarchyFabricEntities.ENTITY_TYPES.register();
|
||||
AntarchyFabricMisc.ATTRIBUTES.register();
|
||||
AntarchyFabricEntityAttributes.register();
|
||||
|
||||
+3
@@ -129,6 +129,8 @@ public final class AntarchyFabricClientBootstrap {
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.NADIR_CHEST_BOAT_ENTITY.get(), context -> new PeachBoatRenderer<>(context, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/chest_boat/nadir.png"), true));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.ROYAL_BOAT_ENTITY.get(), context -> new PeachBoatRenderer<>(context, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/boat/royal.png"), false));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.ROYAL_CHEST_BOAT_ENTITY.get(), context -> new PeachBoatRenderer<>(context, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/chest_boat/royal.png"), true));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.TRUFFALO_BOAT_ENTITY.get(), context -> new PeachBoatRenderer<>(context, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/boat/truffalo.png"), false));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.TRUFFALO_CHEST_BOAT_ENTITY.get(), context -> new PeachBoatRenderer<>(context, ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "textures/entity/chest_boat/truffalo.png"), true));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.APPLE_COW.get(), context -> withTemporalGeoLayer(new AppleCowRenderer(context)));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.GOLDEN_APPLE_COW.get(), context -> withTemporalGeoLayer(new AppleCowRenderer(context)));
|
||||
EntityRendererRegistry.register(AntarchyFabricEntities.ENCHANTED_GOLDEN_APPLE_COW.get(), context -> withTemporalGeoLayer(new AppleCowRenderer(context)));
|
||||
@@ -590,6 +592,7 @@ public final class AntarchyFabricClientBootstrap {
|
||||
|
||||
ElythiaFireflyManager.register();
|
||||
LucidSoundHandler.register();
|
||||
TearIdleSoundHandler.register();
|
||||
MogglesClientRenderer.register();
|
||||
StinkySoundHandler.register();
|
||||
ReverieTrailHandler.register();
|
||||
|
||||
+10
-1
@@ -9,13 +9,14 @@ import net.minecraft.client.KeyMapping;
|
||||
|
||||
public final class KeybindingConflictFixStore {
|
||||
private static final String ANTARCHY_KEY_PREFIX = "key.antarchy.";
|
||||
private static final String SPRINT_KEY = "key.sprint";
|
||||
private static final Map<InputConstants.Key, List<KeyMapping>> MAPPINGS = new HashMap<>();
|
||||
|
||||
private KeybindingConflictFixStore() {
|
||||
}
|
||||
|
||||
public static void add(InputConstants.Key key, KeyMapping mapping) {
|
||||
if (!mapping.getName().startsWith(ANTARCHY_KEY_PREFIX)) {
|
||||
if (!isTracked(mapping)) {
|
||||
return;
|
||||
}
|
||||
List<KeyMapping> mappings = MAPPINGS.computeIfAbsent(key, ignored -> new ArrayList<>());
|
||||
@@ -41,4 +42,12 @@ public final class KeybindingConflictFixStore {
|
||||
}
|
||||
return others;
|
||||
}
|
||||
|
||||
public static boolean isSprint(KeyMapping mapping) {
|
||||
return SPRINT_KEY.equals(mapping.getName());
|
||||
}
|
||||
|
||||
private static boolean isTracked(KeyMapping mapping) {
|
||||
return mapping.getName().startsWith(ANTARCHY_KEY_PREFIX) || isSprint(mapping);
|
||||
}
|
||||
}
|
||||
+112
@@ -0,0 +1,112 @@
|
||||
package com.craisinlord.antarchy.fabric.client;
|
||||
|
||||
import com.craisinlord.antarchy.content.AntarchySoundEvents;
|
||||
import com.craisinlord.antarchy.content.entity.portal.DimensionalTearEntity;
|
||||
import net.fabricmc.fabric.api.client.event.lifecycle.v1.ClientTickEvents;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.resources.sounds.AbstractTickableSoundInstance;
|
||||
import net.minecraft.sounds.SoundSource;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class TearIdleSoundHandler {
|
||||
private static final double START_SCAN_RADIUS = 64.0D;
|
||||
private static final int DISCOVERY_SCAN_INTERVAL_TICKS = 10;
|
||||
private static final Map<UUID, TearIdleSound> ACTIVE_LOOPS = new HashMap<>();
|
||||
private static long nextDiscoveryScanTick;
|
||||
|
||||
private TearIdleSoundHandler() {
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
ClientTickEvents.END_CLIENT_TICK.register(client -> {
|
||||
if (client.level == null || client.player == null || client.isPaused()) {
|
||||
resetAll(client);
|
||||
return;
|
||||
}
|
||||
|
||||
pruneStaleLoops(client);
|
||||
|
||||
long gameTime = client.level.getGameTime();
|
||||
if (gameTime >= nextDiscoveryScanTick) {
|
||||
nextDiscoveryScanTick = gameTime + DISCOVERY_SCAN_INTERVAL_TICKS;
|
||||
discoverNearbyTears(client);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
private static void discoverNearbyTears(Minecraft mc) {
|
||||
List<DimensionalTearEntity> tears = mc.level.getEntitiesOfClass(
|
||||
DimensionalTearEntity.class,
|
||||
mc.player.getBoundingBox().inflate(START_SCAN_RADIUS)
|
||||
);
|
||||
|
||||
for (DimensionalTearEntity tear : tears) {
|
||||
if (!tear.shouldPlayIdleSound() || ACTIVE_LOOPS.containsKey(tear.getUUID())) {
|
||||
continue;
|
||||
}
|
||||
TearIdleSound sound = new TearIdleSound(tear);
|
||||
ACTIVE_LOOPS.put(tear.getUUID(), sound);
|
||||
mc.getSoundManager().play(sound);
|
||||
}
|
||||
}
|
||||
|
||||
private static void pruneStaleLoops(Minecraft mc) {
|
||||
Iterator<Map.Entry<UUID, TearIdleSound>> iterator = ACTIVE_LOOPS.entrySet().iterator();
|
||||
while (iterator.hasNext()) {
|
||||
TearIdleSound sound = iterator.next().getValue();
|
||||
if (!sound.isValid()) {
|
||||
mc.getSoundManager().stop(sound);
|
||||
iterator.remove();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void resetAll(Minecraft mc) {
|
||||
for (TearIdleSound sound : ACTIVE_LOOPS.values()) {
|
||||
mc.getSoundManager().stop(sound);
|
||||
}
|
||||
ACTIVE_LOOPS.clear();
|
||||
nextDiscoveryScanTick = 0L;
|
||||
}
|
||||
|
||||
private static final class TearIdleSound extends AbstractTickableSoundInstance {
|
||||
private final DimensionalTearEntity tear;
|
||||
|
||||
private TearIdleSound(DimensionalTearEntity tear) {
|
||||
super(AntarchySoundEvents.DIMENSIONAL_TEAR_IDLE.get(), SoundSource.HOSTILE, tear.getRandom());
|
||||
this.tear = tear;
|
||||
this.looping = true;
|
||||
this.delay = 0;
|
||||
this.volume = 0.6F;
|
||||
this.pitch = 1.0F;
|
||||
this.x = tear.getX();
|
||||
this.y = tear.getY();
|
||||
this.z = tear.getZ();
|
||||
}
|
||||
|
||||
private boolean isValid() {
|
||||
return !this.tear.isRemoved() && this.tear.shouldPlayIdleSound();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void tick() {
|
||||
if (!this.isValid()) {
|
||||
this.stop();
|
||||
return;
|
||||
}
|
||||
this.x = this.tear.getX();
|
||||
this.y = this.tear.getY();
|
||||
this.z = this.tear.getZ();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canStartSilent() {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
+24
@@ -19,6 +19,7 @@ public abstract class KeybindingConflictFixMixin {
|
||||
@Shadow @Final private static Map<String, KeyMapping> ALL;
|
||||
@Shadow private InputConstants.Key key;
|
||||
@Shadow private boolean isDown;
|
||||
@Shadow private int clickCount;
|
||||
|
||||
@Inject(method = "<init>(Ljava/lang/String;Lcom/mojang/blaze3d/platform/InputConstants$Type;ILjava/lang/String;)V", at = @At("TAIL"))
|
||||
private void antarchy$addInitialMapping(String name, InputConstants.Type type, int key, String category, CallbackInfo ci) {
|
||||
@@ -44,8 +45,31 @@ public abstract class KeybindingConflictFixMixin {
|
||||
}
|
||||
}
|
||||
|
||||
@Inject(method = "click", at = @At("TAIL"))
|
||||
private static void antarchy$clickConflicts(InputConstants.Key key, CallbackInfo ci) {
|
||||
if (!AntarchySettings.fabricKeybindingConflictFixEnabled()) {
|
||||
return;
|
||||
}
|
||||
KeyMapping active = MAP.get(key);
|
||||
for (KeyMapping mapping : KeybindingConflictFixStore.others(key, active)) {
|
||||
if (((KeybindingConflictFixMixin) (Object) mapping).antarchy$isSprint()) {
|
||||
((KeybindingConflictFixMixin) (Object) mapping).antarchy$click();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void antarchy$setDown(boolean down) {
|
||||
this.isDown = down;
|
||||
}
|
||||
|
||||
@Unique
|
||||
private boolean antarchy$isSprint() {
|
||||
return KeybindingConflictFixStore.isSprint((KeyMapping) (Object) this);
|
||||
}
|
||||
|
||||
@Unique
|
||||
private void antarchy$click() {
|
||||
this.clickCount++;
|
||||
}
|
||||
}
|
||||
+14
@@ -51,6 +51,7 @@ import net.minecraft.world.level.block.state.StateDefinition;
|
||||
import net.minecraft.world.item.context.BlockPlaceContext;
|
||||
import net.minecraft.world.level.block.Mirror;
|
||||
import net.minecraft.world.level.block.Rotation;
|
||||
import net.fabricmc.fabric.api.registry.StrippableBlockRegistry;
|
||||
|
||||
public final class AntarchyFabricBlocks {
|
||||
|
||||
@@ -1759,4 +1760,17 @@ public final class AntarchyFabricBlocks {
|
||||
BLOCK_ENTITY_TYPES.register();
|
||||
}
|
||||
|
||||
public static void registerStripping() {
|
||||
StrippableBlockRegistry.register(OURANWOOD_LOG.get(), STRIPPED_OURANWOOD_LOG.get());
|
||||
StrippableBlockRegistry.register(OURANWOOD_WOOD.get(), STRIPPED_OURANWOOD_WOOD.get());
|
||||
StrippableBlockRegistry.register(PEACH_LOG.get(), STRIPPED_PEACH_LOG.get());
|
||||
StrippableBlockRegistry.register(PEACH_WOOD.get(), STRIPPED_PEACH_WOOD.get());
|
||||
StrippableBlockRegistry.register(NADIR_LOG.get(), STRIPPED_NADIR_LOG.get());
|
||||
StrippableBlockRegistry.register(NADIR_WOOD.get(), STRIPPED_NADIR_WOOD.get());
|
||||
StrippableBlockRegistry.register(ROYAL_LOG.get(), STRIPPED_ROYAL_LOG.get());
|
||||
StrippableBlockRegistry.register(ROYAL_WOOD.get(), STRIPPED_ROYAL_WOOD.get());
|
||||
StrippableBlockRegistry.register(TRUFFALO_LOG.get(), STRIPPED_TRUFFALO_LOG.get());
|
||||
StrippableBlockRegistry.register(TRUFFALO_WOOD.get(), STRIPPED_TRUFFALO_WOOD.get());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -36,6 +36,7 @@
|
||||
"minecraft": "~${minecraft_version}",
|
||||
"java": ">=21",
|
||||
"fabric-api": "*",
|
||||
"architectury": "${architectury_api_version}",
|
||||
"integrated_api": "*",
|
||||
"geckolib": "*",
|
||||
"sizeable_foliage": "*"
|
||||
|
||||
Reference in new issue
Block a user