Skip to content

Commit

Permalink
Update to Minecraft 1.20.2
Browse files Browse the repository at this point in the history
  • Loading branch information
IzzelAliz committed Sep 24, 2023
1 parent f347f85 commit fd650cc
Show file tree
Hide file tree
Showing 102 changed files with 1,190 additions and 984 deletions.
27 changes: 14 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,24 +4,25 @@ A Bukkit server implementation utilizing Mixin.

![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 | Status | Build |
|:--------------------:|:-------:|:------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Trials (1.20-1.20.1) | 47.2.0 | ACTIVE | [![1.19.4 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) |
| Executions (1.19.4) | 45.1.0 | LTS | [![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) |
| 1.18.x | 40.1.80 | LTS | [![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.16.x | 36.2.39 | LTS | [![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) |
| Release | Forge | Status | Build |
|:--------------------:|:------:|:------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Net (1.20.2) | 48.0.4 | ACTIVE | [![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) |
| Trials (1.20-1.20.1) | 47.2.0 | 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 |
|:-------:|:-------:|:----------------------------------------------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------:|
| 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.2.11 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/horn/1.0.2) | [![Horn Status](https://img.shields.io/appveyor/build/IzzelAliz/arclight-19?style=flat-square)](https://ci.appveyor.com/project/IzzelAliz/arclight-19) |
| 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.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 | Status | Build |
|:-------------------:|:-------:|:----------------------------------------------------------------------------:|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
| Executions (1.19.4) | 45.1.0 | LEGACY | [![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.2.11 | [LEGACY](https://github.com/IzzelAliz/Arclight/releases/tag/horn/1.0.2) | [![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.1.80 | LEGACY | [![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 | [![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 @@ -24,7 +24,7 @@ apply plugin: 'io.izzel.arclight'
arclight {
mcVersion = minecraftVersion
forgeVersion = project.ext.forgeVersion
bukkitVersion = 'v1_20_R1'
bukkitVersion = 'v1_20_R2'
wipeVersion = true
reobfVersion = true
accessTransformer = project.file('bukkit.at')
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
package io.izzel.arclight.common.bridge.core.entity;

import io.izzel.arclight.common.bridge.core.command.ICommandSourceBridge;
import net.minecraft.core.PositionImpl;
import net.minecraft.server.level.ServerLevel;
import net.minecraft.world.entity.Entity;
import net.minecraft.world.phys.Vec3;
import org.bukkit.craftbukkit.v.entity.CraftEntity;
import org.bukkit.projectiles.ProjectileSource;

import java.util.List;

public interface EntityBridge extends ICommandSourceBridge {

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

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import io.izzel.arclight.common.mod.util.WrappedContents;
import net.minecraft.world.Container;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeHolder;
import org.bukkit.Location;
import org.bukkit.craftbukkit.v.entity.CraftHumanEntity;
import org.bukkit.craftbukkit.v.inventory.CraftInventory;
Expand Down Expand Up @@ -35,11 +35,11 @@ default List<ItemStack> getContents() {

Location getLocation();

default Recipe<?> getCurrentRecipe() {
default RecipeHolder<?> getCurrentRecipe() {
return null;
}

default void setCurrentRecipe(Recipe<?> recipe) {
default void setCurrentRecipe(RecipeHolder<?> recipe) {
}

default Inventory getOwnerInventory() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package io.izzel.arclight.common.bridge.core.item.crafting;

import org.bukkit.NamespacedKey;
import org.bukkit.inventory.Recipe;

public interface RecipeBridge {

Recipe bridge$toBukkitRecipe(NamespacedKey id);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

import org.bukkit.inventory.Recipe;

public interface IRecipeBridge {
public interface RecipeHolderBridge {

Recipe bridge$toBukkitRecipe();
}
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package io.izzel.arclight.common.bridge.core.item.crafting;

import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeHolder;

public interface RecipeManagerBridge {

void bridge$addRecipe(Recipe<?> recipe);
void bridge$addRecipe(RecipeHolder<?> recipe);

void bridge$clearRecipes();
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
package io.izzel.arclight.common.bridge.core.network.common;

import net.minecraft.server.level.ServerPlayer;

public interface ServerCommonPacketListenerBridge {

boolean bridge$processedDisconnect();

boolean bridge$isDisconnected();

void bridge$setPlayer(ServerPlayer player);
}
Original file line number Diff line number Diff line change
@@ -1,17 +1,12 @@
package io.izzel.arclight.common.bridge.core.network.play;

import io.izzel.arclight.common.bridge.core.network.common.ServerCommonPacketListenerBridge;
import org.bukkit.Location;
import org.bukkit.event.player.PlayerTeleportEvent;

public interface ServerPlayNetHandlerBridge {
public interface ServerPlayNetHandlerBridge extends ServerCommonPacketListenerBridge {

void bridge$pushTeleportCause(PlayerTeleportEvent.TeleportCause cause);

void bridge$disconnect(String str);

void bridge$teleport(Location dest);

boolean bridge$processedDisconnect();

boolean bridge$isDisconnected();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

import net.minecraft.server.level.ServerPlayer;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.item.crafting.Recipe;
import net.minecraft.world.item.crafting.RecipeHolder;

import java.util.List;

public interface AbstractFurnaceTileEntityBridge {

List<Recipe<?>> bridge$dropExp(ServerPlayer entity, ItemStack itemStack, int amount);
List<RecipeHolder<?>> bridge$dropExp(ServerPlayer entity, ItemStack itemStack, int amount);

int bridge$getBurnDuration(ItemStack stack);

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
import org.bukkit.entity.Entity;
import org.bukkit.entity.EntityType;
import org.bukkit.event.entity.CreatureSpawnEvent;
import org.bukkit.util.Consumer;
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.CallbackInfoReturnable;

import java.util.function.Consumer;
import java.util.function.Function;

@Mixin(value = CraftRegionAccessor.class, remap = false)
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.izzel.arclight.common.mixin.bukkit;

import io.izzel.arclight.common.bridge.core.item.crafting.IRecipeBridge;
import io.izzel.arclight.common.bridge.core.item.crafting.RecipeHolderBridge;
import it.unimi.dsi.fastutil.objects.Object2ObjectLinkedOpenHashMap;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.crafting.RecipeHolder;
import net.minecraft.world.item.crafting.RecipeType;
import org.bukkit.craftbukkit.v.inventory.RecipeIterator;
import org.bukkit.inventory.Recipe;
Expand All @@ -17,26 +19,10 @@
public class RecipeIteratorMixin {

// @formatter:off
@Shadow private Iterator<net.minecraft.world.item.crafting.Recipe<?>> current;
@Shadow @Final private Iterator<Map.Entry<RecipeType<?>, Map<ResourceLocation, net.minecraft.world.item.crafting.Recipe<?>>>> recipes;
@Shadow @Final private Iterator<Map.Entry<RecipeType<?>, Object2ObjectLinkedOpenHashMap<ResourceLocation, RecipeHolder<?>>>> recipes;
@Shadow private Iterator<RecipeHolder<?>> current;
// @formatter:on

/**
* @author IzzelAliz
* @reason
*/
@Overwrite
public boolean hasNext() {
if (current != null && current.hasNext()) {
return true;
}
if (recipes.hasNext()) {
current = recipes.next().getValue().values().iterator();
return hasNext();
}
return false;
}

/**
* @author IzzelAliz
* @reason
Expand All @@ -47,11 +33,11 @@ public Recipe next() {
current = recipes.next().getValue().values().iterator();
return next();
}
net.minecraft.world.item.crafting.Recipe<?> recipe = current.next();
var recipe = current.next();
try {
return ((IRecipeBridge) recipe).bridge$toBukkitRecipe();
return ((RecipeHolderBridge) (Object) recipe).bridge$toBukkitRecipe();
} catch (Throwable e) {
throw new RuntimeException("Error converting recipe " + recipe.getId(), e);
throw new RuntimeException("Error converting recipe " + recipe.id(), e);
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
package io.izzel.arclight.common.mixin.core.advancements;

import io.izzel.arclight.common.bridge.core.advancement.AdvancementBridge;
import net.minecraft.advancements.AdvancementHolder;
import org.bukkit.advancement.Advancement;
import org.bukkit.craftbukkit.v.advancement.CraftAdvancement;
import org.spongepowered.asm.mixin.Mixin;

@Mixin(AdvancementHolder.class)
public class AdvancementHolderMixin implements AdvancementBridge {

@Override
public Advancement bridge$getBukkit() {
return new CraftAdvancement((AdvancementHolder) (Object) this);
}
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,14 @@

import com.mojang.authlib.properties.Property;
import io.izzel.arclight.common.bridge.core.network.NetworkManagerBridge;
import io.netty.channel.Channel;
import net.minecraft.network.Connection;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Shadow;

import java.util.UUID;

@Mixin(Connection.class)
public class ConnectionMixin implements NetworkManagerBridge {

@Shadow public Channel channel;
public java.util.UUID spoofedUUID;
public com.mojang.authlib.properties.Property[] spoofedProfile;
public String hostname;
Expand Down
Loading

0 comments on commit fd650cc

Please sign in to comment.