Skip to content

Commit

Permalink
Update to Minecraft 1.21
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Jun 28, 2024
1 parent 80ec5df commit 39364b3
Show file tree
Hide file tree
Showing 378 changed files with 5,490 additions and 9,869 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: '17'
java-version: '21'
- name: Cache Gradle User Files
uses: actions/cache@v1
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:

steps:
- uses: actions/checkout@v2
- name: Set up JDK 17
- name: Set up JDK 21
uses: actions/setup-java@v1
with:
java-version: '17'
java-version: '21'
- name: Cache Gradle User Files
uses: actions/cache@v1
with:
Expand Down
33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,30 @@
# Arclight

A Bukkit server implementation utilizing Mixin.
A Bukkit server implementation on common mod loaders.

![Downloads](https://img.shields.io/github/downloads/IzzelAliz/Arclight/total?style=flat-square) ![GitHub](https://img.shields.io/github/license/IzzelAliz/Arclight?style=flat-square)

| Release | Forge | NeoForge | Fabric | Status | Downloads |
|:---------------------|:--------|:---------|:-------|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Whisper (1.20.4) | 49.0.49 | 20.4.234 | 0.97.0 | ACTIVE | [![1.20.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Whisper&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AWhisper) |
| Trials (1.20-1.20.1) | 47.2.20 | - | - | LTS | [![1.20.1 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Trials&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ATrials) |
| Horn (1.19-1.19.2) | 43.3.7 | - | - | LTS | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
| Release | Forge | NeoForge | Fabric | Status | Downloads |
|:---------------------|:--------|:------------|:--------|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Feudal Kings (1.21) | 51.0.5 | 21.0.4-beta | 0.100.1 | ACTIVE | [![1.21 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=FeudalKings&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AFeudalKings) |
| Whisper (1.20.4) | 49.0.49 | 20.4.234 | 0.97.0 | ACTIVE | [![1.20.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Whisper&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AWhisper) |
| Trials (1.20-1.20.1) | 47.2.20 | - | - | LTS | [![1.20.1 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Trials&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ATrials) |

**Legacy versions**:

<details>

| Release | Forge | Status | Build |
|:-------------------:|:-------:|:-------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Net (1.20.2) | 48.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/Net%2F1.0.1) | [![1.20.2 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Net&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ANet) |
| Executions (1.19.4) | 45.2.6 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/Executions%2F1.0.6) | [![1.19.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Executions&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AExecutions) |
| Great Horn (1.19.3) | 44.1.22 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/GreatHorn/1.0.3) | [![1.19 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=GreatHorn&style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
| 1.18.x | 40.2.14 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.18%2F1.0.10) | [![1.18 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=1.18&style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
| 1.17.x | 37.1.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [![1.17 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-17?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
| 1.16.x | 36.2.39 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.16%2F1.0.25) | [![1.16 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=1.16&style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
| 1.15.x | 31.2.48 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
| 1.14.x | 28.2.0 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) |
| Release | Forge | NeoForge | Fabric | Status | Downloads |
|:--------------------|:--------|:---------|:-------|:-------------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Net (1.20.2) | 48.1.0 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/Net%2F1.0.1) | [![1.20.2 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Net&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3ANet) |
| Executions (1.19.4) | 45.2.6 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/Executions%2F1.0.6) | [![1.19.4 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=Executions&style=flat-square)](https://github.com/IzzelAliz/Arclight/actions?query=branch%3AExecutions) |
| Great Horn (1.19.3) | 44.1.22 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/GreatHorn/1.0.3) | [![1.19 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=GreatHorn&style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
| Horn (1.19-1.19.2) | 43.3.7 | - | - | LEGACY | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
| 1.18.x | 40.2.14 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.18%2F1.0.10) | [![1.18 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=1.18&style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-18) |
| 1.17.x | 37.1.0 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.17/1.0.2) | [![1.17 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-17?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-17) |
| 1.16.x | 36.2.39 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.16%2F1.0.25) | [![1.16 Status](https://img.shields.io/github/actions/workflow/status/IzzelAliz/Arclight/gradle.yml?branch=1.16&style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-16) |
| 1.15.x | 31.2.48 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.15/1.0.19) | [![1.15 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-15?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-15) |
| 1.14.x | 28.2.0 | | | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/1.0.6) | [![1.14 Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight) |

* Legacy version still accepts pull requests.

Expand Down
2 changes: 1 addition & 1 deletion arclight-common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ loom {
arclight {
mcVersion = minecraftVersion
forgeVersion = project.ext.forgeVersion
bukkitVersion = 'v1_20_R3'
bukkitVersion = 'v1_21_R1'
accessTransformer = project.file('bukkit.at')
extraMapping = project(':arclight-common').file('extra_mapping.tsrg')
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,5 @@
package io.izzel.arclight.common.bridge.bukkit;

import java.util.Map;
import net.minecraft.nbt.CompoundTag;
import net.minecraft.nbt.Tag;

public interface ItemMetaBridge {

CompoundTag bridge$getForgeCaps();

void bridge$setForgeCaps(CompoundTag nbt);

void bridge$offerUnhandledTags(CompoundTag nbt);

Map<String, Tag> bridge$getUnhandledTags();

void bridge$setUnhandledTags(Map<String, Tag> tags);
}
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
package io.izzel.arclight.common.bridge.bukkit;

import io.izzel.arclight.i18n.conf.MaterialPropertySpec;
import net.minecraft.core.component.DataComponents;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import net.minecraft.world.level.block.entity.AbstractFurnaceBlockEntity;
import org.bukkit.block.BlockState;
import org.bukkit.craftbukkit.v.block.CraftBlock;
import org.bukkit.craftbukkit.v.inventory.CraftMetaItem;
import org.bukkit.inventory.meta.ItemMeta;

import javax.annotation.Nullable;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.level.block.Block;
import java.util.function.Function;

public interface MaterialBridge {
Expand Down Expand Up @@ -40,19 +41,19 @@ public interface MaterialBridge {

boolean bridge$shouldApplyStateFactory();

default Item bridge$getCraftRemainingItem(Item item) {
default Item bridge$getCraftRemainingItem(Item item) {
return item.getCraftingRemainingItem();
}

default int bridge$forge$getMaxStackSize(Item item) {
return item.getMaxStackSize();
return item.getDefaultMaxStackSize();
}

default int bridge$forge$getDurability(Item item) {
return item.getMaxDamage();
return item.components().getOrDefault(DataComponents.MAX_DAMAGE, 0);
}

default int bridge$forge$getBurnTime(Item item) {
default int bridge$forge$getBurnTime(Item item) {
var result = AbstractFurnaceBlockEntity.getFuel().get(item);
return result != null ? result : 0;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
package io.izzel.arclight.common.bridge.core.entity;

public interface AreaEffectCloudEntityBridge {

void bridge$refreshEffects();
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,21 @@
import io.izzel.tools.product.Product;
import io.izzel.tools.product.Product4;
import net.minecraft.core.BlockPos;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.entity.boss.EnderDragonPart;
import net.minecraft.world.entity.boss.enderdragon.EnderDragon;
import net.minecraft.world.phys.Vec3;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v.entity.CraftEntity;
import org.bukkit.craftbukkit.v.event.CraftPortalEvent;
import org.bukkit.event.entity.EntityRemoveEvent;
import org.bukkit.event.player.PlayerTeleportEvent;
import org.bukkit.projectiles.ProjectileSource;

import java.util.List;

public interface EntityBridge extends ICommandSourceBridge, InjectEntityBridge {

Entity bridge$teleportTo(ServerLevel world, Vec3 blockPos);

void bridge$setOnFire(int tick, boolean callEvent);
void bridge$setOnFire(float seconds, boolean callEvent);

CraftEntity bridge$getBukkitEntity();

Expand Down Expand Up @@ -52,10 +51,6 @@ public interface EntityBridge extends ICommandSourceBridge, InjectEntityBridge {

void bridge$postTick();

boolean bridge$removePassenger(Entity passenger);

boolean bridge$addPassenger(Entity entity);

List<Entity> bridge$getPassengers();

void bridge$setRideCooldown(int rideCooldown);
Expand All @@ -66,12 +61,18 @@ public interface EntityBridge extends ICommandSourceBridge, InjectEntityBridge {

void bridge$setLastLavaContact(BlockPos pos);

Vec3 bridge$getLastTpPos();

void bridge$revive();

void bridge$pushEntityRemoveCause(EntityRemoveEvent.Cause cause);

CraftPortalEvent bridge$callPortalEvent(Entity entity, Location exit, PlayerTeleportEvent.TeleportCause cause, int searchRadius, int creationRadius);

boolean bridge$pluginRemoved();

boolean bridge$isForceDrops();

void bridge$setForceDrops(boolean b);

default boolean bridge$forge$isPartEntity() {
return this instanceof EnderDragonPart;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
package io.izzel.arclight.common.bridge.core.entity;

import io.izzel.tools.product.Product;
import io.izzel.tools.product.Product3;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Holder;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.damagesource.DamageSource;
import net.minecraft.world.effect.MobEffect;
Expand All @@ -14,13 +13,11 @@
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.state.BlockState;
import org.bukkit.craftbukkit.v.entity.CraftLivingEntity;
import org.bukkit.event.entity.EntityKnockbackEvent;
import org.bukkit.event.entity.EntityPotionEffectEvent;
import org.bukkit.event.entity.EntityRegainHealthEvent;

import javax.annotation.Nullable;
import java.util.Collection;
import java.util.Optional;

Expand All @@ -32,9 +29,7 @@ public interface LivingEntityBridge extends EntityBridge {

boolean bridge$canPickUpLoot();

boolean bridge$isForceDrops();

int bridge$getExpReward();
int bridge$getExpReward(Entity entity);

void bridge$setExpToDrop(int amount);

Expand All @@ -48,7 +43,7 @@ public interface LivingEntityBridge extends EntityBridge {

boolean bridge$addEffect(MobEffectInstance effect, EntityPotionEffectEvent.Cause cause);

boolean bridge$removeEffect(MobEffect effect, EntityPotionEffectEvent.Cause cause);
boolean bridge$removeEffect(Holder<MobEffect> effect, EntityPotionEffectEvent.Cause cause);

boolean bridge$removeAllEffects(EntityPotionEffectEvent.Cause cause);

Expand All @@ -63,27 +58,6 @@ public interface LivingEntityBridge extends EntityBridge {
return originalExperience;
}

default boolean bridge$forge$mobEffectExpired(MobEffectInstance effect) {
return false;
}

default boolean bridge$forge$mobEffectAdded(MobEffectInstance old, MobEffectInstance effect, Entity entity) {
return false;
}

default float bridge$forge$onLivingHurt(LivingEntity entity, DamageSource src, float amount) {
return amount;
}

default Product3<Boolean /*cancelled*/, Float /*block damage*/, Boolean /*shield take damage*/> bridge$forge$onShieldBlock(
LivingEntity blocker, DamageSource source, float blocked) {
return Product.of(false, blocked, true);
}

default float bridge$forge$onLivingDamage(LivingEntity entity, DamageSource src, float amount) {
return amount;
}

default boolean bridge$forge$onLivingUseTotem(LivingEntity entity, DamageSource damageSource, ItemStack totem, InteractionHand hand) {
return true;
}
Expand All @@ -93,24 +67,12 @@ enum LivingTargetType {
MOB_TARGET
}

default @Nullable LivingEntity bridge$forge$onLivingChangeTarget(LivingEntity entity, LivingEntity originalTarget, LivingTargetType targetType) {
return originalTarget;
}

default BlockPos bridge$forge$onEnderTeleport(LivingEntity entity, double targetX, double targetY, double targetZ) {
return BlockPos.containing(targetX, targetY, targetZ);
}

default void bridge$forge$onLivingConvert(LivingEntity entity, LivingEntity outcome) {}

default boolean bridge$forge$canEntityDestroy(Level level, BlockPos pos, LivingEntity entity) {
return true;
}

default boolean bridge$forge$onEntityDestroyBlock(LivingEntity entity, BlockPos pos, BlockState state) {
return true;
}

void bridge$common$startCaptureDrops();

boolean bridge$common$isCapturingDrops();
Expand All @@ -119,5 +81,5 @@ enum LivingTargetType {

Collection<ItemEntity> bridge$common$getCapturedDrops();

void bridge$common$finishCaptureAndFireEvent();
void bridge$common$finishCaptureAndFireEvent(DamageSource damageSource);
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.izzel.arclight.common.bridge.core.entity;

import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.entity.AgeableMob;
import net.minecraft.world.entity.LivingEntity;
import net.minecraft.world.entity.Mob;
Expand All @@ -20,8 +19,6 @@ public interface MobEntityBridge extends LivingEntityBridge {

boolean bridge$lastGoalTargetResult();

ResourceLocation bridge$getLootTable();

boolean bridge$isPersistenceRequired();

void bridge$setPersistenceRequired(boolean value);
Expand Down
Loading

0 comments on commit 39364b3

Please sign in to comment.