Compare commits

..
Author SHA1 Message Date
Dream Master 175ea9b6ff update 2025-07-18 10:19:59 +07:00
Dream Master 8d98b59370 Merge branch 'master' into dev 2025-07-18 10:19:32 +07:00
boubou19 4001d105a8 Speed up forge event registration (#62) 2025-07-17 19:17:22 +02:00
Dream Master b741ac43f7 update 2025-07-17 22:52:52 +07:00
Dream Master d0ea0b8be8 Merge remote-tracking branch 'origin/speed-up' into dev 2025-07-17 22:52:22 +07:00
boubou19 fb189fe873 spotlessApply 2025-07-17 13:21:00 +02:00
boubou19 01a9b12525 Remove unnecessary event registration 2025-07-17 13:20:13 +02:00
boubou19 b5964875af Speed up BlockConcrete event registration 2025-07-17 13:18:51 +02:00
5 changed files with 29 additions and 28 deletions

No files matched your search

+4 -4
View File
@@ -2,13 +2,13 @@
dependencies {
implementation("com.github.GTNewHorizons:CodeChickenCore:1.4.3:dev")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.60-GTNH:dev")
implementation("com.github.GTNewHorizons:ForgeMultipart:1.6.6:dev")
implementation("com.github.GTNewHorizons:NotEnoughItems:2.7.66-GTNH:dev")
implementation("com.github.GTNewHorizons:ForgeMultipart:1.6.7:dev")
compileOnly("org.projectlombok:lombok:1.18.24")
annotationProcessor("org.projectlombok:lombok:1.18.24")
devOnlyNonPublishable("com.github.GTNewHorizons:waila:1.8.10:dev") {
devOnlyNonPublishable("com.github.GTNewHorizons:waila:1.8.12:dev") {
transitive = false
}
devOnlyNonPublishable("com.github.GTNewHorizons:WailaHarvestability:1.3.4-GTNH:dev")
@@ -17,7 +17,7 @@ dependencies {
transitive = false
}
compileOnly("com.github.GTNewHorizons:Angelica:1.0.0-beta47:api") {
compileOnly("com.github.GTNewHorizons:Angelica:1.0.0-beta51:api") {
transitive = false
}
}
+1 -1
View File
@@ -151,7 +151,7 @@ modrinthProjectId =
# type can be one of [project, version],
# and the name is the Modrinth project or version slug/id of the other mod.
# Example: required-project:fplib;optional-project:gasstation;incompatible-project:gregtech
# Note: GTNH Mixins is automatically set as a required dependency if usesMixins = true
# Note: UniMixins is automatically set as a required dependency if usesMixins = true.
modrinthRelations =
# Publishing to CurseForge requires you to set the CURSEFORGE_TOKEN environment variable to one of your CurseForge API tokens.
+1 -1
View File
@@ -17,7 +17,7 @@ pluginManagement {
}
plugins {
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.38'
id 'com.gtnewhorizons.gtnhsettingsconvention' version '1.0.41'
}
@@ -21,31 +21,34 @@ public class BlockConcrete extends BlockCarvable {
super();
FMLCommonHandler.instance()
.bus()
.register(this);
.register(new EventHandler());
}
@SideOnly(Side.CLIENT)
private static MovementInput manualInputCheck;
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void speedupPlayer(PlayerTickEvent event) {
if (event.phase == Phase.START && event.side.isClient()
&& event.player.onGround
&& event.player instanceof EntityPlayerSP) {
if (manualInputCheck == null) {
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
}
EntityPlayerSP player = (EntityPlayerSP) event.player;
Block below = player.worldObj.getBlock(
MathHelper.floor_double(player.posX),
MathHelper.floor_double(player.posY) - 2,
MathHelper.floor_double(player.posZ));
if (below == this) {
manualInputCheck.updatePlayerMoveState();
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
player.motionX *= Configurations.concreteVelocityMult + 0.05;
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
public class EventHandler {
@SubscribeEvent
@SideOnly(Side.CLIENT)
public void speedupPlayer(PlayerTickEvent event) {
if (event.phase == Phase.START && event.side.isClient()
&& event.player.onGround
&& event.player instanceof EntityPlayerSP) {
if (manualInputCheck == null) {
manualInputCheck = new MovementInputFromOptions(Minecraft.getMinecraft().gameSettings);
}
EntityPlayerSP player = (EntityPlayerSP) event.player;
Block below = player.worldObj.getBlock(
MathHelper.floor_double(player.posX),
MathHelper.floor_double(player.posY) - 2,
MathHelper.floor_double(player.posZ));
if (below == BlockConcrete.this) {
manualInputCheck.updatePlayerMoveState();
if (manualInputCheck.moveForward != 0 || manualInputCheck.moveStrafe != 0) {
player.motionX *= Configurations.concreteVelocityMult + 0.05;
player.motionZ *= Configurations.concreteVelocityMult + 0.05;
}
}
}
}
@@ -14,7 +14,6 @@ import net.minecraft.init.Items;
import net.minecraft.item.Item;
import net.minecraft.item.ItemStack;
import net.minecraft.world.World;
import net.minecraftforge.common.MinecraftForge;
import com.cricketcraft.chisel.api.IChiselItem;
import com.cricketcraft.chisel.api.carving.ICarvingRegistry;
@@ -68,7 +67,6 @@ public class ItemChisel extends Item implements IChiselItem {
+ type.name()
.toLowerCase());
}
MinecraftForge.EVENT_BUS.register(this);
}
@Override