Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: remove byte buddy and improve startup time significantly #492

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
db140d8
refactor: block entity
smartcmd Nov 22, 2024
e879c8f
refactor: entity
smartcmd Nov 22, 2024
f9dc0ca
build: use specific protocol lib version
smartcmd Nov 22, 2024
1f1e6ac
build: revert
smartcmd Nov 22, 2024
5fa10ed
feat: item
smartcmd Nov 22, 2024
698303b
fix: fix hard item type for vanilla block being registered as custom …
smartcmd Nov 23, 2024
3765c86
fix: fix command output for the sender itself being shown wrongly
smartcmd Nov 23, 2024
d2967ff
refactor: merge impls
smartcmd Nov 23, 2024
015b3b2
refactor: block
smartcmd Nov 24, 2024
d0f7037
refactor: merge impls
smartcmd Nov 24, 2024
7372670
refactor: merge interfaces for block
smartcmd Nov 25, 2024
2db9a02
refactor: merge buttons
smartcmd Nov 25, 2024
e160a4a
refactor: merge wools
smartcmd Nov 25, 2024
dbf15ea
Merge branch 'master' into refactor/remove-byte-buddy
smartcmd Nov 25, 2024
2453b28
refactor: merge more blocks
smartcmd Nov 25, 2024
94eb283
refactor: merge more blocks
smartcmd Nov 25, 2024
8030bd4
refactor: merge more blocks
smartcmd Nov 25, 2024
38ae0d0
fix: fix test
smartcmd Nov 25, 2024
08d01d3
refactor: optimize BlockTypeDefaultInitializer
smartcmd Nov 25, 2024
c96c8ae
refactor: optimize EntityTypeDefaultInitializer
smartcmd Nov 26, 2024
480463c
fix: fix useless ";" mark in generated class
smartcmd Nov 26, 2024
6eb8133
refactor: remove subpackage for block
smartcmd Nov 26, 2024
e602bf1
Merge branch 'master' into refactor/remove-byte-buddy
smartcmd Nov 26, 2024
c972a77
refactor: optimize ItemTypeDefaultInitializer
smartcmd Nov 27, 2024
8ddbfb1
refactor: finish item
smartcmd Nov 27, 2024
3d685c7
refactor: remove useless toString() call
smartcmd Nov 27, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
The diff you're trying to view is too large. We only load the first 3000 changed files.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonObject;
import lombok.Builder;
import lombok.EqualsAndHashCode;
import lombok.Getter;
Expand Down Expand Up @@ -106,8 +107,8 @@ public class BlockStateData {
@Builder.Default
protected float friction = DEFAULT_FRICTION;
/**
* The amount that light will be dampened when it passes through the block, in a range (0-15).
* Higher value means the light will be dampened more.
* The amount that light will be dampened when it passes through the block, in a range (0-15).
* Higher value means the light will be dampened more.
*/
@Builder.Default
protected int lightDampening = 15;
Expand All @@ -132,6 +133,10 @@ public static BlockStateData fromJson(String json) {
return SERIALIZER.fromJson(json, BlockStateData.class);
}

public static BlockStateData fromJson(JsonObject json) {
return SERIALIZER.fromJson(json, BlockStateData.class);
}

public boolean hasCollision() {
return !collisionShape.getSolids().isEmpty();
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockAnvilBehavior extends BlockBehavior {
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;
import org.allaymc.api.block.component.BlockEntityHolderComponent;
import org.allaymc.api.blockentity.interfaces.BlockEntityBlastFurnace;

public interface BlockBlastFurnaceBehavior extends BlockBehavior {
public interface BlockBlastFurnaceBehavior extends BlockBehavior, BlockEntityHolderComponent<BlockEntityBlastFurnace> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockBricksBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockButtonBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCandleBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCandleCakeBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCarpetBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCoarseDirtBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockColoredTorchBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockConcreteBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockConcretePowderBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCopperBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCopperDoorBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCopperTrapdoorBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCoralBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCoralBlockBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCoralFanBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockCoralWallFanBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockDirtBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockDoorBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockElementBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockFenceBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockFenceGateBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockHangingSignBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockHeadBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockIronDoorBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockIronTrapdoorBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockLargeAmethystBudBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockLeavesBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockLightBlockBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockLiquidBehavior extends BlockBehavior {
}

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockMediumAmethystBudBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockPistonArmCollisionBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockPistonBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockPlanksBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockPurpurBlockBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockPurpurPillarBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.block.interfaces.sand;
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;
import org.allaymc.api.block.component.BlockFallableBaseComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockRedstoneTorchBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package org.allaymc.api.block.interfaces.sand;
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;
import org.allaymc.api.block.component.BlockFallableBaseComponent;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockSandstoneBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockSaplingBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;
import org.allaymc.api.block.component.BlockEntityHolderComponent;
import org.allaymc.api.blockentity.interfaces.BlockEntityShulkerBox;

public interface BlockShulkerBoxBehavior extends BlockBehavior,
BlockEntityHolderComponent<BlockEntityShulkerBox> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;
import org.allaymc.api.block.component.BlockEntityHolderComponent;
import org.allaymc.api.blockentity.interfaces.BlockEntitySign;

public interface BlockSignBehavior extends BlockBehavior, BlockEntityHolderComponent<BlockEntitySign> {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockSlabBehavior extends BlockBehavior {
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package org.allaymc.api.block.interfaces;

import org.allaymc.api.block.BlockBehavior;

public interface BlockSmallAmethystBudBehavior extends BlockBehavior {
}
Loading