-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: Support for L2Tabs and multiple fixes.
- Loading branch information
Showing
16 changed files
with
137 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
1.0.8 | ||
1.0.9 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
src/main/java/com/seniors/justlevelingfork/client/gui/TabJustLeveling.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.seniors.justlevelingfork.client.gui; | ||
|
||
import com.seniors.justlevelingfork.client.core.Utils; | ||
import com.seniors.justlevelingfork.client.screen.JustLevelingScreen; | ||
import dev.xkmc.l2tabs.tabs.core.BaseTab; | ||
import dev.xkmc.l2tabs.tabs.core.TabManager; | ||
import dev.xkmc.l2tabs.tabs.core.TabToken; | ||
import net.minecraft.client.Minecraft; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.item.ItemStack; | ||
|
||
public class TabJustLeveling extends BaseTab<TabJustLeveling> { | ||
|
||
public TabJustLeveling(TabToken<TabJustLeveling> token, TabManager manager, ItemStack stack, Component title){ | ||
super(token, manager, stack, title); | ||
} | ||
|
||
@Override | ||
public void onTabClicked() { | ||
Utils.playSound(); | ||
Minecraft.getInstance().setScreen(new JustLevelingScreen()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 10 additions & 0 deletions
10
src/main/java/com/seniors/justlevelingfork/integration/L2TabsIntegration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
package com.seniors.justlevelingfork.integration; | ||
|
||
import net.minecraftforge.fml.ModList; | ||
|
||
public class L2TabsIntegration { | ||
|
||
public static boolean isModLoaded() { | ||
return ModList.get().isLoaded("l2tabs"); | ||
} | ||
} |
30 changes: 30 additions & 0 deletions
30
src/main/java/com/seniors/justlevelingfork/integration/ScorchedGuns2Integration.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
package com.seniors.justlevelingfork.integration; | ||
|
||
import com.seniors.justlevelingfork.common.capability.AptitudeCapability; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraftforge.eventbus.api.EventPriority; | ||
import net.minecraftforge.eventbus.api.SubscribeEvent; | ||
import net.minecraftforge.fml.ModList; | ||
import top.ribs.scguns.event.GunFireEvent; | ||
|
||
public class ScorchedGuns2Integration { | ||
|
||
public static boolean isModLoaded() { | ||
return ModList.get().isLoaded("scguns"); | ||
} | ||
|
||
@SubscribeEvent(priority = EventPriority.HIGHEST) | ||
public void onGunFireEvent(GunFireEvent.Pre event){ | ||
Player player = event.getEntity(); | ||
|
||
if (!player.isCreative()) { | ||
ItemStack itemStack = event.getStack(); | ||
AptitudeCapability provider = AptitudeCapability.get(player); | ||
if (!provider.canUseItemClient(itemStack)) { | ||
event.setCanceled(true); | ||
} | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.