├── .gitignore ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat └── src └── main ├── java └── com │ └── feed_the_beast │ └── ftblib │ ├── FTBLib.java │ ├── FTBLibCommon.java │ ├── FTBLibConfig.java │ ├── FTBLibEventHandler.java │ ├── FTBLibGameRules.java │ ├── FTBLibNotifications.java │ ├── client │ ├── BuiltinChunkMap.java │ ├── ClientConfig.java │ ├── EnumSidebarButtonPlacement.java │ ├── FTBLibClient.java │ ├── FTBLibClientConfig.java │ ├── FTBLibClientConfigManager.java │ ├── FTBLibClientEventHandler.java │ ├── FTBLibResourceType.java │ ├── GuiClientConfig.java │ ├── GuiSidebarButtonConfig.java │ ├── SidebarButton.java │ ├── SidebarButtonGroup.java │ ├── SidebarButtonManager.java │ ├── ThreadReloadChunkSelector.java │ ├── package-info.java │ └── teamsgui │ │ ├── GuiCreateTeam.java │ │ ├── GuiManageAllies.java │ │ ├── GuiManageEnemies.java │ │ ├── GuiManageMembers.java │ │ ├── GuiManageModerators.java │ │ ├── GuiManagePlayersBase.java │ │ ├── GuiSelectTeam.java │ │ ├── GuiTransferOwnership.java │ │ ├── PublicTeamData.java │ │ └── package-info.java │ ├── command │ ├── CmdAddFakePlayer.java │ ├── CmdMySettings.java │ ├── CmdReload.java │ ├── client │ │ ├── CommandClientConfig.java │ │ ├── CommandListAdvancements.java │ │ ├── CommandPrintItem.java │ │ ├── CommandPrintState.java │ │ ├── CommandSimulateButton.java │ │ └── package-info.java │ ├── package-info.java │ └── team │ │ ├── CmdCreate.java │ │ ├── CmdCreateServerTeam.java │ │ ├── CmdDelete.java │ │ ├── CmdGet.java │ │ ├── CmdInfo.java │ │ ├── CmdJoin.java │ │ ├── CmdKick.java │ │ ├── CmdLeave.java │ │ ├── CmdList.java │ │ ├── CmdRequestInvite.java │ │ ├── CmdSettings.java │ │ ├── CmdSettingsFor.java │ │ ├── CmdStatus.java │ │ ├── CmdTeam.java │ │ ├── CmdTransferOwnership.java │ │ └── package-info.java │ ├── events │ ├── FTBLibEvent.java │ ├── FTBLibPreInitRegistryEvent.java │ ├── IReloadHandler.java │ ├── RegisterRankConfigEvent.java │ ├── RegisterRankConfigHandlerEvent.java │ ├── ServerReloadEvent.java │ ├── SidebarButtonCreatedEvent.java │ ├── SyncGamerulesEvent.java │ ├── client │ │ ├── CustomClickEvent.java │ │ ├── GuideEvent.java │ │ └── package-info.java │ ├── package-info.java │ ├── player │ │ ├── ForgePlayerConfigEvent.java │ │ ├── ForgePlayerConfigSavedEvent.java │ │ ├── ForgePlayerDataEvent.java │ │ ├── ForgePlayerEvent.java │ │ ├── ForgePlayerLoadedEvent.java │ │ ├── ForgePlayerLoggedInEvent.java │ │ ├── ForgePlayerLoggedOutEvent.java │ │ ├── ForgePlayerSavedEvent.java │ │ └── package-info.java │ ├── team │ │ ├── ForgeTeamChangedEvent.java │ │ ├── ForgeTeamConfigEvent.java │ │ ├── ForgeTeamConfigSavedEvent.java │ │ ├── ForgeTeamCreatedEvent.java │ │ ├── ForgeTeamDataEvent.java │ │ ├── ForgeTeamDeletedEvent.java │ │ ├── ForgeTeamEvent.java │ │ ├── ForgeTeamLoadedEvent.java │ │ ├── ForgeTeamOwnerChangedEvent.java │ │ ├── ForgeTeamPlayerJoinedEvent.java │ │ ├── ForgeTeamPlayerLeftEvent.java │ │ ├── ForgeTeamSavedEvent.java │ │ └── package-info.java │ └── universe │ │ ├── PersistentScheduledTaskEvent.java │ │ ├── UniverseClearCacheEvent.java │ │ ├── UniverseClosedEvent.java │ │ ├── UniverseEvent.java │ │ ├── UniverseLoadedEvent.java │ │ ├── UniverseSavedEvent.java │ │ └── package-info.java │ ├── integration │ ├── FTBLibJEIIntegration.java │ ├── JEIGhostItemHandler.java │ ├── JEIGlobalGuiHandler.java │ ├── WidgetTarget.java │ └── package-info.java │ ├── lib │ ├── ATHelper.java │ ├── ClientATHelper.java │ ├── EnumMessageLocation.java │ ├── EnumReloadType.java │ ├── EnumTeamColor.java │ ├── EnumTeamStatus.java │ ├── EventBase.java │ ├── OtherMods.java │ ├── block │ │ ├── BlockSpecialDrop.java │ │ ├── EnumHorizontalOffset.java │ │ ├── EnumRotation.java │ │ └── package-info.java │ ├── client │ │ ├── CachedVertexData.java │ │ ├── ClientUtils.java │ │ ├── IPixelBuffer.java │ │ ├── ParticleColoredDust.java │ │ ├── PixelBuffer.java │ │ └── package-info.java │ ├── command │ │ ├── CmdBase.java │ │ ├── CmdEditConfigBase.java │ │ ├── CmdTreeBase.java │ │ ├── CmdTreeHelp.java │ │ ├── CommandMirror.java │ │ ├── CommandUtils.java │ │ ├── ICommandWithParent.java │ │ └── package-info.java │ ├── config │ │ ├── ConfigBlockState.java │ │ ├── ConfigBoolean.java │ │ ├── ConfigColor.java │ │ ├── ConfigDouble.java │ │ ├── ConfigEnum.java │ │ ├── ConfigFluid.java │ │ ├── ConfigGroup.java │ │ ├── ConfigInt.java │ │ ├── ConfigItemStack.java │ │ ├── ConfigList.java │ │ ├── ConfigLong.java │ │ ├── ConfigNBT.java │ │ ├── ConfigNull.java │ │ ├── ConfigRGB.java │ │ ├── ConfigString.java │ │ ├── ConfigStringEnum.java │ │ ├── ConfigTeam.java │ │ ├── ConfigTeamClient.java │ │ ├── ConfigTextComponent.java │ │ ├── ConfigTimer.java │ │ ├── ConfigValue.java │ │ ├── ConfigValueInstance.java │ │ ├── ConfigValueProvider.java │ │ ├── DefaultRankConfigHandler.java │ │ ├── EnumTristate.java │ │ ├── IConfigCallback.java │ │ ├── IIteratingConfig.java │ │ ├── IRankConfigHandler.java │ │ ├── RankConfigAPI.java │ │ ├── RankConfigValueInfo.java │ │ └── package-info.java │ ├── data │ │ ├── Action.java │ │ ├── AdminPanelAction.java │ │ ├── FTBLibAPI.java │ │ ├── FTBLibTeamGuiActions.java │ │ ├── FakeForgePlayer.java │ │ ├── ForgePlayer.java │ │ ├── ForgeTeam.java │ │ ├── ISyncData.java │ │ ├── NBTDataStorage.java │ │ ├── PlayerData.java │ │ ├── TeamAction.java │ │ ├── TeamData.java │ │ ├── TeamType.java │ │ ├── Universe.java │ │ └── package-info.java │ ├── gui │ │ ├── BlankPanel.java │ │ ├── Button.java │ │ ├── CheckBoxList.java │ │ ├── ColorWidget.java │ │ ├── ContainerBase.java │ │ ├── ContextMenu.java │ │ ├── ContextMenuItem.java │ │ ├── GuiBase.java │ │ ├── GuiContainerWrapper.java │ │ ├── GuiHelper.java │ │ ├── GuiIcons.java │ │ ├── GuiWrapper.java │ │ ├── IGuiWrapper.java │ │ ├── IOpenableGui.java │ │ ├── MismatchingParentPanelException.java │ │ ├── Panel.java │ │ ├── PanelScrollBar.java │ │ ├── ScrollBar.java │ │ ├── SimpleButton.java │ │ ├── SimpleTextButton.java │ │ ├── TextBox.java │ │ ├── TextField.java │ │ ├── Theme.java │ │ ├── Widget.java │ │ ├── WidgetLayout.java │ │ ├── WidgetType.java │ │ ├── WidgetVerticalSpace.java │ │ ├── WrappedIngredient.java │ │ ├── misc │ │ │ ├── BlockGuiHandler.java │ │ │ ├── BlockGuiSupplier.java │ │ │ ├── ChunkSelectorMap.java │ │ │ ├── CompactGridLayout.java │ │ │ ├── GuiActionList.java │ │ │ ├── GuiButtonListBase.java │ │ │ ├── GuiChunkSelectorBase.java │ │ │ ├── GuiEditConfig.java │ │ │ ├── GuiEditConfigList.java │ │ │ ├── GuiEditConfigValue.java │ │ │ ├── GuiLoading.java │ │ │ ├── GuiSelectFluid.java │ │ │ ├── GuiSelectItemStack.java │ │ │ ├── GuiSelectTeamValue.java │ │ │ ├── IConfigValueEditCallback.java │ │ │ ├── SimpleToast.java │ │ │ ├── YesNoCallback.java │ │ │ └── package-info.java │ │ └── package-info.java │ ├── icon │ │ ├── AtlasSpriteIcon.java │ │ ├── BulletIcon.java │ │ ├── Color4I.java │ │ ├── CombinedIcon.java │ │ ├── Drawable.java │ │ ├── HollowRectangleIcon.java │ │ ├── Icon.java │ │ ├── IconAnimation.java │ │ ├── IconPresets.java │ │ ├── IconProperties.java │ │ ├── IconRenderer.java │ │ ├── IconWithBorder.java │ │ ├── IconWithPadding.java │ │ ├── IconWithParent.java │ │ ├── ImageCallback.java │ │ ├── ImageIcon.java │ │ ├── ItemIcon.java │ │ ├── MutableColor4I.java │ │ ├── PartIcon.java │ │ ├── PlayerHeadIcon.java │ │ └── URLImageIcon.java │ ├── io │ │ ├── Bits.java │ │ ├── ByteCounterOutputStream.java │ │ ├── DataIn.java │ │ ├── DataOut.java │ │ ├── DataReader.java │ │ ├── FileDataReader.java │ │ ├── HttpDataReader.java │ │ ├── RequestMethod.java │ │ ├── ResourceDataReader.java │ │ ├── StreamDataReader.java │ │ ├── StringDataReader.java │ │ └── package-info.java │ ├── item │ │ ├── ItemEntry.java │ │ ├── ItemEntryWithCount.java │ │ ├── ItemStackArrayHandler.java │ │ ├── ItemStackSerializer.java │ │ ├── SlotOnlyInsertItem.java │ │ └── package-info.java │ ├── math │ │ ├── BlockDimPos.java │ │ ├── ChunkDimPos.java │ │ ├── MathUtils.java │ │ ├── SidedDirection.java │ │ ├── TeleporterDimPos.java │ │ ├── Ticks.java │ │ └── package-info.java │ ├── net │ │ ├── MessageBase.java │ │ ├── MessageToClient.java │ │ ├── MessageToClientHandler.java │ │ ├── MessageToServer.java │ │ ├── MessageToServerHandler.java │ │ ├── NetworkWrapper.java │ │ └── package-info.java │ ├── package-info.java │ ├── tile │ │ ├── EnumSaveType.java │ │ ├── IChangeCallback.java │ │ ├── TileBase.java │ │ └── package-info.java │ └── util │ │ ├── BlockUtils.java │ │ ├── ChainedBooleanSupplier.java │ │ ├── CommonUtils.java │ │ ├── EnumDyeColorHelper.java │ │ ├── FileUtils.java │ │ ├── FinalIDObject.java │ │ ├── IWithID.java │ │ ├── InvUtils.java │ │ ├── JsonUtils.java │ │ ├── ListUtils.java │ │ ├── MapUtils.java │ │ ├── NBTUtils.java │ │ ├── NetUtils.java │ │ ├── ServerUtils.java │ │ ├── SidedUtils.java │ │ ├── StringJoiner.java │ │ ├── StringUtils.java │ │ ├── misc │ │ ├── BlockPropertyString.java │ │ ├── BooleanConsumer.java │ │ ├── DataStorage.java │ │ ├── EnumIO.java │ │ ├── EnumPrivacyLevel.java │ │ ├── EnumRedstoneMode.java │ │ ├── EnumScreenPosition.java │ │ ├── IScheduledTask.java │ │ ├── MouseButton.java │ │ ├── NameMap.java │ │ ├── NullableOptional.java │ │ ├── TextureSet.java │ │ ├── TimeType.java │ │ ├── UnlistedPropertyString.java │ │ └── package-info.java │ │ ├── package-info.java │ │ └── text_components │ │ ├── Notification.java │ │ ├── TextComponentCountdown.java │ │ ├── TextComponentParser.java │ │ └── package-info.java │ ├── net │ ├── FTBLibNetHandler.java │ ├── MessageAdminPanelAction.java │ ├── MessageAdminPanelGui.java │ ├── MessageAdminPanelGuiResponse.java │ ├── MessageCloseGui.java │ ├── MessageEditConfig.java │ ├── MessageEditConfigResponse.java │ ├── MessageMyTeamAction.java │ ├── MessageMyTeamGui.java │ ├── MessageMyTeamGuiResponse.java │ ├── MessageMyTeamPlayerList.java │ ├── MessageSelectTeamGui.java │ ├── MessageSyncData.java │ └── package-info.java │ └── package-info.java └── resources ├── META-INF └── ftblib_at.cfg ├── assets └── ftblib │ ├── client_config.json │ ├── lang │ ├── de_de.lang │ ├── en_us.lang │ ├── es_es.lang │ ├── fr_fr.lang │ ├── ru_ru.lang │ └── zh_cn.lang │ ├── resource_reloader.json │ ├── sidebar_button_groups.json │ ├── sidebar_buttons.json │ └── textures │ ├── blocks │ └── no_texture.png │ ├── gui │ ├── background_squares.png │ ├── entity.png │ ├── entity.png.mcmeta │ ├── missing_image.png │ └── teams.png │ ├── icons │ ├── accept.png │ ├── accept_gray.png │ ├── add.png │ ├── add_gray.png │ ├── art.png │ ├── back.png │ ├── beacon.png │ ├── bed.png │ ├── bell.png │ ├── bin.png │ ├── blank.png │ ├── blank_blue.png │ ├── blue_button.png │ ├── blue_grid.png │ ├── bug.png │ ├── camera.png │ ├── cancel.png │ ├── chat.png │ ├── check.png │ ├── close.png │ ├── color_blank.png │ ├── color_hsb.png │ ├── color_rgb.png │ ├── compass.png │ ├── controller.png │ ├── diamond.png │ ├── dice.png │ ├── down.png │ ├── feather.png │ ├── friends.png │ ├── globe.png │ ├── heart.png │ ├── info.png │ ├── info_gray.png │ ├── inv_in.png │ ├── inv_io.png │ ├── inv_none.png │ ├── inv_out.png │ ├── jacket.png │ ├── left.png │ ├── lock.png │ ├── lock_open.png │ ├── map.png │ ├── marker.png │ ├── money.png │ ├── money_bag.png │ ├── notes.png │ ├── offline.png │ ├── online.png │ ├── online_red.png │ ├── player.png │ ├── player_gray.png │ ├── refresh.png │ ├── remove.png │ ├── remove_gray.png │ ├── right.png │ ├── rs_high.png │ ├── rs_low.png │ ├── rs_none.png │ ├── rs_pulse.png │ ├── security_friends.png │ ├── security_private.png │ ├── security_public.png │ ├── security_team.png │ ├── settings.png │ ├── settings_red.png │ ├── shield.png │ ├── sort_az.png │ ├── star.png │ ├── support.png │ ├── support.png.mcmeta │ ├── time.png │ ├── toggle_day.png │ ├── toggle_day.png.mcmeta │ ├── toggle_gamemode.png │ ├── toggle_gamemode.png.mcmeta │ ├── toggle_night.png │ ├── toggle_night.png.mcmeta │ ├── toggle_rain.png │ ├── toggle_rain.png.mcmeta │ └── up.png │ ├── logo.png │ ├── logo_small.png │ └── logo_small.png.mcmeta ├── mcmod.info └── pack.mcmeta /.gitignore: -------------------------------------------------------------------------------- 1 | # eclipse 2 | bin 3 | *.launch 4 | .settings 5 | .metadata 6 | .classpath 7 | .project 8 | 9 | # idea 10 | out 11 | *.ipr 12 | *.iws 13 | *.iml 14 | .idea 15 | 16 | # gradle 17 | build 18 | .gradle 19 | 20 | # other 21 | eclipse 22 | run 23 | /classes 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # FTB Library [![](http://cf.way2muchnoise.eu/ftb-library-legacy-forge.svg) ![](https://cf.way2muchnoise.eu/packs/ftb-library-legacy-forge.svg) ![](http://cf.way2muchnoise.eu/versions/ftb-library-legacy-forge.svg)](https://www.curseforge.com/minecraft/mc-mods/ftb-library-legacy-forge) 2 | 3 | Use https://github.com/FTBTeam/FTB-Mods-Issues for any mod issues 4 | 5 | ### Building the mod 6 | 7 | - Make sure you have Java JDK 1.8+ installed 8 | - Downloading it as zip or clone with Git 9 | - Open console / Command Prompt in downloaded folder's location 10 | - Run "gradlew build" 11 | 12 | ### Adding as dependency 13 | 14 | ```groovy 15 | repositories { 16 | maven { url "https://maven.latmod.com/" } 17 | } 18 | 19 | dependencies { 20 | deobfCompile "com.feed_the_beast.mods:FTBLib:${ftblib_version}" 21 | } 22 | ``` 23 | 24 | And `ftblib_version=5.+` line in your `gradle.properties` file. You can also specify exact version, e.g. `5.0.0`. 25 | 26 | You probably also want to add "required-after:ftblib" or "after:ftblib" in your @Mod's dependencies. 27 | Most of the APIs don't need hard dependency, but things like GUIs won't work without FTBLib loaded 28 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | org.gradle.jvmargs=-Xmx3G 2 | mod_name=FTBLib 3 | package_group=com.feed_the_beast.mods 4 | mod_version=5.4.7 5 | mod_reference=FTBLib.java 6 | mc_version=1.12.2 7 | curseforge_id=237167 8 | min_forge_version=14.23.5.2768 9 | forge_version=14.23.5.2784 10 | mappings_version=snapshot_20180814 11 | jei_version=4.14.3.248 12 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Sep 14 12:28:28 PDT 2015 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-4.9-bin.zip -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/FTBLibEventHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | import com.feed_the_beast.ftblib.lib.util.ServerUtils; 5 | import net.minecraft.entity.player.EntityPlayerMP; 6 | import net.minecraftforge.fml.common.Mod; 7 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 8 | import net.minecraftforge.fml.common.gameevent.TickEvent; 9 | 10 | /** 11 | * @author LatvianModder 12 | */ 13 | @Mod.EventBusSubscriber(modid = FTBLib.MOD_ID) 14 | public class FTBLibEventHandler 15 | { 16 | @SubscribeEvent 17 | public static void onPlayerTick(TickEvent.PlayerTickEvent event) 18 | { 19 | if (event.player.ticksExisted % 5 == 2 && event.player instanceof EntityPlayerMP) 20 | { 21 | byte opState = event.player.getEntityData().getByte("FTBLibOP"); 22 | byte newOpState = ServerUtils.isOP((EntityPlayerMP) event.player) ? (byte) 2 : (byte) 1; 23 | 24 | if (opState != newOpState) 25 | { 26 | event.player.getEntityData().setByte("FTBLibOP", newOpState); 27 | Universe.get().clearCache(); 28 | } 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/FTBLibGameRules.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib; 2 | 3 | import net.minecraft.world.World; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public interface FTBLibGameRules 9 | { 10 | String DISABLE_TEAM_CREATION = "ftblib:disable_team_creation"; 11 | String DISABLE_TEAM_JOINING = "ftblib:disable_team_joining"; 12 | 13 | static boolean canCreateTeam(World world) 14 | { 15 | return !FTBLibConfig.teams.disable_teams && !world.getGameRules().getBoolean(DISABLE_TEAM_CREATION); 16 | } 17 | 18 | static boolean canJoinTeam(World world) 19 | { 20 | return !FTBLibConfig.teams.disable_teams && !world.getGameRules().getBoolean(DISABLE_TEAM_JOINING); 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/FTBLibNotifications.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.text_components.Notification; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraft.util.text.TextComponentTranslation; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class FTBLibNotifications 11 | { 12 | public static final ResourceLocation RELOAD_SERVER = new ResourceLocation(FTBLib.MOD_ID, "reload_server"); 13 | public static final Notification NO_TEAM = Notification.of(new ResourceLocation(FTBLib.MOD_ID, "no_team"), new TextComponentTranslation("ftblib.lang.team.error.no_team")).setError(); 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/ClientConfig.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Icon; 4 | import com.feed_the_beast.ftblib.lib.util.JsonUtils; 5 | import com.google.gson.JsonObject; 6 | import net.minecraft.util.text.ITextComponent; 7 | import net.minecraft.util.text.TextComponentString; 8 | 9 | import javax.annotation.Nullable; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class ClientConfig 15 | { 16 | public final String id; 17 | public final ITextComponent name; 18 | public final Icon icon; 19 | 20 | public ClientConfig(String _id, @Nullable ITextComponent _name, Icon _icon) 21 | { 22 | id = _id; 23 | name = _name == null ? new TextComponentString(id) : _name; 24 | icon = _icon; 25 | } 26 | 27 | public ClientConfig(JsonObject o) 28 | { 29 | this(o.get("id").getAsString(), JsonUtils.deserializeTextComponent(o.get("name")), Icon.getIcon(o.get("icon"))); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/EnumSidebarButtonPlacement.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client; 2 | 3 | import com.feed_the_beast.ftblib.lib.OtherMods; 4 | import net.minecraftforge.fml.common.Loader; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public enum EnumSidebarButtonPlacement 10 | { 11 | DISABLED, 12 | TOP_LEFT, 13 | INVENTORY_SIDE, 14 | AUTO; 15 | 16 | public boolean top() 17 | { 18 | switch (this) 19 | { 20 | case TOP_LEFT: 21 | return true; 22 | case AUTO: 23 | return !Loader.isModLoaded(OtherMods.NEI); 24 | default: 25 | return false; 26 | } 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/FTBLibClientConfig.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import net.minecraftforge.common.config.Config; 5 | import net.minecraftforge.common.config.ConfigManager; 6 | import net.minecraftforge.fml.client.event.ConfigChangedEvent; 7 | import net.minecraftforge.fml.common.Mod; 8 | import net.minecraftforge.fml.common.eventhandler.SubscribeEvent; 9 | import net.minecraftforge.fml.relauncher.Side; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | @Mod.EventBusSubscriber(modid = FTBLib.MOD_ID, value = Side.CLIENT) 15 | @Config(modid = "ftblib_client", name = "../local/client/ftblib") 16 | public class FTBLibClientConfig 17 | { 18 | @Config.Comment("Show item Ore Dictionary names in inventory.") 19 | public static boolean item_ore_names = false; 20 | 21 | @Config.Comment("Show item NBT in inventory.") 22 | public static boolean item_nbt = false; 23 | 24 | @Config.Comment({ 25 | "DISABLED: Buttons are hidden;", 26 | "TOP_LEFT: Buttons are placed on top-left corner, where NEI has it's buttons;", 27 | "INVENTORY_SIDE: Buttons are placed on the side or top of your inventory, depending on potion effects and crafting book;", 28 | "AUTO: When NEI is installed, INVENTORY_SIDE, else TOP_LEFT." 29 | }) 30 | @Config.LangKey("sidebar_button") 31 | public static EnumSidebarButtonPlacement action_buttons = EnumSidebarButtonPlacement.AUTO; 32 | 33 | @Config.Comment("Replace vanilla status message with Notifications, which support colors and timers.") 34 | public static boolean replace_vanilla_status_messages = true; 35 | 36 | @Config.Comment("Show help text while holding F3.") 37 | public static boolean debug_helper = true; 38 | 39 | public static void sync() 40 | { 41 | ConfigManager.sync("ftblib_client", Config.Type.INSTANCE); 42 | } 43 | 44 | @SubscribeEvent 45 | public static void onConfigChanged(ConfigChangedEvent.OnConfigChangedEvent event) 46 | { 47 | if (event.getModID().equals("ftblib_client")) 48 | { 49 | sync(); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/FTBLibClientConfigManager.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client; 2 | 3 | import com.feed_the_beast.ftblib.lib.io.DataReader; 4 | import com.google.gson.JsonElement; 5 | import net.minecraft.client.resources.IResource; 6 | import net.minecraft.client.resources.IResourceManager; 7 | import net.minecraft.util.ResourceLocation; 8 | import net.minecraftforge.client.resource.IResourceType; 9 | import net.minecraftforge.client.resource.ISelectiveResourceReloadListener; 10 | 11 | import java.io.FileNotFoundException; 12 | import java.util.function.Predicate; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public enum FTBLibClientConfigManager implements ISelectiveResourceReloadListener 18 | { 19 | INSTANCE; 20 | 21 | @Override 22 | public void onResourceManagerReload(IResourceManager manager, Predicate resourcePredicate) 23 | { 24 | if (!resourcePredicate.test(FTBLibResourceType.FTB_CONFIG)) 25 | { 26 | return; 27 | } 28 | 29 | FTBLibClient.CLIENT_CONFIG_MAP.clear(); 30 | 31 | for (String domain : manager.getResourceDomains()) 32 | { 33 | try 34 | { 35 | for (IResource resource : manager.getAllResources(new ResourceLocation(domain, "client_config.json"))) 36 | { 37 | for (JsonElement e : DataReader.get(resource).json().getAsJsonArray()) 38 | { 39 | ClientConfig c = new ClientConfig(e.getAsJsonObject()); 40 | FTBLibClient.CLIENT_CONFIG_MAP.put(c.id, c); 41 | } 42 | } 43 | } 44 | catch (Exception ex) 45 | { 46 | if (!(ex instanceof FileNotFoundException)) 47 | { 48 | ex.printStackTrace(); 49 | } 50 | } 51 | } 52 | } 53 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/FTBLibResourceType.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client; 2 | 3 | import net.minecraftforge.client.resource.IResourceType; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public enum FTBLibResourceType implements IResourceType 9 | { 10 | FTB_CONFIG, 11 | FTB_SIDEBAR_BUTTONS 12 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/SidebarButtonGroup.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client; 2 | 3 | import net.minecraft.util.ResourceLocation; 4 | 5 | import java.util.ArrayList; 6 | import java.util.List; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class SidebarButtonGroup implements Comparable 12 | { 13 | private final ResourceLocation id; 14 | private final int y; 15 | private final List buttons; 16 | 17 | public SidebarButtonGroup(ResourceLocation _id, int _y) 18 | { 19 | id = _id; 20 | y = _y; 21 | buttons = new ArrayList<>(); 22 | } 23 | 24 | public ResourceLocation getId() 25 | { 26 | return id; 27 | } 28 | 29 | public int getY() 30 | { 31 | return y; 32 | } 33 | 34 | public List getButtons() 35 | { 36 | return buttons; 37 | } 38 | 39 | @Override 40 | public int compareTo(SidebarButtonGroup group) 41 | { 42 | return getY() - group.getY(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.client; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/teamsgui/GuiTransferOwnership.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.client.teamsgui; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.FTBLibTeamGuiActions; 4 | import com.feed_the_beast.ftblib.lib.gui.GuiHelper; 5 | import com.feed_the_beast.ftblib.lib.gui.Panel; 6 | import com.feed_the_beast.ftblib.lib.util.misc.MouseButton; 7 | import com.feed_the_beast.ftblib.net.MessageMyTeamAction; 8 | import com.feed_the_beast.ftblib.net.MessageMyTeamPlayerList; 9 | import net.minecraft.client.Minecraft; 10 | import net.minecraft.client.resources.I18n; 11 | import net.minecraft.nbt.NBTTagCompound; 12 | 13 | import java.util.Collection; 14 | import java.util.List; 15 | 16 | /** 17 | * @author LatvianModder 18 | */ 19 | public class GuiTransferOwnership extends GuiManagePlayersBase 20 | { 21 | private static class ButtonPlayer extends ButtonPlayerBase 22 | { 23 | private ButtonPlayer(Panel panel, MessageMyTeamPlayerList.Entry m) 24 | { 25 | super(panel, m); 26 | } 27 | 28 | @Override 29 | public void addMouseOverText(List list) 30 | { 31 | } 32 | 33 | @Override 34 | public void onClicked(MouseButton button) 35 | { 36 | GuiHelper.playClickSound(); 37 | 38 | getGui().openYesNo(I18n.format("team_action.ftblib.transfer_ownership") + "?", Minecraft.getMinecraft().getSession().getUsername() + " => " + entry.name, () -> 39 | { 40 | getGui().closeGui(false); 41 | NBTTagCompound data = new NBTTagCompound(); 42 | data.setString("player", entry.name); 43 | new MessageMyTeamAction(FTBLibTeamGuiActions.TRANSFER_OWNERSHIP.getId(), data).sendToServer(); 44 | }); 45 | } 46 | } 47 | 48 | public GuiTransferOwnership(Collection m) 49 | { 50 | super(I18n.format("team_action.ftblib.transfer_ownership"), m, ButtonPlayer::new); 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/client/teamsgui/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.client.teamsgui; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/CmdAddFakePlayer.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import com.feed_the_beast.ftblib.lib.util.StringUtils; 8 | import net.minecraft.command.CommandException; 9 | import net.minecraft.command.ICommandSender; 10 | import net.minecraft.server.MinecraftServer; 11 | 12 | import java.util.UUID; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public class CmdAddFakePlayer extends CmdBase 18 | { 19 | public CmdAddFakePlayer() 20 | { 21 | super("add_fake_player", Level.OP); 22 | } 23 | 24 | @Override 25 | public boolean isUsernameIndex(String[] args, int index) 26 | { 27 | return index == 0; 28 | } 29 | 30 | @Override 31 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 32 | { 33 | checkArgs(sender, args, 2); 34 | 35 | UUID id = StringUtils.fromString(args[0]); 36 | 37 | if (id == null) 38 | { 39 | throw FTBLib.error(sender, "ftblib.lang.add_fake_player.invalid_uuid"); 40 | } 41 | 42 | if (Universe.get().getPlayer(id) != null || Universe.get().getPlayer(args[1]) != null) 43 | { 44 | throw FTBLib.error(sender, "ftblib.lang.add_fake_player.player_exists"); 45 | } 46 | 47 | ForgePlayer p = new ForgePlayer(Universe.get(), id, args[1]); 48 | p.team.universe.players.put(p.getId(), p); 49 | p.clearCache(); 50 | sender.sendMessage(FTBLib.lang(sender, "ftblib.lang.add_fake_player.added", p.getDisplayName())); 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/CmdMySettings.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdEditConfigBase; 4 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 5 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 6 | import com.feed_the_beast.ftblib.lib.config.IConfigCallback; 7 | import net.minecraft.command.CommandException; 8 | import net.minecraft.command.ICommandSender; 9 | 10 | /** 11 | * @author LatvianModder 12 | */ 13 | public class CmdMySettings extends CmdEditConfigBase 14 | { 15 | public CmdMySettings() 16 | { 17 | super("my_settings", Level.ALL); 18 | } 19 | 20 | @Override 21 | public ConfigGroup getGroup(ICommandSender sender) throws CommandException 22 | { 23 | return CommandUtils.getForgePlayer(sender).getSettings(); 24 | } 25 | 26 | @Override 27 | public IConfigCallback getCallback(ICommandSender sender) throws CommandException 28 | { 29 | return CommandUtils.getForgePlayer(sender); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/client/CommandClientConfig.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.client; 2 | 3 | import com.feed_the_beast.ftblib.client.GuiClientConfig; 4 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 5 | import net.minecraft.command.CommandException; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.server.MinecraftServer; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public class CommandClientConfig extends CmdBase 13 | { 14 | public CommandClientConfig() 15 | { 16 | super("client_config", Level.ALL); 17 | } 18 | 19 | @Override 20 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 21 | { 22 | new GuiClientConfig().openGuiLater(); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/client/CommandPrintItem.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.client; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 4 | import com.feed_the_beast.ftblib.lib.util.NBTUtils; 5 | import net.minecraft.client.gui.GuiScreen; 6 | import net.minecraft.command.CommandException; 7 | import net.minecraft.command.ICommandSender; 8 | import net.minecraft.entity.player.EntityPlayer; 9 | import net.minecraft.item.ItemStack; 10 | import net.minecraft.server.MinecraftServer; 11 | import net.minecraft.util.EnumHand; 12 | import net.minecraft.util.text.ITextComponent; 13 | import net.minecraft.util.text.TextComponentString; 14 | import net.minecraft.util.text.event.ClickEvent; 15 | 16 | import java.util.Arrays; 17 | import java.util.HashSet; 18 | 19 | public class CommandPrintItem extends CmdBase 20 | { 21 | public CommandPrintItem() 22 | { 23 | super("print_item", Level.ALL); 24 | } 25 | 26 | @Override 27 | public void execute(MinecraftServer server, ICommandSender sender, final String[] args) throws CommandException 28 | { 29 | if (!(sender instanceof EntityPlayer)) 30 | { 31 | return; 32 | } 33 | 34 | ItemStack stack = ((EntityPlayer) sender).getHeldItem(EnumHand.MAIN_HAND); 35 | 36 | if (stack.isEmpty()) 37 | { 38 | return; 39 | } 40 | 41 | HashSet argsSet = new HashSet<>(Arrays.asList(args)); 42 | 43 | ITextComponent component = new TextComponentString(stack.getDisplayName() + " :: " + NBTUtils.getColoredNBTString(stack.serializeNBT())); 44 | component.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, stack.serializeNBT().toString())); 45 | sender.sendMessage(component); 46 | 47 | if (argsSet.contains("copy")) 48 | { 49 | GuiScreen.setClipboardString(stack.serializeNBT().toString()); 50 | } 51 | } 52 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/client/CommandPrintState.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.client; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 4 | import com.feed_the_beast.ftblib.lib.util.BlockUtils; 5 | import net.minecraft.block.state.IBlockState; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.command.CommandException; 8 | import net.minecraft.command.ICommandSender; 9 | import net.minecraft.server.MinecraftServer; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.util.math.RayTraceResult; 12 | import net.minecraft.util.text.ITextComponent; 13 | import net.minecraft.util.text.TextComponentString; 14 | import net.minecraft.util.text.event.ClickEvent; 15 | 16 | public class CommandPrintState extends CmdBase 17 | { 18 | public CommandPrintState() 19 | { 20 | super("print_block_state", Level.ALL); 21 | } 22 | 23 | @Override 24 | public void execute(MinecraftServer server, ICommandSender sender, final String[] args) throws CommandException 25 | { 26 | RayTraceResult ray = Minecraft.getMinecraft().objectMouseOver; 27 | if (ray.typeOfHit != RayTraceResult.Type.BLOCK) 28 | { 29 | return; 30 | } 31 | 32 | BlockPos pos = ray.getBlockPos(); 33 | IBlockState state = sender.getEntityWorld().getBlockState(pos); 34 | 35 | ITextComponent component = new TextComponentString(state.getBlock().getPickBlock(state, ray, sender.getEntityWorld(), pos, Minecraft.getMinecraft().player).getDisplayName() + " :: " + BlockUtils.getNameFromState(state)); 36 | component.getStyle().setClickEvent(new ClickEvent(ClickEvent.Action.SUGGEST_COMMAND, BlockUtils.getNameFromState(state))); 37 | sender.sendMessage(component); 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/client/CommandSimulateButton.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.client; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 4 | import com.feed_the_beast.ftblib.lib.gui.GuiHelper; 5 | import com.feed_the_beast.ftblib.lib.util.StringUtils; 6 | import net.minecraft.command.CommandException; 7 | import net.minecraft.command.ICommandSender; 8 | import net.minecraft.server.MinecraftServer; 9 | 10 | /** 11 | * @author LatvianModder 12 | */ 13 | public class CommandSimulateButton extends CmdBase 14 | { 15 | public CommandSimulateButton() 16 | { 17 | super("ftblib_simulate_button", Level.ALL); 18 | } 19 | 20 | @Override 21 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 22 | { 23 | GuiHelper.BLANK_GUI.handleClick(StringUtils.joinSpaceUntilEnd(0, args)); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/client/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.command.client; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.command; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdCreateServerTeam.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.events.team.ForgeTeamCreatedEvent; 5 | import com.feed_the_beast.ftblib.lib.EnumTeamColor; 6 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 7 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 8 | import com.feed_the_beast.ftblib.lib.data.TeamType; 9 | import com.feed_the_beast.ftblib.lib.data.Universe; 10 | import net.minecraft.command.CommandException; 11 | import net.minecraft.command.ICommandSender; 12 | import net.minecraft.server.MinecraftServer; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public class CmdCreateServerTeam extends CmdBase 18 | { 19 | public CmdCreateServerTeam() 20 | { 21 | super("create_server_team", Level.OP_OR_SP); 22 | } 23 | 24 | @Override 25 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 26 | { 27 | checkArgs(sender, args, 1); 28 | 29 | if (!CmdCreate.isValidTeamID(args[0])) 30 | { 31 | throw FTBLib.error(sender, "ftblib.lang.team.id_invalid"); 32 | } 33 | 34 | if (Universe.get().getTeam(args[0]).isValid()) 35 | { 36 | throw FTBLib.error(sender, "ftblib.lang.team.id_already_exists"); 37 | } 38 | 39 | Universe universe = Universe.get(); 40 | universe.clearCache(); 41 | ForgeTeam team = new ForgeTeam(universe, universe.generateTeamUID((short) 0), args[0], TeamType.SERVER); 42 | team.setTitle(team.getId()); 43 | team.setColor(EnumTeamColor.NAME_MAP.getRandom(sender.getEntityWorld().rand)); 44 | team.universe.addTeam(team); 45 | new ForgeTeamCreatedEvent(team).post(); 46 | sender.sendMessage(FTBLib.lang(sender, "ftblib.lang.team.created", team.getId())); 47 | team.markDirty(); 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdDelete.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 7 | import com.feed_the_beast.ftblib.lib.data.Universe; 8 | import net.minecraft.command.CommandException; 9 | import net.minecraft.command.ICommandSender; 10 | import net.minecraft.server.MinecraftServer; 11 | import net.minecraft.util.math.BlockPos; 12 | 13 | import javax.annotation.Nullable; 14 | import java.util.List; 15 | 16 | /** 17 | * @author LatvianModder 18 | */ 19 | public class CmdDelete extends CmdBase 20 | { 21 | public CmdDelete() 22 | { 23 | super("delete", Level.OP_OR_SP); 24 | } 25 | 26 | @Override 27 | public List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) 28 | { 29 | if (args.length == 1) 30 | { 31 | return getListOfStringsMatchingLastWord(args, Universe.get().getTeams()); 32 | } 33 | 34 | return super.getTabCompletions(server, sender, args, pos); 35 | } 36 | 37 | @Override 38 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 39 | { 40 | checkArgs(sender, args, 1); 41 | 42 | ForgeTeam team = Universe.get().getTeam(args[0]); 43 | 44 | if (!team.isValid()) 45 | { 46 | throw FTBLib.error(sender, "ftblib.lang.team.error.not_found", args[0]); 47 | } 48 | 49 | ForgePlayer o = team.getOwner(); 50 | 51 | for (ForgePlayer player : team.getMembers()) 52 | { 53 | if (player != o) 54 | { 55 | team.removeMember(player); 56 | } 57 | } 58 | 59 | if (o != null) 60 | { 61 | team.removeMember(o); 62 | } 63 | 64 | team.delete(); 65 | } 66 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdGet.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 4 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import net.minecraft.command.CommandException; 8 | import net.minecraft.command.ICommandSender; 9 | import net.minecraft.server.MinecraftServer; 10 | import net.minecraft.util.math.BlockPos; 11 | import net.minecraft.util.text.ITextComponent; 12 | import net.minecraft.util.text.TextComponentString; 13 | 14 | import javax.annotation.Nullable; 15 | import java.util.List; 16 | 17 | /** 18 | * @author LatvianModder 19 | */ 20 | public class CmdGet extends CmdBase 21 | { 22 | public CmdGet() 23 | { 24 | super("get", Level.ALL); 25 | } 26 | 27 | @Override 28 | public List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) 29 | { 30 | if (args.length == 1) 31 | { 32 | return getListOfStringsMatchingLastWord(args, Universe.get().getPlayers()); 33 | } 34 | 35 | return super.getTabCompletions(server, sender, args, pos); 36 | } 37 | 38 | @Override 39 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 40 | { 41 | checkArgs(sender, args, 1); 42 | ForgePlayer player = CommandUtils.getSelfOrOther(sender, args, 0); 43 | ITextComponent component = new TextComponentString(""); 44 | component.appendSibling(player.getDisplayName()); 45 | component.appendText(": "); 46 | component.appendSibling(player.team.getCommandTitle()); 47 | sender.sendMessage(component); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdKick.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 5 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 6 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 7 | import net.minecraft.command.CommandException; 8 | import net.minecraft.command.ICommandSender; 9 | import net.minecraft.server.MinecraftServer; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class CmdKick extends CmdBase 15 | { 16 | public CmdKick() 17 | { 18 | super("kick", Level.ALL); 19 | } 20 | 21 | @Override 22 | public boolean isUsernameIndex(String[] args, int index) 23 | { 24 | return index == 0; 25 | } 26 | 27 | @Override 28 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 29 | { 30 | ForgePlayer p = CommandUtils.getForgePlayer(getCommandSenderAsPlayer(sender)); 31 | 32 | if (!p.hasTeam()) 33 | { 34 | throw FTBLib.error(sender, "ftblib.lang.team.error.no_team"); 35 | } 36 | else if (!p.team.isModerator(p)) 37 | { 38 | throw new CommandException("commands.generic.permission"); 39 | } 40 | 41 | checkArgs(sender, args, 1); 42 | 43 | ForgePlayer p1 = CommandUtils.getForgePlayer(sender, args[0]); 44 | 45 | if (!p.team.isMember(p1)) 46 | { 47 | throw FTBLib.error(sender, "ftblib.lang.team.error.not_member", p1.getDisplayName()); 48 | } 49 | else if (!p1.equalsPlayer(p)) 50 | { 51 | p.team.removeMember(p1); 52 | } 53 | else 54 | { 55 | throw FTBLib.error(sender, "ftblib.lang.team.error.must_transfer_ownership"); 56 | } 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdLeave.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 5 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 6 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 7 | import net.minecraft.command.CommandException; 8 | import net.minecraft.command.ICommandSender; 9 | import net.minecraft.server.MinecraftServer; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class CmdLeave extends CmdBase 15 | { 16 | public CmdLeave() 17 | { 18 | super("leave", Level.ALL); 19 | } 20 | 21 | @Override 22 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 23 | { 24 | ForgePlayer p = CommandUtils.getForgePlayer(getCommandSenderAsPlayer(sender)); 25 | 26 | if (!p.hasTeam()) 27 | { 28 | throw FTBLib.error(sender, "ftblib.lang.team.error.no_team"); 29 | } 30 | else if (!p.team.removeMember(p)) 31 | { 32 | throw FTBLib.error(sender, "ftblib.lang.team.error.must_transfer_ownership"); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdList.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 5 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import net.minecraft.command.CommandException; 8 | import net.minecraft.command.ICommandSender; 9 | import net.minecraft.server.MinecraftServer; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class CmdList extends CmdBase 15 | { 16 | public CmdList() 17 | { 18 | super("list", Level.ALL); 19 | } 20 | 21 | @Override 22 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 23 | { 24 | sender.sendMessage(FTBLib.lang(sender, "commands.team.list.teams", Universe.get().getTeams().size())); 25 | 26 | for (ForgeTeam team : Universe.get().getTeams()) 27 | { 28 | sender.sendMessage(team.getCommandTitle()); 29 | } 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdSettings.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.command.CmdEditConfigBase; 5 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 6 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 7 | import com.feed_the_beast.ftblib.lib.config.IConfigCallback; 8 | import com.feed_the_beast.ftblib.lib.data.FTBLibAPI; 9 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 10 | import net.minecraft.command.CommandException; 11 | import net.minecraft.command.ICommandSender; 12 | import net.minecraft.entity.player.EntityPlayerMP; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public class CmdSettings extends CmdEditConfigBase 18 | { 19 | public CmdSettings() 20 | { 21 | super("settings", Level.ALL); 22 | } 23 | 24 | @Override 25 | public ConfigGroup getGroup(ICommandSender sender) throws CommandException 26 | { 27 | EntityPlayerMP player = getCommandSenderAsPlayer(sender); 28 | ForgePlayer p = CommandUtils.getForgePlayer(player); 29 | 30 | if (!p.hasTeam()) 31 | { 32 | FTBLibAPI.sendCloseGuiPacket(player); 33 | throw FTBLib.error(sender, "ftblib.lang.team.error.no_team"); 34 | } 35 | else if (!p.team.isModerator(p)) 36 | { 37 | FTBLibAPI.sendCloseGuiPacket(player); 38 | throw new CommandException("commands.generic.permission"); 39 | } 40 | 41 | return p.team.getSettings(); 42 | } 43 | 44 | @Override 45 | public IConfigCallback getCallback(ICommandSender sender) throws CommandException 46 | { 47 | return CommandUtils.getForgePlayer(sender).team; 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdSettingsFor.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 4 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 5 | import com.feed_the_beast.ftblib.lib.data.FTBLibAPI; 6 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 7 | import com.feed_the_beast.ftblib.lib.data.Universe; 8 | import net.minecraft.command.CommandException; 9 | import net.minecraft.command.ICommandSender; 10 | import net.minecraft.server.MinecraftServer; 11 | import net.minecraft.util.math.BlockPos; 12 | 13 | import javax.annotation.Nullable; 14 | import java.util.ArrayList; 15 | import java.util.List; 16 | 17 | /** 18 | * @author LatvianModder 19 | */ 20 | public class CmdSettingsFor extends CmdBase 21 | { 22 | public CmdSettingsFor() 23 | { 24 | super("settings_for", Level.OP); 25 | } 26 | 27 | @Override 28 | public List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) 29 | { 30 | if (args.length == 1) 31 | { 32 | List list = new ArrayList<>(); 33 | 34 | for (ForgeTeam team : Universe.get().getTeams()) 35 | { 36 | if (team.type.isServer) 37 | { 38 | list.add(team.getId()); 39 | } 40 | } 41 | 42 | return getListOfStringsMatchingLastWord(args, list); 43 | } 44 | 45 | return super.getTabCompletions(server, sender, args, pos); 46 | } 47 | 48 | @Override 49 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 50 | { 51 | checkArgs(sender, args, 1); 52 | ForgeTeam team = CommandUtils.getTeam(sender, args[0]); 53 | 54 | if (team.type.isServer) 55 | { 56 | FTBLibAPI.editServerConfig(getCommandSenderAsPlayer(sender), team.getSettings(), team); 57 | } 58 | } 59 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdTeam.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.command.CmdTreeBase; 4 | import com.feed_the_beast.ftblib.lib.command.CmdTreeHelp; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class CmdTeam extends CmdTreeBase 10 | { 11 | public CmdTeam() 12 | { 13 | super("team"); 14 | addSubcommand(new CmdSettings()); 15 | addSubcommand(new CmdCreate()); 16 | addSubcommand(new CmdLeave()); 17 | addSubcommand(new CmdTransferOwnership()); 18 | addSubcommand(new CmdKick()); 19 | addSubcommand(new CmdJoin()); 20 | addSubcommand(new CmdStatus()); 21 | addSubcommand(new CmdRequestInvite()); 22 | addSubcommand(new CmdDelete()); 23 | addSubcommand(new CmdCreateServerTeam()); 24 | addSubcommand(new CmdInfo()); 25 | addSubcommand(new CmdGet()); 26 | addSubcommand(new CmdList()); 27 | addSubcommand(new CmdSettingsFor()); 28 | addSubcommand(new CmdTreeHelp(this)); 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/CmdTransferOwnership.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.command.team; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.lib.EnumTeamStatus; 5 | import com.feed_the_beast.ftblib.lib.command.CmdBase; 6 | import com.feed_the_beast.ftblib.lib.command.CommandUtils; 7 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 8 | import net.minecraft.command.CommandException; 9 | import net.minecraft.command.ICommandSender; 10 | import net.minecraft.server.MinecraftServer; 11 | 12 | /** 13 | * @author LatvianModder 14 | */ 15 | public class CmdTransferOwnership extends CmdBase 16 | { 17 | public CmdTransferOwnership() 18 | { 19 | super("transfer_ownership", Level.ALL); 20 | } 21 | 22 | @Override 23 | public boolean isUsernameIndex(String[] args, int index) 24 | { 25 | return index == 0; 26 | } 27 | 28 | @Override 29 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 30 | { 31 | ForgePlayer p = CommandUtils.getForgePlayer(getCommandSenderAsPlayer(sender)); 32 | 33 | if (!p.hasTeam()) 34 | { 35 | throw FTBLib.error(sender, "ftblib.lang.team.error.no_team"); 36 | } 37 | else if (!p.team.isOwner(p)) 38 | { 39 | throw FTBLib.error(sender, "ftblib.lang.team.error.not_owner"); 40 | } 41 | 42 | checkArgs(sender, args, 1); 43 | 44 | ForgePlayer p1 = CommandUtils.getForgePlayer(sender, args[0]); 45 | 46 | if (!p.team.equalsTeam(p1.team)) 47 | { 48 | throw FTBLib.error(sender, "ftblib.lang.team.error.not_member", p1.getDisplayName()); 49 | } 50 | 51 | p.team.setStatus(p1, EnumTeamStatus.OWNER); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/command/team/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.command.team; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/FTBLibEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | import com.feed_the_beast.ftblib.lib.EventBase; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class FTBLibEvent extends EventBase 9 | { 10 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/FTBLibPreInitRegistryEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigValueProvider; 4 | import com.feed_the_beast.ftblib.lib.data.AdminPanelAction; 5 | import com.feed_the_beast.ftblib.lib.data.ISyncData; 6 | import com.feed_the_beast.ftblib.lib.data.TeamAction; 7 | import net.minecraft.util.ResourceLocation; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public class FTBLibPreInitRegistryEvent extends FTBLibEvent 13 | { 14 | public interface Registry 15 | { 16 | void registerConfigValueProvider(String id, ConfigValueProvider provider); 17 | 18 | void registerSyncData(String mod, ISyncData data); 19 | 20 | void registerServerReloadHandler(ResourceLocation id, IReloadHandler handler); 21 | 22 | void registerAdminPanelAction(AdminPanelAction action); 23 | 24 | void registerTeamAction(TeamAction action); 25 | } 26 | 27 | private final Registry registry; 28 | 29 | public FTBLibPreInitRegistryEvent(Registry r) 30 | { 31 | registry = r; 32 | } 33 | 34 | public Registry getRegistry() 35 | { 36 | return registry; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/IReloadHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | @FunctionalInterface 7 | public interface IReloadHandler 8 | { 9 | boolean onReload(ServerReloadEvent reloadEvent) throws Exception; 10 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/RegisterRankConfigEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigValue; 4 | import com.feed_the_beast.ftblib.lib.config.RankConfigValueInfo; 5 | 6 | import java.util.function.Consumer; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class RegisterRankConfigEvent extends FTBLibEvent 12 | { 13 | private final Consumer callback; 14 | 15 | public RegisterRankConfigEvent(Consumer c) 16 | { 17 | callback = c; 18 | } 19 | 20 | public void register(RankConfigValueInfo info) 21 | { 22 | callback.accept(info); 23 | } 24 | 25 | public RankConfigValueInfo register(String id, ConfigValue defaultPlayerValue, ConfigValue defaultOPValue) 26 | { 27 | RankConfigValueInfo info = new RankConfigValueInfo(id, defaultPlayerValue, defaultOPValue); 28 | register(info); 29 | return info; 30 | } 31 | 32 | public RankConfigValueInfo register(String id, ConfigValue defaultValue) 33 | { 34 | RankConfigValueInfo info = new RankConfigValueInfo(id, defaultValue, null); 35 | register(info); 36 | return info; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/RegisterRankConfigHandlerEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.IRankConfigHandler; 4 | 5 | import java.util.function.Consumer; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class RegisterRankConfigHandlerEvent extends FTBLibEvent 11 | { 12 | private final Consumer callback; 13 | 14 | public RegisterRankConfigHandlerEvent(Consumer c) 15 | { 16 | callback = c; 17 | } 18 | 19 | public void setHandler(IRankConfigHandler handler) 20 | { 21 | callback.accept(handler); 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/SidebarButtonCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | import com.feed_the_beast.ftblib.client.SidebarButton; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class SidebarButtonCreatedEvent extends FTBLibEvent 9 | { 10 | private final SidebarButton button; 11 | 12 | public SidebarButtonCreatedEvent(SidebarButton b) 13 | { 14 | button = b; 15 | } 16 | 17 | public SidebarButton getButton() 18 | { 19 | return button; 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/SyncGamerulesEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events; 2 | 3 | import java.util.function.Consumer; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class SyncGamerulesEvent extends FTBLibEvent 9 | { 10 | private final Consumer callback; 11 | 12 | public SyncGamerulesEvent(Consumer c) 13 | { 14 | callback = c; 15 | } 16 | 17 | public void sync(String gamerule) 18 | { 19 | callback.accept(gamerule); 20 | } 21 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/client/CustomClickEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.client; 2 | 3 | import com.feed_the_beast.ftblib.events.FTBLibEvent; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | @Cancelable 11 | public class CustomClickEvent extends FTBLibEvent 12 | { 13 | private final ResourceLocation id; 14 | 15 | public CustomClickEvent(ResourceLocation _id) 16 | { 17 | id = _id; 18 | } 19 | 20 | public ResourceLocation getID() 21 | { 22 | return id; 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/client/GuideEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.client; 2 | 3 | import com.feed_the_beast.ftblib.events.FTBLibEvent; 4 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | @Cancelable 10 | public class GuideEvent extends FTBLibEvent 11 | { 12 | private final String path; 13 | 14 | private GuideEvent(String p) 15 | { 16 | path = p; 17 | } 18 | 19 | public static class Check extends GuideEvent 20 | { 21 | private Check(String path) 22 | { 23 | super(path); 24 | } 25 | } 26 | 27 | public static class Open extends GuideEvent 28 | { 29 | private Open(String path) 30 | { 31 | super(path); 32 | } 33 | } 34 | 35 | public String getPath() 36 | { 37 | return path; 38 | } 39 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/client/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.events.client; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.events; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerConfigEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 4 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class ForgePlayerConfigEvent extends ForgePlayerEvent 10 | { 11 | private final ConfigGroup config; 12 | 13 | public ForgePlayerConfigEvent(ForgePlayer player, ConfigGroup s) 14 | { 15 | super(player); 16 | config = s; 17 | } 18 | 19 | public ConfigGroup getConfig() 20 | { 21 | return config; 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerConfigSavedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 4 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 5 | import net.minecraft.command.ICommandSender; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class ForgePlayerConfigSavedEvent extends ForgePlayerEvent 11 | { 12 | private final ConfigGroup config; 13 | private final ICommandSender sender; 14 | 15 | public ForgePlayerConfigSavedEvent(ForgePlayer player, ConfigGroup s, ICommandSender ics) 16 | { 17 | super(player); 18 | config = s; 19 | sender = ics; 20 | } 21 | 22 | public ConfigGroup getConfig() 23 | { 24 | return config; 25 | } 26 | 27 | public ICommandSender getSender() 28 | { 29 | return sender; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerDataEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 4 | import com.feed_the_beast.ftblib.lib.data.NBTDataStorage; 5 | 6 | import java.util.function.Consumer; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class ForgePlayerDataEvent extends ForgePlayerEvent 12 | { 13 | private final Consumer callback; 14 | 15 | public ForgePlayerDataEvent(ForgePlayer player, Consumer c) 16 | { 17 | super(player); 18 | callback = c; 19 | } 20 | 21 | public void register(NBTDataStorage.Data data) 22 | { 23 | callback.accept(data); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.events.team.ForgeTeamEvent; 4 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public abstract class ForgePlayerEvent extends ForgeTeamEvent 10 | { 11 | private final ForgePlayer player; 12 | 13 | public ForgePlayerEvent(ForgePlayer p) 14 | { 15 | super(p.team); 16 | player = p; 17 | } 18 | 19 | public ForgePlayer getPlayer() 20 | { 21 | return player; 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerLoadedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgePlayerLoadedEvent extends ForgePlayerEvent 9 | { 10 | public ForgePlayerLoadedEvent(ForgePlayer player) 11 | { 12 | super(player); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerLoggedInEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgePlayerLoggedInEvent extends ForgePlayerEvent 9 | { 10 | public ForgePlayerLoggedInEvent(ForgePlayer player) 11 | { 12 | super(player); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerLoggedOutEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgePlayerLoggedOutEvent extends ForgePlayerEvent 9 | { 10 | public ForgePlayerLoggedOutEvent(ForgePlayer player) 11 | { 12 | super(player); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/ForgePlayerSavedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.player; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgePlayerSavedEvent extends ForgePlayerEvent 9 | { 10 | public ForgePlayerSavedEvent(ForgePlayer player) 11 | { 12 | super(player); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/player/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.events.player; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgeTeamChangedEvent extends ForgeTeamEvent 9 | { 10 | private final ForgeTeam oldTeam; 11 | 12 | public ForgeTeamChangedEvent(ForgeTeam team, ForgeTeam o) 13 | { 14 | super(team); 15 | oldTeam = o; 16 | } 17 | 18 | public ForgeTeam getOldTeam() 19 | { 20 | return oldTeam; 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamConfigEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 4 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class ForgeTeamConfigEvent extends ForgeTeamEvent 10 | { 11 | private final ConfigGroup config; 12 | 13 | public ForgeTeamConfigEvent(ForgeTeam team, ConfigGroup s) 14 | { 15 | super(team); 16 | config = s; 17 | } 18 | 19 | public ConfigGroup getConfig() 20 | { 21 | return config; 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamConfigSavedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 4 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 5 | import net.minecraft.command.ICommandSender; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class ForgeTeamConfigSavedEvent extends ForgeTeamEvent 11 | { 12 | private final ConfigGroup config; 13 | private final ICommandSender sender; 14 | 15 | public ForgeTeamConfigSavedEvent(ForgeTeam team, ConfigGroup s, ICommandSender ics) 16 | { 17 | super(team); 18 | config = s; 19 | sender = ics; 20 | } 21 | 22 | public ConfigGroup getConfig() 23 | { 24 | return config; 25 | } 26 | 27 | public ICommandSender getSender() 28 | { 29 | return sender; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamCreatedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgeTeamCreatedEvent extends ForgeTeamEvent 9 | { 10 | public ForgeTeamCreatedEvent(ForgeTeam team) 11 | { 12 | super(team); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamDataEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 4 | import com.feed_the_beast.ftblib.lib.data.NBTDataStorage; 5 | 6 | import java.util.function.Consumer; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class ForgeTeamDataEvent extends ForgeTeamEvent 12 | { 13 | private final Consumer callback; 14 | 15 | public ForgeTeamDataEvent(ForgeTeam team, Consumer c) 16 | { 17 | super(team); 18 | callback = c; 19 | } 20 | 21 | public void register(NBTDataStorage.Data data) 22 | { 23 | callback.accept(data); 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamDeletedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 4 | 5 | import java.io.File; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class ForgeTeamDeletedEvent extends ForgeTeamEvent 11 | { 12 | private final File folder; 13 | 14 | public ForgeTeamDeletedEvent(ForgeTeam team, File f) 15 | { 16 | super(team); 17 | folder = f; 18 | } 19 | 20 | public File getDataFolder() 21 | { 22 | return folder; 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.events.universe.UniverseEvent; 4 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 5 | 6 | import java.util.Objects; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class ForgeTeamEvent extends UniverseEvent 12 | { 13 | private final ForgeTeam team; 14 | 15 | public ForgeTeamEvent(ForgeTeam t) 16 | { 17 | super(t.universe); 18 | team = Objects.requireNonNull(t, "Null ForgeTeam in ForgeTeamEvent!"); 19 | } 20 | 21 | public ForgeTeam getTeam() 22 | { 23 | return team; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamLoadedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgeTeamLoadedEvent extends ForgeTeamEvent 9 | { 10 | public ForgeTeamLoadedEvent(ForgeTeam team) 11 | { 12 | super(team); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamOwnerChangedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 4 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class ForgeTeamOwnerChangedEvent extends ForgeTeamEvent 12 | { 13 | private final ForgePlayer oldOwner; 14 | 15 | public ForgeTeamOwnerChangedEvent(ForgeTeam team, @Nullable ForgePlayer o0) 16 | { 17 | super(team); 18 | oldOwner = o0; 19 | } 20 | 21 | @Nullable 22 | public ForgePlayer getOldOwner() 23 | { 24 | return oldOwner; 25 | } 26 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamPlayerJoinedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.events.player.ForgePlayerEvent; 4 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class ForgeTeamPlayerJoinedEvent extends ForgePlayerEvent 12 | { 13 | private Runnable displayGui; 14 | 15 | public ForgeTeamPlayerJoinedEvent(ForgePlayer player) 16 | { 17 | super(player); 18 | } 19 | 20 | public void setDisplayGui(Runnable gui) 21 | { 22 | displayGui = gui; 23 | } 24 | 25 | @Nullable 26 | public Runnable getDisplayGui() 27 | { 28 | return displayGui; 29 | } 30 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamPlayerLeftEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.events.player.ForgePlayerEvent; 4 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class ForgeTeamPlayerLeftEvent extends ForgePlayerEvent 10 | { 11 | public ForgeTeamPlayerLeftEvent(ForgePlayer player) 12 | { 13 | super(player); 14 | } 15 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/ForgeTeamSavedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.team; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.ForgeTeam; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ForgeTeamSavedEvent extends ForgeTeamEvent 9 | { 10 | public ForgeTeamSavedEvent(ForgeTeam team) 11 | { 12 | super(team); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/team/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.events.team; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/PersistentScheduledTaskEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.universe; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.util.ResourceLocation; 6 | import net.minecraftforge.fml.common.eventhandler.Cancelable; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | @Cancelable 12 | public class PersistentScheduledTaskEvent extends UniverseEvent 13 | { 14 | private final ResourceLocation id; 15 | private final NBTTagCompound data; 16 | 17 | public PersistentScheduledTaskEvent(Universe universe, ResourceLocation i, NBTTagCompound d) 18 | { 19 | super(universe); 20 | id = i; 21 | data = d; 22 | } 23 | 24 | public ResourceLocation getID() 25 | { 26 | return id; 27 | } 28 | 29 | public NBTTagCompound getData() 30 | { 31 | return data; 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/UniverseClearCacheEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.universe; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class UniverseClearCacheEvent extends UniverseEvent 9 | { 10 | public UniverseClearCacheEvent(Universe universe) 11 | { 12 | super(universe); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/UniverseClosedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.universe; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class UniverseClosedEvent extends UniverseEvent 9 | { 10 | public UniverseClosedEvent(Universe universe) 11 | { 12 | super(universe); 13 | } 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/UniverseEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.universe; 2 | 3 | import com.feed_the_beast.ftblib.events.FTBLibEvent; 4 | import com.feed_the_beast.ftblib.lib.data.Universe; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public abstract class UniverseEvent extends FTBLibEvent 10 | { 11 | private final Universe universe; 12 | 13 | public UniverseEvent(Universe u) 14 | { 15 | universe = u; 16 | } 17 | 18 | public Universe getUniverse() 19 | { 20 | return universe; 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/UniverseLoadedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.universe; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraft.world.WorldServer; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public abstract class UniverseLoadedEvent extends UniverseEvent 11 | { 12 | public UniverseLoadedEvent(Universe universe) 13 | { 14 | super(universe); 15 | } 16 | 17 | public WorldServer getWorld() 18 | { 19 | return getUniverse().world; 20 | } 21 | 22 | public static class Pre extends UniverseLoadedEvent 23 | { 24 | private final NBTTagCompound data; 25 | 26 | public Pre(Universe universe, NBTTagCompound nbt) 27 | { 28 | super(universe); 29 | data = nbt; 30 | } 31 | 32 | public NBTTagCompound getData(String id) 33 | { 34 | NBTTagCompound tag = data.getCompoundTag(id); 35 | return tag.isEmpty() ? data.getCompoundTag(id + ":data") : tag; 36 | } 37 | } 38 | 39 | public static class CreateServerTeams extends UniverseLoadedEvent 40 | { 41 | public CreateServerTeams(Universe universe) 42 | { 43 | super(universe); 44 | } 45 | } 46 | 47 | public static class Post extends UniverseLoadedEvent 48 | { 49 | private final NBTTagCompound data; 50 | 51 | public Post(Universe universe, NBTTagCompound nbt) 52 | { 53 | super(universe); 54 | data = nbt; 55 | } 56 | 57 | public NBTTagCompound getData(String id) 58 | { 59 | NBTTagCompound tag = data.getCompoundTag(id); 60 | return tag.isEmpty() ? data.getCompoundTag(id + ":data") : tag; 61 | } 62 | } 63 | 64 | public static class Finished extends UniverseLoadedEvent 65 | { 66 | public Finished(Universe universe) 67 | { 68 | super(universe); 69 | } 70 | } 71 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/UniverseSavedEvent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.events.universe; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class UniverseSavedEvent extends UniverseEvent 10 | { 11 | private NBTTagCompound data; 12 | 13 | public UniverseSavedEvent(Universe universe, NBTTagCompound nbt) 14 | { 15 | super(universe); 16 | data = nbt; 17 | } 18 | 19 | public void setData(String id, NBTTagCompound nbt) 20 | { 21 | data.setTag(id, nbt); 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/events/universe/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.events.universe; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/integration/JEIGhostItemHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.integration; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.GuiContainerWrapper; 4 | import com.feed_the_beast.ftblib.lib.gui.Panel; 5 | import com.feed_the_beast.ftblib.lib.gui.Widget; 6 | import mezz.jei.api.gui.IGhostIngredientHandler; 7 | 8 | import java.util.ArrayList; 9 | import java.util.Collections; 10 | import java.util.List; 11 | 12 | /** 13 | * @author LatvianModder 14 | */ 15 | public class JEIGhostItemHandler implements IGhostIngredientHandler 16 | { 17 | @Override 18 | public List> getTargets(GuiContainerWrapper gui, I ingredient, boolean doStart) 19 | { 20 | List> list = new ArrayList<>(); 21 | getTargets(list, ingredient, gui.getGui()); 22 | Collections.reverse(list); 23 | return list; 24 | } 25 | 26 | private void getTargets(List> list, Object ingredient, Panel panel) 27 | { 28 | for (Widget widget : panel.widgets) 29 | { 30 | if (widget.isGhostIngredientTarget(ingredient)) 31 | { 32 | list.add((Target) new WidgetTarget(widget)); 33 | } 34 | 35 | if (widget instanceof Panel) 36 | { 37 | getTargets(list, ingredient, (Panel) widget); 38 | } 39 | } 40 | } 41 | 42 | @Override 43 | public void onComplete() 44 | { 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/integration/JEIGlobalGuiHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.integration; 2 | 3 | import com.feed_the_beast.ftblib.client.FTBLibClientEventHandler; 4 | import com.feed_the_beast.ftblib.lib.gui.IGuiWrapper; 5 | import com.feed_the_beast.ftblib.lib.gui.WrappedIngredient; 6 | import mezz.jei.api.gui.IGlobalGuiHandler; 7 | import net.minecraft.client.Minecraft; 8 | import net.minecraft.client.gui.GuiScreen; 9 | 10 | import javax.annotation.Nullable; 11 | import java.awt.*; 12 | import java.util.Collection; 13 | import java.util.Collections; 14 | 15 | /** 16 | * @author LatvianModder 17 | */ 18 | public class JEIGlobalGuiHandler implements IGlobalGuiHandler 19 | { 20 | @Override 21 | public Collection getGuiExtraAreas() 22 | { 23 | GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen; 24 | 25 | if (FTBLibClientEventHandler.areButtonsVisible(currentScreen)) 26 | { 27 | return Collections.singleton(FTBLibClientEventHandler.lastDrawnArea); 28 | } 29 | 30 | return Collections.emptySet(); 31 | } 32 | 33 | @Override 34 | @Nullable 35 | public Object getIngredientUnderMouse(int mouseX, int mouseY) 36 | { 37 | GuiScreen currentScreen = Minecraft.getMinecraft().currentScreen; 38 | 39 | if (currentScreen instanceof IGuiWrapper) 40 | { 41 | return WrappedIngredient.unwrap(((IGuiWrapper) currentScreen).getGui().getIngredientUnderMouse()); 42 | } 43 | 44 | return null; 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/integration/WidgetTarget.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.integration; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.Widget; 4 | import mezz.jei.api.gui.IGhostIngredientHandler; 5 | 6 | import java.awt.*; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class WidgetTarget implements IGhostIngredientHandler.Target 12 | { 13 | private final Widget widget; 14 | 15 | public WidgetTarget(Widget w) 16 | { 17 | widget = w; 18 | } 19 | 20 | @Override 21 | public Rectangle getArea() 22 | { 23 | return new Rectangle(widget.getX(), widget.getY(), widget.width, widget.height); 24 | } 25 | 26 | @Override 27 | public void accept(Object ingredient) 28 | { 29 | widget.acceptGhostIngredient(ingredient); 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/integration/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.integration; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/ClientATHelper.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib; 2 | 3 | import net.minecraft.client.Minecraft; 4 | import net.minecraft.client.gui.FontRenderer; 5 | import net.minecraft.client.gui.chat.IChatListener; 6 | import net.minecraft.client.renderer.texture.TextureAtlasSprite; 7 | import net.minecraft.util.ResourceLocation; 8 | import net.minecraft.util.text.ChatType; 9 | 10 | import javax.annotation.Nullable; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public final class ClientATHelper 18 | { 19 | @Nullable 20 | public static ResourceLocation getFontUnicodePage(int page) 21 | { 22 | return FontRenderer.UNICODE_PAGE_LOCATIONS[page]; 23 | } 24 | 25 | public static Map> getChatListeners() 26 | { 27 | return Minecraft.getMinecraft().ingameGUI.chatListeners; 28 | } 29 | 30 | public static Map getRegisteredSpritesMap() 31 | { 32 | return Minecraft.getMinecraft().getTextureMapBlocks().mapRegisteredSprites; 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/EnumMessageLocation.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.misc.NameMap; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public enum EnumMessageLocation 9 | { 10 | OFF("options.narrator.off"), 11 | CHAT("options.chat.visibility"), 12 | ACTION_BAR("action_bar"); 13 | 14 | public static final NameMap NAME_MAP = NameMap.createWithTranslation(CHAT, (sender, value) -> value.translationKey, values()); 15 | 16 | public final String translationKey; 17 | 18 | EnumMessageLocation(String k) 19 | { 20 | translationKey = k; 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/EnumReloadType.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public enum EnumReloadType 7 | { 8 | /** 9 | * On client side - logged in, on server side - world created 10 | */ 11 | CREATED(false), 12 | 13 | /** 14 | * On client side - /reload_client, on server side - /reload 15 | */ 16 | RELOAD_COMMAND(true); 17 | 18 | private final boolean command; 19 | 20 | EnumReloadType(boolean b) 21 | { 22 | command = b; 23 | } 24 | 25 | public boolean command() 26 | { 27 | return command; 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/EventBase.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.FTBLibConfig; 5 | import net.minecraftforge.common.MinecraftForge; 6 | import net.minecraftforge.fml.common.eventhandler.Event; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class EventBase extends Event 12 | { 13 | private boolean canPost = true; 14 | 15 | public boolean post() 16 | { 17 | if (canPost) 18 | { 19 | canPost = false; 20 | boolean b = MinecraftForge.EVENT_BUS.post(this); 21 | 22 | if (FTBLibConfig.debugging.log_events) 23 | { 24 | FTBLib.LOGGER.info("Event " + getClass().getName() + " fired, cancelled: " + b); 25 | } 26 | 27 | return b; 28 | } 29 | 30 | return false; 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/OtherMods.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public interface OtherMods 7 | { 8 | String BAUBLES = "baubles"; 9 | String JEI = "jei"; 10 | String NEI = "nei"; 11 | String MC_MULTIPART = "mcmultipart"; 12 | String CHISELS_AND_BITS = "chiselsandbits"; 13 | String ICHUN_UTIL = "ichunutil"; 14 | String FORESTRY = "forestry"; 15 | String TINKERS_CONSTRUCT = "tconstruct"; 16 | String JOURNEYMAP = "journeymap"; 17 | String CHISEL = "chisel"; 18 | String SILENTGEMS = "silentgems"; 19 | String REFINED_STORAGE = "refinedstorage"; 20 | String FTBGUIDES = "ftbguides"; 21 | String FTBQUESTS = "ftbquests"; 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/block/EnumHorizontalOffset.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.block; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.misc.EnumScreenPosition; 4 | import com.feed_the_beast.ftblib.lib.util.misc.NameMap; 5 | import net.minecraft.util.IStringSerializable; 6 | import net.minecraft.util.math.BlockPos; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public enum EnumHorizontalOffset implements IStringSerializable 12 | { 13 | CENTER("center", EnumScreenPosition.CENTER), 14 | NORTH("north", EnumScreenPosition.BOTTOM), 15 | NORTH_EAST("north_east", EnumScreenPosition.BOTTOM_RIGHT), 16 | EAST("east", EnumScreenPosition.RIGHT), 17 | SOUTH_EAST("south_east", EnumScreenPosition.TOP_RIGHT), 18 | SOUTH("south", EnumScreenPosition.TOP), 19 | SOUTH_WEST("south_west", EnumScreenPosition.TOP_LEFT), 20 | WEST("west", EnumScreenPosition.LEFT), 21 | NORTH_WEST("north_west", EnumScreenPosition.BOTTOM_LEFT); 22 | 23 | public static final EnumHorizontalOffset[] VALUES = values(); 24 | private static final EnumHorizontalOffset[] OPPOSITES = {CENTER, SOUTH, SOUTH_WEST, WEST, NORTH_WEST, NORTH, NORTH_EAST, EAST, SOUTH_EAST}; 25 | public static final NameMap NAME_MAP = NameMap.create(CENTER, VALUES); 26 | 27 | private final String name; 28 | public final EnumScreenPosition screenPosition; 29 | public final BlockPos offset; 30 | 31 | EnumHorizontalOffset(String n, EnumScreenPosition p) 32 | { 33 | name = n; 34 | screenPosition = p; 35 | offset = new BlockPos(p.offsetX, 0, p.offsetY); 36 | } 37 | 38 | @Override 39 | public String getName() 40 | { 41 | return name; 42 | } 43 | 44 | public BlockPos offset(BlockPos pos) 45 | { 46 | return pos.add(offset); 47 | } 48 | 49 | public boolean isCenter() 50 | { 51 | return this == CENTER; 52 | } 53 | 54 | public EnumHorizontalOffset opposite() 55 | { 56 | return OPPOSITES[ordinal()]; 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/block/EnumRotation.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.block; 2 | 3 | import net.minecraft.entity.EntityLivingBase; 4 | import net.minecraft.util.EnumFacing; 5 | import net.minecraft.util.IStringSerializable; 6 | import net.minecraft.util.math.BlockPos; 7 | import net.minecraft.util.math.MathHelper; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public enum EnumRotation implements IStringSerializable 13 | { 14 | NORMAL("normal"), 15 | FACING_DOWN("down"), 16 | UPSIDE_DOWN("upside_down"), 17 | FACING_UP("up"); 18 | 19 | public static final EnumRotation[] VALUES = values(); 20 | 21 | private final String name; 22 | 23 | EnumRotation(String n) 24 | { 25 | name = n; 26 | } 27 | 28 | public int getModelRotationIndexFromFacing(EnumFacing facing) 29 | { 30 | return ordinal() << 2 | facing.getOpposite().getHorizontalIndex(); 31 | } 32 | 33 | @Override 34 | public String getName() 35 | { 36 | return name; 37 | } 38 | 39 | public static EnumRotation getRotationFromEntity(BlockPos pos, EntityLivingBase placer) 40 | { 41 | if (MathHelper.abs((float) (placer.posX - pos.getX())) < 2F && MathHelper.abs((float) (placer.posZ - pos.getZ())) < 2F) 42 | { 43 | double d = placer.posY + placer.getEyeHeight(); 44 | 45 | if (d - pos.getY() > 2D) 46 | { 47 | return FACING_UP; 48 | } 49 | else if (pos.getY() - d > 0D) 50 | { 51 | return FACING_DOWN; 52 | } 53 | } 54 | 55 | return NORMAL; 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/block/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.block; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/client/ParticleColoredDust.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.client; 2 | 3 | import net.minecraft.client.particle.ParticleRedstone; 4 | import net.minecraft.world.World; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class ParticleColoredDust extends ParticleRedstone 10 | { 11 | public ParticleColoredDust(World worldIn, double xCoordIn, double yCoordIn, double zCoordIn, float red, float green, float blue, float alpha) 12 | { 13 | super(worldIn, xCoordIn, yCoordIn, zCoordIn, 0F, 0F, 0F); 14 | setRBGColorF(red, green, blue); 15 | setAlphaF(alpha); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/client/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.client; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/command/CmdTreeBase.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.command; 2 | 3 | import net.minecraft.command.CommandBase; 4 | import net.minecraft.command.ICommand; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraftforge.server.command.CommandTreeBase; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public class CmdTreeBase extends CommandTreeBase implements ICommandWithParent 13 | { 14 | private final String name; 15 | private ICommand parent; 16 | 17 | public CmdTreeBase(String n) 18 | { 19 | name = n; 20 | } 21 | 22 | @Override 23 | public void addSubcommand(ICommand command) 24 | { 25 | super.addSubcommand(command); 26 | 27 | if (command instanceof ICommandWithParent) 28 | { 29 | ((ICommandWithParent) command).setParent(this); 30 | } 31 | } 32 | 33 | @Override 34 | public final String getName() 35 | { 36 | return name; 37 | } 38 | 39 | @Override 40 | public int getRequiredPermissionLevel() 41 | { 42 | int level = 4; 43 | 44 | for (ICommand command : getSubCommands()) 45 | { 46 | if (command instanceof CommandBase) 47 | { 48 | level = Math.min(level, ((CommandBase) command).getRequiredPermissionLevel()); 49 | } 50 | } 51 | 52 | return level; 53 | } 54 | 55 | @Override 56 | public boolean checkPermission(MinecraftServer server, ICommandSender sender) 57 | { 58 | for (ICommand command : getSubCommands()) 59 | { 60 | if (command.checkPermission(server, sender)) 61 | { 62 | return true; 63 | } 64 | } 65 | 66 | return false; 67 | } 68 | 69 | @Override 70 | public ICommand getParent() 71 | { 72 | return parent; 73 | } 74 | 75 | @Override 76 | public void setParent(ICommand c) 77 | { 78 | parent = c; 79 | } 80 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/command/CmdTreeHelp.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.command; 2 | 3 | import net.minecraft.command.CommandHelp; 4 | import net.minecraft.command.ICommand; 5 | import net.minecraft.command.ICommandSender; 6 | import net.minecraft.server.MinecraftServer; 7 | import net.minecraftforge.server.command.CommandTreeBase; 8 | 9 | import java.util.ArrayList; 10 | import java.util.Collections; 11 | import java.util.List; 12 | import java.util.Map; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public class CmdTreeHelp extends CommandHelp 18 | { 19 | private final CommandTreeBase parent; 20 | 21 | public CmdTreeHelp(CommandTreeBase parent) 22 | { 23 | this.parent = parent; 24 | } 25 | 26 | @Override 27 | public boolean checkPermission(MinecraftServer server, ICommandSender sender) 28 | { 29 | return true; 30 | } 31 | 32 | @Override 33 | protected List getSortedPossibleCommands(ICommandSender sender, MinecraftServer server) 34 | { 35 | List list = new ArrayList<>(); 36 | 37 | for (ICommand command : parent.getSubCommands()) 38 | { 39 | if (command.checkPermission(server, sender)) 40 | { 41 | list.add(command); 42 | } 43 | } 44 | 45 | Collections.sort(list); 46 | return list; 47 | } 48 | 49 | @Override 50 | protected Map getCommandMap(MinecraftServer server) 51 | { 52 | return parent.getCommandMap(); 53 | } 54 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/command/CommandMirror.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.command; 2 | 3 | import net.minecraft.command.CommandBase; 4 | import net.minecraft.command.CommandException; 5 | import net.minecraft.command.ICommand; 6 | import net.minecraft.command.ICommandSender; 7 | import net.minecraft.server.MinecraftServer; 8 | import net.minecraft.util.math.BlockPos; 9 | 10 | import javax.annotation.Nullable; 11 | import java.util.List; 12 | 13 | /** 14 | * @author LatvianModder 15 | */ 16 | public class CommandMirror extends CommandBase 17 | { 18 | public final ICommand mirrored; 19 | 20 | public CommandMirror(ICommand c) 21 | { 22 | mirrored = c; 23 | } 24 | 25 | @Override 26 | public String getName() 27 | { 28 | return mirrored.getName(); 29 | } 30 | 31 | @Override 32 | public String getUsage(ICommandSender sender) 33 | { 34 | return mirrored.getUsage(sender); 35 | } 36 | 37 | @Override 38 | public List getAliases() 39 | { 40 | return mirrored.getAliases(); 41 | } 42 | 43 | @Override 44 | public void execute(MinecraftServer server, ICommandSender sender, String[] args) throws CommandException 45 | { 46 | mirrored.execute(server, sender, args); 47 | } 48 | 49 | @Override 50 | public int getRequiredPermissionLevel() 51 | { 52 | return mirrored instanceof CommandBase ? ((CommandBase) mirrored).getRequiredPermissionLevel() : 4; 53 | } 54 | 55 | @Override 56 | public boolean checkPermission(MinecraftServer server, ICommandSender sender) 57 | { 58 | return mirrored.checkPermission(server, sender); 59 | } 60 | 61 | @Override 62 | public List getTabCompletions(MinecraftServer server, ICommandSender sender, String[] args, @Nullable BlockPos pos) 63 | { 64 | return mirrored.getTabCompletions(server, sender, args, pos); 65 | } 66 | 67 | @Override 68 | public boolean isUsernameIndex(String[] args, int index) 69 | { 70 | return mirrored.isUsernameIndex(args, index); 71 | } 72 | 73 | @Override 74 | public int compareTo(ICommand o) 75 | { 76 | return getName().compareTo(o.getName()); 77 | } 78 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/command/ICommandWithParent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.command; 2 | 3 | import net.minecraft.command.ICommand; 4 | import net.minecraft.command.ICommandSender; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public interface ICommandWithParent extends ICommand 12 | { 13 | @Nullable 14 | ICommand getParent(); 15 | 16 | void setParent(@Nullable ICommand p); 17 | 18 | @Override 19 | default String getUsage(ICommandSender sender) 20 | { 21 | return "commands." + getCommandPath(this) + ".usage"; 22 | } 23 | 24 | static String getCommandPath(ICommand command) 25 | { 26 | return (command instanceof ICommandWithParent && ((ICommandWithParent) command).getParent() != null ? (getCommandPath(((ICommandWithParent) command).getParent()) + ".") : "") + command.getName(); 27 | } 28 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/command/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.command; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/ConfigRGB.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Color4I; 4 | import net.minecraftforge.common.config.Config; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class ConfigRGB 10 | { 11 | @Config.RangeInt(min = 0, max = 255) 12 | @Config.LangKey("item.fireworksCharge.red") 13 | public int red; 14 | 15 | @Config.RangeInt(min = 0, max = 255) 16 | @Config.LangKey("item.fireworksCharge.green") 17 | public int green; 18 | 19 | @Config.RangeInt(min = 0, max = 255) 20 | @Config.LangKey("item.fireworksCharge.blue") 21 | public int blue; 22 | 23 | public ConfigRGB(int r, int g, int b) 24 | { 25 | red = r & 0xFF; 26 | green = g & 0xFF; 27 | blue = b & 0xFF; 28 | } 29 | 30 | public ConfigRGB(Color4I col) 31 | { 32 | red = col.redi(); 33 | green = col.greeni(); 34 | blue = col.bluei(); 35 | } 36 | 37 | public Color4I createColor(int a) 38 | { 39 | return Color4I.rgba(red, green, blue, a); 40 | } 41 | 42 | public Color4I createColor() 43 | { 44 | return createColor(255); 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/ConfigValueProvider.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | import java.util.function.Supplier; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | @FunctionalInterface 9 | public interface ConfigValueProvider extends Supplier 10 | { 11 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/DefaultRankConfigHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.ServerUtils; 4 | import com.google.common.base.Preconditions; 5 | import com.mojang.authlib.GameProfile; 6 | import net.minecraft.server.MinecraftServer; 7 | 8 | import javax.annotation.Nullable; 9 | import java.util.Collection; 10 | import java.util.Collections; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public enum DefaultRankConfigHandler implements IRankConfigHandler 18 | { 19 | INSTANCE; 20 | 21 | private static final Map MAP = new HashMap<>(); 22 | private static Collection VALUES = Collections.unmodifiableCollection(MAP.values()); 23 | 24 | @Override 25 | public void registerRankConfig(RankConfigValueInfo info) 26 | { 27 | Preconditions.checkNotNull(info, "RankConfigValueInfo can't be null!"); 28 | Preconditions.checkArgument(!MAP.containsKey(info.node), "Duplicate rank config ID found: " + info.node); 29 | MAP.put(info.node, info); 30 | } 31 | 32 | @Override 33 | public Collection getRegisteredConfigs() 34 | { 35 | return VALUES; 36 | } 37 | 38 | @Override 39 | public ConfigValue getConfigValue(MinecraftServer server, GameProfile profile, String node) 40 | { 41 | RankConfigValueInfo info = RankConfigAPI.getHandler().getInfo(node); 42 | 43 | if (info != null) 44 | { 45 | return ServerUtils.isOP(server, profile) ? info.defaultOPValue : info.defaultValue; 46 | } 47 | 48 | return ConfigNull.INSTANCE; 49 | } 50 | 51 | @Override 52 | @Nullable 53 | public RankConfigValueInfo getInfo(String node) 54 | { 55 | Preconditions.checkNotNull(node, "Config node can't be null!"); 56 | return MAP.get(node); 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/IConfigCallback.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | import net.minecraft.command.ICommandSender; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | @FunctionalInterface 9 | public interface IConfigCallback 10 | { 11 | IConfigCallback DEFAULT = (group, sender) -> {}; 12 | 13 | void onConfigSaved(ConfigGroup group, ICommandSender sender); 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/IIteratingConfig.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | @FunctionalInterface 7 | public interface IIteratingConfig 8 | { 9 | ConfigValue getIteration(boolean next); 10 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/IRankConfigHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | import com.mojang.authlib.GameProfile; 4 | import net.minecraft.server.MinecraftServer; 5 | 6 | import javax.annotation.Nullable; 7 | import java.util.Collection; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public interface IRankConfigHandler 13 | { 14 | void registerRankConfig(RankConfigValueInfo info); 15 | 16 | Collection getRegisteredConfigs(); 17 | 18 | ConfigValue getConfigValue(MinecraftServer server, GameProfile profile, String node); 19 | 20 | @Nullable 21 | RankConfigValueInfo getInfo(String node); 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/RankConfigValueInfo.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.config; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public final class RankConfigValueInfo implements Comparable 9 | { 10 | public final String node; 11 | public final ConfigValue defaultValue; 12 | public final ConfigValue defaultOPValue; 13 | 14 | public RankConfigValueInfo(String s, ConfigValue def, @Nullable ConfigValue defOP) 15 | { 16 | node = s; 17 | defaultValue = def.copy(); 18 | defaultOPValue = def.copy(); 19 | 20 | if (defOP != null) 21 | { 22 | defaultOPValue.setValueFromOtherValue(defOP); 23 | } 24 | } 25 | 26 | public String toString() 27 | { 28 | return node; 29 | } 30 | 31 | public int hashCode() 32 | { 33 | return node.hashCode(); 34 | } 35 | 36 | public boolean equals(Object o) 37 | { 38 | return o == this || o instanceof RankConfigValueInfo && node.equals(((RankConfigValueInfo) o).node); 39 | } 40 | 41 | @Override 42 | public int compareTo(RankConfigValueInfo o) 43 | { 44 | return node.compareTo(o.node); 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/config/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.config; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/AdminPanelAction.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Icon; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraft.util.text.ITextComponent; 6 | import net.minecraft.util.text.TextComponentTranslation; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public abstract class AdminPanelAction extends Action 12 | { 13 | public AdminPanelAction(String mod, String id, Icon icon, int order) 14 | { 15 | super(new ResourceLocation(mod, id), new TextComponentTranslation("admin_panel." + mod + "." + id), icon, order); 16 | } 17 | 18 | @Override 19 | public AdminPanelAction setTitle(ITextComponent t) 20 | { 21 | super.setTitle(t); 22 | return this; 23 | } 24 | 25 | @Override 26 | public AdminPanelAction setRequiresConfirm() 27 | { 28 | super.setRequiresConfirm(); 29 | return this; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/FakeForgePlayer.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.ServerUtils; 4 | import com.mojang.authlib.GameProfile; 5 | import net.minecraft.entity.player.EntityPlayerMP; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class FakeForgePlayer extends ForgePlayer 11 | { 12 | public FakeForgePlayer(Universe u) 13 | { 14 | super(u, ServerUtils.FAKE_PLAYER_PROFILE.getId(), ServerUtils.FAKE_PLAYER_PROFILE.getName()); 15 | } 16 | 17 | @Override 18 | public GameProfile getProfile() 19 | { 20 | return ServerUtils.FAKE_PLAYER_PROFILE; 21 | } 22 | 23 | @Override 24 | public boolean isOnline() 25 | { 26 | return tempPlayer != null; 27 | } 28 | 29 | @Override 30 | public EntityPlayerMP getPlayer() 31 | { 32 | if (tempPlayer == null) 33 | { 34 | throw new NullPointerException("Fake player not set yet!"); 35 | } 36 | 37 | return tempPlayer; 38 | } 39 | 40 | @Override 41 | public boolean isFake() 42 | { 43 | return true; 44 | } 45 | 46 | @Override 47 | public boolean isOP() 48 | { 49 | return false; 50 | } 51 | 52 | @Override 53 | public void markDirty() 54 | { 55 | team.universe.markDirty(); 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/ISyncData.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | import net.minecraft.entity.player.EntityPlayerMP; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | import net.minecraftforge.fml.relauncher.Side; 6 | import net.minecraftforge.fml.relauncher.SideOnly; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public interface ISyncData 12 | { 13 | NBTTagCompound writeSyncData(EntityPlayerMP player, ForgePlayer forgePlayer); 14 | 15 | @SideOnly(Side.CLIENT) 16 | void readSyncData(NBTTagCompound nbt); 17 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/PlayerData.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public abstract class PlayerData implements NBTDataStorage.Data 7 | { 8 | public final ForgePlayer player; 9 | 10 | public PlayerData(ForgePlayer p) 11 | { 12 | player = p; 13 | } 14 | 15 | @Override 16 | public final int hashCode() 17 | { 18 | return getId().hashCode() * 31 + player.hashCode(); 19 | } 20 | 21 | @Override 22 | public final boolean equals(Object o) 23 | { 24 | if (o == this) 25 | { 26 | return true; 27 | } 28 | else if (o instanceof PlayerData) 29 | { 30 | return player.equalsPlayer(((PlayerData) o).player) && getId().equals(((PlayerData) o).getId()); 31 | } 32 | 33 | return false; 34 | } 35 | 36 | public final String toString() 37 | { 38 | return player.getName() + ':' + getId(); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/TeamAction.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Icon; 4 | import net.minecraft.util.ResourceLocation; 5 | import net.minecraft.util.text.ITextComponent; 6 | import net.minecraft.util.text.TextComponentTranslation; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public abstract class TeamAction extends Action 12 | { 13 | public TeamAction(String mod, String id, Icon icon, int order) 14 | { 15 | super(new ResourceLocation(mod, id), new TextComponentTranslation("team_action." + mod + "." + id), icon, order); 16 | } 17 | 18 | @Override 19 | public TeamAction setTitle(ITextComponent t) 20 | { 21 | super.setTitle(t); 22 | return this; 23 | } 24 | 25 | @Override 26 | public TeamAction setRequiresConfirm() 27 | { 28 | super.setRequiresConfirm(); 29 | return this; 30 | } 31 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/TeamData.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public abstract class TeamData implements NBTDataStorage.Data 7 | { 8 | public final ForgeTeam team; 9 | 10 | public TeamData(ForgeTeam t) 11 | { 12 | team = t; 13 | } 14 | 15 | @Override 16 | public final int hashCode() 17 | { 18 | return getId().hashCode() * 31 + team.hashCode(); 19 | } 20 | 21 | @Override 22 | public final boolean equals(Object o) 23 | { 24 | if (o == this) 25 | { 26 | return true; 27 | } 28 | else if (o instanceof TeamData) 29 | { 30 | return team.equalsTeam(((TeamData) o).team) && getId().equals(((TeamData) o).getId()); 31 | } 32 | 33 | return false; 34 | } 35 | 36 | public final String toString() 37 | { 38 | return team.getId() + ':' + getId(); 39 | } 40 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/TeamType.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.data; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.misc.NameMap; 4 | import net.minecraft.util.IStringSerializable; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public enum TeamType implements IStringSerializable 10 | { 11 | PLAYER("player", true, false, true, false), 12 | SERVER("server", false, true, true, false), 13 | SERVER_NO_SAVE("server_no_save", false, true, false, false), 14 | NONE("none", false, false, false, true); 15 | 16 | private final String name; 17 | public final boolean isPlayer, isServer, save, isNone; 18 | 19 | public static final NameMap NAME_MAP = NameMap.create(PLAYER, values()); 20 | 21 | TeamType(String n, boolean p, boolean s, boolean sv, boolean nn) 22 | { 23 | name = n; 24 | isPlayer = p; 25 | isServer = s; 26 | save = sv; 27 | isNone = nn; 28 | } 29 | 30 | @Override 31 | public String getName() 32 | { 33 | return name; 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/data/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.data; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/BlankPanel.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public class BlankPanel extends Panel 7 | { 8 | public String id; 9 | 10 | public BlankPanel(Panel panel) 11 | { 12 | this(panel, ""); 13 | } 14 | 15 | public BlankPanel(Panel panel, String _id) 16 | { 17 | super(panel); 18 | id = _id; 19 | } 20 | 21 | @Override 22 | public void clearWidgets() 23 | { 24 | } 25 | 26 | @Override 27 | public void addWidgets() 28 | { 29 | } 30 | 31 | @Override 32 | public void alignWidgets() 33 | { 34 | } 35 | 36 | @Override 37 | public String toString() 38 | { 39 | return id.isEmpty() ? super.toString() : id; 40 | } 41 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/Button.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Icon; 4 | import com.feed_the_beast.ftblib.lib.util.misc.MouseButton; 5 | 6 | import javax.annotation.Nullable; 7 | 8 | public abstract class Button extends Widget 9 | { 10 | protected String title = ""; 11 | protected Icon icon = Icon.EMPTY; 12 | 13 | public Button(Panel panel) 14 | { 15 | super(panel); 16 | setSize(16, 16); 17 | } 18 | 19 | public Button(Panel panel, String t, Icon i) 20 | { 21 | this(panel); 22 | icon = i; 23 | title = t; 24 | } 25 | 26 | @Override 27 | public String getTitle() 28 | { 29 | return title; 30 | } 31 | 32 | public Button setTitle(String s) 33 | { 34 | title = s; 35 | return this; 36 | } 37 | 38 | public Button setIcon(Icon i) 39 | { 40 | icon = i; 41 | return this; 42 | } 43 | 44 | public void drawBackground(Theme theme, int x, int y, int w, int h) 45 | { 46 | theme.drawButton(x, y, w, h, getWidgetType()); 47 | } 48 | 49 | public void drawIcon(Theme theme, int x, int y, int w, int h) 50 | { 51 | icon.draw(x, y, w, h); 52 | } 53 | 54 | @Override 55 | public void draw(Theme theme, int x, int y, int w, int h) 56 | { 57 | int s = h >= 16 ? 16 : 8; 58 | drawBackground(theme, x, y, w, h); 59 | drawIcon(theme, x + (w - s) / 2, y + (h - s) / 2, s, s); 60 | } 61 | 62 | @Override 63 | public boolean mousePressed(MouseButton button) 64 | { 65 | if (isMouseOver()) 66 | { 67 | if (getWidgetType() != WidgetType.DISABLED) 68 | { 69 | onClicked(button); 70 | } 71 | 72 | return true; 73 | } 74 | 75 | return false; 76 | } 77 | 78 | public abstract void onClicked(MouseButton button); 79 | 80 | @Override 81 | @Nullable 82 | public Object getIngredientUnderMouse() 83 | { 84 | return new WrappedIngredient(icon.getIngredient()).tooltip(); 85 | } 86 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/ColorWidget.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Color4I; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class ColorWidget extends Widget 11 | { 12 | public final Color4I color; 13 | public Color4I mouseOverColor; 14 | 15 | public ColorWidget(Panel panel, Color4I c, @Nullable Color4I m) 16 | { 17 | super(panel); 18 | color = c; 19 | mouseOverColor = m; 20 | } 21 | 22 | @Override 23 | public void draw(Theme theme, int x, int y, int w, int h) 24 | { 25 | ((mouseOverColor != null && isMouseOver()) ? mouseOverColor : color).draw(x, y, w, h); 26 | } 27 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/IGuiWrapper.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | public interface IGuiWrapper extends IOpenableGui 4 | { 5 | GuiBase getGui(); 6 | 7 | @Override 8 | default void openGui() 9 | { 10 | getGui().openGui(); 11 | } 12 | 13 | @Override 14 | default void closeGui(boolean openPrevScreen) 15 | { 16 | getGui().closeGui(openPrevScreen); 17 | } 18 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/IOpenableGui.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | import com.feed_the_beast.ftblib.lib.client.ClientUtils; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public interface IOpenableGui extends Runnable 11 | { 12 | void openGui(); 13 | 14 | default void openGuiLater() 15 | { 16 | ClientUtils.runLater(this); 17 | } 18 | 19 | default void closeGui() 20 | { 21 | closeGui(true); 22 | } 23 | 24 | default void closeGui(boolean openPrevScreen) 25 | { 26 | } 27 | 28 | default void openContextMenu(@Nullable Panel panel) 29 | { 30 | if (this instanceof Widget) 31 | { 32 | ((Widget) this).getGui().openContextMenu(panel); 33 | } 34 | } 35 | 36 | default void closeContextMenu() 37 | { 38 | if (this instanceof Widget) 39 | { 40 | ((Widget) this).getGui().closeContextMenu(); 41 | } 42 | else 43 | { 44 | openContextMenu(null); 45 | } 46 | } 47 | 48 | @Override 49 | default void run() 50 | { 51 | openGui(); 52 | } 53 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/MismatchingParentPanelException.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public class MismatchingParentPanelException extends IllegalArgumentException 7 | { 8 | public final Panel panel; 9 | public final Widget widget; 10 | 11 | public MismatchingParentPanelException(Panel p, Widget w) 12 | { 13 | super("Widget's parent panel [" + w.parent + "] doesn't match the panel it was added to! [" + p + "]"); 14 | panel = p; 15 | widget = w; 16 | } 17 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/PanelScrollBar.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public class PanelScrollBar extends ScrollBar 7 | { 8 | public final Panel panel; 9 | 10 | public PanelScrollBar(Panel parent, Plane plane, Panel p) 11 | { 12 | super(parent, plane, 0); 13 | panel = p; 14 | panel.attachedScrollbar = this; 15 | } 16 | 17 | public PanelScrollBar(Panel parent, Panel panel) 18 | { 19 | this(parent, Plane.VERTICAL, panel); 20 | } 21 | 22 | @Override 23 | public void setMinValue(int min) 24 | { 25 | } 26 | 27 | @Override 28 | public int getMinValue() 29 | { 30 | return 0; 31 | } 32 | 33 | @Override 34 | public void setMaxValue(int max) 35 | { 36 | super.setMaxValue(max - (plane.isVertical ? panel.height : panel.width)); 37 | } 38 | 39 | @Override 40 | public void setScrollStep(int s) 41 | { 42 | panel.setScrollStep(s); 43 | } 44 | 45 | @Override 46 | public int getScrollStep() 47 | { 48 | return panel.getScrollStep(); 49 | } 50 | 51 | @Override 52 | public int getScrollBarSize() 53 | { 54 | int max = getMaxValue(); 55 | 56 | if (max <= 0) 57 | { 58 | return 0; 59 | } 60 | 61 | int size; 62 | 63 | if (plane.isVertical) 64 | { 65 | size = (int) (panel.height / (double) (max + panel.height) * height); 66 | } 67 | else 68 | { 69 | size = (int) (panel.width / (double) (max + panel.width) * width); 70 | } 71 | 72 | return size < 10 ? 10 : size; 73 | } 74 | 75 | @Override 76 | public void onMoved() 77 | { 78 | int value = getMaxValue() <= 0 ? 0 : getValue(); 79 | 80 | if (plane.isVertical) 81 | { 82 | panel.setScrollY(value); 83 | } 84 | else 85 | { 86 | panel.setScrollX(value); 87 | } 88 | } 89 | 90 | @Override 91 | public boolean canMouseScroll() 92 | { 93 | return super.canMouseScroll() || panel.isMouseOver(); 94 | } 95 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/SimpleButton.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | import com.feed_the_beast.ftblib.lib.icon.Icon; 4 | import com.feed_the_beast.ftblib.lib.util.misc.MouseButton; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class SimpleButton extends Button 10 | { 11 | public interface Callback 12 | { 13 | void onClicked(SimpleButton widget, MouseButton button); 14 | } 15 | 16 | private final Callback consumer; 17 | 18 | public SimpleButton(Panel panel, String text, Icon icon, Callback c) 19 | { 20 | super(panel, text, icon); 21 | consumer = c; 22 | } 23 | 24 | @Override 25 | public void drawBackground(Theme theme, int x, int y, int w, int h) 26 | { 27 | } 28 | 29 | @Override 30 | public void onClicked(MouseButton button) 31 | { 32 | GuiHelper.playClickSound(); 33 | consumer.onClicked(this, button); 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/WidgetLayout.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | @FunctionalInterface 7 | public interface WidgetLayout 8 | { 9 | int align(Panel panel); 10 | 11 | class Vertical implements WidgetLayout 12 | { 13 | private final int pre, spacing, post; 14 | 15 | public Vertical(int _pre, int _spacing, int _post) 16 | { 17 | pre = _pre; 18 | spacing = _spacing; 19 | post = _post; 20 | } 21 | 22 | @Override 23 | public int align(Panel panel) 24 | { 25 | int i = pre; 26 | 27 | if (!panel.widgets.isEmpty()) 28 | { 29 | for (Widget widget : panel.widgets) 30 | { 31 | widget.setY(i); 32 | i += widget.height + spacing; 33 | } 34 | 35 | i -= spacing; 36 | } 37 | 38 | return i + post; 39 | } 40 | } 41 | 42 | class Horizontal implements WidgetLayout 43 | { 44 | private final int pre, spacing, post; 45 | 46 | public Horizontal(int _pre, int _spacing, int _post) 47 | { 48 | pre = _pre; 49 | spacing = _spacing; 50 | post = _post; 51 | } 52 | 53 | @Override 54 | public int align(Panel panel) 55 | { 56 | int i = pre; 57 | 58 | if (!panel.widgets.isEmpty()) 59 | { 60 | for (Widget widget : panel.widgets) 61 | { 62 | widget.setX(i); 63 | i += widget.width + spacing; 64 | } 65 | 66 | i -= spacing; 67 | } 68 | 69 | return i + post; 70 | } 71 | } 72 | 73 | WidgetLayout NONE = panel -> 0; 74 | 75 | WidgetLayout VERTICAL = new Vertical(0, 0, 0); 76 | 77 | WidgetLayout HORIZONTAL = new Horizontal(0, 0, 0); 78 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/WidgetType.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public enum WidgetType 7 | { 8 | NORMAL, 9 | MOUSE_OVER, 10 | DISABLED; 11 | 12 | public static WidgetType mouseOver(boolean mouseOver) 13 | { 14 | return mouseOver ? MOUSE_OVER : NORMAL; 15 | } 16 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/WidgetVerticalSpace.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public class WidgetVerticalSpace extends Widget 7 | { 8 | public WidgetVerticalSpace(Panel p, int h) 9 | { 10 | super(p); 11 | setSize(1, h); 12 | } 13 | 14 | @Override 15 | public boolean isEnabled() 16 | { 17 | return false; 18 | } 19 | 20 | @Override 21 | public boolean shouldDraw() 22 | { 23 | return false; 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/WrappedIngredient.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui; 2 | 3 | import javax.annotation.Nullable; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public final class WrappedIngredient 9 | { 10 | @Nullable 11 | public static Object unwrap(@Nullable Object object) 12 | { 13 | if (object instanceof WrappedIngredient) 14 | { 15 | return unwrap(((WrappedIngredient) object).wrappedIngredient); 16 | } 17 | 18 | return object; 19 | } 20 | 21 | public final Object wrappedIngredient; 22 | public boolean tooltip = false; 23 | 24 | public WrappedIngredient(@Nullable Object o) 25 | { 26 | wrappedIngredient = o; 27 | } 28 | 29 | public WrappedIngredient tooltip() 30 | { 31 | tooltip = true; 32 | return this; 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/BlockGuiHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | import it.unimi.dsi.fastutil.ints.Int2ObjectOpenHashMap; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.inventory.Container; 6 | import net.minecraft.tileentity.TileEntity; 7 | import net.minecraft.util.math.BlockPos; 8 | import net.minecraft.world.World; 9 | import net.minecraftforge.fml.common.network.IGuiHandler; 10 | 11 | import javax.annotation.Nullable; 12 | 13 | /** 14 | * @author LatvianModder 15 | */ 16 | public class BlockGuiHandler implements IGuiHandler 17 | { 18 | private final Int2ObjectOpenHashMap map = new Int2ObjectOpenHashMap<>(); 19 | 20 | public void add(BlockGuiSupplier h) 21 | { 22 | map.put(h.id, h); 23 | } 24 | 25 | @Nullable 26 | @Override 27 | public Object getServerGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 28 | { 29 | BlockGuiSupplier supplier = map.get(ID); 30 | 31 | if (supplier != null) 32 | { 33 | TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z)); 34 | 35 | if (tileEntity != null) 36 | { 37 | return supplier.getContainer(player, tileEntity); 38 | } 39 | } 40 | 41 | return null; 42 | } 43 | 44 | @Nullable 45 | @Override 46 | public Object getClientGuiElement(int ID, EntityPlayer player, World world, int x, int y, int z) 47 | { 48 | BlockGuiSupplier supplier = map.get(ID); 49 | 50 | if (supplier != null) 51 | { 52 | TileEntity tileEntity = world.getTileEntity(new BlockPos(x, y, z)); 53 | 54 | if (tileEntity != null) 55 | { 56 | Container container = supplier.getContainer(player, tileEntity); 57 | return container == null ? null : supplier.getGui(container); 58 | } 59 | } 60 | 61 | return null; 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/BlockGuiSupplier.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | import net.minecraft.entity.player.EntityPlayer; 4 | import net.minecraft.inventory.Container; 5 | import net.minecraft.tileentity.TileEntity; 6 | import net.minecraft.util.math.BlockPos; 7 | 8 | import javax.annotation.Nullable; 9 | 10 | /** 11 | * @author LatvianModder 12 | */ 13 | public abstract class BlockGuiSupplier 14 | { 15 | public final Object mod; 16 | public final int id; 17 | 18 | public BlockGuiSupplier(Object _mod, int _id) 19 | { 20 | mod = _mod; 21 | id = _id; 22 | } 23 | 24 | public void open(EntityPlayer player, BlockPos pos) 25 | { 26 | player.openGui(mod, id, player.world, pos.getX(), pos.getY(), pos.getZ()); 27 | } 28 | 29 | @Nullable 30 | public abstract Container getContainer(EntityPlayer player, TileEntity tileEntity); 31 | 32 | public abstract Object getGui(Container container); 33 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/ChunkSelectorMap.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.GuiBase; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public abstract class ChunkSelectorMap 9 | { 10 | private static ChunkSelectorMap INSTANCE; 11 | 12 | public static ChunkSelectorMap getMap() 13 | { 14 | return INSTANCE; 15 | } 16 | 17 | public static void setMap(ChunkSelectorMap map) 18 | { 19 | INSTANCE = map; 20 | } 21 | 22 | public static final int TILES_TEX = 16; 23 | public static final int TILES_GUI = 15; 24 | public static final int TILES_GUI2 = TILES_GUI / 2; 25 | 26 | public abstract void resetMap(int startX, int startZ); 27 | 28 | public abstract void drawMap(GuiBase gui, int ax, int ay, int startX, int startZ); 29 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/CompactGridLayout.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.Panel; 4 | import com.feed_the_beast.ftblib.lib.gui.WidgetLayout; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class CompactGridLayout implements WidgetLayout 10 | { 11 | public static final int[][] LAYOUTS = { 12 | {1}, 13 | {2}, 14 | {3}, 15 | {4}, 16 | {3, 2}, 17 | {3, 3}, 18 | {4, 3}, 19 | {4, 4}, 20 | {3, 3, 3}, 21 | {3, 4, 3}, 22 | {4, 3, 4}, 23 | {4, 4, 4}, 24 | {4, 3, 3, 3}, 25 | {3, 4, 4, 3}, 26 | {4, 4, 4, 3}, 27 | {4, 4, 4, 4} 28 | }; 29 | 30 | public final int size; 31 | 32 | public CompactGridLayout(int s) 33 | { 34 | size = s; 35 | } 36 | 37 | @Override 38 | public int align(Panel panel) 39 | { 40 | int s = panel.widgets.size(); 41 | 42 | if (s <= 0) 43 | { 44 | return 0; 45 | } 46 | else if (s > LAYOUTS.length) 47 | { 48 | for (int i = 0; i < s; i++) 49 | { 50 | panel.widgets.get(i).setPosAndSize((i % 4) * size, (i / 4) * size, size, size); 51 | } 52 | 53 | return (s / 4) * size; 54 | } 55 | 56 | int[] layout = LAYOUTS[s - 1]; 57 | 58 | int m = 0; 59 | 60 | for (int v : layout) 61 | { 62 | m = Math.max(m, v); 63 | } 64 | 65 | int off = 0; 66 | 67 | for (int l = 0; l < layout.length; l++) 68 | { 69 | int o = ((layout[l] % 2) == (m % 2)) ? 0 : size / 2; 70 | 71 | for (int i = 0; i < layout[l]; i++) 72 | { 73 | panel.widgets.get(off + i).setPosAndSize(o + i * size, l * size, size, size); 74 | } 75 | 76 | off += layout[l]; 77 | } 78 | 79 | return layout.length * size; 80 | } 81 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/GuiSelectTeamValue.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigTeamClient; 4 | import com.feed_the_beast.ftblib.lib.gui.GuiHelper; 5 | import com.feed_the_beast.ftblib.lib.gui.IOpenableGui; 6 | import com.feed_the_beast.ftblib.lib.gui.Panel; 7 | import com.feed_the_beast.ftblib.lib.gui.SimpleTextButton; 8 | import com.feed_the_beast.ftblib.lib.util.misc.MouseButton; 9 | import net.minecraft.client.resources.I18n; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class GuiSelectTeamValue extends GuiButtonListBase 15 | { 16 | private final ConfigTeamClient value; 17 | private final IOpenableGui callbackGui; 18 | private final Runnable callback; 19 | 20 | public GuiSelectTeamValue(ConfigTeamClient v, IOpenableGui c, Runnable cb) 21 | { 22 | setTitle(I18n.format("ftblib.select_team.gui")); 23 | setHasSearchBox(true); 24 | value = v; 25 | callbackGui = c; 26 | callback = cb; 27 | } 28 | 29 | @Override 30 | public void addButtons(Panel panel) 31 | { 32 | for (ConfigTeamClient.TeamInst inst : value.map.values()) 33 | { 34 | panel.add(new SimpleTextButton(panel, inst.title.getFormattedText(), inst.icon) 35 | { 36 | @Override 37 | public void onClicked(MouseButton button) 38 | { 39 | GuiHelper.playClickSound(); 40 | callbackGui.openGui(); 41 | value.setString(inst.getId()); 42 | callback.run(); 43 | } 44 | }); 45 | } 46 | } 47 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/IConfigValueEditCallback.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigValue; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | @FunctionalInterface 9 | public interface IConfigValueEditCallback 10 | { 11 | void onCallback(ConfigValue value, boolean set); 12 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/YesNoCallback.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.gui.misc; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | @FunctionalInterface 7 | public interface YesNoCallback 8 | { 9 | void onButtonClicked(boolean result); 10 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/misc/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.gui.misc; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/gui/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.gui; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/Drawable.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import net.minecraft.client.renderer.GlStateManager; 4 | import net.minecraftforge.fml.relauncher.Side; 5 | import net.minecraftforge.fml.relauncher.SideOnly; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public interface Drawable 11 | { 12 | @SideOnly(Side.CLIENT) 13 | void draw(int x, int y, int w, int h); 14 | 15 | @SideOnly(Side.CLIENT) 16 | default void drawStatic(int x, int y, int w, int h) 17 | { 18 | draw(x, y, w, h); 19 | } 20 | 21 | @SideOnly(Side.CLIENT) 22 | default void draw3D() 23 | { 24 | GlStateManager.pushMatrix(); 25 | GlStateManager.scale(1D / 16D, 1D / 16D, 1D); 26 | draw(-8, -8, 16, 16); 27 | GlStateManager.popMatrix(); 28 | } 29 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/HollowRectangleIcon.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.GuiHelper; 4 | import com.google.gson.JsonElement; 5 | import com.google.gson.JsonObject; 6 | import net.minecraftforge.fml.relauncher.Side; 7 | import net.minecraftforge.fml.relauncher.SideOnly; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public class HollowRectangleIcon extends Icon 13 | { 14 | public Color4I color; 15 | public boolean roundEdges; 16 | 17 | public HollowRectangleIcon(Color4I c, boolean r) 18 | { 19 | color = c; 20 | roundEdges = r; 21 | } 22 | 23 | @Override 24 | public HollowRectangleIcon copy() 25 | { 26 | return new HollowRectangleIcon(color, roundEdges); 27 | } 28 | 29 | @Override 30 | public HollowRectangleIcon withColor(Color4I color) 31 | { 32 | return new HollowRectangleIcon(color, roundEdges); 33 | } 34 | 35 | @Override 36 | public HollowRectangleIcon withTint(Color4I c) 37 | { 38 | return withColor(color.withTint(c)); 39 | } 40 | 41 | @Override 42 | protected void setProperties(IconProperties properties) 43 | { 44 | super.setProperties(properties); 45 | roundEdges = properties.getBoolean("round_edges", roundEdges); 46 | } 47 | 48 | @Override 49 | @SideOnly(Side.CLIENT) 50 | public void draw(int x, int y, int w, int h) 51 | { 52 | GuiHelper.drawHollowRect(x, y, w, h, color, roundEdges); 53 | } 54 | 55 | @Override 56 | public JsonElement getJson() 57 | { 58 | JsonObject o = new JsonObject(); 59 | o.addProperty("id", "hollow_rectangle"); 60 | o.add("color", color.getJson()); 61 | 62 | if (roundEdges) 63 | { 64 | o.addProperty("round_edges", true); 65 | } 66 | 67 | return o; 68 | } 69 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/IconPresets.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import java.util.HashMap; 4 | import java.util.Map; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public class IconPresets 10 | { 11 | public static final Map MAP = new HashMap<>(); 12 | 13 | static 14 | { 15 | MAP.put("#gray_button", IconWithBorder.BUTTON_GRAY); 16 | MAP.put("#red_button", IconWithBorder.BUTTON_RED); 17 | MAP.put("#green_button", IconWithBorder.BUTTON_GREEN); 18 | MAP.put("#blue_button", IconWithBorder.BUTTON_BLUE); 19 | MAP.put("#gray_round_button", IconWithBorder.BUTTON_ROUND_GRAY); 20 | MAP.put("#red_round_button", IconWithBorder.BUTTON_ROUND_RED); 21 | MAP.put("#green_round_button", IconWithBorder.BUTTON_ROUND_GREEN); 22 | MAP.put("#blue_round_button", IconWithBorder.BUTTON_ROUND_BLUE); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/IconProperties.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import net.minecraft.util.math.MathHelper; 4 | 5 | import javax.annotation.Nullable; 6 | import java.util.LinkedHashMap; 7 | import java.util.Map; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public class IconProperties 13 | { 14 | private final Map map = new LinkedHashMap<>(); 15 | 16 | public void set(String key, String value) 17 | { 18 | map.remove(key); 19 | map.put(key, value); 20 | } 21 | 22 | public String getString(String key, String def) 23 | { 24 | return map.getOrDefault(key, def); 25 | } 26 | 27 | public int getInt(String key, int def, int min, int max) 28 | { 29 | if (map.containsKey(key)) 30 | { 31 | return MathHelper.clamp(Integer.parseInt(map.get(key)), min, max); 32 | } 33 | 34 | return def; 35 | } 36 | 37 | public int getInt(String key, int def) 38 | { 39 | return getInt(key, def, Integer.MIN_VALUE, Integer.MAX_VALUE); 40 | } 41 | 42 | public double getDouble(String key, double def, double min, double max) 43 | { 44 | if (map.containsKey(key)) 45 | { 46 | return MathHelper.clamp(Double.parseDouble(map.get(key)), min, max); 47 | } 48 | 49 | return def; 50 | } 51 | 52 | public double getDouble(String key, double def) 53 | { 54 | return getDouble(key, def, -Double.MAX_VALUE, Double.MAX_VALUE); 55 | } 56 | 57 | public boolean getBoolean(String key, boolean def) 58 | { 59 | return map.containsKey(key) ? map.get(key).equals("1") : def; 60 | } 61 | 62 | @Nullable 63 | public Color4I getColor(String key) 64 | { 65 | String s = map.get(key); 66 | return s == null ? null : Color4I.fromString(s); 67 | } 68 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/IconWithPadding.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | import net.minecraftforge.fml.relauncher.Side; 6 | import net.minecraftforge.fml.relauncher.SideOnly; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class IconWithPadding extends IconWithParent 12 | { 13 | public int padding; 14 | 15 | IconWithPadding(Icon p, int b) 16 | { 17 | super(p); 18 | padding = b; 19 | } 20 | 21 | @Override 22 | @SideOnly(Side.CLIENT) 23 | public void draw(int x, int y, int w, int h) 24 | { 25 | x += padding; 26 | y += padding; 27 | w -= padding * 2; 28 | h -= padding * 2; 29 | parent.draw(x, y, w, h); 30 | } 31 | 32 | @Override 33 | public JsonElement getJson() 34 | { 35 | if (padding == 0) 36 | { 37 | return parent.getJson(); 38 | } 39 | 40 | JsonObject json = new JsonObject(); 41 | json.addProperty("id", "padding"); 42 | json.addProperty("padding", padding); 43 | json.add("parent", parent.getJson()); 44 | return json; 45 | } 46 | 47 | @Override 48 | public IconWithPadding copy() 49 | { 50 | return new IconWithPadding(parent.copy(), padding); 51 | } 52 | 53 | @Override 54 | public IconWithPadding withTint(Color4I color) 55 | { 56 | return new IconWithPadding(parent.withTint(color), padding); 57 | } 58 | 59 | @Override 60 | public IconWithPadding withColor(Color4I color) 61 | { 62 | return new IconWithPadding(parent.withColor(color), padding); 63 | } 64 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/IconWithParent.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import net.minecraftforge.fml.relauncher.Side; 4 | import net.minecraftforge.fml.relauncher.SideOnly; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public abstract class IconWithParent extends Icon 10 | { 11 | public final Icon parent; 12 | 13 | public IconWithParent(Icon i) 14 | { 15 | parent = i; 16 | } 17 | 18 | @Override 19 | @SideOnly(Side.CLIENT) 20 | public void bindTexture() 21 | { 22 | parent.bindTexture(); 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/icon/ImageCallback.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.icon; 2 | 3 | import javafx.scene.image.Image; 4 | 5 | import javax.annotation.Nullable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | @FunctionalInterface 11 | public interface ImageCallback 12 | { 13 | void imageLoaded(boolean queued, @Nullable Image image); 14 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/io/ByteCounterOutputStream.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.io; 2 | 3 | import java.io.OutputStream; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class ByteCounterOutputStream extends OutputStream 9 | { 10 | private long size = 0L; 11 | 12 | @Override 13 | public void write(int b) 14 | { 15 | size++; 16 | } 17 | 18 | @Override 19 | public void write(byte b[]) 20 | { 21 | size += b.length; 22 | } 23 | 24 | @Override 25 | public void write(byte b[], int off, int len) 26 | { 27 | size += len; 28 | } 29 | 30 | public long getSize() 31 | { 32 | return size; 33 | } 34 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/io/RequestMethod.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.io; 2 | 3 | public enum RequestMethod 4 | { 5 | GET, 6 | POST, 7 | HEAD, 8 | OPTIONS, 9 | PUT, 10 | DELETE, 11 | TRACE 12 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/io/ResourceDataReader.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.io; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.JsonUtils; 4 | import com.google.gson.JsonElement; 5 | import net.minecraft.client.resources.IResource; 6 | 7 | import javax.imageio.ImageIO; 8 | import java.awt.image.BufferedImage; 9 | import java.io.InputStreamReader; 10 | import java.io.Reader; 11 | import java.nio.charset.StandardCharsets; 12 | import java.util.List; 13 | 14 | /** 15 | * @author LatvianModder 16 | */ 17 | public class ResourceDataReader extends DataReader 18 | { 19 | public final IResource resource; 20 | 21 | ResourceDataReader(IResource r) 22 | { 23 | resource = r; 24 | } 25 | 26 | public String toString() 27 | { 28 | return resource.getResourceLocation().toString(); 29 | } 30 | 31 | @Override 32 | public String string(int bufferSize) throws Exception 33 | { 34 | return readStringFromStream(resource.getInputStream(), bufferSize); 35 | } 36 | 37 | @Override 38 | public List stringList() throws Exception 39 | { 40 | return readStringListFromStream(resource.getInputStream()); 41 | } 42 | 43 | @Override 44 | public JsonElement json() throws Exception 45 | { 46 | try (Reader reader = new InputStreamReader(resource.getInputStream(), StandardCharsets.UTF_8)) 47 | { 48 | return JsonUtils.parse(reader); 49 | } 50 | } 51 | 52 | @Override 53 | public BufferedImage image() throws Exception 54 | { 55 | return ImageIO.read(resource.getInputStream()); 56 | } 57 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/io/StreamDataReader.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.io; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.JsonUtils; 4 | import com.google.gson.JsonElement; 5 | 6 | import javax.imageio.ImageIO; 7 | import java.awt.image.BufferedImage; 8 | import java.io.InputStream; 9 | import java.io.InputStreamReader; 10 | import java.nio.charset.StandardCharsets; 11 | import java.util.List; 12 | 13 | /** 14 | * @author LatvianModder 15 | */ 16 | public class StreamDataReader extends DataReader 17 | { 18 | public final InputStream stream; 19 | 20 | StreamDataReader(InputStream s) 21 | { 22 | stream = s; 23 | } 24 | 25 | public String toString() 26 | { 27 | return stream.toString(); 28 | } 29 | 30 | @Override 31 | public String string(int bufferSize) throws Exception 32 | { 33 | try 34 | { 35 | return readStringFromStream(stream, bufferSize); 36 | } 37 | finally 38 | { 39 | stream.close(); 40 | } 41 | } 42 | 43 | @Override 44 | public List stringList() throws Exception 45 | { 46 | try 47 | { 48 | return readStringListFromStream(stream); 49 | } 50 | finally 51 | { 52 | stream.close(); 53 | } 54 | } 55 | 56 | @Override 57 | public JsonElement json() throws Exception 58 | { 59 | try 60 | { 61 | return JsonUtils.parse(new InputStreamReader(stream, StandardCharsets.UTF_8)); 62 | } 63 | finally 64 | { 65 | stream.close(); 66 | } 67 | } 68 | 69 | @Override 70 | public BufferedImage image() throws Exception 71 | { 72 | try 73 | { 74 | return ImageIO.read(stream); 75 | } 76 | finally 77 | { 78 | stream.close(); 79 | } 80 | } 81 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/io/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.io; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/item/SlotOnlyInsertItem.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.item; 2 | 3 | import com.feed_the_beast.ftblib.lib.util.InvUtils; 4 | import net.minecraft.entity.player.EntityPlayer; 5 | import net.minecraft.inventory.Slot; 6 | import net.minecraft.item.ItemStack; 7 | import net.minecraftforge.items.IItemHandler; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public class SlotOnlyInsertItem extends Slot 13 | { 14 | private final IItemHandler itemHandler; 15 | 16 | public SlotOnlyInsertItem(IItemHandler i, int index, int xPosition, int yPosition) 17 | { 18 | super(InvUtils.EMPTY_INVENTORY, index, xPosition, yPosition); 19 | itemHandler = i; 20 | } 21 | 22 | @Override 23 | public boolean isItemValid(ItemStack stack) 24 | { 25 | return itemHandler.insertItem(0, stack, true) != stack; 26 | } 27 | 28 | @Override 29 | public ItemStack getStack() 30 | { 31 | return ItemStack.EMPTY; 32 | } 33 | 34 | @Override 35 | public void putStack(ItemStack stack) 36 | { 37 | if (itemHandler.insertItem(getSlotIndex(), stack, false) != stack) 38 | { 39 | onSlotChanged(); 40 | } 41 | } 42 | 43 | @Override 44 | public ItemStack onTake(EntityPlayer thePlayer, ItemStack stack) 45 | { 46 | return stack; 47 | } 48 | 49 | @Override 50 | public void onSlotChange(ItemStack stack1, ItemStack stack2) 51 | { 52 | } 53 | 54 | @Override 55 | public int getSlotStackLimit() 56 | { 57 | return itemHandler.getSlotLimit(getSlotIndex()); 58 | } 59 | 60 | @Override 61 | public boolean canTakeStack(EntityPlayer playerIn) 62 | { 63 | return false; 64 | } 65 | 66 | @Override 67 | public ItemStack decrStackSize(int amount) 68 | { 69 | return ItemStack.EMPTY; 70 | } 71 | 72 | @Override 73 | public boolean isSameInventory(Slot other) 74 | { 75 | return other instanceof SlotOnlyInsertItem && ((SlotOnlyInsertItem) other).itemHandler == itemHandler; 76 | } 77 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/item/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.item; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/math/ChunkDimPos.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.math; 2 | 3 | import net.minecraft.entity.Entity; 4 | import net.minecraft.util.math.BlockPos; 5 | import net.minecraft.util.math.ChunkPos; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public final class ChunkDimPos 11 | { 12 | public final int posX, posZ, dim; 13 | 14 | public ChunkDimPos(int x, int z, int d) 15 | { 16 | posX = x; 17 | posZ = z; 18 | dim = d; 19 | } 20 | 21 | public ChunkDimPos(ChunkPos pos, int d) 22 | { 23 | this(pos.x, pos.z, d); 24 | } 25 | 26 | public ChunkDimPos(BlockPos pos, int d) 27 | { 28 | this(MathUtils.chunk(pos.getX()), MathUtils.chunk(pos.getZ()), d); 29 | } 30 | 31 | public ChunkDimPos(Entity entity) 32 | { 33 | this(MathUtils.chunk(entity.posX), MathUtils.chunk(entity.posZ), entity.world.provider.getDimension()); 34 | } 35 | 36 | public boolean equals(Object o) 37 | { 38 | if (o == null) 39 | { 40 | return false; 41 | } 42 | else if (o == this) 43 | { 44 | return true; 45 | } 46 | else if (o instanceof ChunkDimPos) 47 | { 48 | return equalsChunkDimPos((ChunkDimPos) o); 49 | } 50 | return false; 51 | } 52 | 53 | public boolean equalsChunkDimPos(ChunkDimPos p) 54 | { 55 | return p == this || (p.dim == dim && p.posX == posX && p.posZ == posZ); 56 | } 57 | 58 | public String toString() 59 | { 60 | return "[" + dim + '@' + posX + ',' + posZ + ']'; 61 | } 62 | 63 | public int hashCode() 64 | { 65 | return 31 * (31 * posX + posZ) + dim; 66 | } 67 | 68 | public ChunkPos getChunkPos() 69 | { 70 | return new ChunkPos(posX, posZ); 71 | } 72 | 73 | public int getBlockX() 74 | { 75 | return (posX << 4) + 8; 76 | } 77 | 78 | public int getBlockZ() 79 | { 80 | return (posZ << 4) + 8; 81 | } 82 | 83 | public BlockDimPos getBlockPos(int y) 84 | { 85 | return new BlockDimPos(getBlockX(), y, getBlockZ(), dim); 86 | } 87 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/math/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.math; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/net/MessageBase.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.net; 2 | 3 | import com.feed_the_beast.ftblib.lib.io.DataIn; 4 | import com.feed_the_beast.ftblib.lib.io.DataOut; 5 | import io.netty.buffer.ByteBuf; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 7 | 8 | public abstract class MessageBase implements IMessage 9 | { 10 | MessageBase() 11 | { 12 | } 13 | 14 | public abstract NetworkWrapper getWrapper(); 15 | 16 | @Override 17 | public final void toBytes(ByteBuf buf) 18 | { 19 | writeData(new DataOut(buf)); 20 | } 21 | 22 | @Override 23 | public final void fromBytes(ByteBuf buf) 24 | { 25 | readData(new DataIn(buf)); 26 | } 27 | 28 | public void writeData(DataOut data) 29 | { 30 | } 31 | 32 | public void readData(DataIn data) 33 | { 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/net/MessageToClientHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import net.minecraftforge.fml.common.FMLCommonHandler; 5 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 7 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | enum MessageToClientHandler implements IMessageHandler 13 | { 14 | INSTANCE; 15 | 16 | @Override 17 | public IMessage onMessage(MessageToClient message, MessageContext context) 18 | { 19 | FMLCommonHandler.instance().getWorldThread(context.netHandler).addScheduledTask(() -> FTBLib.PROXY.handleClientMessage(message)); 20 | return null; 21 | } 22 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/net/MessageToServer.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.net; 2 | 3 | import io.netty.channel.ChannelFutureListener; 4 | import net.minecraft.entity.player.EntityPlayerMP; 5 | import net.minecraftforge.fml.common.network.FMLEmbeddedChannel; 6 | import net.minecraftforge.fml.common.network.FMLOutboundHandler; 7 | import net.minecraftforge.fml.relauncher.Side; 8 | 9 | /** 10 | * @author LatvianModder 11 | */ 12 | public abstract class MessageToServer extends MessageBase 13 | { 14 | public final void sendToServer() 15 | { 16 | FMLEmbeddedChannel channel = getWrapper().getChannel(Side.CLIENT); 17 | channel.attr(FMLOutboundHandler.FML_MESSAGETARGET).set(FMLOutboundHandler.OutboundTarget.TOSERVER); 18 | channel.writeAndFlush(this).addListener(ChannelFutureListener.FIRE_EXCEPTION_ON_FAILURE); 19 | } 20 | 21 | public void onMessage(EntityPlayerMP player) 22 | { 23 | } 24 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/net/MessageToServerHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLib; 4 | import com.feed_the_beast.ftblib.FTBLibConfig; 5 | import net.minecraftforge.fml.common.FMLCommonHandler; 6 | import net.minecraftforge.fml.common.network.simpleimpl.IMessage; 7 | import net.minecraftforge.fml.common.network.simpleimpl.IMessageHandler; 8 | import net.minecraftforge.fml.common.network.simpleimpl.MessageContext; 9 | 10 | /** 11 | * @author LatvianModder 12 | */ 13 | enum MessageToServerHandler implements IMessageHandler 14 | { 15 | INSTANCE; 16 | 17 | @Override 18 | public IMessage onMessage(MessageToServer message, MessageContext context) 19 | { 20 | FMLCommonHandler.instance().getWorldThread(context.netHandler).addScheduledTask(() -> 21 | { 22 | if (FTBLibConfig.debugging.log_network) 23 | { 24 | FTBLib.LOGGER.info("Net TX: " + message.getClass().getName()); 25 | } 26 | 27 | message.onMessage(context.getServerHandler().player); 28 | }); 29 | 30 | return null; 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/net/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.net; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/tile/EnumSaveType.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.tile; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public enum EnumSaveType 7 | { 8 | SAVE(true, true, false), 9 | NET_FULL(false, true, false), 10 | NET_UPDATE(false, false, false), 11 | ITEM(true, true, true); 12 | 13 | public final boolean save; 14 | public final boolean full; 15 | public final boolean item; 16 | 17 | EnumSaveType(boolean s, boolean f, boolean i) 18 | { 19 | save = s; 20 | full = f; 21 | item = i; 22 | } 23 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/tile/IChangeCallback.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.tile; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | @FunctionalInterface 7 | public interface IChangeCallback 8 | { 9 | void onContentsChanged(boolean majorChange); 10 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/tile/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.tile; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/ChainedBooleanSupplier.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | import java.util.function.BooleanSupplier; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | @FunctionalInterface 9 | public interface ChainedBooleanSupplier extends BooleanSupplier 10 | { 11 | ChainedBooleanSupplier TRUE = () -> true; 12 | ChainedBooleanSupplier FALSE = () -> false; 13 | 14 | default ChainedBooleanSupplier not() 15 | { 16 | return () -> !getAsBoolean(); 17 | } 18 | 19 | default ChainedBooleanSupplier or(BooleanSupplier supplier) 20 | { 21 | return () -> getAsBoolean() || supplier.getAsBoolean(); 22 | } 23 | 24 | default ChainedBooleanSupplier and(BooleanSupplier supplier) 25 | { 26 | return () -> getAsBoolean() && supplier.getAsBoolean(); 27 | } 28 | 29 | default ChainedBooleanSupplier xor(BooleanSupplier supplier) 30 | { 31 | return () -> getAsBoolean() != supplier.getAsBoolean(); 32 | } 33 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/CommonUtils.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | import com.google.common.collect.ImmutableListMultimap; 4 | import com.google.common.collect.ListMultimap; 5 | import net.minecraftforge.fml.common.LoadController; 6 | import net.minecraftforge.fml.common.Loader; 7 | import net.minecraftforge.fml.common.ModContainer; 8 | import net.minecraftforge.fml.relauncher.ReflectionHelper; 9 | 10 | import javax.annotation.Nullable; 11 | 12 | /** 13 | * Made by LatvianModder 14 | */ 15 | public class CommonUtils 16 | { 17 | private static ListMultimap packageOwners = null; 18 | 19 | @SuppressWarnings({"unchecked", "ConstantConditions"}) 20 | public static T cast(@Nullable Object o) 21 | { 22 | return o == null ? null : (T) o; 23 | } 24 | 25 | @Nullable 26 | @SuppressWarnings("deprecation") 27 | public static ModContainer getModContainerForClass(Class clazz) 28 | { 29 | if (packageOwners == null) 30 | { 31 | try 32 | { 33 | LoadController instance = ReflectionHelper.getPrivateValue(Loader.class, Loader.instance(), "modController"); 34 | packageOwners = ReflectionHelper.getPrivateValue(LoadController.class, instance, "packageOwners"); 35 | } 36 | catch (Exception ex) 37 | { 38 | packageOwners = ImmutableListMultimap.of(); 39 | } 40 | } 41 | 42 | if (packageOwners.isEmpty()) 43 | { 44 | return null; 45 | } 46 | 47 | String pkg = clazz.getName().substring(0, clazz.getName().lastIndexOf('.')); 48 | return packageOwners.containsKey(pkg) ? packageOwners.get(pkg).get(0) : null; 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/EnumDyeColorHelper.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | import net.minecraft.init.Items; 4 | import net.minecraft.item.EnumDyeColor; 5 | import net.minecraft.item.ItemStack; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class EnumDyeColorHelper // ItemDye 11 | { 12 | public static final EnumDyeColorHelper[] HELPERS = new EnumDyeColorHelper[EnumDyeColor.values().length]; 13 | 14 | static 15 | { 16 | for (EnumDyeColor c : EnumDyeColor.values()) 17 | { 18 | HELPERS[c.ordinal()] = new EnumDyeColorHelper(c); 19 | } 20 | } 21 | 22 | private final EnumDyeColor dye; 23 | private final String langKey; 24 | private final String oreName; 25 | 26 | private EnumDyeColorHelper(EnumDyeColor col) 27 | { 28 | dye = col; 29 | langKey = "item.fireworksCharge." + col.getTranslationKey(); 30 | oreName = StringUtils.firstUppercase(col.getTranslationKey()); 31 | } 32 | 33 | public static EnumDyeColorHelper get(EnumDyeColor dye) 34 | { 35 | return HELPERS[dye.ordinal()]; 36 | } 37 | 38 | public ItemStack getDye(int s) 39 | { 40 | return new ItemStack(Items.DYE, s, dye.getDyeDamage()); 41 | } 42 | 43 | @Override 44 | public String toString() 45 | { 46 | return dye.getName(); 47 | } 48 | 49 | @Override 50 | public int hashCode() 51 | { 52 | return dye.ordinal(); 53 | } 54 | 55 | public EnumDyeColor getDye() 56 | { 57 | return dye; 58 | } 59 | 60 | public String getLangKey() 61 | { 62 | return langKey; 63 | } 64 | 65 | public String getOreName() 66 | { 67 | return oreName; 68 | } 69 | 70 | public String getDyeName() 71 | { 72 | return "dye" + getOreName(); 73 | } 74 | 75 | public String getGlassName() 76 | { 77 | return "blockGlass" + getOreName(); 78 | } 79 | 80 | public String getPaneName() 81 | { 82 | return "paneGlass" + getOreName(); 83 | } 84 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/FinalIDObject.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public class FinalIDObject implements IWithID 7 | { 8 | private final String id; 9 | 10 | public FinalIDObject(String _id, int flags) 11 | { 12 | id = StringUtils.getID(_id, flags); 13 | } 14 | 15 | public FinalIDObject(String id) 16 | { 17 | this(id, StringUtils.FLAG_ID_DEFAULTS); 18 | } 19 | 20 | @Override 21 | public final String getId() 22 | { 23 | return id; 24 | } 25 | 26 | @Override 27 | public String toString() 28 | { 29 | return id; 30 | } 31 | 32 | @Override 33 | public int hashCode() 34 | { 35 | return id.hashCode(); 36 | } 37 | 38 | @Override 39 | public boolean equals(Object o) 40 | { 41 | return o == this || o instanceof IWithID && id.equals(((IWithID) o).getId()); 42 | } 43 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/IWithID.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public interface IWithID 7 | { 8 | String getId(); 9 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/MapUtils.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | import javax.annotation.Nullable; 4 | import java.util.ArrayList; 5 | import java.util.Comparator; 6 | import java.util.HashMap; 7 | import java.util.List; 8 | import java.util.Map; 9 | 10 | /** 11 | * @author LatvianModder 12 | */ 13 | public class MapUtils 14 | { 15 | public static Map inverse(Map map) 16 | { 17 | Map map1 = new HashMap<>(); 18 | for (Map.Entry e : map.entrySet()) 19 | { 20 | map1.put(e.getValue(), e.getKey()); 21 | } 22 | return map1; 23 | } 24 | 25 | @SuppressWarnings("unchecked") 26 | public static List> sortedEntryList(Map map, @Nullable Comparator> c) 27 | { 28 | if (c == null) 29 | { 30 | c = (o1, o2) -> ((Comparable) o1.getKey()).compareTo(o2.getKey()); 31 | } 32 | 33 | List> list = new ArrayList<>(map.entrySet()); 34 | list.sort(c); 35 | return list; 36 | } 37 | 38 | public static List values(Map map, Comparator> c) 39 | { 40 | List list = new ArrayList<>(); 41 | for (Map.Entry entry : sortedEntryList(map, c)) 42 | { 43 | list.add(entry.getValue()); 44 | } 45 | return list; 46 | } 47 | 48 | public static Comparator> byKeyNames(final boolean ignoreCase) 49 | { 50 | return (o1, o2) -> 51 | { 52 | if (ignoreCase) 53 | { 54 | return String.valueOf(o1.getKey()).compareToIgnoreCase(String.valueOf(o2.getKey())); 55 | } 56 | else 57 | { 58 | return String.valueOf(o1.getKey()).compareTo(String.valueOf(o2.getKey())); 59 | } 60 | }; 61 | } 62 | 63 | public static void sortMap(Map map, Comparator> comparator) 64 | { 65 | if (!map.isEmpty()) 66 | { 67 | List> list = new ArrayList<>(); 68 | list.addAll(map.entrySet()); 69 | list.sort(comparator); 70 | map.clear(); 71 | 72 | for (Map.Entry e : list) 73 | { 74 | map.put(e.getKey(), e.getValue()); 75 | } 76 | } 77 | } 78 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/NetUtils.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | import com.feed_the_beast.ftblib.lib.io.DataReader; 4 | 5 | import java.io.InputStream; 6 | import java.io.OutputStream; 7 | import java.net.InetAddress; 8 | import java.net.Proxy; 9 | import java.net.URI; 10 | import java.net.URL; 11 | 12 | /** 13 | * @author LatvianModder 14 | */ 15 | public class NetUtils 16 | { 17 | public static String getHostAddress() 18 | { 19 | try 20 | { 21 | return StringUtils.emptyIfNull(InetAddress.getLocalHost().getHostAddress()); 22 | } 23 | catch (Exception e) 24 | { 25 | return ""; 26 | } 27 | } 28 | 29 | public static String getPublicAddress(Proxy proxy) 30 | { 31 | try 32 | { 33 | return DataReader.get(new URL("https://api.ipify.org"), DataReader.TEXT, proxy).safeString(); 34 | } 35 | catch (Exception e) 36 | { 37 | return ""; 38 | } 39 | } 40 | 41 | // Misc // 42 | 43 | public static boolean openURI(URI uri) throws Exception 44 | { 45 | Class oclass = Class.forName("java.awt.Desktop"); 46 | Object object = oclass.getMethod("getDesktop").invoke(null); 47 | oclass.getMethod("browse", URI.class).invoke(object, uri); 48 | return true; 49 | } 50 | 51 | public static void moveBytes(InputStream is, OutputStream os, boolean close) throws Exception 52 | { 53 | byte[] buffer = new byte[1024]; 54 | int len; 55 | while ((len = is.read(buffer, 0, buffer.length)) > 0) 56 | { 57 | os.write(buffer, 0, len); 58 | } 59 | os.flush(); 60 | 61 | if (close) 62 | { 63 | is.close(); 64 | os.close(); 65 | } 66 | } 67 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/SidedUtils.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util; 2 | 3 | import net.minecraft.command.ICommandSender; 4 | import net.minecraft.util.text.ITextComponent; 5 | import net.minecraftforge.fml.relauncher.Side; 6 | import net.minecraftforge.server.command.TextComponentHelper; 7 | 8 | import javax.annotation.Nullable; 9 | import java.util.Collection; 10 | import java.util.Collections; 11 | import java.util.HashMap; 12 | import java.util.Map; 13 | import java.util.UUID; 14 | 15 | /** 16 | * @author LatvianModder 17 | */ 18 | public class SidedUtils 19 | { 20 | private static final Map SERVER_MODS_0 = new HashMap<>(); 21 | public static final Map SERVER_MODS = Collections.unmodifiableMap(SERVER_MODS_0); 22 | 23 | public static UUID UNIVERSE_UUID_CLIENT = null; 24 | 25 | public static ITextComponent lang(@Nullable ICommandSender sender, String mod, String key, Object... args) 26 | { 27 | return TextComponentHelper.createComponentTranslation(sender, key, args); 28 | } 29 | 30 | public static void checkModLists(@Nullable Side side, @Nullable Map map) 31 | { 32 | if (side == Side.SERVER) 33 | { 34 | SERVER_MODS_0.clear(); 35 | 36 | if (map != null && !map.isEmpty()) 37 | { 38 | SERVER_MODS_0.putAll(map); 39 | } 40 | } 41 | else if (side == Side.CLIENT) 42 | { 43 | } 44 | } 45 | 46 | /** 47 | * Checks from client side if a mod exists on server side 48 | */ 49 | public static boolean isModLoadedOnServer(String modid) 50 | { 51 | return !modid.isEmpty() && SERVER_MODS_0.containsKey(modid); 52 | } 53 | 54 | /** 55 | * Checks from client side if a set of mods exists on server side 56 | */ 57 | public static boolean areAllModsLoadedOnServer(Collection modids) 58 | { 59 | if (!modids.isEmpty()) 60 | { 61 | for (String modid : modids) 62 | { 63 | if (!isModLoadedOnServer(modid)) 64 | { 65 | return false; 66 | } 67 | } 68 | } 69 | 70 | return true; 71 | } 72 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/BlockPropertyString.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import com.google.common.base.Optional; 4 | import net.minecraft.block.properties.PropertyHelper; 5 | 6 | import java.util.Collection; 7 | 8 | /** 9 | * @author LatvianModder 10 | */ 11 | public class BlockPropertyString extends PropertyHelper 12 | { 13 | private final String name; 14 | private final Collection allowedValues; 15 | 16 | public BlockPropertyString(String n, Collection v) 17 | { 18 | super(n, String.class); 19 | name = n; 20 | allowedValues = v; 21 | } 22 | 23 | @Override 24 | public String getName() 25 | { 26 | return name; 27 | } 28 | 29 | @Override 30 | public Collection getAllowedValues() 31 | { 32 | return allowedValues; 33 | } 34 | 35 | @Override 36 | public Optional parseValue(String value) 37 | { 38 | return Optional.of(value); 39 | } 40 | 41 | @Override 42 | public String getName(String value) 43 | { 44 | return value; 45 | } 46 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/BooleanConsumer.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | @FunctionalInterface 7 | public interface BooleanConsumer 8 | { 9 | void accept(boolean v); 10 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/DataStorage.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.tile.EnumSaveType; 4 | import net.minecraft.nbt.NBTTagCompound; 5 | 6 | /** 7 | * @author LatvianModder 8 | */ 9 | public abstract class DataStorage 10 | { 11 | public static final DataStorage EMPTY = new DataStorage() 12 | { 13 | @Override 14 | public void serializeNBT(NBTTagCompound nbt, EnumSaveType type) 15 | { 16 | } 17 | 18 | @Override 19 | public void deserializeNBT(NBTTagCompound nbt, EnumSaveType type) 20 | { 21 | } 22 | 23 | @Override 24 | public boolean isEmpty() 25 | { 26 | return true; 27 | } 28 | }; 29 | 30 | public abstract void serializeNBT(NBTTagCompound nbt, EnumSaveType type); 31 | 32 | public abstract void deserializeNBT(NBTTagCompound nbt, EnumSaveType type); 33 | 34 | public boolean isEmpty() 35 | { 36 | return false; 37 | } 38 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/EnumIO.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.GuiIcons; 4 | import com.feed_the_beast.ftblib.lib.icon.Icon; 5 | import net.minecraft.util.IStringSerializable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public enum EnumIO implements IStringSerializable 11 | { 12 | IO("io"), 13 | IN("in"), 14 | OUT("out"), 15 | NONE("none"); 16 | 17 | public static final NameMap NAME_MAP = NameMap.createWithBaseTranslationKey(IO, "io_mode", values()); 18 | 19 | private final String name; 20 | 21 | EnumIO(String n) 22 | { 23 | name = n; 24 | } 25 | 26 | @Override 27 | public String getName() 28 | { 29 | return name; 30 | } 31 | 32 | public Icon getIcon() 33 | { 34 | switch (this) 35 | { 36 | case IO: 37 | return GuiIcons.INV_IO; 38 | case IN: 39 | return GuiIcons.INV_IN; 40 | case OUT: 41 | return GuiIcons.INV_OUT; 42 | default: 43 | return GuiIcons.INV_NONE; 44 | } 45 | } 46 | 47 | public boolean canInsert() 48 | { 49 | return this == IO || this == IN; 50 | } 51 | 52 | public boolean canExtract() 53 | { 54 | return this == IO || this == OUT; 55 | } 56 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/EnumPrivacyLevel.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.GuiIcons; 4 | import com.feed_the_beast.ftblib.lib.icon.Icon; 5 | import net.minecraft.util.IStringSerializable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public enum EnumPrivacyLevel implements IStringSerializable 11 | { 12 | PUBLIC("public"), 13 | PRIVATE("private"), 14 | TEAM("team"); 15 | 16 | public static final EnumPrivacyLevel[] VALUES = values(); 17 | public static final NameMap NAME_MAP = NameMap.createWithBaseTranslationKey(PUBLIC, "ftblib.privacy", VALUES); 18 | 19 | private final String name; 20 | 21 | EnumPrivacyLevel(String n) 22 | { 23 | name = n; 24 | } 25 | 26 | @Override 27 | public String getName() 28 | { 29 | return name; 30 | } 31 | 32 | public Icon getIcon() 33 | { 34 | switch (this) 35 | { 36 | case PRIVATE: 37 | return GuiIcons.SECURITY_PRIVATE; 38 | case TEAM: 39 | return GuiIcons.SECURITY_TEAM; 40 | default: 41 | return GuiIcons.SECURITY_PUBLIC; 42 | } 43 | } 44 | 45 | public boolean isPublic() 46 | { 47 | return this == PUBLIC; 48 | } 49 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/EnumRedstoneMode.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.GuiIcons; 4 | import com.feed_the_beast.ftblib.lib.icon.Icon; 5 | import net.minecraft.util.IStringSerializable; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public enum EnumRedstoneMode implements IStringSerializable 11 | { 12 | DISABLED("disabled"), 13 | ACTIVE_HIGH("active_high"), 14 | ACTIVE_LOW("active_low"), 15 | PULSE("pulse"); 16 | 17 | public static final NameMap NAME_MAP = NameMap.createWithBaseTranslationKey(DISABLED, "redstone_mode", DISABLED, ACTIVE_HIGH, ACTIVE_LOW); 18 | public static final NameMap NAME_MAP_WITH_PULSE = NameMap.createWithBaseTranslationKey(DISABLED, "redstone_mode", DISABLED, ACTIVE_HIGH, ACTIVE_LOW, PULSE); 19 | 20 | private final String name; 21 | 22 | EnumRedstoneMode(String n) 23 | { 24 | name = n; 25 | } 26 | 27 | @Override 28 | public String getName() 29 | { 30 | return name; 31 | } 32 | 33 | public boolean isActive(boolean prevValue, boolean value) 34 | { 35 | switch (this) 36 | { 37 | case DISABLED: 38 | return false; 39 | case ACTIVE_HIGH: 40 | return value; 41 | case ACTIVE_LOW: 42 | return !value; 43 | default: 44 | return false; 45 | } 46 | } 47 | 48 | public Icon getIcon() 49 | { 50 | switch (this) 51 | { 52 | case ACTIVE_HIGH: 53 | return GuiIcons.RS_HIGH; 54 | case ACTIVE_LOW: 55 | return GuiIcons.RS_LOW; 56 | case PULSE: 57 | return GuiIcons.RS_PULSE; 58 | default: 59 | return GuiIcons.RS_NONE; 60 | } 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/EnumScreenPosition.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import net.minecraft.util.IStringSerializable; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public enum EnumScreenPosition implements IStringSerializable 9 | { 10 | CENTER("center", 0, 0), 11 | TOP("top", 0, -1), 12 | BOTTOM("bottom", 0, 1), 13 | LEFT("left", -1, 0), 14 | RIGHT("right", 1, 0), 15 | TOP_LEFT("top_left", -1, -1), 16 | TOP_RIGHT("top_right", 1, -1), 17 | BOTTOM_LEFT("bottom_left", -1, 1), 18 | BOTTOM_RIGHT("bottom_right", 1, 1); 19 | 20 | public static final NameMap NAME_MAP = NameMap.create(CENTER, values()); 21 | 22 | private final String name; 23 | public final int offsetX, offsetY; 24 | 25 | EnumScreenPosition(String n, int ox, int oy) 26 | { 27 | name = n; 28 | offsetX = ox; 29 | offsetY = oy; 30 | } 31 | 32 | @Override 33 | public String getName() 34 | { 35 | return name; 36 | } 37 | 38 | public int getX(int screenWidth, int width, int offset) 39 | { 40 | switch (offsetX) 41 | { 42 | case -1: 43 | return offset; 44 | case 1: 45 | return (screenWidth - width) / 2; 46 | default: 47 | return screenWidth - width - offset; 48 | } 49 | } 50 | 51 | public int getY(int screenHeight, int height, int offset) 52 | { 53 | switch (offsetY) 54 | { 55 | case -1: 56 | return offset; 57 | case 1: 58 | return (screenHeight - height) / 2; 59 | default: 60 | return screenHeight - height - offset; 61 | } 62 | } 63 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/IScheduledTask.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Universe; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | @FunctionalInterface 9 | public interface IScheduledTask 10 | { 11 | default boolean isComplete(Universe universe, TimeType type, long time) 12 | { 13 | return (type == TimeType.TICKS ? universe.ticks.ticks() : System.currentTimeMillis()) >= time; 14 | } 15 | 16 | void execute(Universe universe); 17 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/MouseButton.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public class MouseButton 7 | { 8 | private static final MouseButton[] BUTTONS = new MouseButton[16]; 9 | 10 | static 11 | { 12 | for (int i = 0; i < BUTTONS.length; i++) 13 | { 14 | BUTTONS[i] = new MouseButton(i); 15 | } 16 | } 17 | 18 | public static MouseButton get(int i) 19 | { 20 | return i >= 0 && i < BUTTONS.length ? BUTTONS[i] : BUTTONS[BUTTONS.length - 1]; 21 | } 22 | 23 | public static final MouseButton LEFT = get(0); 24 | public static final MouseButton RIGHT = get(1); 25 | public static final MouseButton MIDDLE = get(2); 26 | public static final MouseButton BACK = get(3); 27 | public static final MouseButton NEXT = get(4); 28 | 29 | public final int id; 30 | 31 | private MouseButton(int b) 32 | { 33 | id = b; 34 | } 35 | 36 | public int hashCode() 37 | { 38 | return id; 39 | } 40 | 41 | public boolean isLeft() 42 | { 43 | return id == LEFT.id; 44 | } 45 | 46 | public boolean isRight() 47 | { 48 | return id == RIGHT.id; 49 | } 50 | 51 | public boolean isMiddle() 52 | { 53 | return id == MIDDLE.id; 54 | } 55 | 56 | public int getId() 57 | { 58 | return id; 59 | } 60 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/TimeType.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | /** 4 | * @author LatvianModder 5 | */ 6 | public enum TimeType 7 | { 8 | TICKS, 9 | MILLIS; 10 | 11 | public static final NameMap NAME_MAP = NameMap.create(TICKS, values()); 12 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/UnlistedPropertyString.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.lib.util.misc; 2 | 3 | import net.minecraftforge.common.property.IUnlistedProperty; 4 | 5 | import java.util.function.Predicate; 6 | 7 | /** 8 | * @author LatvianModder 9 | */ 10 | public class UnlistedPropertyString implements IUnlistedProperty 11 | { 12 | public static UnlistedPropertyString create(String name, Predicate validator) 13 | { 14 | return new UnlistedPropertyString(name, validator); 15 | } 16 | 17 | private final String name; 18 | private final Predicate validator; 19 | 20 | private UnlistedPropertyString(String n, Predicate v) 21 | { 22 | name = n; 23 | validator = v; 24 | } 25 | 26 | @Override 27 | public String getName() 28 | { 29 | return name; 30 | } 31 | 32 | @Override 33 | public boolean isValid(String value) 34 | { 35 | return validator.test(value); 36 | } 37 | 38 | @Override 39 | public Class getType() 40 | { 41 | return String.class; 42 | } 43 | 44 | @Override 45 | public String valueToString(String value) 46 | { 47 | return value; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/misc/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.util.misc; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.util; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/lib/util/text_components/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.lib.util.text_components; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/FTBLibNetHandler.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 4 | 5 | /** 6 | * @author LatvianModder 7 | */ 8 | public class FTBLibNetHandler 9 | { 10 | static final NetworkWrapper GENERAL = NetworkWrapper.newWrapper("ftblib"); 11 | static final NetworkWrapper EDIT_CONFIG = NetworkWrapper.newWrapper("ftblib_edit_config"); 12 | static final NetworkWrapper MY_TEAM = NetworkWrapper.newWrapper("ftblib_my_team"); 13 | 14 | public static void init() 15 | { 16 | GENERAL.register(new MessageSyncData()); 17 | GENERAL.registerBlank(); 18 | GENERAL.register(new MessageCloseGui()); 19 | GENERAL.register(new MessageAdminPanelGui()); 20 | GENERAL.register(new MessageAdminPanelGuiResponse()); 21 | GENERAL.register(new MessageAdminPanelAction()); 22 | 23 | EDIT_CONFIG.register(new MessageEditConfig()); 24 | EDIT_CONFIG.register(new MessageEditConfigResponse()); 25 | 26 | MY_TEAM.register(new MessageSelectTeamGui()); 27 | MY_TEAM.register(new MessageMyTeamGui()); 28 | MY_TEAM.register(new MessageMyTeamGuiResponse()); 29 | MY_TEAM.register(new MessageMyTeamAction()); 30 | MY_TEAM.register(new MessageMyTeamPlayerList()); 31 | } 32 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageAdminPanelAction.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLibCommon; 4 | import com.feed_the_beast.ftblib.lib.data.Action; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import com.feed_the_beast.ftblib.lib.io.DataIn; 8 | import com.feed_the_beast.ftblib.lib.io.DataOut; 9 | import com.feed_the_beast.ftblib.lib.net.MessageToServer; 10 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 11 | import net.minecraft.entity.player.EntityPlayerMP; 12 | import net.minecraft.nbt.NBTTagCompound; 13 | import net.minecraft.util.ResourceLocation; 14 | 15 | /** 16 | * @author LatvianModder 17 | */ 18 | public class MessageAdminPanelAction extends MessageToServer 19 | { 20 | private ResourceLocation action; 21 | 22 | public MessageAdminPanelAction() 23 | { 24 | } 25 | 26 | public MessageAdminPanelAction(ResourceLocation id) 27 | { 28 | action = id; 29 | } 30 | 31 | @Override 32 | public NetworkWrapper getWrapper() 33 | { 34 | return FTBLibNetHandler.GENERAL; 35 | } 36 | 37 | @Override 38 | public void writeData(DataOut data) 39 | { 40 | data.writeResourceLocation(action); 41 | } 42 | 43 | @Override 44 | public void readData(DataIn data) 45 | { 46 | action = data.readResourceLocation(); 47 | } 48 | 49 | @Override 50 | public void onMessage(EntityPlayerMP player) 51 | { 52 | Action a = FTBLibCommon.ADMIN_PANEL_ACTIONS.get(action); 53 | 54 | if (a != null) 55 | { 56 | ForgePlayer p = Universe.get().getPlayer(player); 57 | NBTTagCompound data = new NBTTagCompound(); 58 | 59 | if (a.getType(p, data).isEnabled()) 60 | { 61 | a.onAction(p, data); 62 | } 63 | } 64 | } 65 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageAdminPanelGui.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLibCommon; 4 | import com.feed_the_beast.ftblib.lib.data.Action; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import com.feed_the_beast.ftblib.lib.net.MessageToServer; 8 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 9 | import net.minecraft.entity.player.EntityPlayerMP; 10 | import net.minecraft.nbt.NBTTagCompound; 11 | 12 | import java.util.ArrayList; 13 | import java.util.List; 14 | 15 | /** 16 | * @author LatvianModder 17 | */ 18 | public class MessageAdminPanelGui extends MessageToServer 19 | { 20 | @Override 21 | public NetworkWrapper getWrapper() 22 | { 23 | return FTBLibNetHandler.GENERAL; 24 | } 25 | 26 | @Override 27 | public void onMessage(EntityPlayerMP player) 28 | { 29 | List actions = new ArrayList<>(); 30 | ForgePlayer p = Universe.get().getPlayer(player); 31 | NBTTagCompound data = new NBTTagCompound(); 32 | 33 | for (Action a : FTBLibCommon.ADMIN_PANEL_ACTIONS.values()) 34 | { 35 | Action.Type type = a.getType(p, data); 36 | 37 | if (type.isVisible()) 38 | { 39 | actions.add(new Action.Inst(a, type)); 40 | } 41 | } 42 | 43 | new MessageAdminPanelGuiResponse(actions).sendTo(player); 44 | } 45 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageAdminPanelGuiResponse.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.lib.data.Action; 4 | import com.feed_the_beast.ftblib.lib.gui.misc.GuiActionList; 5 | import com.feed_the_beast.ftblib.lib.io.DataIn; 6 | import com.feed_the_beast.ftblib.lib.io.DataOut; 7 | import com.feed_the_beast.ftblib.lib.net.MessageToClient; 8 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 9 | import net.minecraft.client.resources.I18n; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | import net.minecraftforge.fml.relauncher.SideOnly; 12 | 13 | import java.util.Collection; 14 | 15 | /** 16 | * @author LatvianModder 17 | */ 18 | public class MessageAdminPanelGuiResponse extends MessageToClient 19 | { 20 | private Collection actions; 21 | 22 | public MessageAdminPanelGuiResponse() 23 | { 24 | } 25 | 26 | public MessageAdminPanelGuiResponse(Collection a) 27 | { 28 | actions = a; 29 | } 30 | 31 | @Override 32 | public NetworkWrapper getWrapper() 33 | { 34 | return FTBLibNetHandler.GENERAL; 35 | } 36 | 37 | @Override 38 | public void writeData(DataOut data) 39 | { 40 | data.writeCollection(actions, Action.Inst.SERIALIZER); 41 | } 42 | 43 | @Override 44 | public void readData(DataIn data) 45 | { 46 | actions = data.readCollection(Action.Inst.DESERIALIZER); 47 | } 48 | 49 | @Override 50 | @SideOnly(Side.CLIENT) 51 | public void onMessage() 52 | { 53 | new GuiActionList(I18n.format("sidebar_button.ftblib.admin_panel"), actions, id -> new MessageAdminPanelAction(id).sendToServer()).openGui(); 54 | } 55 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageCloseGui.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.lib.gui.IGuiWrapper; 4 | import com.feed_the_beast.ftblib.lib.net.MessageToClient; 5 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 6 | import net.minecraft.client.Minecraft; 7 | import net.minecraft.client.gui.GuiChat; 8 | import net.minecraftforge.fml.relauncher.Side; 9 | import net.minecraftforge.fml.relauncher.SideOnly; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class MessageCloseGui extends MessageToClient 15 | { 16 | @Override 17 | public NetworkWrapper getWrapper() 18 | { 19 | return FTBLibNetHandler.GENERAL; 20 | } 21 | 22 | @Override 23 | @SideOnly(Side.CLIENT) 24 | public void onMessage() 25 | { 26 | Minecraft mc = Minecraft.getMinecraft(); 27 | 28 | if (mc.currentScreen instanceof IGuiWrapper) 29 | { 30 | ((IGuiWrapper) mc.currentScreen).getGui().closeGui(); 31 | } 32 | else if (!(mc.currentScreen instanceof GuiChat)) 33 | { 34 | mc.player.closeScreen(); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageEditConfig.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.lib.config.ConfigGroup; 4 | import com.feed_the_beast.ftblib.lib.config.IConfigCallback; 5 | import com.feed_the_beast.ftblib.lib.gui.misc.GuiEditConfig; 6 | import com.feed_the_beast.ftblib.lib.io.DataIn; 7 | import com.feed_the_beast.ftblib.lib.io.DataOut; 8 | import com.feed_the_beast.ftblib.lib.net.MessageToClient; 9 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 10 | import net.minecraftforge.fml.relauncher.Side; 11 | import net.minecraftforge.fml.relauncher.SideOnly; 12 | 13 | /** 14 | * @author LatvianModder 15 | */ 16 | public class MessageEditConfig extends MessageToClient 17 | { 18 | private static final IConfigCallback RX_CONFIG_TREE = (group, sender) -> new MessageEditConfigResponse(group.serializeNBT()).sendToServer(); 19 | 20 | private ConfigGroup group; 21 | 22 | public MessageEditConfig() 23 | { 24 | } 25 | 26 | public MessageEditConfig(ConfigGroup _group) 27 | { 28 | group = _group; 29 | //TODO: Logger 30 | } 31 | 32 | @Override 33 | public NetworkWrapper getWrapper() 34 | { 35 | return FTBLibNetHandler.EDIT_CONFIG; 36 | } 37 | 38 | @Override 39 | public void writeData(DataOut data) 40 | { 41 | ConfigGroup.SERIALIZER.write(data, group); 42 | } 43 | 44 | @Override 45 | public void readData(DataIn data) 46 | { 47 | group = ConfigGroup.DESERIALIZER.read(data); 48 | } 49 | 50 | @Override 51 | @SideOnly(Side.CLIENT) 52 | public void onMessage() 53 | { 54 | new GuiEditConfig(group, RX_CONFIG_TREE).openGui(); 55 | } 56 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageEditConfigResponse.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLibCommon; 4 | import com.feed_the_beast.ftblib.lib.io.DataIn; 5 | import com.feed_the_beast.ftblib.lib.io.DataOut; 6 | import com.feed_the_beast.ftblib.lib.net.MessageToServer; 7 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 8 | import net.minecraft.entity.player.EntityPlayerMP; 9 | import net.minecraft.nbt.NBTTagCompound; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class MessageEditConfigResponse extends MessageToServer 15 | { 16 | private NBTTagCompound nbt; 17 | 18 | public MessageEditConfigResponse() 19 | { 20 | } 21 | 22 | public MessageEditConfigResponse(NBTTagCompound n) 23 | { 24 | nbt = n; 25 | } 26 | 27 | @Override 28 | public NetworkWrapper getWrapper() 29 | { 30 | return FTBLibNetHandler.EDIT_CONFIG; 31 | } 32 | 33 | @Override 34 | public void writeData(DataOut data) 35 | { 36 | data.writeNBT(nbt); 37 | } 38 | 39 | @Override 40 | public void readData(DataIn data) 41 | { 42 | nbt = data.readNBT(); 43 | } 44 | 45 | @Override 46 | public void onMessage(EntityPlayerMP player) 47 | { 48 | FTBLibCommon.EditingConfig c = FTBLibCommon.TEMP_SERVER_CONFIG.get(player.getGameProfile().getId()); 49 | //TODO: Logger 50 | 51 | if (c != null) 52 | { 53 | c.group.deserializeNBT(nbt); 54 | c.callback.onConfigSaved(c.group, player); 55 | FTBLibCommon.TEMP_SERVER_CONFIG.remove(player.getUniqueID()); 56 | } 57 | } 58 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageMyTeamAction.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLibCommon; 4 | import com.feed_the_beast.ftblib.lib.data.Action; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import com.feed_the_beast.ftblib.lib.io.DataIn; 8 | import com.feed_the_beast.ftblib.lib.io.DataOut; 9 | import com.feed_the_beast.ftblib.lib.net.MessageToServer; 10 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 11 | import net.minecraft.entity.player.EntityPlayerMP; 12 | import net.minecraft.nbt.NBTTagCompound; 13 | import net.minecraft.util.ResourceLocation; 14 | 15 | /** 16 | * @author LatvianModder 17 | */ 18 | public class MessageMyTeamAction extends MessageToServer 19 | { 20 | private ResourceLocation action; 21 | private NBTTagCompound nbt; 22 | 23 | public MessageMyTeamAction() 24 | { 25 | } 26 | 27 | public MessageMyTeamAction(ResourceLocation id, NBTTagCompound data) 28 | { 29 | action = id; 30 | nbt = data; 31 | } 32 | 33 | @Override 34 | public NetworkWrapper getWrapper() 35 | { 36 | return FTBLibNetHandler.MY_TEAM; 37 | } 38 | 39 | @Override 40 | public void writeData(DataOut data) 41 | { 42 | data.writeResourceLocation(action); 43 | data.writeNBT(nbt); 44 | } 45 | 46 | @Override 47 | public void readData(DataIn data) 48 | { 49 | action = data.readResourceLocation(); 50 | nbt = data.readNBT(); 51 | } 52 | 53 | @Override 54 | public void onMessage(EntityPlayerMP player) 55 | { 56 | Action a = FTBLibCommon.TEAM_GUI_ACTIONS.get(action); 57 | 58 | if (a != null) 59 | { 60 | ForgePlayer p = Universe.get().getPlayer(player); 61 | 62 | if (p.hasTeam() && a.getType(p, nbt).isEnabled()) 63 | { 64 | a.onAction(p, nbt); 65 | } 66 | } 67 | } 68 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/MessageMyTeamGui.java: -------------------------------------------------------------------------------- 1 | package com.feed_the_beast.ftblib.net; 2 | 3 | import com.feed_the_beast.ftblib.FTBLibGameRules; 4 | import com.feed_the_beast.ftblib.lib.data.FTBLibAPI; 5 | import com.feed_the_beast.ftblib.lib.data.ForgePlayer; 6 | import com.feed_the_beast.ftblib.lib.data.Universe; 7 | import com.feed_the_beast.ftblib.lib.net.MessageToServer; 8 | import com.feed_the_beast.ftblib.lib.net.NetworkWrapper; 9 | import net.minecraft.entity.player.EntityPlayerMP; 10 | 11 | /** 12 | * @author LatvianModder 13 | */ 14 | public class MessageMyTeamGui extends MessageToServer 15 | { 16 | @Override 17 | public NetworkWrapper getWrapper() 18 | { 19 | return FTBLibNetHandler.MY_TEAM; 20 | } 21 | 22 | @Override 23 | public void onMessage(EntityPlayerMP player) 24 | { 25 | if (!FTBLibGameRules.canCreateTeam(player.world) && !FTBLibGameRules.canJoinTeam(player.world)) 26 | { 27 | FTBLibAPI.sendCloseGuiPacket(player); 28 | } 29 | else 30 | { 31 | ForgePlayer p = Universe.get().getPlayer(player); 32 | (p.hasTeam() ? new MessageMyTeamGuiResponse(p) : new MessageSelectTeamGui(p, FTBLibGameRules.canCreateTeam(player.world))).sendTo(player); 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/net/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib.net; -------------------------------------------------------------------------------- /src/main/java/com/feed_the_beast/ftblib/package-info.java: -------------------------------------------------------------------------------- 1 | @javax.annotation.ParametersAreNonnullByDefault 2 | @mcp.MethodsReturnNonnullByDefault 3 | package com.feed_the_beast.ftblib; -------------------------------------------------------------------------------- /src/main/resources/META-INF/ftblib_at.cfg: -------------------------------------------------------------------------------- 1 | public net.minecraft.inventory.Container field_75149_d # listeners 2 | public net.minecraft.item.EnumDyeColor field_176793_x # chatColor 3 | public net.minecraft.util.text.TextFormatting field_96329_z # formattingCode 4 | public net.minecraft.command.CommandHandler field_71561_b # commandSet 5 | public net.minecraft.server.management.PlayerList field_72407_n # commandsAllowedForAll 6 | public net.minecraft.client.gui.FontRenderer field_111274_c # UNICODE_PAGE_LOCATIONS 7 | public net.minecraft.util.text.Style func_150224_n()Lnet/minecraft/util/text/Style; # getParent 8 | public net.minecraft.util.text.Style field_150248_c # bold 9 | public net.minecraft.util.text.Style field_150245_d # italic 10 | public net.minecraft.util.text.Style field_150243_f # strikethrough 11 | public net.minecraft.util.text.Style field_150246_e # underlined 12 | public net.minecraft.util.text.Style field_150244_g # obfuscated 13 | public net.minecraft.util.text.Style field_150247_b # color 14 | public net.minecraft.util.text.Style field_150251_h # clickEvent 15 | public net.minecraft.util.text.Style field_150252_i # hoverEvent 16 | # public net.minecraft.util.text.Style field_150249_a # parentStyle 17 | public net.minecraft.util.text.Style field_179990_j # insertion 18 | public net.minecraft.client.gui.GuiIngame field_191743_I # chatListeners 19 | public net.minecraft.client.renderer.texture.TextureMap field_110574_e # mapRegisteredSprites 20 | -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/client_config.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "id": "ftblib_client", 4 | "name": "FTB Library", 5 | "icon": "ftblib:textures/logo_small.png" 6 | } 7 | ] -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/resource_reloader.json: -------------------------------------------------------------------------------- 1 | { 2 | "groups": { 3 | "ftb_client_configs": "com.feed_the_beast.ftblib.client.FTBLibResourceType.FTB_CONFIG", 4 | "sidebar_buttons": "com.feed_the_beast.ftblib.client.FTBLibResourceType.FTB_SIDEBAR_BUTTONS" 5 | }, 6 | "listeners": { 7 | "ftb_client_configs": "com.feed_the_beast.ftblib.client.FTBLibClientConfigManager", 8 | "sidebar_buttons": "com.feed_the_beast.ftblib.client.SidebarButtonManager" 9 | } 10 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/sidebar_button_groups.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "y": 0 4 | }, 5 | "cheat": { 6 | "y": 100 7 | }, 8 | "util": { 9 | "y": 200 10 | } 11 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/sidebar_buttons.json: -------------------------------------------------------------------------------- 1 | { 2 | "my_team": { 3 | "group": "ftblib:info", 4 | "icon": "ftblib:textures/gui/teams.png", 5 | "x": 0, 6 | "click": "custom:ftblib:my_team_gui", 7 | "required_server_mods": ["ftblib"], 8 | "loading_screen": true 9 | }, 10 | "settings": { 11 | "group": "ftblib:info", 12 | "icon": "ftblib:icons/settings", 13 | "x": 100, 14 | "click": "custom:ftblib:client_config_gui" 15 | }, 16 | "admin_panel": { 17 | "group": "ftblib:info", 18 | "icon": "ftblib:icons/settings_red", 19 | "x": 110, 20 | "click": "custom:ftblib:admin_panel_gui", 21 | "requires_op": true, 22 | "required_server_mods": ["ftblib"], 23 | "loading_screen": true 24 | } 25 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/blocks/no_texture.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/blocks/no_texture.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/gui/background_squares.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/gui/background_squares.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/gui/entity.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/gui/entity.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/gui/entity.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } 6 | 7 | -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/gui/missing_image.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/gui/missing_image.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/gui/teams.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/gui/teams.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/accept.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/accept.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/accept_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/accept_gray.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/add.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/add.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/add_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/add_gray.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/art.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/art.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/back.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/back.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/beacon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/beacon.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/bed.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/bed.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/bell.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/bell.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/bin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/bin.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/blank.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/blank_blue.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/blank_blue.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/blue_button.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/blue_button.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/blue_grid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/blue_grid.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/bug.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/bug.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/camera.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/camera.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/cancel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/cancel.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/chat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/chat.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/check.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/check.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/close.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/close.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/color_blank.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/color_blank.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/color_hsb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/color_hsb.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/color_rgb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/color_rgb.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/compass.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/compass.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/controller.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/controller.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/diamond.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/diamond.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/dice.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/dice.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/down.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/down.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/feather.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/feather.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/friends.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/globe.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/globe.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/heart.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/heart.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/info.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/info.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/info_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/info_gray.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/inv_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/inv_in.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/inv_io.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/inv_io.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/inv_none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/inv_none.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/inv_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/inv_out.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/jacket.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/jacket.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/left.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/lock.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/lock.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/lock_open.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/lock_open.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/map.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/map.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/marker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/marker.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/money.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/money.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/money_bag.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/money_bag.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/notes.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/notes.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/offline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/offline.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/online.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/online.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/online_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/online_red.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/player.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/player.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/player_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/player_gray.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/refresh.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/refresh.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/remove.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/remove.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/remove_gray.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/remove_gray.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/right.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/rs_high.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/rs_high.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/rs_low.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/rs_low.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/rs_none.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/rs_none.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/rs_pulse.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/rs_pulse.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/security_friends.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/security_friends.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/security_private.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/security_private.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/security_public.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/security_public.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/security_team.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/security_team.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/settings.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/settings.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/settings_red.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/settings_red.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/shield.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/shield.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/sort_az.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/sort_az.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/star.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/star.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/support.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/support.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/support.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/time.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/time.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_day.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/toggle_day.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_day.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_gamemode.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/toggle_gamemode.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_gamemode.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_night.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/toggle_night.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_night.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_rain.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/toggle_rain.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/toggle_rain.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/icons/up.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/icons/up.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/logo.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/logo_small.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/FTBTeam/FTB-Library-Legacy/47586e9a1bb60e6229ce05d75b3d88ae82ef963a/src/main/resources/assets/ftblib/textures/logo_small.png -------------------------------------------------------------------------------- /src/main/resources/assets/ftblib/textures/logo_small.png.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "texture": { 3 | "blur": true 4 | } 5 | } -------------------------------------------------------------------------------- /src/main/resources/mcmod.info: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "modid": "ftblib", 4 | "name": "FTB Library", 5 | "description": "", 6 | "version": "${version}", 7 | "mcversion": "${mcversion}", 8 | "url": "http://minecraft.curseforge.com/projects/ftblib", 9 | "updateUrl": "", 10 | "authorList": ["LatvianModder"], 11 | "credits": "", 12 | "logoFile": "assets/ftblib/textures/logo.png", 13 | "screenshots": [], 14 | "parent": "", 15 | "dependencies": [] 16 | } 17 | ] -------------------------------------------------------------------------------- /src/main/resources/pack.mcmeta: -------------------------------------------------------------------------------- 1 | { 2 | "pack": { 3 | "description": "FTBLib Resources", 4 | "pack_format": 3 5 | } 6 | } 7 | --------------------------------------------------------------------------------