Added first VERY rough draft of jumpy bug, creeping horror, lurking terror
This commit is contained in:
1 parent
70e4479f19
commit
fb8fd3c927
112 files changed
+16339
-8
No files matched your search
@@ -55,6 +55,7 @@ import com.craisinlord.antarchy.content.entity.lucid.LucidEntity;
|
||||
import com.craisinlord.antarchy.content.entity.lucid.LucidBoltEntity;
|
||||
import com.craisinlord.antarchy.content.entity.lucid.LucidEyeProjectileEntity;
|
||||
import com.craisinlord.antarchy.content.entity.HushProjectileEntity;
|
||||
import com.craisinlord.antarchy.content.entity.JumpyBugEntity;
|
||||
import com.craisinlord.antarchy.content.entity.OuranwoodBoatEntity;
|
||||
import com.craisinlord.antarchy.content.entity.OuranwoodChestBoatEntity;
|
||||
import com.craisinlord.antarchy.content.entity.MantisEntity;
|
||||
@@ -66,6 +67,8 @@ import com.craisinlord.antarchy.content.item.LucidPearlItem;
|
||||
import com.craisinlord.antarchy.content.entity.nightmare.NightmareEntity;
|
||||
import com.craisinlord.antarchy.content.entity.ToreterrorEntity;
|
||||
import com.craisinlord.antarchy.content.entity.WaterBombEntity;
|
||||
import com.craisinlord.antarchy.content.entity.CreepingHorrorEntity;
|
||||
import com.craisinlord.antarchy.content.entity.LurkingTerrorEntity;
|
||||
import com.craisinlord.antarchy.content.item.PrimordialArmorItem;
|
||||
import com.craisinlord.antarchy.content.item.WaterCannonItem;
|
||||
import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity;
|
||||
@@ -191,6 +194,7 @@ import net.minecraft.world.item.StandingAndWallBlockItem;
|
||||
import net.minecraft.world.food.FoodProperties;
|
||||
import net.minecraft.world.item.Tier;
|
||||
import net.minecraft.world.item.Tiers;
|
||||
import net.minecraft.world.item.alchemy.Potions;
|
||||
import net.minecraft.world.item.crafting.Ingredient;
|
||||
import net.minecraft.core.Direction;
|
||||
import net.minecraft.core.particles.ParticleType;
|
||||
@@ -614,6 +618,22 @@ public final class AntarchyFabricContent {
|
||||
() -> new DreamFireBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.SOUL_FIRE)));
|
||||
public static final DeferredBlock<DreamCeilingFireBlock> DREAM_CEILING_FIRE = BLOCKS.register("dream_fire_ceiling",
|
||||
() -> new DreamCeilingFireBlock(BlockBehaviour.Properties.ofFullCopy(Blocks.SOUL_FIRE)));
|
||||
public static final DeferredBlock<CreepingHorrorEggBlock> CREEPING_HORROR_EGGS = BLOCKS.register("creeping_horror_eggs",
|
||||
() -> new CreepingHorrorEggBlock(BlockBehaviour.Properties.of()
|
||||
.strength(0.15F)
|
||||
.sound(SoundType.METAL)
|
||||
.randomTicks()
|
||||
.noOcclusion()
|
||||
.noCollission()
|
||||
.replaceable()));
|
||||
public static final DeferredBlock<LurkingTerrorEggBlock> LURKING_TERROR_EGGS = BLOCKS.register("lurking_terror_eggs",
|
||||
() -> new LurkingTerrorEggBlock(BlockBehaviour.Properties.of()
|
||||
.strength(0.15F)
|
||||
.sound(SoundType.METAL)
|
||||
.randomTicks()
|
||||
.noOcclusion()
|
||||
.noCollission()
|
||||
.replaceable()));
|
||||
public static final DeferredBlock<BedBugEggBlock> BED_BUG_EGG = BLOCKS.register("bed_bug_egg",
|
||||
() -> new BedBugEggBlock(BlockBehaviour.Properties.of()
|
||||
.strength(0.15F)
|
||||
@@ -749,6 +769,11 @@ public final class AntarchyFabricContent {
|
||||
.sized(0.55F, 0.75F)
|
||||
.clientTrackingRange(8)
|
||||
.build("bomber"));
|
||||
public static final DeferredHolder<EntityType<?>, EntityType<JumpyBugEntity>> JUMPY_BUG = ENTITY_TYPES.register("jumpy_bug",
|
||||
() -> EntityType.Builder.of(JumpyBugEntity::new, MobCategory.MONSTER)
|
||||
.sized(3.0F, 3.0F)
|
||||
.clientTrackingRange(8)
|
||||
.build("jumpy_bug"));
|
||||
public static final DeferredHolder<EntityType<?>, EntityType<SizeRayProjectileEntity>> SHRINK_RAY_PROJECTILE = ENTITY_TYPES.register("shrink_ray_projectile",
|
||||
() -> EntityType.Builder.<SizeRayProjectileEntity>of(SizeRayProjectileEntity::createShrink, MobCategory.MISC)
|
||||
.sized(0.5F, 0.5F)
|
||||
@@ -1112,6 +1137,8 @@ public final class AntarchyFabricContent {
|
||||
() -> new StandingAndWallBlockItem(DREAM_TORCH.get(), DREAM_WALL_TORCH.get(), new Item.Properties(), Direction.UP));
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> DREAM_LANTERN_ITEM = ITEMS.registerSimpleBlockItem(DREAM_LANTERN);
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> DREAM_CAMPFIRE_ITEM = ITEMS.registerSimpleBlockItem(DREAM_CAMPFIRE);
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> CREEPING_HORROR_EGGS_ITEM = ITEMS.registerSimpleBlockItem(CREEPING_HORROR_EGGS);
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> LURKING_TERROR_EGGS_ITEM = ITEMS.registerSimpleBlockItem(LURKING_TERROR_EGGS);
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> BED_BUG_EGG_ITEM = ITEMS.registerSimpleBlockItem(BED_BUG_EGG);
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> WASP_NEST_ITEM = ITEMS.registerSimpleBlockItem(WASP_NEST);
|
||||
public static final DeferredItem<net.minecraft.world.item.BlockItem> HUSHWEED_ITEM = ITEMS.registerSimpleBlockItem(HUSHWEED);
|
||||
@@ -1148,8 +1175,26 @@ public final class AntarchyFabricContent {
|
||||
-2.2F
|
||||
));
|
||||
public static final DeferredItem<Item> MANTIS_CLAW = ITEMS.registerSimpleItem("mantis_claw", new Item.Properties().rarity(Rarity.UNCOMMON));
|
||||
public static final DeferredItem<Item> JUMPY_BUG_LEG = ITEMS.register("jumpy_bug_leg",
|
||||
() -> new MobComingSoonTooltipItem(new Item.Properties().rarity(Rarity.UNCOMMON)));
|
||||
public static final DeferredItem<Item> KING_SCALE = ITEMS.register("king_scale",
|
||||
() -> new MobComingSoonTooltipItem(new Item.Properties().rarity(Rarity.RARE)));
|
||||
public static final DeferredItem<Item> QUEEN_SCALE = ITEMS.register("queen_scale",
|
||||
() -> new MobComingSoonTooltipItem(new Item.Properties().rarity(Rarity.RARE)));
|
||||
public static final DeferredItem<Item> JUMPY_BUG_LEG = ITEMS.registerSimpleItem("jumpy_bug_leg", new Item.Properties().rarity(Rarity.UNCOMMON));
|
||||
private static final DeferredHolder<ArmorMaterial, ArmorMaterial> JUMPY_BOOTS_ARMOR_MATERIAL = ARMOR_MATERIALS.register("jumpy_boots",
|
||||
() -> new ArmorMaterial(
|
||||
createJumpyBootsDefense(),
|
||||
15,
|
||||
net.minecraft.sounds.SoundEvents.ARMOR_EQUIP_NETHERITE,
|
||||
() -> Ingredient.of(net.minecraft.world.item.Items.NETHERITE_BOOTS),
|
||||
java.util.List.of(new ArmorMaterial.Layer(net.minecraft.resources.ResourceLocation.fromNamespaceAndPath(Antarchy.MODID, "jumpy_boots"))),
|
||||
3.0F,
|
||||
0.1F
|
||||
));
|
||||
public static final DeferredItem<com.craisinlord.antarchy.content.item.JumpyBootsItem> JUMPY_BOOTS = ITEMS.register("jumpy_boots",
|
||||
() -> new com.craisinlord.antarchy.content.item.JumpyBootsItem(
|
||||
net.minecraft.core.Holder.direct(JUMPY_BOOTS_ARMOR_MATERIAL.get()),
|
||||
new Item.Properties().stacksTo(1).rarity(Rarity.UNCOMMON).fireResistant().durability(ArmorItem.Type.BOOTS.getDurability(37))
|
||||
));
|
||||
public static final DeferredItem<Item> BRUTALFLY_WING = ITEMS.registerSimpleItem("brutalfly_wing", new Item.Properties().rarity(Rarity.UNCOMMON));
|
||||
public static final DeferredItem<BrutalflyElytraItem> BRUTALFLY_ELYTRA = ITEMS.register("brutalfly_elytra",
|
||||
() -> new BrutalflyElytraItem(new Item.Properties().rarity(Rarity.UNCOMMON).durability(480)));
|
||||
@@ -1548,6 +1593,8 @@ public final class AntarchyFabricContent {
|
||||
() -> new DeferredSpawnEggItem(WASP, 0x111111, 0xF1D800, new Item.Properties()));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> BOMBER_SPAWN_EGG = ITEMS.register("bomber_spawn_egg",
|
||||
() -> new DeferredSpawnEggItem(BOMBER, 0x7A7A7A, 0xB32020, new Item.Properties()));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> JUMPY_BUG_SPAWN_EGG = ITEMS.register("jumpy_bug_spawn_egg",
|
||||
() -> new DeferredSpawnEggItem(JUMPY_BUG, 0x111111, 0xFF7A00, new Item.Properties()));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> CLOUD_SHARK_SPAWN_EGG = ITEMS.register("cloud_shark_spawn_egg",
|
||||
() -> new DeferredSpawnEggItem(CLOUD_SHARK, 0xDDEAF4, 0x7F96A8, new Item.Properties()));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> KRAKEN_SPAWN_EGG = ITEMS.register("kraken_spawn_egg",
|
||||
@@ -1598,8 +1645,22 @@ public final class AntarchyFabricContent {
|
||||
.clientTrackingRange(8)
|
||||
.updateInterval(1)
|
||||
.build("water_bomb"));
|
||||
public static final DeferredHolder<EntityType<?>, EntityType<CreepingHorrorEntity>> CREEPING_HORROR = ENTITY_TYPES.register("creeping_horror",
|
||||
() -> EntityType.Builder.of(CreepingHorrorEntity::new, MobCategory.MONSTER)
|
||||
.sized(0.7F, 0.5F)
|
||||
.clientTrackingRange(10)
|
||||
.build("creeping_horror"));
|
||||
public static final DeferredHolder<EntityType<?>, EntityType<LurkingTerrorEntity>> LURKING_TERROR = ENTITY_TYPES.register("lurking_terror",
|
||||
() -> EntityType.Builder.of(LurkingTerrorEntity::new, MobCategory.MONSTER)
|
||||
.sized(0.8F, 0.6F)
|
||||
.clientTrackingRange(10)
|
||||
.build("lurking_terror"));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> TORETERROR_SPAWN_EGG = ITEMS.register("toreterror_spawn_egg",
|
||||
() -> new DeferredSpawnEggItem(TORETERROR, 0x90EE90, 0x5C4033, new Item.Properties().rarity(Rarity.EPIC)));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> CREEPING_HORROR_SPAWN_EGG = ITEMS.register("creeping_horror_spawn_egg",
|
||||
() -> new DeferredSpawnEggItem(CREEPING_HORROR, 0x6B3A1F, 0x6B0000, new Item.Properties()));
|
||||
public static final DeferredItem<DeferredSpawnEggItem> LURKING_TERROR_SPAWN_EGG = ITEMS.register("lurking_terror_spawn_egg",
|
||||
() -> new DeferredSpawnEggItem(LURKING_TERROR, 0x2D5A1B, 0x8B0000, new Item.Properties()));
|
||||
public static final DeferredHolder<CreativeModeTab, CreativeModeTab> ANTARCHY_TAB = CREATIVE_MODE_TABS.register("antarchy",
|
||||
() -> CreativeModeTab.builder(CreativeModeTab.Row.TOP, 0)
|
||||
.title(net.minecraft.network.chat.Component.translatable("itemGroup.antarchy.antarchy"))
|
||||
@@ -1673,6 +1734,7 @@ public final class AntarchyFabricContent {
|
||||
FabricDefaultAttributeRegistry.register(BED_BUG.get(), BedBugEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(WASP.get(), WaspEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(BOMBER.get(), BomberEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(JUMPY_BUG.get(), JumpyBugEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(MANTIS.get(), MantisEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(TRIFFID.get(), TriffidEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(LUCID.get(), LucidEntity.createAttributes().build());
|
||||
@@ -1680,6 +1742,8 @@ public final class AntarchyFabricContent {
|
||||
FabricDefaultAttributeRegistry.register(BASILISK.get(), BasiliskEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(EMPEROR_SCORPION.get(), EmperorScorpionEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(TORETERROR.get(), ToreterrorEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(CREEPING_HORROR.get(), CreepingHorrorEntity.createAttributes().build());
|
||||
FabricDefaultAttributeRegistry.register(LURKING_TERROR.get(), LurkingTerrorEntity.createAttributes().build());
|
||||
|
||||
FabricDefaultAttributeRegistry.register(RED_ANT.get(), buildAntAttributes(
|
||||
AntarchySettings.redAntHealth(),
|
||||
@@ -1712,6 +1776,7 @@ public final class AntarchyFabricContent {
|
||||
SpawnPlacements.register(CLOUD_SHARK.get(), SpawnPlacementTypes.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, CloudSharkEntity::canSpawn);
|
||||
SpawnPlacements.register(WASP.get(), SpawnPlacementTypes.NO_RESTRICTIONS, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, WaspEntity::canSpawn);
|
||||
SpawnPlacements.register(BOMBER.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, BomberEntity::canSpawn);
|
||||
SpawnPlacements.register(JUMPY_BUG.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, JumpyBugEntity::canSpawn);
|
||||
SpawnPlacements.register(KRAKEN.get(), SpawnPlacementTypes.IN_WATER, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, KrakenEntity::canSpawn);
|
||||
SpawnPlacements.register(MISSILE_SQUID.get(), SpawnPlacementTypes.IN_WATER, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, MissileSquidEntity::canSpawn);
|
||||
SpawnPlacements.register(NIGHTMARE.get(), SpawnPlacementTypes.ON_GROUND, Heightmap.Types.MOTION_BLOCKING_NO_LEAVES, NightmareEntity::canSpawn);
|
||||
@@ -1813,11 +1878,14 @@ public final class AntarchyFabricContent {
|
||||
"moleworm_spawn_egg", "mantis_spawn_egg", "molevore_spawn_egg", "triffid_spawn_egg",
|
||||
"apple_cow_spawn_egg", "golden_apple_cow_spawn_egg", "enchanted_golden_apple_cow_spawn_egg",
|
||||
"honeyed_apple_cow_spawn_egg", "dr_trayaurus_spawn_egg", "wasp_spawn_egg",
|
||||
"bomber_spawn_egg", "cloud_shark_spawn_egg", "kraken_spawn_egg", "missile_squid_spawn_egg",
|
||||
"bomber_spawn_egg", "jumpy_bug_spawn_egg", "cloud_shark_spawn_egg", "kraken_spawn_egg", "missile_squid_spawn_egg",
|
||||
"nightmare_spawn_egg", "bed_bug_spawn_egg", "lucid_spawn_egg", "scorpion_spawn_egg",
|
||||
"basilisk_spawn_egg", "emperor_scorpion_spawn_egg", "toreterror_spawn_egg" -> 90;
|
||||
"basilisk_spawn_egg", "emperor_scorpion_spawn_egg", "toreterror_spawn_egg",
|
||||
"creeping_horror_spawn_egg", "lurking_terror_spawn_egg" -> 90;
|
||||
case "water_cannon" -> 52;
|
||||
case "primordial_helmet", "primordial_chestplate", "primordial_leggings", "primordial_boots" -> 53;
|
||||
case "jumpy_boots" -> 54;
|
||||
case "king_scale", "queen_scale" -> 22;
|
||||
default -> 50;
|
||||
};
|
||||
}
|
||||
@@ -1972,6 +2040,16 @@ public final class AntarchyFabricContent {
|
||||
return defense;
|
||||
}
|
||||
|
||||
private static java.util.EnumMap<ArmorItem.Type, Integer> createJumpyBootsDefense() {
|
||||
java.util.EnumMap<ArmorItem.Type, Integer> defense = new java.util.EnumMap<>(ArmorItem.Type.class);
|
||||
defense.put(ArmorItem.Type.BOOTS, 3);
|
||||
defense.put(ArmorItem.Type.LEGGINGS, 0);
|
||||
defense.put(ArmorItem.Type.CHESTPLATE, 0);
|
||||
defense.put(ArmorItem.Type.HELMET, 0);
|
||||
defense.put(ArmorItem.Type.BODY, 0);
|
||||
return defense;
|
||||
}
|
||||
|
||||
private static java.util.EnumMap<ArmorItem.Type, Integer> createBloodCrystalArmorDefense() {
|
||||
java.util.EnumMap<ArmorItem.Type, Integer> defense = new java.util.EnumMap<>(ArmorItem.Type.class);
|
||||
defense.put(ArmorItem.Type.BOOTS, 2);
|
||||
@@ -2062,6 +2140,7 @@ public final class AntarchyFabricContent {
|
||||
builder.registerPotionRecipe(potionHolder(GROWING), Ingredient.of(Items.GLOWSTONE_DUST), potionHolder(STRONG_GROWING));
|
||||
builder.registerPotionRecipe(potionHolder(STRONG_GROWING), Ingredient.of(Items.GLOWSTONE_DUST), potionHolder(EXTREME_GROWING));
|
||||
builder.registerPotionRecipe(net.minecraft.world.item.alchemy.Potions.AWKWARD, Ingredient.of(CLOUD_SHARK_FIN.get()), net.minecraft.world.item.alchemy.Potions.SLOW_FALLING);
|
||||
builder.registerPotionRecipe(net.minecraft.world.item.alchemy.Potions.AWKWARD, Ingredient.of(JUMPY_BUG_LEG.get()), Potions.LEAPING);
|
||||
builder.registerPotionRecipe(net.minecraft.world.item.alchemy.Potions.AWKWARD, Ingredient.of(CORNEA_EAR.get()), net.minecraft.world.item.alchemy.Potions.NIGHT_VISION);
|
||||
});
|
||||
|
||||
@@ -2218,6 +2297,8 @@ public final class AntarchyFabricContent {
|
||||
HUSH_PROJECTILE,
|
||||
TORETERROR,
|
||||
WATER_BOMB,
|
||||
CREEPING_HORROR,
|
||||
LURKING_TERROR,
|
||||
() -> DUPLICATOR_LOG.get(),
|
||||
() -> DUPLICATOR_SAPLING.get(),
|
||||
() -> DUCT_TAPE.get(),
|
||||
@@ -2268,6 +2349,8 @@ public final class AntarchyFabricContent {
|
||||
() -> PINK_MILKWEED.get(),
|
||||
() -> TORCHFLOWER_BUSH.get(),
|
||||
() -> BED_BUG_EGG.get(),
|
||||
() -> CREEPING_HORROR_EGGS.get(),
|
||||
() -> LURKING_TERROR_EGGS.get(),
|
||||
() -> WASP_NEST.get(),
|
||||
() -> HUSHWEED.get(),
|
||||
() -> OURANWOOD_SQUIRREL_NEST.get(),
|
||||
|
||||
@@ -10,6 +10,9 @@ import com.craisinlord.antarchy.content.entity.kraken.KrakenEntity;
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyGravityDirection;
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyGravityTransition;
|
||||
import com.craisinlord.antarchy.content.command.CaterpillarCommand;
|
||||
import com.craisinlord.antarchy.content.command.GravityCommand;
|
||||
import net.fabricmc.fabric.api.command.v2.CommandRegistrationCallback;
|
||||
import net.fabricmc.fabric.api.entity.event.v1.ServerLivingEntityEvents;
|
||||
import net.fabricmc.fabric.api.event.lifecycle.v1.ServerTickEvents;
|
||||
import net.minecraft.server.level.ServerPlayer;
|
||||
@@ -38,6 +41,11 @@ public final class AntarchyFabricEvents {
|
||||
}
|
||||
|
||||
public static void register() {
|
||||
CommandRegistrationCallback.EVENT.register((dispatcher, registryAccess, environment) -> {
|
||||
GravityCommand.register(dispatcher);
|
||||
CaterpillarCommand.register(dispatcher);
|
||||
});
|
||||
|
||||
DispenserBlock.registerBehavior(AntarchyFabricContent.SQUIDZOOKA.get(), new SquidzookaDispenseBehavior());
|
||||
DispenserBlock.registerBehavior(AntarchyFabricContent.WATER_CANNON.get(), new WaterCannonDispenseBehavior());
|
||||
|
||||
|
||||
+5
@@ -92,6 +92,7 @@ public final class AntarchyFabricClientBootstrap {
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.BED_BUG.get(), BedBugRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.WASP.get(), WaspRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.BOMBER.get(), BomberRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.JUMPY_BUG.get(), JumpyBugRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.BASILISK.get(), BasiliskRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.SHRINK_RAY_PROJECTILE.get(), SizeRayProjectileRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.GROWTH_RAY_PROJECTILE.get(), SizeRayProjectileRenderer::new);
|
||||
@@ -104,6 +105,8 @@ public final class AntarchyFabricClientBootstrap {
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.EMPEROR_SCORPION.get(), EmperorScorpionRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.TORETERROR.get(), ToreterrorRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.WATER_BOMB.get(), WaterBombRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.CREEPING_HORROR.get(), CreepingHorrorRenderer::new);
|
||||
EntityRendererRegistry.register(AntarchyFabricContent.LURKING_TERROR.get(), LurkingTerrorRenderer::new);
|
||||
|
||||
EntityModelLayerRegistry.registerModelLayer(OuranwoodBoatRenderer.boatLayer(), BoatModel::createBodyModel);
|
||||
EntityModelLayerRegistry.registerModelLayer(OuranwoodBoatRenderer.chestBoatLayer(), ChestBoatModel::createBodyModel);
|
||||
@@ -285,6 +288,7 @@ public final class AntarchyFabricClientBootstrap {
|
||||
ParalyzedClientHandler.clampPlayerInput(client.player);
|
||||
}
|
||||
BrutalflyElytraClientHandler.tick();
|
||||
JumpyBootsClientHandler.tick();
|
||||
DiamondMinecartClientHandler.tick();
|
||||
ParalyzedClientHandler.tick();
|
||||
DreadClientHandler.tick();
|
||||
@@ -303,6 +307,7 @@ public final class AntarchyFabricClientBootstrap {
|
||||
DreadHudRenderer.render(guiGraphics);
|
||||
ParalyzedHudRenderer.render(guiGraphics);
|
||||
BrutalflyElytraHudRenderer.render(guiGraphics);
|
||||
JumpyBootsHudRenderer.render(guiGraphics);
|
||||
BloodglassHudRenderer.render(guiGraphics);
|
||||
TriffidGooHudRenderer.render(guiGraphics);
|
||||
});
|
||||
|
||||
+84
@@ -0,0 +1,84 @@
|
||||
package com.craisinlord.antarchy.fabric.client;
|
||||
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsHelper;
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsItem;
|
||||
import com.craisinlord.antarchy.content.network.JumpyBootsLaunchPayload;
|
||||
import net.fabricmc.fabric.api.client.networking.v1.ClientPlayNetworking;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.player.LocalPlayer;
|
||||
|
||||
public final class JumpyBootsClientHandler {
|
||||
private static int chargeTicks = 0;
|
||||
private static boolean wasCharging = false;
|
||||
private static int primeWindowTicks = 0;
|
||||
private static int storedChargeTicks = 0;
|
||||
|
||||
private JumpyBootsClientHandler() {
|
||||
}
|
||||
|
||||
public static void tick() {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
LocalPlayer player = mc.player;
|
||||
|
||||
if (player == null || mc.level == null || mc.screen != null) {
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
|
||||
if (!JumpyBootsItem.isWearingJumpyBoots(player)) {
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
|
||||
boolean onGround = player.onGround();
|
||||
boolean sneaking = player.input.shiftKeyDown;
|
||||
boolean jumpPressed = mc.options.keyJump.consumeClick();
|
||||
|
||||
if (primeWindowTicks > 0) {
|
||||
primeWindowTicks--;
|
||||
if (jumpPressed) {
|
||||
ClientPlayNetworking.send(new JumpyBootsLaunchPayload(storedChargeTicks, player.isSprinting()));
|
||||
reset();
|
||||
return;
|
||||
}
|
||||
if (primeWindowTicks <= 0) {
|
||||
reset();
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (!onGround) {
|
||||
chargeTicks = 0;
|
||||
wasCharging = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (sneaking) {
|
||||
chargeTicks = Math.min(chargeTicks + 1, JumpyBootsHelper.CHARGE_TICKS_MAX);
|
||||
wasCharging = true;
|
||||
} else if (wasCharging && chargeTicks > 0) {
|
||||
storedChargeTicks = chargeTicks;
|
||||
primeWindowTicks = JumpyBootsHelper.PRIME_WINDOW_TICKS;
|
||||
chargeTicks = 0;
|
||||
wasCharging = false;
|
||||
} else {
|
||||
chargeTicks = 0;
|
||||
wasCharging = false;
|
||||
}
|
||||
}
|
||||
|
||||
private static void reset() {
|
||||
chargeTicks = 0;
|
||||
wasCharging = false;
|
||||
primeWindowTicks = 0;
|
||||
storedChargeTicks = 0;
|
||||
}
|
||||
|
||||
public static boolean isCharging() {
|
||||
return chargeTicks > 0;
|
||||
}
|
||||
|
||||
public static int getChargeTicks() {
|
||||
return chargeTicks;
|
||||
}
|
||||
}
|
||||
+49
@@ -0,0 +1,49 @@
|
||||
package com.craisinlord.antarchy.fabric.client;
|
||||
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsHelper;
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsItem;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.gui.GuiGraphics;
|
||||
import net.minecraft.resources.ResourceLocation;
|
||||
import net.minecraft.util.Mth;
|
||||
import net.minecraft.world.entity.player.Player;
|
||||
|
||||
public final class JumpyBootsHudRenderer {
|
||||
private static final ResourceLocation JUMP_BAR_BACKGROUND = ResourceLocation.withDefaultNamespace("textures/gui/sprites/hud/jump_bar_background.png");
|
||||
private static final ResourceLocation JUMP_BAR_PROGRESS = ResourceLocation.withDefaultNamespace("textures/gui/sprites/hud/jump_bar_progress.png");
|
||||
private static final int BAR_WIDTH = 182;
|
||||
private static final int BAR_HEIGHT = 5;
|
||||
|
||||
private JumpyBootsHudRenderer() {
|
||||
}
|
||||
|
||||
public static void render(GuiGraphics guiGraphics) {
|
||||
Minecraft mc = Minecraft.getInstance();
|
||||
Player player = mc.player;
|
||||
if (player == null || mc.screen != null || player.isDeadOrDying()) {
|
||||
return;
|
||||
}
|
||||
if (!JumpyBootsItem.isWearingJumpyBoots(player)) {
|
||||
return;
|
||||
}
|
||||
if (!JumpyBootsClientHandler.isCharging()) {
|
||||
return;
|
||||
}
|
||||
|
||||
int width = mc.getWindow().getGuiScaledWidth();
|
||||
int height = mc.getWindow().getGuiScaledHeight();
|
||||
int x0 = width / 2 - BAR_WIDTH / 2;
|
||||
int y0 = height - 29;
|
||||
|
||||
guiGraphics.blit(JUMP_BAR_BACKGROUND, x0, y0, 0, 0, BAR_WIDTH, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT);
|
||||
|
||||
int chargeTicks = JumpyBootsClientHandler.getChargeTicks();
|
||||
float chargeRatio = Mth.clamp(chargeTicks / (float) JumpyBootsHelper.CHARGE_TICKS_MAX, 0.0F, 1.0F);
|
||||
int filledWidth = Mth.clamp((int) (chargeRatio * BAR_WIDTH), 0, BAR_WIDTH);
|
||||
if (filledWidth > 0) {
|
||||
guiGraphics.setColor(1.0F, 1.0F, 1.0F, 0.35F + chargeRatio * 0.65F);
|
||||
guiGraphics.blit(JUMP_BAR_PROGRESS, x0, y0, 0, 0, filledWidth, BAR_HEIGHT, BAR_WIDTH, BAR_HEIGHT);
|
||||
guiGraphics.setColor(1.0F, 1.0F, 1.0F, 1.0F);
|
||||
}
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
package com.craisinlord.antarchy.fabric.mixin;
|
||||
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsHelper;
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsItem;
|
||||
import net.minecraft.world.entity.LivingEntity;
|
||||
import org.spongepowered.asm.mixin.Mixin;
|
||||
import org.spongepowered.asm.mixin.injection.At;
|
||||
import org.spongepowered.asm.mixin.injection.ModifyVariable;
|
||||
|
||||
@Mixin(LivingEntity.class)
|
||||
public abstract class JumpyBootsFallDamageMixin {
|
||||
@ModifyVariable(method = "causeFallDamage", at = @At("HEAD"), ordinal = 0, argsOnly = true)
|
||||
private float antarchy$reduceJumpyBootsFallDamage(float fallDistance) {
|
||||
LivingEntity self = (LivingEntity) (Object) this;
|
||||
if (!JumpyBootsItem.isWearingJumpyBoots(self)) return fallDistance;
|
||||
long protectionUntil = self.getPersistentData().getLong(JumpyBootsHelper.FALL_PROTECTION_NBT_KEY);
|
||||
if (self.level().getGameTime() < protectionUntil) {
|
||||
return fallDistance * 0.25F;
|
||||
}
|
||||
return fallDistance;
|
||||
}
|
||||
}
|
||||
+42
@@ -7,8 +7,11 @@ import com.craisinlord.antarchy.content.entity.multipart.network.MultipartIntera
|
||||
import com.craisinlord.antarchy.content.gravity.AntarchyGravityApi;
|
||||
import com.craisinlord.antarchy.content.item.BrutalflyElytraFlightHelper;
|
||||
import com.craisinlord.antarchy.content.item.BrutalflyElytraItem;
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsHelper;
|
||||
import com.craisinlord.antarchy.content.item.JumpyBootsItem;
|
||||
import com.craisinlord.antarchy.content.item.GravityGunItem;
|
||||
import com.craisinlord.antarchy.content.network.*;
|
||||
import com.craisinlord.antarchy.content.network.JumpyBootsLaunchPayload;
|
||||
import com.craisinlord.antarchy.content.weather.ThoraxisWeatherSnapshot;
|
||||
import net.fabricmc.fabric.api.networking.v1.PayloadTypeRegistry;
|
||||
import net.fabricmc.fabric.api.networking.v1.PlayerLookup;
|
||||
@@ -46,6 +49,7 @@ public final class AntarchyFabricNetworking {
|
||||
PayloadTypeRegistry.playC2S().register(GravityGunScrollPayload.TYPE, GravityGunScrollPayload.STREAM_CODEC);
|
||||
PayloadTypeRegistry.playC2S().register(DiamondMinecartInputPayload.TYPE, DiamondMinecartInputPayload.STREAM_CODEC);
|
||||
PayloadTypeRegistry.playC2S().register(BrutalflyElytraFlapPayload.TYPE, BrutalflyElytraFlapPayload.STREAM_CODEC);
|
||||
PayloadTypeRegistry.playC2S().register(JumpyBootsLaunchPayload.TYPE, JumpyBootsLaunchPayload.STREAM_CODEC);
|
||||
PayloadTypeRegistry.playC2S().register(MultipartAttackPayload.TYPE, MultipartAttackPayload.STREAM_CODEC);
|
||||
PayloadTypeRegistry.playC2S().register(MultipartInteractPayload.TYPE, MultipartInteractPayload.STREAM_CODEC);
|
||||
}
|
||||
@@ -59,6 +63,8 @@ public final class AntarchyFabricNetworking {
|
||||
context.server().execute(() -> handleDiamondMinecartInput(context.player(), payload)));
|
||||
ServerPlayNetworking.registerGlobalReceiver(BrutalflyElytraFlapPayload.TYPE, (payload, context) ->
|
||||
context.server().execute(() -> handleBrutalflyFlap(context.player(), payload)));
|
||||
ServerPlayNetworking.registerGlobalReceiver(JumpyBootsLaunchPayload.TYPE, (payload, context) ->
|
||||
context.server().execute(() -> handleJumpyBootsLaunch(context.player(), payload)));
|
||||
ServerPlayNetworking.registerGlobalReceiver(MultipartAttackPayload.TYPE, (payload, context) ->
|
||||
context.server().execute(() -> handleMultipartAttack(context.player(), payload)));
|
||||
ServerPlayNetworking.registerGlobalReceiver(MultipartInteractPayload.TYPE, (payload, context) ->
|
||||
@@ -262,4 +268,40 @@ public final class AntarchyFabricNetworking {
|
||||
InteractionHand hand = payload.handId() == 0 ? InteractionHand.MAIN_HAND : InteractionHand.OFF_HAND;
|
||||
owner.antarchy$interactMultipartPart(part, serverPlayer, part.position(), hand);
|
||||
}
|
||||
|
||||
private static void handleJumpyBootsLaunch(ServerPlayer player, JumpyBootsLaunchPayload payload) {
|
||||
if (!JumpyBootsItem.isWearingJumpyBoots(player)) return;
|
||||
if (player.isSpectator() || player.isPassenger()) return;
|
||||
|
||||
ItemStack boots = player.getItemBySlot(EquipmentSlot.FEET);
|
||||
if (player.getCooldowns().isOnCooldown(boots.getItem())) return;
|
||||
|
||||
int clampedCharge = Math.min(payload.chargeTicks(), JumpyBootsHelper.CHARGE_TICKS_MAX);
|
||||
if (clampedCharge <= 0) return;
|
||||
|
||||
float verticalBoost = JumpyBootsHelper.verticalBoostFor(clampedCharge);
|
||||
Vec3 current = player.getDeltaMovement();
|
||||
double newX = current.x;
|
||||
double newZ = current.z;
|
||||
|
||||
if (payload.sprinting()) {
|
||||
Vec3 look = player.getLookAngle();
|
||||
newX += look.x * JumpyBootsHelper.SPRINT_FORWARD_BOOST;
|
||||
newZ += look.z * JumpyBootsHelper.SPRINT_FORWARD_BOOST;
|
||||
}
|
||||
|
||||
player.setDeltaMovement(newX, verticalBoost, newZ);
|
||||
player.hasImpulse = true;
|
||||
player.hurtMarked = true;
|
||||
player.resetFallDistance();
|
||||
player.connection.send(new ClientboundSetEntityMotionPacket(player));
|
||||
|
||||
player.level().playSound(null, player.blockPosition(), SoundEvents.SLIME_JUMP, SoundSource.PLAYERS,
|
||||
1.0F, 0.6F + (clampedCharge / (float) JumpyBootsHelper.CHARGE_TICKS_MAX) * 0.6F);
|
||||
|
||||
player.getPersistentData().putLong(JumpyBootsHelper.FALL_PROTECTION_NBT_KEY,
|
||||
player.level().getGameTime() + JumpyBootsHelper.FALL_PROTECTION_TICKS);
|
||||
|
||||
player.getCooldowns().addCooldown(boots.getItem(), JumpyBootsHelper.COOLDOWN_TICKS);
|
||||
}
|
||||
}
|
||||
@@ -14,6 +14,7 @@
|
||||
"BloodglassEffectMixin",
|
||||
"BloodglassRespawnMixin",
|
||||
"DreamCampfireBlockEntityMixin",
|
||||
"JumpyBootsFallDamageMixin",
|
||||
"infinity.RandomSpringMixin",
|
||||
"infinity.PortalCreatorMixin"
|
||||
],
|
||||
|
||||
Reference in new issue
Block a user