├── .editorconfig ├── .github └── workflows │ ├── build.yml │ ├── check.yml │ └── release.yml ├── .gitignore ├── HEADER ├── LICENSE.md ├── README.md ├── build.gradle ├── gradle.properties ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradlew ├── gradlew.bat ├── settings.gradle └── src └── main ├── java ├── io │ └── github │ │ └── cottonmc │ │ └── libcd │ │ └── api │ │ └── CustomOutputRecipe.java └── reborncore │ ├── Distribution.java │ ├── RebornCore.java │ ├── RebornCoreClient.java │ ├── RebornRegistry.java │ ├── api │ ├── ICustomToolHandler.java │ ├── IListInfoProvider.java │ ├── IToolDrop.java │ ├── IToolHandler.java │ ├── ToolManager.java │ ├── blockentity │ │ ├── IMachineGuiHandler.java │ │ ├── IUpgrade.java │ │ ├── IUpgradeable.java │ │ ├── InventoryProvider.java │ │ └── UnloadHandler.java │ ├── events │ │ ├── ApplyArmorToDamageCallback.java │ │ └── ItemCraftCallback.java │ ├── items │ │ ├── ArmorFovHandler.java │ │ ├── ArmorRemoveHandler.java │ │ ├── ArmorTickable.java │ │ ├── InventoryBase.java │ │ ├── InventoryUtils.java │ │ └── ItemStackModifiers.java │ └── recipe │ │ └── IRecipeCrafterProvider.java │ ├── client │ ├── ClientChunkManager.java │ ├── HolidayRenderManager.java │ ├── IconSupplier.java │ ├── ItemStackRenderManager.java │ ├── ItemStackRenderer.java │ ├── ModelSantaHat.java │ ├── RenderUtil.java │ ├── StackToolTipHandler.java │ ├── gui │ │ ├── GuiButtonCustomTexture.java │ │ ├── GuiButtonItemTexture.java │ │ ├── GuiUtil.java │ │ ├── builder │ │ │ ├── GuiBase.java │ │ │ ├── RedstoneConfigGui.java │ │ │ ├── slot │ │ │ │ ├── FluidConfigGui.java │ │ │ │ ├── GuiTab.java │ │ │ │ ├── SlotConfigGui.java │ │ │ │ └── elements │ │ │ │ │ ├── ButtonElement.java │ │ │ │ │ ├── CheckBoxElement.java │ │ │ │ │ ├── ConfigFluidElement.java │ │ │ │ │ ├── ConfigSlotElement.java │ │ │ │ │ ├── ElementBase.java │ │ │ │ │ ├── FluidConfigPopupElement.java │ │ │ │ │ ├── ISprite.java │ │ │ │ │ ├── OffsetSprite.java │ │ │ │ │ ├── SlotConfigPopupElement.java │ │ │ │ │ ├── SlotElement.java │ │ │ │ │ ├── SlotType.java │ │ │ │ │ ├── Sprite.java │ │ │ │ │ └── SpriteContainer.java │ │ │ └── widget │ │ │ │ ├── GuiButtonExtended.java │ │ │ │ ├── GuiButtonHologram.java │ │ │ │ ├── GuiButtonSimple.java │ │ │ │ └── GuiButtonUpDown.java │ │ ├── componets │ │ │ ├── BaseTextures.java │ │ │ └── GuiHiddenButton.java │ │ ├── guibuilder │ │ │ └── GuiBuilder.java │ │ └── slots │ │ │ ├── BaseSlot.java │ │ │ ├── SlotCharge.java │ │ │ ├── SlotFake.java │ │ │ ├── SlotFilteredVoid.java │ │ │ ├── SlotFluid.java │ │ │ ├── SlotInput.java │ │ │ └── SlotOutput.java │ ├── multiblock │ │ ├── MultiblockComponent.java │ │ └── MultiblockRenderer.java │ ├── screen │ │ ├── BuiltScreenHandlerProvider.java │ │ └── builder │ │ │ ├── BlockEntityScreenHandlerBuilder.java │ │ │ ├── BuiltScreenHandler.java │ │ │ ├── ExtendedScreenHandlerListener.java │ │ │ ├── PlayerScreenHandlerBuilder.java │ │ │ ├── ScreenHandlerBuilder.java │ │ │ ├── Syncable.java │ │ │ └── slot │ │ │ ├── FilteredSlot.java │ │ │ ├── PlayerInventorySlot.java │ │ │ ├── SpriteSlot.java │ │ │ └── UpgradeSlot.java │ └── texture │ │ └── InputStreamTexture.java │ ├── common │ ├── BaseBlock.java │ ├── BaseBlockEntityProvider.java │ ├── RebornCoreCommands.java │ ├── RebornCoreConfig.java │ ├── blockentity │ │ ├── FluidConfiguration.java │ │ ├── MachineBaseBlockEntity.java │ │ ├── MultiblockWriter.java │ │ ├── RedstoneConfiguration.java │ │ └── SlotConfiguration.java │ ├── blocks │ │ ├── BlockMachineBase.java │ │ └── BlockWrenchEventHandler.java │ ├── chunkloading │ │ └── ChunkLoaderManager.java │ ├── config │ │ ├── Config.java │ │ └── Configuration.java │ ├── crafting │ │ ├── ConditionManager.java │ │ ├── RebornFluidRecipe.java │ │ ├── RebornRecipe.java │ │ ├── RebornRecipeType.java │ │ ├── RecipeManager.java │ │ ├── RecipeUtils.java │ │ └── ingredient │ │ │ ├── DummyIngredient.java │ │ │ ├── FluidIngredient.java │ │ │ ├── IngredientManager.java │ │ │ ├── RebornIngredient.java │ │ │ ├── SimpleTag.java │ │ │ ├── StackIngredient.java │ │ │ ├── TagIngredient.java │ │ │ └── WrappedIngredient.java │ ├── explosion │ │ ├── NuclearDamageSource.java │ │ └── RebornExplosion.java │ ├── fluid │ │ ├── FluidSettings.java │ │ ├── FluidUtil.java │ │ ├── FluidValue.java │ │ ├── RebornBucketItem.java │ │ ├── RebornFluid.java │ │ ├── RebornFluidBlock.java │ │ ├── RebornFluidManager.java │ │ ├── RebornFluidRenderManager.java │ │ └── container │ │ │ ├── FluidInstance.java │ │ │ ├── GenericFluidContainer.java │ │ │ └── ItemFluidInfo.java │ ├── misc │ │ ├── Functions.java │ │ ├── ModSounds.java │ │ ├── MultiBlockBreakingTool.java │ │ └── RebornCoreTags.java │ ├── multiblock │ │ ├── BlockMultiblockBase.java │ │ ├── IMultiblockPart.java │ │ ├── MultiblockBlockEntityBase.java │ │ ├── MultiblockControllerBase.java │ │ ├── MultiblockEventHandler.java │ │ ├── MultiblockRegistry.java │ │ ├── MultiblockValidationException.java │ │ ├── MultiblockWorldRegistry.java │ │ └── rectangular │ │ │ ├── PartPosition.java │ │ │ ├── RectangularMultiblockBlockEntityBase.java │ │ │ └── RectangularMultiblockControllerBase.java │ ├── network │ │ ├── ClientBoundPacketHandlers.java │ │ ├── ClientBoundPackets.java │ │ ├── ExtendedPacketBuffer.java │ │ ├── IdentifiedPacket.java │ │ ├── NetworkManager.java │ │ ├── ObjectBufferUtils.java │ │ └── ServerBoundPackets.java │ ├── powerSystem │ │ ├── PowerAcceptorBlockEntity.java │ │ └── PowerSystem.java │ ├── recipes │ │ ├── ExtendedRecipeRemainder.java │ │ ├── ICrafterSoundHanlder.java │ │ ├── IRecipeInput.java │ │ ├── IUpgradeHandler.java │ │ ├── RCRecipeMethods.java │ │ └── RecipeCrafter.java │ └── util │ │ ├── ArrayUtils.java │ │ ├── BiObseravable.java │ │ ├── BooleanFunction.java │ │ ├── CalenderUtils.java │ │ ├── ChatUtils.java │ │ ├── Color.java │ │ ├── DefaultedListCollector.java │ │ ├── EasingFunctions.java │ │ ├── ExceptionUtils.java │ │ ├── GenericWrenchHelper.java │ │ ├── IDebuggable.java │ │ ├── IInventoryAccess.java │ │ ├── IdentifiableObject.java │ │ ├── InventoryItem.java │ │ ├── ItemDurabilityExtensions.java │ │ ├── ItemHandlerUtils.java │ │ ├── ItemNBTHelper.java │ │ ├── ItemUsageContextCustomStack.java │ │ ├── ItemUtils.java │ │ ├── MachineFacing.java │ │ ├── NBTSerializable.java │ │ ├── RebornInventory.java │ │ ├── StringUtils.java │ │ ├── Tank.java │ │ ├── TemporaryLazy.java │ │ ├── TorchHelper.java │ │ ├── Torus.java │ │ ├── TranslationTools.java │ │ ├── WorldUtils.java │ │ ├── WrenchUtils.java │ │ └── serialization │ │ ├── ItemStackSerializer.java │ │ └── SerializationUtil.java │ └── mixin │ ├── client │ ├── AccessorChatHud.java │ ├── AccessorModelPredicateProviderRegistry.java │ ├── MixinDebugRenderer.java │ ├── MixinGameRenderer.java │ ├── MixinItemRenderer.java │ └── MixinWorldRenderer.java │ └── common │ ├── AccessorFluidBlock.java │ ├── AccessorFoliagePlacerType.java │ ├── AccessorIngredient.java │ ├── AccessorRecipeManager.java │ ├── AccessorScreenHandler.java │ ├── AccessorSlot.java │ ├── MixinBucketItem.java │ ├── MixinCraftingResultSlot.java │ ├── MixinItemEntity.java │ ├── MixinItemStack.java │ ├── MixinLivingEntity.java │ ├── MixinPlayerEntity.java │ └── MixinRecipeManager.java └── resources ├── assets └── reborncore │ ├── icon.png │ ├── lang │ ├── de_de.lang │ ├── en_US.lang │ ├── en_us.json │ ├── es_AR.lang │ ├── pt_BR.lang │ ├── pt_br.json │ ├── ru_ru.json │ ├── tr_TR.lang │ ├── zh_CN.lang │ └── zh_cn.json │ ├── sounds.json │ ├── sounds │ └── block_dismantle.ogg │ └── textures │ ├── gui │ ├── base.png │ ├── elements.png │ ├── gui_sheet.png │ ├── guielements.png │ ├── guielementsTR.png │ ├── manual.png │ ├── manual_elements.png │ └── slot_sprites │ │ ├── armour_chest.png │ │ ├── armour_feet.png │ │ ├── armour_head.png │ │ ├── armour_legs.png │ │ ├── armour_offhand.png │ │ ├── cells.png │ │ └── upgrade.png │ └── models │ └── santa_hat.png ├── fabric.mod.json ├── reborncore.client.mixins.json └── reborncore.common.mixins.json /.editorconfig: -------------------------------------------------------------------------------- 1 | root = true 2 | 3 | [*] 4 | charset = utf-8 5 | tab_width = 4 6 | 7 | [*.java] 8 | indent_style = tab 9 | 10 | [*.json] 11 | indent_style = tab 12 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | name: Publish 2 | on: [push] 3 | jobs: 4 | build: 5 | runs-on: ubuntu-20.04 6 | container: 7 | image: openjdk:15-jdk 8 | options: --user root 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: gradle/wrapper-validation-action@v1 12 | 13 | - name: Generate build number 14 | id: buildnumber 15 | uses: einaregilsson/build-number@v3 16 | with: 17 | token: ${{ secrets.github_token }} 18 | prefix: ${{ github.ref }} 19 | 20 | - run: ./gradlew build publish --stacktrace 21 | env: 22 | MAVEN_URL: ${{ secrets.MAVEN_URL }} 23 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 24 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 25 | SIGNING_KEY: ${{ secrets.SIGNING_KEY }} 26 | SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} 27 | 28 | - name: Upload artifacts 29 | uses: actions/upload-artifact@v2 30 | with: 31 | name: Artifacts 32 | path: build/libs/ -------------------------------------------------------------------------------- /.github/workflows/check.yml: -------------------------------------------------------------------------------- 1 | name: Check 2 | on: [pull_request] 3 | jobs: 4 | build: 5 | runs-on: ubuntu-20.04 6 | container: 7 | image: openjdk:15-jdk 8 | options: --user root 9 | steps: 10 | - uses: actions/checkout@v2 11 | - uses: gradle/wrapper-validation-action@v1 12 | - run: ./gradlew build --stacktrace 13 | 14 | - name: Upload artifacts 15 | uses: actions/upload-artifact@v2 16 | with: 17 | name: Artifacts 18 | path: build/libs/ -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Release 2 | on: 3 | workflow_dispatch: 4 | inputs: 5 | channel: 6 | description: 'Release channel' 7 | required: true 8 | default: 'release' 9 | jobs: 10 | build: 11 | runs-on: ubuntu-20.04 12 | container: 13 | image: openjdk:15-jdk 14 | options: --user root 15 | steps: 16 | - uses: actions/checkout@v2 17 | - uses: gradle/wrapper-validation-action@v1 18 | 19 | - name: Generate build number 20 | id: buildnumber 21 | uses: einaregilsson/build-number@v3 22 | with: 23 | token: ${{ secrets.github_token }} 24 | prefix: ${{ github.ref }} 25 | 26 | - run: ./gradlew build publish curseforge github --stacktrace 27 | env: 28 | RELEASE_CHANNEL: ${{ github.event.inputs.channel }} 29 | MAVEN_URL: ${{ secrets.MAVEN_URL }} 30 | MAVEN_USERNAME: ${{ secrets.MAVEN_USERNAME }} 31 | MAVEN_PASSWORD: ${{ secrets.MAVEN_PASSWORD }} 32 | CURSEFORGE_API_KEY: ${{ secrets.CURSEFORGE_API_KEY }} 33 | GITHUB_TOKEN: ${{ secrets.GH_API_KEY }} 34 | SIGNING_KEY: ${{ secrets.SIGNING_KEY }} 35 | SIGNING_PASSWORD: ${{ secrets.SIGNING_PASSWORD }} 36 | 37 | - name: Upload artifacts 38 | uses: actions/upload-artifact@v2 39 | with: 40 | name: Artifacts 41 | path: build/libs/ -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /bin 2 | /out 3 | /run 4 | /.gradle 5 | *.iml 6 | /.metadata 7 | /.settings 8 | ./classpath 9 | /dep 10 | /build 11 | 12 | *.iws 13 | *.ipr 14 | *.iml 15 | Thumbs.db 16 | changelog.txt 17 | *.log 18 | .idea/* 19 | classes/* 20 | /.classpath 21 | /.project 22 | *.launch 23 | /doc/ 24 | /maven -------------------------------------------------------------------------------- /HEADER: -------------------------------------------------------------------------------- 1 | This file is part of RebornCore, licensed under the MIT License (MIT). 2 | 3 | Copyright (c) 2021 TeamReborn 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | Copyright (c) 2020 TechReborn 2 | 3 | Permission is hereby granted, free of charge, to any person obtaining a copy 4 | of this software and associated documentation files (the "Software"), to deal 5 | in the Software without restriction, including without limitation the rights 6 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 7 | copies of the Software, and to permit persons to whom the Software is 8 | furnished to do so, subject to the following conditions: 9 | 10 | The above copyright notice and this permission notice shall be included in all 11 | copies or substantial portions of the Software. 12 | 13 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 14 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 15 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 16 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 17 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 18 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 19 | SOFTWARE. -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![](http://cf.way2muchnoise.eu/full_237903_downloads.svg)](https://minecraft.curseforge.com/projects/reborncore) [![](http://cf.way2muchnoise.eu/packs/237903.svg)](https://minecraft.curseforge.com/projects/reborncore) [![](http://cf.way2muchnoise.eu/mods/237903.svg)](https://minecraft.curseforge.com/projects/reborncore) [![](http://cf.way2muchnoise.eu/versions/237903.svg)](https://minecraft.curseforge.com/projects/reborncore) [![](https://img.shields.io/badge/Discord-TeamReborn-738bd7.svg)](https://discord.gg/0tCDWb77cvetwm0e) 2 | 3 | # RebornCore 4 | Reborn core is a library mod used by a large range of other mods. 5 | 6 | Development of RebornCore has moved into the ![TechReborn](https://github.com/TechReborn/TechReborn) git repository. 7 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Sets default memory used for gradle commands. Can be overridden by user or command line properties. 2 | # This is required to provide enough memory for the Minecraft decompilation process. 3 | org.gradle.jvmargs=-Xmx3G 4 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | pluginManagement { 2 | repositories { 3 | maven { 4 | url = "https://maven.fabricmc.net" 5 | name = "FabricMC" 6 | } 7 | gradlePluginPortal() 8 | } 9 | } 10 | 11 | rootProject.name = "RebornCore-1.16" -------------------------------------------------------------------------------- /src/main/java/io/github/cottonmc/libcd/api/CustomOutputRecipe.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package io.github.cottonmc.libcd.api; 26 | 27 | import net.minecraft.item.Item; 28 | 29 | import java.util.Collection; 30 | 31 | /** 32 | * A recipe that has output behavior that cannot be described by just the Recipe#getOutput() method. 33 | * Used for RecipeTweaker remove-by-output code. 34 | */ 35 | public interface CustomOutputRecipe { 36 | Collection getOutputItems(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/reborncore/Distribution.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore; 26 | 27 | import net.fabricmc.api.EnvType; 28 | 29 | public enum Distribution { 30 | UNIVERSAL, 31 | CLIENT, 32 | SERVER; 33 | 34 | public boolean isInvalid() { 35 | if (this == UNIVERSAL) { 36 | return false; 37 | } 38 | return RebornCore.getSide() == EnvType.CLIENT && this == CLIENT; 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/ICustomToolHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api; 26 | 27 | import net.minecraft.item.ItemStack; 28 | 29 | public interface ICustomToolHandler extends IToolHandler { 30 | 31 | boolean canHandleTool(ItemStack stack); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/IListInfoProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api; 26 | 27 | import net.minecraft.text.Text; 28 | 29 | import java.util.List; 30 | 31 | public interface IListInfoProvider { 32 | 33 | void addInfo(List info, boolean isReal, boolean hasData); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/IToolDrop.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public interface IToolDrop { 31 | 32 | ItemStack getToolDrop(PlayerEntity p0); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/IToolHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.item.ItemStack; 29 | import net.minecraft.util.math.BlockPos; 30 | import net.minecraft.util.math.Direction; 31 | import net.minecraft.world.World; 32 | 33 | /** 34 | * Added onto an item 35 | */ 36 | public interface IToolHandler { 37 | 38 | /** 39 | * Called when a machine is actived with the item that has IToolHandler on it 40 | * 41 | * @param stack the held itemstack 42 | * @param pos the pos of the block 43 | * @param world the world of the block 44 | * @param player the player that actived the block 45 | * @param side the side that the player actived 46 | * @param damage if the tool should be damged, or power taken 47 | * @return If the tool can handle being actived on the block, return false when the tool is broken or out of power for example. 48 | */ 49 | boolean handleTool(ItemStack stack, BlockPos pos, World world, PlayerEntity player, Direction side, boolean damage); 50 | 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/blockentity/IMachineGuiHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.blockentity; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.util.math.BlockPos; 29 | import net.minecraft.world.World; 30 | 31 | public interface IMachineGuiHandler { 32 | 33 | void open(PlayerEntity player, BlockPos pos, World world); 34 | 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/blockentity/IUpgrade.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.blockentity; 26 | 27 | import net.minecraft.item.ItemStack; 28 | import org.jetbrains.annotations.NotNull; 29 | import org.jetbrains.annotations.Nullable; 30 | import reborncore.common.blockentity.MachineBaseBlockEntity; 31 | import reborncore.common.recipes.IUpgradeHandler; 32 | 33 | /** 34 | * Added to an item to say that it is a valid behavior 35 | */ 36 | public interface IUpgrade { 37 | 38 | void process( 39 | @NotNull MachineBaseBlockEntity machineBase, 40 | @Nullable 41 | IUpgradeHandler handler, 42 | @NotNull 43 | ItemStack stack); 44 | 45 | default boolean isValidForInventory(IUpgradeable upgradeable, ItemStack stack) { 46 | return true; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/blockentity/IUpgradeable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.blockentity; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public interface IUpgradeable { 31 | 32 | default boolean canBeUpgraded() { 33 | return true; 34 | } 35 | 36 | Inventory getUpgradeInvetory(); 37 | 38 | int getUpgradeSlotCount(); 39 | 40 | default boolean isUpgradeValid(IUpgrade upgrade, ItemStack stack) { 41 | return true; 42 | } 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/blockentity/InventoryProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.blockentity; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | 29 | public interface InventoryProvider { 30 | 31 | Inventory getInventory(); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/blockentity/UnloadHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.blockentity; 26 | 27 | public interface UnloadHandler { 28 | 29 | void onUnload(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/events/ApplyArmorToDamageCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.events; 26 | 27 | import net.fabricmc.fabric.api.event.Event; 28 | import net.fabricmc.fabric.api.event.EventFactory; 29 | import net.minecraft.entity.damage.DamageSource; 30 | import net.minecraft.entity.player.PlayerEntity; 31 | 32 | public interface ApplyArmorToDamageCallback { 33 | 34 | Event EVENT = EventFactory.createArrayBacked(ApplyArmorToDamageCallback.class, 35 | (listeners) -> (player, damageSource, amount) -> { 36 | float damageAmount = amount; 37 | for (ApplyArmorToDamageCallback listener : listeners){ 38 | damageAmount = listener.applyArmorToDamage(player, damageSource, damageAmount); 39 | } 40 | return damageAmount; 41 | }); 42 | 43 | /** 44 | * Apply armor to amount of damage inflicted. Decreases it in most cases unless armor should increase damage inflicted. 45 | * Event is called after damage is being reduced by armor already and before damage reduction from enchants. 46 | * 47 | * @param player PlayerEntity Player being damaged 48 | * @param source DamageSource Type of damage 49 | * @param amount float Current amount of damage 50 | * @return float Amount of damage after reduction 51 | */ 52 | float applyArmorToDamage(PlayerEntity player, DamageSource source, float amount); 53 | } 54 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/events/ItemCraftCallback.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.events; 26 | 27 | import net.fabricmc.fabric.api.event.Event; 28 | import net.fabricmc.fabric.api.event.EventFactory; 29 | import net.minecraft.entity.player.PlayerEntity; 30 | import net.minecraft.inventory.CraftingInventory; 31 | import net.minecraft.item.ItemStack; 32 | 33 | 34 | public interface ItemCraftCallback { 35 | 36 | Event EVENT = EventFactory.createArrayBacked(ItemCraftCallback.class, (listeners) -> (stack, craftingInventory, playerEntity) -> { 37 | for (ItemCraftCallback callback : listeners) { 38 | callback.onCraft(stack, craftingInventory, playerEntity); 39 | } 40 | }); 41 | 42 | void onCraft(ItemStack stack, CraftingInventory craftingInventory, PlayerEntity playerEntity); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/items/ArmorFovHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.items; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public interface ArmorFovHandler { 31 | 32 | float changeFov(float old, ItemStack stack, PlayerEntity playerEntity); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/items/ArmorRemoveHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.items; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | 29 | public interface ArmorRemoveHandler { 30 | 31 | void onRemoved(PlayerEntity playerEntity); 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/items/ArmorTickable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.items; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public interface ArmorTickable { 31 | 32 | void tickArmor(ItemStack stack, PlayerEntity playerEntity); 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/items/ItemStackModifiers.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.items; 26 | 27 | import com.google.common.collect.Multimap; 28 | import net.minecraft.entity.EquipmentSlot; 29 | import net.minecraft.entity.attribute.EntityAttribute; 30 | import net.minecraft.entity.attribute.EntityAttributeModifier; 31 | import net.minecraft.item.ItemStack; 32 | 33 | public interface ItemStackModifiers { 34 | 35 | void getAttributeModifiers(EquipmentSlot slot, ItemStack stack, Multimap builder); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/reborncore/api/recipe/IRecipeCrafterProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.api.recipe; 26 | 27 | import net.minecraft.item.ItemStack; 28 | import reborncore.common.blockentity.SlotConfiguration; 29 | import reborncore.common.crafting.RebornRecipe; 30 | import reborncore.common.recipes.RecipeCrafter; 31 | 32 | /** 33 | * Created by modmuss50 on 11/04/2016. 34 | */ 35 | public interface IRecipeCrafterProvider extends SlotConfiguration.SlotFilter { 36 | 37 | RecipeCrafter getRecipeCrafter(); 38 | 39 | default boolean canCraft(RebornRecipe rebornRecipe) { 40 | return true; 41 | } 42 | 43 | @Override 44 | default boolean isStackValid(int slotID, ItemStack stack) { 45 | if (getRecipeCrafter() == null) { 46 | return false; 47 | } 48 | return getRecipeCrafter().isStackValidInput(stack); 49 | } 50 | 51 | @Override 52 | default int[] getInputSlots() { 53 | if (getRecipeCrafter() == null) { 54 | return new int[]{}; 55 | } 56 | return getRecipeCrafter().inputSlots; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/IconSupplier.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client; 26 | 27 | import net.fabricmc.api.EnvType; 28 | import net.fabricmc.api.Environment; 29 | import net.fabricmc.fabric.api.event.client.ClientSpriteRegistryCallback; 30 | import net.minecraft.client.texture.SpriteAtlasTexture; 31 | import net.minecraft.util.Identifier; 32 | import reborncore.RebornCore; 33 | 34 | public class IconSupplier { 35 | 36 | public static Identifier armour_head_id = new Identifier(RebornCore.MOD_ID, "gui/slot_sprites/armour_head"); 37 | public static Identifier armour_chest_id = new Identifier(RebornCore.MOD_ID, "gui/slot_sprites/armour_chest"); 38 | public static Identifier armour_legs_id = new Identifier(RebornCore.MOD_ID, "gui/slot_sprites/armour_legs"); 39 | public static Identifier armour_feet_id = new Identifier(RebornCore.MOD_ID, "gui/slot_sprites/armour_feet"); 40 | 41 | @Environment(EnvType.CLIENT) 42 | public static void registerSprites(SpriteAtlasTexture atlasTexture, ClientSpriteRegistryCallback.Registry registry) { 43 | registry.register(IconSupplier.armour_head_id); 44 | registry.register(IconSupplier.armour_chest_id); 45 | registry.register(IconSupplier.armour_legs_id); 46 | registry.register(IconSupplier.armour_feet_id); 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/ItemStackRenderManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client; 26 | 27 | import net.minecraft.item.ItemStack; 28 | 29 | import java.util.LinkedList; 30 | import java.util.Queue; 31 | 32 | public class ItemStackRenderManager { 33 | public static final Queue RENDER_QUEUE = new LinkedList<>(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/GuiUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui; 26 | 27 | import reborncore.client.RenderUtil; 28 | 29 | public class GuiUtil { 30 | public static void drawTooltipBox(int x, int y, int w, int h) { 31 | int bg = 0xf0100010; 32 | drawGradientRect(x + 1, y, w - 1, 1, bg, bg); 33 | drawGradientRect(x + 1, y + h, w - 1, 1, bg, bg); 34 | drawGradientRect(x + 1, y + 1, w - 1, h - 1, bg, bg);// center 35 | drawGradientRect(x, y + 1, 1, h - 1, bg, bg); 36 | drawGradientRect(x + w, y + 1, 1, h - 1, bg, bg); 37 | int grad1 = 0x505000ff; 38 | int grad2 = 0x5028007F; 39 | drawGradientRect(x + 1, y + 2, 1, h - 3, grad1, grad2); 40 | drawGradientRect(x + w - 1, y + 2, 1, h - 3, grad1, grad2); 41 | 42 | drawGradientRect(x + 1, y + 1, w - 1, 1, grad1, grad1); 43 | drawGradientRect(x + 1, y + h - 1, w - 1, 1, grad2, grad2); 44 | } 45 | 46 | public static void drawGradientRect(int x, int y, int w, int h, int colour1, int colour2) { 47 | RenderUtil.drawGradientRect(0, x, y, x + w, y + h, colour1, colour2); 48 | } 49 | 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/slot/elements/ButtonElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.slot.elements; 26 | 27 | public class ButtonElement extends ElementBase { 28 | @SuppressWarnings("unused") 29 | private final Sprite.Button buttonSprite; 30 | 31 | public ButtonElement(int x, int y, Sprite.Button buttonSprite) { 32 | super(x, y, buttonSprite.getNormal()); 33 | this.buttonSprite = buttonSprite; 34 | this.addUpdateAction((gui, element) -> { 35 | if (isHovering) { 36 | element.container.setSprite(0, buttonSprite.getHovered()); 37 | } else { 38 | element.container.setSprite(0, buttonSprite.getNormal()); 39 | } 40 | }); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/slot/elements/ISprite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.slot.elements; 26 | 27 | import reborncore.common.blockentity.MachineBaseBlockEntity; 28 | 29 | public interface ISprite { 30 | Sprite getSprite(MachineBaseBlockEntity provider); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/slot/elements/OffsetSprite.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.slot.elements; 26 | 27 | import reborncore.common.blockentity.MachineBaseBlockEntity; 28 | 29 | public class OffsetSprite { 30 | public ISprite sprite; 31 | public int offsetX = 0; 32 | public int offsetY = 0; 33 | 34 | public OffsetSprite(ISprite sprite, int offsetX, int offsetY) { 35 | this.sprite = sprite; 36 | this.offsetX = offsetX; 37 | this.offsetY = offsetY; 38 | } 39 | 40 | public OffsetSprite(ISprite sprite) { 41 | this.sprite = sprite; 42 | } 43 | 44 | public OffsetSprite(Sprite sprite, MachineBaseBlockEntity provider) { 45 | this.sprite = sprite; 46 | } 47 | 48 | public ISprite getSprite() { 49 | return sprite; 50 | } 51 | 52 | public int getOffsetX(MachineBaseBlockEntity provider) { 53 | return offsetX + sprite.getSprite(provider).offsetX; 54 | } 55 | 56 | public OffsetSprite setOffsetX(int offsetX) { 57 | this.offsetX = offsetX; 58 | return this; 59 | } 60 | 61 | public int getOffsetY(MachineBaseBlockEntity provider) { 62 | return offsetY + sprite.getSprite(provider).offsetY; 63 | } 64 | 65 | public OffsetSprite setOffsetY(int offsetY) { 66 | this.offsetY = offsetY; 67 | return this; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/slot/elements/SlotElement.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.slot.elements; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | 29 | public class SlotElement extends ElementBase { 30 | protected Inventory slotInventory; 31 | protected SlotType type; 32 | int slotId, slotX, slotY; 33 | 34 | public SlotElement(Inventory slotInventory, int slotId, int slotX, int slotY, SlotType type, int x, int y) { 35 | super(x, y, type.getSprite()); 36 | this.type = type; 37 | this.slotInventory = slotInventory; 38 | this.slotId = slotId; 39 | this.slotX = slotX; 40 | this.slotY = slotY; 41 | } 42 | 43 | public SlotType getType() { 44 | return type; 45 | } 46 | 47 | public Inventory getSlotInventory() { 48 | return slotInventory; 49 | } 50 | 51 | public int getSlotId() { 52 | return slotId; 53 | } 54 | 55 | public int getSlotX() { 56 | return slotX; 57 | } 58 | 59 | public int getSlotY() { 60 | return slotY; 61 | } 62 | } -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/slot/elements/SlotType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.slot.elements; 26 | 27 | public enum SlotType { 28 | NORMAL(1, 1, Sprite.SLOT_NORMAL, Sprite.BUTTON_SLOT_NORMAL, Sprite.BUTTON_HOVER_OVERLAY_SLOT_NORMAL); 29 | 30 | int slotOffsetX; 31 | int slotOffsetY; 32 | Sprite sprite; 33 | Sprite buttonSprite; 34 | Sprite buttonHoverOverlay; 35 | 36 | SlotType(int slotOffsetX, int slotOffsetY, Sprite sprite, Sprite buttonSprite, Sprite buttonHoverOverlay) { 37 | this.slotOffsetX = slotOffsetX; 38 | this.slotOffsetY = slotOffsetY; 39 | this.sprite = sprite; 40 | this.buttonSprite = buttonSprite; 41 | this.buttonHoverOverlay = buttonHoverOverlay; 42 | } 43 | 44 | SlotType(int slotOffset, Sprite sprite) { 45 | this.slotOffsetX = slotOffset; 46 | this.slotOffsetY = slotOffset; 47 | this.sprite = sprite; 48 | } 49 | 50 | public int getSlotOffsetX() { 51 | return slotOffsetX; 52 | } 53 | 54 | public int getSlotOffsetY() { 55 | return slotOffsetY; 56 | } 57 | 58 | public Sprite getSprite() { 59 | return sprite; 60 | } 61 | 62 | public Sprite getButtonSprite() { 63 | return buttonSprite; 64 | } 65 | 66 | public Sprite getButtonHoverOverlay() { 67 | return buttonHoverOverlay; 68 | } 69 | } -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/widget/GuiButtonExtended.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.widget; 26 | 27 | import net.minecraft.client.gui.widget.ButtonWidget; 28 | import net.minecraft.text.Text; 29 | import org.apache.logging.log4j.util.TriConsumer; 30 | 31 | 32 | public class GuiButtonExtended extends GuiButtonSimple { 33 | 34 | private TriConsumer clickHandler; 35 | 36 | public GuiButtonExtended(int x, int y, Text buttonText, ButtonWidget.PressAction pressAction) { 37 | super(x, y, 20, 200, buttonText, pressAction); 38 | } 39 | 40 | public GuiButtonExtended(int x, int y, int widthIn, int heightIn, Text buttonText, ButtonWidget.PressAction pressAction) { 41 | super(x, y, widthIn, heightIn, buttonText, pressAction); 42 | } 43 | 44 | public GuiButtonExtended clickHandler(TriConsumer consumer) { 45 | clickHandler = consumer; 46 | return this; 47 | } 48 | 49 | @Override 50 | public void onClick(double mouseX, double mouseY) { 51 | if (clickHandler != null) { 52 | clickHandler.accept(this, mouseX, mouseY); 53 | } 54 | super.onClick(mouseY, mouseY); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/widget/GuiButtonHologram.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.widget; 26 | 27 | import net.minecraft.client.gui.widget.ButtonWidget; 28 | import net.minecraft.client.util.math.MatrixStack; 29 | import net.minecraft.text.LiteralText; 30 | import reborncore.client.gui.builder.GuiBase; 31 | 32 | /** 33 | * Created by Prospector 34 | */ 35 | public class GuiButtonHologram extends GuiButtonExtended { 36 | 37 | GuiBase.Layer layer; 38 | GuiBase gui; 39 | 40 | public GuiButtonHologram(int x, int y, GuiBase gui, GuiBase.Layer layer, ButtonWidget.PressAction pressAction) { 41 | super(x, y, 20, 12, LiteralText.EMPTY, pressAction); 42 | this.layer = layer; 43 | this.gui = gui; 44 | } 45 | 46 | @Override 47 | public void render(MatrixStack matrixStack, int mouseX, int mouseY, float partialTicks) { 48 | 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/builder/widget/GuiButtonSimple.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.builder.widget; 26 | 27 | import net.minecraft.client.gui.widget.ButtonWidget; 28 | import net.minecraft.text.Text; 29 | 30 | public class GuiButtonSimple extends ButtonWidget { 31 | public GuiButtonSimple(int x, int y, Text buttonText, ButtonWidget.PressAction pressAction) { 32 | super(x, y, 20, 200, buttonText, pressAction); 33 | } 34 | 35 | public GuiButtonSimple(int x, int y, int widthIn, int heightIn, Text buttonText, ButtonWidget.PressAction pressAction) { 36 | super(x, y, widthIn, heightIn, buttonText, pressAction); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/BaseSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | import net.minecraft.screen.slot.Slot; 30 | import reborncore.mixin.common.AccessorSlot; 31 | 32 | import java.util.function.Predicate; 33 | 34 | /** 35 | * Created by modmuss50 on 11/04/2016. 36 | */ 37 | public class BaseSlot extends Slot { 38 | 39 | private Predicate filter = (stack) -> true; 40 | 41 | public BaseSlot(Inventory inventoryIn, int index, int xPosition, int yPosition) { 42 | super(inventoryIn, index, xPosition, yPosition); 43 | } 44 | 45 | public BaseSlot(Inventory inventoryIn, int index, int xPosition, int yPosition, Predicate filter) { 46 | super(inventoryIn, index, xPosition, yPosition); 47 | this.filter = filter; 48 | } 49 | 50 | public boolean canWorldBlockRemove() { 51 | return true; 52 | } 53 | 54 | @Override 55 | public boolean canInsert(ItemStack stack) { 56 | return filter.test(stack); 57 | } 58 | 59 | public boolean canWorldBlockInsert() { 60 | return true; 61 | } 62 | 63 | public int getSlotID() { 64 | return ((AccessorSlot) this).getIndex(); 65 | } 66 | } 67 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/SlotCharge.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | import team.reborn.energy.Energy; 30 | 31 | /** 32 | * Created by Rushmead 33 | */ 34 | public class SlotCharge extends BaseSlot { 35 | public SlotCharge(Inventory inventoryIn, int index, int xPosition, int yPosition) { 36 | super(inventoryIn, index, xPosition, yPosition); 37 | } 38 | 39 | @Override 40 | public boolean canInsert(ItemStack stack) { 41 | return Energy.valid(stack); 42 | } 43 | 44 | @Override 45 | public boolean canWorldBlockRemove() { 46 | return false; 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/SlotFake.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public class SlotFake extends BaseSlot { 31 | 32 | public boolean mCanInsertItem; 33 | public boolean mCanStackItem; 34 | public int mMaxStacksize = 127; 35 | 36 | public SlotFake(Inventory itemHandler, int par2, int par3, int par4, boolean aCanInsertItem, 37 | boolean aCanStackItem, int aMaxStacksize) { 38 | super(itemHandler, par2, par3, par4); 39 | this.mCanInsertItem = aCanInsertItem; 40 | this.mCanStackItem = aCanStackItem; 41 | this.mMaxStacksize = aMaxStacksize; 42 | } 43 | 44 | @Override 45 | public boolean canInsert(ItemStack par1ItemStack) { 46 | return this.mCanInsertItem; 47 | } 48 | 49 | @Override 50 | public int getMaxItemCount() { 51 | return this.mMaxStacksize; 52 | } 53 | 54 | @Override 55 | public boolean hasStack() { 56 | return false; 57 | } 58 | 59 | @Override 60 | public ItemStack takeStack(int par1) { 61 | return !this.mCanStackItem ? ItemStack.EMPTY : super.takeStack(par1); 62 | } 63 | 64 | @Override 65 | public boolean canWorldBlockRemove() { 66 | return false; 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/SlotFilteredVoid.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | 30 | import java.util.ArrayList; 31 | import java.util.List; 32 | 33 | public class SlotFilteredVoid extends BaseSlot { 34 | 35 | private final List filter = new ArrayList(); 36 | 37 | public SlotFilteredVoid(Inventory itemHandler, int id, int x, int y) { 38 | super(itemHandler, id, x, y); 39 | } 40 | 41 | public SlotFilteredVoid(Inventory itemHandler, int id, int x, int y, ItemStack[] filterList) { 42 | super(itemHandler, id, x, y); 43 | for (ItemStack itemStack : filterList) { 44 | this.filter.add(itemStack); 45 | } 46 | } 47 | 48 | @Override 49 | public boolean canInsert(ItemStack stack) { 50 | for (ItemStack itemStack : filter) { 51 | if (itemStack.getItem().equals(stack.getItem())) { 52 | return false; 53 | } 54 | } 55 | 56 | return super.canInsert(stack); 57 | } 58 | 59 | @Override 60 | public void setStack(ItemStack arg0) { 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/SlotFluid.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | import reborncore.common.fluid.FluidUtil; 30 | 31 | public class SlotFluid extends BaseSlot { 32 | public SlotFluid(Inventory p_i1824_1_, int p_i1824_2_, int p_i1824_3_, int p_i1824_4_) { 33 | super(p_i1824_1_, p_i1824_2_, p_i1824_3_, p_i1824_4_); 34 | } 35 | 36 | @Override 37 | public boolean canInsert(ItemStack stack) { 38 | 39 | return FluidUtil.getFluidHandler(stack) != null; 40 | 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/SlotInput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public class SlotInput extends BaseSlot { 31 | 32 | public SlotInput(Inventory itemHandler, int par2, int par3, int par4) { 33 | super(itemHandler, par2, par3, par4); 34 | } 35 | 36 | @Override 37 | public boolean canInsert(ItemStack par1ItemStack) { 38 | return true; 39 | } 40 | 41 | @Override 42 | public int getMaxItemCount() { 43 | return 64; 44 | } 45 | 46 | @Override 47 | public boolean canWorldBlockRemove() { 48 | return false; 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/gui/slots/SlotOutput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.gui.slots; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public class SlotOutput extends BaseSlot { 31 | 32 | public SlotOutput(Inventory itemHandler, int par2, int par3, int par4) { 33 | super(itemHandler, par2, par3, par4); 34 | } 35 | 36 | @Override 37 | public boolean canInsert(ItemStack par1ItemStack) { 38 | return false; 39 | } 40 | 41 | @Override 42 | public int getMaxItemCount() { 43 | return 64; 44 | } 45 | 46 | @Override 47 | public boolean canWorldBlockRemove() { 48 | return true; 49 | } 50 | 51 | @Override 52 | public boolean canWorldBlockInsert() { 53 | return false; 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/multiblock/MultiblockComponent.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | /** 26 | * This class was created by . It's distributed as 27 | * part of the Botania Mod. Get the Source Code in github: 28 | * https://github.com/Vazkii/Botania 29 | *

30 | * Botania is Open Source and distributed under the 31 | * Botania License: http://botaniamod.net/license.php 32 | */ 33 | 34 | package reborncore.client.multiblock; 35 | 36 | import net.minecraft.block.Block; 37 | import net.minecraft.block.BlockState; 38 | import net.minecraft.util.math.BlockPos; 39 | 40 | public class MultiblockComponent { 41 | 42 | public BlockPos relPos; 43 | public final BlockState state; 44 | 45 | public MultiblockComponent(BlockPos relPos, BlockState state) { 46 | this.relPos = relPos; 47 | this.state = state; 48 | } 49 | 50 | public BlockPos getRelativePosition() { 51 | return relPos; 52 | } 53 | 54 | public Block getBlock() { 55 | return state.getBlock(); 56 | } 57 | 58 | public BlockState getState() { 59 | return state; 60 | } 61 | 62 | public MultiblockComponent copy() { 63 | return new MultiblockComponent(relPos, state); 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/multiblock/MultiblockRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.multiblock; 26 | 27 | import net.minecraft.client.render.VertexConsumerProvider; 28 | import net.minecraft.client.render.block.entity.BlockEntityRenderDispatcher; 29 | import net.minecraft.client.render.block.entity.BlockEntityRenderer; 30 | import net.minecraft.client.util.math.MatrixStack; 31 | import reborncore.common.blockentity.MachineBaseBlockEntity; 32 | import reborncore.common.blockentity.MultiblockWriter; 33 | 34 | public class MultiblockRenderer extends BlockEntityRenderer { 35 | 36 | public MultiblockRenderer(BlockEntityRenderDispatcher blockEntityRenderDispatcher) { 37 | super(blockEntityRenderDispatcher); 38 | } 39 | 40 | @Override 41 | public void render(T blockEntity, float partialTicks, MatrixStack matrixStack, VertexConsumerProvider vertexConsumerProvider, int light, int overlay) { 42 | if (blockEntity.renderMultiblock) { 43 | blockEntity.writeMultiblock(new MultiblockWriter.HologramRenderer(blockEntity.getWorld(), matrixStack, vertexConsumerProvider, 0.4F).rotate(blockEntity.getFacing().getOpposite())); 44 | } 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/BuiltScreenHandlerProvider.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import reborncore.client.screen.builder.BuiltScreenHandler; 29 | 30 | public interface BuiltScreenHandlerProvider { 31 | BuiltScreenHandler createScreenHandler(int syncID, PlayerEntity player); 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/builder/ExtendedScreenHandlerListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen.builder; 26 | 27 | import net.minecraft.screen.ScreenHandler; 28 | import net.minecraft.screen.ScreenHandlerListener; 29 | import net.minecraft.server.network.ServerPlayerEntity; 30 | import reborncore.common.network.ClientBoundPackets; 31 | import reborncore.common.network.NetworkManager; 32 | 33 | public interface ExtendedScreenHandlerListener { 34 | 35 | default void sendObject(ScreenHandlerListener screenHandlerListener, ScreenHandler screenHandler, int var, Object value) { 36 | if (screenHandlerListener instanceof ServerPlayerEntity) { 37 | NetworkManager.sendToPlayer(ClientBoundPackets.createPacketSendObject(var, value, screenHandler), (ServerPlayerEntity) screenHandlerListener); 38 | } 39 | } 40 | 41 | default void handleObject(int var, Object value) { 42 | 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/builder/Syncable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen.builder; 26 | 27 | import org.apache.commons.lang3.tuple.Pair; 28 | 29 | import java.util.List; 30 | import java.util.function.Consumer; 31 | import java.util.function.Supplier; 32 | 33 | public interface Syncable { 34 | 35 | void getSyncPair(List> pairList); 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/builder/slot/FilteredSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen.builder.slot; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.item.ItemStack; 29 | import reborncore.client.gui.slots.BaseSlot; 30 | 31 | import java.util.function.Predicate; 32 | 33 | public class FilteredSlot extends BaseSlot { 34 | 35 | private Predicate filter; 36 | private int stackLimit = 64; 37 | 38 | public FilteredSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition) { 39 | super(inventory, index, xPosition, yPosition); 40 | } 41 | 42 | public FilteredSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition, int stackLimit) { 43 | super(inventory, index, xPosition, yPosition); 44 | this.stackLimit = stackLimit; 45 | } 46 | 47 | public FilteredSlot setFilter(final Predicate filter) { 48 | this.filter = filter; 49 | return this; 50 | } 51 | 52 | @Override 53 | public boolean canInsert(final ItemStack stack) { 54 | try { 55 | return this.filter.test(stack); 56 | } catch (NullPointerException e) { 57 | return true; 58 | } 59 | } 60 | 61 | @Override 62 | public int getMaxItemCount() { 63 | return stackLimit; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/builder/slot/PlayerInventorySlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen.builder.slot; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.screen.slot.Slot; 29 | 30 | /** 31 | * Created by drcrazy on 31-Dec-19 for TechReborn-1.15. 32 | */ 33 | public class PlayerInventorySlot extends Slot { 34 | 35 | public boolean doDraw; 36 | 37 | public PlayerInventorySlot(Inventory inventory, int index, int xPosition, int yPosition) { 38 | super(inventory, index, xPosition, yPosition); 39 | this.doDraw = true; 40 | } 41 | 42 | @Override 43 | public boolean doDrawHoveringEffect() { 44 | return doDraw; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/builder/slot/SpriteSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen.builder.slot; 26 | 27 | import com.mojang.datafixers.util.Pair; 28 | import net.fabricmc.api.EnvType; 29 | import net.fabricmc.api.Environment; 30 | import net.minecraft.client.texture.SpriteAtlasTexture; 31 | import net.minecraft.inventory.Inventory; 32 | import net.minecraft.util.Identifier; 33 | 34 | import org.jetbrains.annotations.Nullable; 35 | 36 | public class SpriteSlot extends FilteredSlot { 37 | 38 | private final Identifier spriteName; 39 | int stacksize; 40 | 41 | public SpriteSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition, final Identifier sprite, final int stacksize) { 42 | super(inventory, index, xPosition, yPosition); 43 | this.spriteName = sprite; 44 | this.stacksize = stacksize; 45 | } 46 | 47 | public SpriteSlot(final Inventory inventory, final int index, final int xPosition, final int yPosition, final Identifier sprite) { 48 | this(inventory, index, xPosition, yPosition, sprite, 64); 49 | } 50 | 51 | @Override 52 | public int getMaxItemCount() { 53 | return this.stacksize; 54 | } 55 | 56 | @Override 57 | @Nullable 58 | @Environment(EnvType.CLIENT) 59 | public Pair getBackgroundSprite() { 60 | return Pair.of(SpriteAtlasTexture.BLOCK_ATLAS_TEXTURE, spriteName); 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/reborncore/client/screen/builder/slot/UpgradeSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.client.screen.builder.slot; 26 | 27 | import net.minecraft.block.entity.BlockEntity; 28 | import net.minecraft.item.ItemStack; 29 | import reborncore.api.blockentity.IUpgrade; 30 | import reborncore.api.blockentity.IUpgradeable; 31 | import reborncore.client.gui.slots.BaseSlot; 32 | import reborncore.common.util.RebornInventory; 33 | 34 | public class UpgradeSlot extends BaseSlot { 35 | 36 | public UpgradeSlot(final net.minecraft.inventory.Inventory inventory, final int index, final int xPosition, final int yPosition) { 37 | super(inventory, index, xPosition, yPosition); 38 | } 39 | 40 | @Override 41 | public boolean canInsert(final ItemStack stack) { 42 | if (!(stack.getItem() instanceof IUpgrade)) { 43 | return false; 44 | } 45 | IUpgrade upgrade = (IUpgrade) stack.getItem(); 46 | IUpgradeable upgradeable = null; 47 | RebornInventory inv = (RebornInventory) inventory; 48 | BlockEntity blockEntity = inv.getBlockEntity(); 49 | if (blockEntity instanceof IUpgradeable) { 50 | upgradeable = (IUpgradeable) blockEntity; 51 | } 52 | return upgrade.isValidForInventory(upgradeable, stack) && (upgradeable == null || upgradeable.isUpgradeValid(upgrade, stack)); 53 | } 54 | 55 | @Override 56 | public int getMaxItemCount() { 57 | return 1; 58 | } 59 | 60 | } 61 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/BaseBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common; 26 | 27 | import net.minecraft.block.Block; 28 | 29 | public abstract class BaseBlock extends Block { 30 | 31 | public BaseBlock(Settings builder) { 32 | super(builder); 33 | } 34 | 35 | public int getRenderType() { 36 | return 3; 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/RebornCoreConfig.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common; 26 | 27 | import reborncore.common.config.Config; 28 | 29 | public class RebornCoreConfig { 30 | @Config(config = "misc", key = "Enable Seasonal Easter Eggs", comment = "Disable this is you don't want seasonal easter eggs") 31 | public static boolean easterEggs = true; 32 | 33 | @Config(config = "misc", key = "Selected Energy system", comment = "Possible values are: E (was FE, EU)") 34 | public static String selectedSystem = "E"; 35 | } 36 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/blocks/BlockWrenchEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.blocks; 26 | 27 | import net.fabricmc.fabric.api.event.player.UseBlockCallback; 28 | import net.minecraft.block.Block; 29 | import net.minecraft.block.BlockState; 30 | import net.minecraft.util.ActionResult; 31 | import net.minecraft.util.Hand; 32 | import reborncore.api.ToolManager; 33 | 34 | import java.util.ArrayList; 35 | import java.util.List; 36 | 37 | public class BlockWrenchEventHandler { 38 | 39 | public static List wrenableBlocks = new ArrayList<>(); 40 | 41 | 42 | public static void setup() { 43 | UseBlockCallback.EVENT.register((playerEntity, world, hand, blockHitResult) -> { 44 | if (hand == Hand.OFF_HAND) { 45 | // Wrench should be in main hand 46 | return ActionResult.PASS; 47 | } 48 | if (ToolManager.INSTANCE.canHandleTool(playerEntity.getStackInHand(Hand.MAIN_HAND))) { 49 | BlockState state = world.getBlockState(blockHitResult.getBlockPos()); 50 | if (wrenableBlocks.contains(state.getBlock())) { 51 | Block block = state.getBlock(); 52 | block.onUse(state, world, blockHitResult.getBlockPos(), playerEntity, hand, blockHitResult); 53 | return ActionResult.SUCCESS; 54 | } 55 | } 56 | return ActionResult.PASS; 57 | }); 58 | } 59 | 60 | 61 | } 62 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/config/Config.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.config; 26 | 27 | import java.lang.annotation.ElementType; 28 | import java.lang.annotation.Retention; 29 | import java.lang.annotation.RetentionPolicy; 30 | import java.lang.annotation.Target; 31 | 32 | @Retention(RetentionPolicy.RUNTIME) 33 | @Target(ElementType.FIELD) 34 | public @interface Config { 35 | 36 | /** 37 | * This the category of the config 38 | * 39 | * @return 40 | */ 41 | String category() default "config"; 42 | 43 | /** 44 | * This is the key for the config, the default is the field name. 45 | * 46 | * @return 47 | */ 48 | String key() default ""; 49 | 50 | /** 51 | * This is a comment that will be supplied along with the config, use this to explain what the config does 52 | * 53 | * @return 54 | */ 55 | String comment() default ""; 56 | 57 | /** 58 | * this is the config file name, the default is just config.cgf, use this is you whish to split the config into more than one file. 59 | * 60 | * @return 61 | */ 62 | String config() default "config"; 63 | 64 | } 65 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/crafting/ingredient/DummyIngredient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.crafting.ingredient; 26 | 27 | import com.google.gson.JsonObject; 28 | import net.minecraft.item.ItemStack; 29 | import net.minecraft.recipe.Ingredient; 30 | import net.minecraft.util.Identifier; 31 | 32 | import java.util.Collections; 33 | import java.util.List; 34 | 35 | public class DummyIngredient extends RebornIngredient { 36 | 37 | public DummyIngredient() { 38 | super(new Identifier("reborncore", "dummy")); 39 | } 40 | 41 | @Override 42 | public boolean test(ItemStack itemStack) { 43 | return false; 44 | } 45 | 46 | @Override 47 | public Ingredient getPreview() { 48 | return Ingredient.EMPTY; 49 | } 50 | 51 | @Override 52 | public List getPreviewStacks() { 53 | return Collections.emptyList(); 54 | } 55 | 56 | @Override 57 | protected JsonObject toJson() { 58 | return new JsonObject(); 59 | } 60 | 61 | @Override 62 | public int getCount() { 63 | return 0; 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/crafting/ingredient/SimpleTag.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.crafting.ingredient; 26 | 27 | import net.minecraft.tag.Tag; 28 | 29 | import java.util.Collections; 30 | import java.util.List; 31 | 32 | public class SimpleTag implements Tag { 33 | 34 | private final List entries; 35 | 36 | public SimpleTag(List entries) { 37 | this.entries = entries; 38 | } 39 | 40 | @Override 41 | public boolean contains(T entry) { 42 | return entries.contains(entry); 43 | } 44 | 45 | @Override 46 | public List values() { 47 | return Collections.unmodifiableList(entries); 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/explosion/NuclearDamageSource.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.explosion; 26 | 27 | import net.minecraft.entity.Entity; 28 | import net.minecraft.entity.damage.EntityDamageSource; 29 | 30 | /** 31 | * Created by modmuss50 on 16/03/2016. 32 | */ 33 | public class NuclearDamageSource extends EntityDamageSource { 34 | public NuclearDamageSource(Entity entity) { 35 | super("nuke", entity); 36 | } 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/fluid/FluidSettings.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.fluid; 26 | 27 | import net.minecraft.util.Identifier; 28 | 29 | public class FluidSettings { 30 | 31 | private Identifier flowingTexture = new Identifier("reborncore:nope"); 32 | private Identifier stillTexture = new Identifier("reborncore:nope"); 33 | 34 | public FluidSettings setFlowingTexture(Identifier flowingTexture) { 35 | this.flowingTexture = flowingTexture; 36 | return this; 37 | } 38 | 39 | public FluidSettings setStillTexture(Identifier stillTexture) { 40 | this.stillTexture = stillTexture; 41 | return this; 42 | } 43 | 44 | public Identifier getFlowingTexture() { 45 | return flowingTexture; 46 | } 47 | 48 | public Identifier getStillTexture() { 49 | return stillTexture; 50 | } 51 | 52 | private FluidSettings() { 53 | } 54 | 55 | public static FluidSettings create() { 56 | return new FluidSettings(); 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/fluid/RebornBucketItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.fluid; 26 | 27 | import net.minecraft.item.BucketItem; 28 | 29 | public class RebornBucketItem extends BucketItem { 30 | 31 | public RebornBucketItem(RebornFluid fluid, Settings settings) { 32 | super(fluid, settings); 33 | } 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/fluid/RebornFluidBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.fluid; 26 | 27 | import net.minecraft.block.Block; 28 | import net.minecraft.block.FluidBlock; 29 | 30 | public class RebornFluidBlock extends FluidBlock { 31 | 32 | private final RebornFluid fluid; 33 | 34 | public RebornFluidBlock(RebornFluid fluid, Block.Settings properties) { 35 | super(fluid, properties); 36 | this.fluid = fluid; 37 | } 38 | 39 | public RebornFluid getFluid() { 40 | return fluid; 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/fluid/container/ItemFluidInfo.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.fluid.container; 26 | 27 | import net.minecraft.fluid.Fluid; 28 | import net.minecraft.item.ItemStack; 29 | 30 | public interface ItemFluidInfo { 31 | 32 | ItemStack getEmpty(); 33 | 34 | ItemStack getFull(Fluid fluid); 35 | 36 | Fluid getFluid(ItemStack itemStack); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/misc/Functions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.misc; 26 | 27 | import net.minecraft.util.math.Direction; 28 | 29 | public class Functions { 30 | public static int getIntDirFromDirection(Direction dir) { 31 | switch (dir) { 32 | case DOWN: 33 | return 0; 34 | case EAST: 35 | return 5; 36 | case NORTH: 37 | return 2; 38 | case SOUTH: 39 | return 3; 40 | case UP: 41 | return 1; 42 | case WEST: 43 | return 4; 44 | default: 45 | return 0; 46 | } 47 | } 48 | 49 | public static Direction getDirectionFromInt(int dir) { 50 | int metaDataToSet = 0; 51 | switch (dir) { 52 | case 0: 53 | metaDataToSet = 2; 54 | break; 55 | case 1: 56 | metaDataToSet = 4; 57 | break; 58 | case 2: 59 | metaDataToSet = 3; 60 | break; 61 | case 3: 62 | metaDataToSet = 5; 63 | break; 64 | } 65 | return Direction.byId(metaDataToSet); 66 | } 67 | } 68 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/misc/ModSounds.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.misc; 26 | 27 | import net.minecraft.sound.SoundEvent; 28 | import net.minecraft.util.Identifier; 29 | import net.minecraft.util.registry.Registry; 30 | 31 | /** 32 | * @author drcrazy 33 | */ 34 | 35 | public class ModSounds { 36 | 37 | public static SoundEvent BLOCK_DISMANTLE; 38 | 39 | public static void setup() { 40 | BLOCK_DISMANTLE = createSoundEvent(new Identifier("reborncore", "block_dismantle")); 41 | 42 | } 43 | 44 | private static SoundEvent createSoundEvent(Identifier identifier) { 45 | return Registry.register(Registry.SOUND_EVENT, identifier, new SoundEvent(identifier)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/misc/MultiBlockBreakingTool.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.misc; 26 | 27 | import net.minecraft.entity.LivingEntity; 28 | import net.minecraft.item.ItemStack; 29 | import net.minecraft.util.math.BlockPos; 30 | import net.minecraft.world.World; 31 | 32 | import org.jetbrains.annotations.Nullable; 33 | import java.util.Set; 34 | 35 | public interface MultiBlockBreakingTool { 36 | 37 | Set getBlocksToBreak(ItemStack stack, World worldIn, BlockPos pos, @Nullable LivingEntity entityLiving); 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/misc/RebornCoreTags.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.misc; 26 | 27 | import net.fabricmc.fabric.api.tag.TagRegistry; 28 | import net.minecraft.item.Item; 29 | import net.minecraft.tag.Tag; 30 | import net.minecraft.util.Identifier; 31 | 32 | public class RebornCoreTags { 33 | public static final Tag WATER_EXPLOSION_ITEM = TagRegistry.item(new Identifier("reborncore", "water_explosion")); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/multiblock/BlockMultiblockBase.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.multiblock; 26 | 27 | import net.minecraft.block.Block; 28 | import reborncore.common.BaseBlockEntityProvider; 29 | 30 | /* 31 | * Base class for multiblock-capable blocks. This is only a reference implementation 32 | * and can be safely ignored. 33 | */ 34 | public abstract class BlockMultiblockBase extends BaseBlockEntityProvider { 35 | 36 | protected BlockMultiblockBase(Block.Settings builder) { 37 | super(builder); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/multiblock/MultiblockEventHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.multiblock; 26 | 27 | /** 28 | * In your mod, subscribe this on both the client and server sides side to 29 | * handle chunk load events for your multiblock machines. Chunks can load 30 | * asynchronously in environments like MCPC+, so we cannot behavior any blocks 31 | * that are in chunks which are still loading. 32 | */ 33 | public class MultiblockEventHandler { 34 | 35 | //TODO mixins needed for this 36 | // public void onChunkLoad(ChunkEvent.Load loadEvent) { 37 | // Chunk chunk = loadEvent.getChunk(); 38 | // IWorld world = loadEvent.getWorld(); 39 | // MultiblockRegistry.onChunkLoaded(world, chunk); 40 | // } 41 | // 42 | // 43 | // public void onWorldUnload(WorldEvent.Unload unloadWorldEvent) { 44 | // MultiblockRegistry.onWorldUnloaded(unloadWorldEvent.getWorld()); 45 | // } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/multiblock/MultiblockValidationException.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.multiblock; 26 | 27 | /** 28 | * An exception thrown when trying to validate a multiblock. Requires a string 29 | * describing why the multiblock could not assemble. 30 | * 31 | * @author Erogenous Beef 32 | */ 33 | public class MultiblockValidationException extends Exception { 34 | 35 | /** 36 | * 37 | */ 38 | private static final long serialVersionUID = -4038176177468678877L; 39 | 40 | public MultiblockValidationException(String reason) { 41 | super(reason); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/multiblock/rectangular/PartPosition.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.multiblock.rectangular; 26 | 27 | public enum PartPosition { 28 | Unknown, Interior, FrameCorner, Frame, TopFace, BottomFace, NorthFace, SouthFace, EastFace, WestFace; 29 | 30 | public boolean isFace(PartPosition position) { 31 | switch (position) { 32 | case TopFace: 33 | case BottomFace: 34 | case NorthFace: 35 | case SouthFace: 36 | case EastFace: 37 | case WestFace: 38 | return true; 39 | default: 40 | return false; 41 | } 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/network/IdentifiedPacket.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.network; 26 | 27 | import net.minecraft.network.PacketByteBuf; 28 | import net.minecraft.util.Identifier; 29 | 30 | public final class IdentifiedPacket { 31 | 32 | private final Identifier channel; 33 | private final PacketByteBuf packetByteBuf; 34 | 35 | public IdentifiedPacket(Identifier channel, PacketByteBuf packetByteBuf) { 36 | this.channel = channel; 37 | this.packetByteBuf = packetByteBuf; 38 | } 39 | 40 | public Identifier getChannel() { 41 | return channel; 42 | } 43 | 44 | public PacketByteBuf getPacketByteBuf() { 45 | return packetByteBuf; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/recipes/ExtendedRecipeRemainder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.recipes; 26 | 27 | import net.minecraft.item.ItemStack; 28 | 29 | public interface ExtendedRecipeRemainder { 30 | 31 | default ItemStack getRemainderStack(ItemStack stack) { 32 | return stack.getItem().hasRecipeRemainder() ? new ItemStack(stack.getItem().getRecipeRemainder()) : ItemStack.EMPTY; 33 | } 34 | 35 | } -------------------------------------------------------------------------------- /src/main/java/reborncore/common/recipes/ICrafterSoundHanlder.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.recipes; 26 | 27 | import net.minecraft.block.entity.BlockEntity; 28 | 29 | /** 30 | * Created by Mark on 01/07/2017. 31 | */ 32 | public interface ICrafterSoundHanlder { 33 | 34 | void playSound(boolean firstRun, BlockEntity blockEntity); 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/recipes/IRecipeInput.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.recipes; 26 | 27 | import net.minecraft.item.ItemStack; 28 | 29 | import java.util.List; 30 | 31 | public interface IRecipeInput { 32 | 33 | ItemStack getItemStack(); 34 | 35 | List getAllStacks(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/recipes/IUpgradeHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.recipes; 26 | 27 | /** 28 | * This class isnt designed to be used by other mods, if you want to have upgrades have your 29 | */ 30 | public interface IUpgradeHandler { 31 | 32 | void resetSpeedMulti(); 33 | 34 | double getSpeedMultiplier(); 35 | 36 | void addPowerMulti(double amount); 37 | 38 | void resetPowerMulti(); 39 | 40 | double getPowerMultiplier(); 41 | 42 | double getEuPerTick(double baseEu); 43 | 44 | void addSpeedMulti(double amount); 45 | 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/recipes/RCRecipeMethods.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.recipes; 26 | 27 | import net.minecraft.block.Block; 28 | import net.minecraft.item.Item; 29 | import net.minecraft.item.ItemStack; 30 | 31 | /** 32 | * Created by Prospector 33 | */ 34 | public abstract class RCRecipeMethods { 35 | 36 | static ItemStack getStack(Item item) { 37 | return getStack(item, 1); 38 | } 39 | 40 | static ItemStack getStack(Item item, int count) { 41 | return getStack(item, count); 42 | } 43 | 44 | static ItemStack getStack(Block block) { 45 | return getStack(block, 1); 46 | } 47 | 48 | static ItemStack getStack(Block block, int count) { 49 | return getStack(block, count); 50 | } 51 | } 52 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/ArrayUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import java.util.Collection; 28 | import java.util.Locale; 29 | 30 | /** 31 | * Created by covers1624 on 3/27/2016. 32 | */ 33 | public class ArrayUtils { 34 | 35 | public static String[] arrayToLowercase(String[] array) { 36 | String[] copy = new String[array.length]; 37 | for (int i = 0; i < array.length; i++) { 38 | copy[i] = array[i].toLowerCase(Locale.ROOT).intern(); 39 | } 40 | return copy; 41 | } 42 | 43 | public static Collection addAll(Collection dest, Collection... src) { 44 | for (Collection c : src) { 45 | dest.addAll(c); 46 | } 47 | return dest; 48 | } 49 | } 50 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/BiObseravable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import org.jetbrains.annotations.NotNull; 28 | import org.jetbrains.annotations.Nullable; 29 | 30 | import java.util.LinkedList; 31 | import java.util.List; 32 | import java.util.Objects; 33 | import java.util.function.BiConsumer; 34 | 35 | public class BiObseravable { 36 | @Nullable 37 | private A a; 38 | @Nullable 39 | private B b; 40 | 41 | private final List> listeners = new LinkedList<>(); 42 | 43 | public void pushA(A a) { 44 | this.a = a; 45 | fireListeners(); 46 | } 47 | 48 | public void pushB(B b) { 49 | this.b = b; 50 | fireListeners(); 51 | } 52 | 53 | @NotNull 54 | public A getA() { 55 | Objects.requireNonNull(a); 56 | return a; 57 | } 58 | 59 | @NotNull 60 | public B getB() { 61 | Objects.requireNonNull(b); 62 | return b; 63 | } 64 | 65 | private void fireListeners() { 66 | if (a == null || b == null) { 67 | return; 68 | } 69 | for (BiConsumer listener : listeners) { 70 | listener.accept(a, b); 71 | } 72 | } 73 | 74 | public void listen(@NotNull BiConsumer<@NotNull A, @NotNull B> consumer) { 75 | listeners.add(consumer); 76 | } 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/BooleanFunction.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | @FunctionalInterface 28 | public interface BooleanFunction { 29 | 30 | boolean get(T type); 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/CalenderUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import reborncore.RebornCore; 28 | 29 | import java.util.Calendar; 30 | 31 | /** 32 | * Created by Mark on 27/11/2016. 33 | */ 34 | public class CalenderUtils { 35 | 36 | public static boolean christmas; 37 | 38 | public static void loadCalender() { 39 | Calendar calendar = Calendar.getInstance(); 40 | calendar.setTimeInMillis(System.currentTimeMillis()); 41 | 42 | int day = calendar.get(Calendar.DAY_OF_MONTH); 43 | int month = calendar.get(Calendar.MONTH) + 1; //Java months start at 0 44 | if (month == 12) { 45 | if (day >= 24 && day <= 26) { 46 | christmas = true; 47 | RebornCore.LOGGER.info("Merry christmas from reborn core! :)"); 48 | } 49 | } 50 | 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/ExceptionUtils.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | public class ExceptionUtils { 28 | 29 | public static void tryAndThrow(Runnable runnable, String message) throws RuntimeException { 30 | try { 31 | runnable.run(); 32 | } catch (Throwable t) { 33 | t.printStackTrace(); 34 | throw new RuntimeException(message, t); 35 | } 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/GenericWrenchHelper.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.item.ItemStack; 29 | import net.minecraft.server.network.ServerPlayerEntity; 30 | import net.minecraft.util.Identifier; 31 | import net.minecraft.util.math.BlockPos; 32 | import net.minecraft.util.math.Direction; 33 | import net.minecraft.util.registry.Registry; 34 | import net.minecraft.world.World; 35 | import reborncore.api.ICustomToolHandler; 36 | 37 | public class GenericWrenchHelper implements ICustomToolHandler { 38 | 39 | Identifier itemLocation; 40 | boolean damage; 41 | 42 | public GenericWrenchHelper(Identifier itemLocation, boolean damage) { 43 | this.itemLocation = itemLocation; 44 | this.damage = damage; 45 | } 46 | 47 | @Override 48 | public boolean canHandleTool(ItemStack stack) { 49 | return Registry.ITEM.getId(stack.getItem()).equals(itemLocation); 50 | } 51 | 52 | @Override 53 | public boolean handleTool(ItemStack stack, BlockPos pos, World world, PlayerEntity player, Direction side, boolean damage) { 54 | if (this.damage && damage && !world.isClient) { 55 | stack.damage(1, world.random, (ServerPlayerEntity) player); 56 | } 57 | return true; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/IDebuggable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.util.Formatting; 28 | 29 | public interface IDebuggable { 30 | 31 | String getDebugText(); 32 | 33 | 34 | // Formatting helpers 35 | static String propertyFormat(String property, String info){ 36 | String s = "" + Formatting.GREEN; 37 | s += property + ": "; 38 | s += Formatting.RED; 39 | s += info; 40 | 41 | return s; 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/IInventoryAccess.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.item.ItemStack; 28 | import net.minecraft.util.math.Direction; 29 | import reborncore.common.blockentity.MachineBaseBlockEntity; 30 | 31 | public interface IInventoryAccess { 32 | 33 | boolean canHandleIO(int slotID, ItemStack stack, Direction face, AccessDirection direction, T blockEntity); 34 | 35 | enum AccessDirection { 36 | INSERT, 37 | EXTRACT 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/IdentifiableObject.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.util.Identifier; 28 | import org.jetbrains.annotations.NotNull; 29 | 30 | import java.util.Objects; 31 | 32 | public class IdentifiableObject { 33 | @NotNull 34 | private final T object; 35 | @NotNull 36 | private final Identifier identifier; 37 | 38 | public IdentifiableObject(@NotNull T object, @NotNull Identifier identifier) { 39 | Objects.requireNonNull(object); 40 | Objects.requireNonNull(identifier); 41 | this.object = object; 42 | this.identifier = identifier; 43 | } 44 | 45 | @NotNull 46 | public T getObject() { 47 | return object; 48 | } 49 | 50 | @NotNull 51 | public Identifier getIdentifier() { 52 | return identifier; 53 | } 54 | 55 | @Override 56 | public boolean equals(Object o) { 57 | if (this == o) return true; 58 | if (o == null || getClass() != o.getClass()) return false; 59 | IdentifiableObject that = (IdentifiableObject) o; 60 | return object.equals(that.object) && 61 | identifier.equals(that.identifier); 62 | } 63 | 64 | @Override 65 | public int hashCode() { 66 | return Objects.hash(object, identifier); 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/ItemDurabilityExtensions.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.item.ItemStack; 28 | 29 | public interface ItemDurabilityExtensions { 30 | 31 | default double getDurability(ItemStack stack) { 32 | return 0; 33 | } 34 | 35 | default boolean showDurability(ItemStack stack) { 36 | return false; 37 | } 38 | 39 | default int getDurabilityColor(ItemStack stack) { 40 | return 0; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/ItemUsageContextCustomStack.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.entity.player.PlayerEntity; 28 | import net.minecraft.item.ItemStack; 29 | import net.minecraft.item.ItemUsageContext; 30 | import net.minecraft.util.Hand; 31 | import net.minecraft.util.hit.BlockHitResult; 32 | import net.minecraft.world.World; 33 | 34 | import org.jetbrains.annotations.Nullable; 35 | 36 | public class ItemUsageContextCustomStack extends ItemUsageContext { 37 | 38 | public ItemUsageContextCustomStack(World world, @Nullable PlayerEntity player, Hand hand, ItemStack stack, BlockHitResult hit) { 39 | super(world, player, hand, stack, hit); 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/MachineFacing.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.util.math.Direction; 28 | import reborncore.common.blockentity.MachineBaseBlockEntity; 29 | 30 | public enum MachineFacing { 31 | FRONT, 32 | BACK, 33 | UP, 34 | DOWN, 35 | LEFT, 36 | RIGHT; 37 | 38 | public Direction getFacing(MachineBaseBlockEntity machineBase) { 39 | if (this == FRONT) { 40 | return machineBase.getFacing(); 41 | } 42 | if (this == BACK) { 43 | return machineBase.getFacing().getOpposite(); 44 | } 45 | if (this == RIGHT) { 46 | //North -> West 47 | int i = machineBase.getFacing().getOpposite().getHorizontal() + 1; 48 | if (i > 3) { 49 | i = 0; 50 | } 51 | if (i < 0) { 52 | i = 3; 53 | } 54 | return Direction.fromHorizontal(i); 55 | } 56 | if (this == LEFT) { 57 | //North -> East 58 | int i = machineBase.getFacing().getOpposite().getHorizontal() - 1; 59 | if (i > 3) { 60 | i = 0; 61 | } 62 | if (i < 0) { 63 | i = 3; 64 | } 65 | return Direction.fromHorizontal(i); 66 | } 67 | if (this == UP) { 68 | return Direction.UP; 69 | } 70 | if (this == DOWN) { 71 | return Direction.DOWN; 72 | } 73 | 74 | return Direction.NORTH; 75 | } 76 | 77 | } 78 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/NBTSerializable.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import net.minecraft.nbt.CompoundTag; 28 | 29 | import org.jetbrains.annotations.NotNull; 30 | 31 | public interface NBTSerializable { 32 | 33 | @NotNull 34 | CompoundTag write(); 35 | 36 | void read(@NotNull CompoundTag tag); 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/TemporaryLazy.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util; 26 | 27 | import java.util.function.Supplier; 28 | 29 | public class TemporaryLazy { 30 | private T value; 31 | private final Supplier valueSupplier; 32 | 33 | public TemporaryLazy(Supplier valueSupplier) { 34 | this.valueSupplier = valueSupplier; 35 | } 36 | 37 | public T get() { 38 | if (value == null) { 39 | value = valueSupplier.get(); 40 | } 41 | return value; 42 | } 43 | 44 | public void reset() { 45 | value = null; 46 | } 47 | } -------------------------------------------------------------------------------- /src/main/java/reborncore/common/util/serialization/SerializationUtil.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.common.util.serialization; 26 | 27 | import com.google.gson.Gson; 28 | import com.google.gson.GsonBuilder; 29 | import com.google.gson.JsonArray; 30 | import com.google.gson.JsonElement; 31 | import net.minecraft.item.ItemStack; 32 | 33 | import java.util.List; 34 | import java.util.stream.IntStream; 35 | import java.util.stream.Stream; 36 | 37 | public class SerializationUtil { 38 | 39 | public static final Gson GSON = new GsonBuilder() 40 | .setPrettyPrinting() 41 | .enableComplexMapKeySerialization() 42 | .registerTypeAdapter(ItemStack.class, new ItemStackSerializer()) 43 | .create(); 44 | 45 | //Same as above, just without pretty printing 46 | public static final Gson GSON_FLAT = new GsonBuilder() 47 | .enableComplexMapKeySerialization() 48 | .registerTypeAdapter(ItemStack.class, new ItemStackSerializer()) 49 | .create(); 50 | 51 | 52 | public static Stream stream(JsonArray array) { 53 | return IntStream.range(0, array.size()) 54 | .mapToObj(array::get); 55 | } 56 | 57 | public static JsonArray asArray(List elements) { 58 | JsonArray array = new JsonArray(); 59 | elements.forEach(array::add); 60 | return array; 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/client/AccessorChatHud.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.client; 26 | 27 | import net.minecraft.client.gui.hud.ChatHud; 28 | import net.minecraft.text.Text; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.gen.Invoker; 31 | 32 | @Mixin(ChatHud.class) 33 | public interface AccessorChatHud { 34 | @Invoker("addMessage") 35 | void invokeAddMessage(Text message, int messageId); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/client/AccessorModelPredicateProviderRegistry.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.client; 26 | 27 | import net.minecraft.client.item.ModelPredicateProvider; 28 | import net.minecraft.client.item.ModelPredicateProviderRegistry; 29 | import net.minecraft.item.Item; 30 | import net.minecraft.util.Identifier; 31 | import org.spongepowered.asm.mixin.Mixin; 32 | import org.spongepowered.asm.mixin.gen.Invoker; 33 | 34 | @Mixin(ModelPredicateProviderRegistry.class) 35 | public interface AccessorModelPredicateProviderRegistry { 36 | @Invoker 37 | static void callRegister(Item item, Identifier id, ModelPredicateProvider provider) { 38 | throw new RuntimeException("nope"); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/client/MixinDebugRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.client; 26 | 27 | import net.minecraft.client.render.VertexConsumerProvider; 28 | import net.minecraft.client.render.debug.DebugRenderer; 29 | import net.minecraft.client.util.math.MatrixStack; 30 | import org.spongepowered.asm.mixin.Mixin; 31 | import org.spongepowered.asm.mixin.injection.At; 32 | import org.spongepowered.asm.mixin.injection.Inject; 33 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 34 | import reborncore.client.ClientChunkManager; 35 | 36 | @Mixin(DebugRenderer.class) 37 | public class MixinDebugRenderer { 38 | 39 | @Inject(method = "render", at = @At("RETURN")) 40 | public void render(MatrixStack matrices, VertexConsumerProvider.Immediate vertexConsumers, double cameraX, double cameraY, double cameraZ, CallbackInfo info) { 41 | ClientChunkManager.render(matrices, vertexConsumers, cameraX, cameraY, cameraZ); 42 | } 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/client/MixinGameRenderer.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.client; 26 | 27 | import net.minecraft.client.MinecraftClient; 28 | import net.minecraft.client.network.AbstractClientPlayerEntity; 29 | import net.minecraft.client.render.GameRenderer; 30 | import net.minecraft.item.ItemStack; 31 | import org.spongepowered.asm.mixin.Final; 32 | import org.spongepowered.asm.mixin.Mixin; 33 | import org.spongepowered.asm.mixin.Shadow; 34 | import org.spongepowered.asm.mixin.injection.At; 35 | import org.spongepowered.asm.mixin.injection.Redirect; 36 | import reborncore.api.items.ArmorFovHandler; 37 | 38 | @Mixin(GameRenderer.class) 39 | public class MixinGameRenderer { 40 | 41 | @Shadow 42 | @Final 43 | private MinecraftClient client; 44 | 45 | @Redirect(method = "updateMovementFovMultiplier", at = @At(value = "INVOKE", target = "Lnet/minecraft/client/network/AbstractClientPlayerEntity;getSpeed()F")) 46 | private float updateMovementFovMultiplier(AbstractClientPlayerEntity playerEntity) { 47 | float playerSpeed = playerEntity.getSpeed(); 48 | for (ItemStack stack : playerEntity.getArmorItems()) { 49 | if (stack.getItem() instanceof ArmorFovHandler) { 50 | playerSpeed = ((ArmorFovHandler) stack.getItem()).changeFov(playerSpeed, stack, client.player); 51 | } 52 | } 53 | return playerSpeed; 54 | } 55 | 56 | } 57 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/AccessorFluidBlock.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.block.FluidBlock; 28 | import net.minecraft.fluid.FlowableFluid; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.gen.Accessor; 31 | 32 | @Mixin(FluidBlock.class) 33 | public interface AccessorFluidBlock { 34 | 35 | @Accessor 36 | FlowableFluid getFluid(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/AccessorFoliagePlacerType.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import com.mojang.serialization.Codec; 28 | import net.minecraft.world.gen.foliage.FoliagePlacer; 29 | import net.minecraft.world.gen.foliage.FoliagePlacerType; 30 | import org.spongepowered.asm.mixin.Mixin; 31 | import org.spongepowered.asm.mixin.gen.Invoker; 32 | 33 | @Mixin(FoliagePlacerType.class) 34 | public interface AccessorFoliagePlacerType { 35 | 36 | @Invoker("register") 37 | static

FoliagePlacerType

register(String id, Codec

codec) { 38 | throw new UnsupportedOperationException(); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/AccessorIngredient.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.item.ItemStack; 28 | import net.minecraft.recipe.Ingredient; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.gen.Accessor; 31 | 32 | @Mixin(Ingredient.class) 33 | public interface AccessorIngredient { 34 | 35 | @Accessor 36 | ItemStack[] getMatchingStacks(); 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/AccessorRecipeManager.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.inventory.Inventory; 28 | import net.minecraft.recipe.Recipe; 29 | import net.minecraft.recipe.RecipeManager; 30 | import net.minecraft.recipe.RecipeType; 31 | import net.minecraft.util.Identifier; 32 | import org.spongepowered.asm.mixin.Mixin; 33 | import org.spongepowered.asm.mixin.gen.Invoker; 34 | 35 | import java.util.Map; 36 | 37 | @Mixin(RecipeManager.class) 38 | public interface AccessorRecipeManager { 39 | 40 | @Invoker(value = "getAllOfType") 41 | > Map> getAll(RecipeType type); 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/AccessorScreenHandler.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.screen.ScreenHandler; 28 | import net.minecraft.screen.ScreenHandlerListener; 29 | import org.spongepowered.asm.mixin.Mixin; 30 | import org.spongepowered.asm.mixin.gen.Accessor; 31 | 32 | import java.util.List; 33 | 34 | @Mixin(ScreenHandler.class) 35 | public interface AccessorScreenHandler { 36 | 37 | @Accessor 38 | List getListeners(); 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/AccessorSlot.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.screen.slot.Slot; 28 | import org.spongepowered.asm.mixin.Mixin; 29 | import org.spongepowered.asm.mixin.gen.Accessor; 30 | 31 | @Mixin(Slot.class) 32 | public interface AccessorSlot { 33 | 34 | @Accessor 35 | int getIndex(); 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/MixinBucketItem.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.fluid.Fluid; 28 | import net.minecraft.item.BucketItem; 29 | import net.minecraft.item.ItemStack; 30 | import net.minecraft.item.Items; 31 | import org.spongepowered.asm.mixin.Final; 32 | import org.spongepowered.asm.mixin.Mixin; 33 | import org.spongepowered.asm.mixin.Shadow; 34 | import reborncore.common.fluid.RebornFluidManager; 35 | import reborncore.common.fluid.container.ItemFluidInfo; 36 | 37 | @Mixin(BucketItem.class) 38 | public class MixinBucketItem implements ItemFluidInfo { 39 | 40 | @Shadow 41 | @Final 42 | private Fluid fluid; 43 | 44 | @Override 45 | public ItemStack getEmpty() { 46 | return new ItemStack(Items.BUCKET); 47 | } 48 | 49 | @Override 50 | public ItemStack getFull(Fluid fluid) { 51 | BucketItem item = RebornFluidManager.getBucketMap().get(fluid); 52 | return new ItemStack(item); 53 | } 54 | 55 | @Override 56 | public Fluid getFluid(ItemStack itemStack) { 57 | return fluid; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/MixinItemEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.entity.Entity; 28 | import net.minecraft.entity.EntityType; 29 | import net.minecraft.entity.ItemEntity; 30 | import net.minecraft.item.ItemStack; 31 | import net.minecraft.world.World; 32 | import net.minecraft.world.explosion.Explosion; 33 | import org.spongepowered.asm.mixin.Mixin; 34 | import org.spongepowered.asm.mixin.Shadow; 35 | import org.spongepowered.asm.mixin.injection.At; 36 | import org.spongepowered.asm.mixin.injection.Inject; 37 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfo; 38 | import reborncore.common.misc.RebornCoreTags; 39 | 40 | @Mixin(ItemEntity.class) 41 | public abstract class MixinItemEntity extends Entity { 42 | @Shadow 43 | public abstract ItemStack getStack(); 44 | 45 | public MixinItemEntity(EntityType type, World world) { 46 | super(type, world); 47 | } 48 | 49 | @Inject(method = "tick", at = @At("RETURN")) 50 | public void tick(CallbackInfo info) { 51 | if (!world.isClient && isTouchingWater() && !getStack().isEmpty()) { 52 | if (getStack().getItem().isIn(RebornCoreTags.WATER_EXPLOSION_ITEM)) { 53 | world.createExplosion(this, getX(), getY(), getZ(), 2F, Explosion.DestructionType.BREAK); 54 | this.remove(); 55 | } 56 | } 57 | } 58 | 59 | } 60 | -------------------------------------------------------------------------------- /src/main/java/reborncore/mixin/common/MixinLivingEntity.java: -------------------------------------------------------------------------------- 1 | /* 2 | * This file is part of RebornCore, licensed under the MIT License (MIT). 3 | * 4 | * Copyright (c) 2021 TeamReborn 5 | * 6 | * Permission is hereby granted, free of charge, to any person obtaining a copy 7 | * of this software and associated documentation files (the "Software"), to deal 8 | * in the Software without restriction, including without limitation the rights 9 | * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | * copies of the Software, and to permit persons to whom the Software is 11 | * furnished to do so, subject to the following conditions: 12 | * 13 | * The above copyright notice and this permission notice shall be included in all 14 | * copies or substantial portions of the Software. 15 | * 16 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 22 | * SOFTWARE. 23 | */ 24 | 25 | package reborncore.mixin.common; 26 | 27 | import net.minecraft.entity.LivingEntity; 28 | import net.minecraft.entity.damage.DamageSource; 29 | import net.minecraft.entity.player.PlayerEntity; 30 | import org.spongepowered.asm.mixin.Mixin; 31 | import org.spongepowered.asm.mixin.injection.At; 32 | import org.spongepowered.asm.mixin.injection.Inject; 33 | import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable; 34 | import reborncore.api.events.ApplyArmorToDamageCallback; 35 | 36 | @Mixin(LivingEntity.class) 37 | abstract class MixinLivingEntity { 38 | 39 | @Inject(method = "applyArmorToDamage", at = @At("RETURN"), cancellable = true) 40 | public void onApplyArmorToDamage(DamageSource source, float amount, CallbackInfoReturnable cir){ 41 | 42 | LivingEntity entity = (LivingEntity) (Object) this; 43 | if (! (entity instanceof PlayerEntity)) { return; } 44 | 45 | cir.setReturnValue(ApplyArmorToDamageCallback.EVENT.invoker().applyArmorToDamage((PlayerEntity) entity, source, amount)); 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/icon.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/de_de.lang: -------------------------------------------------------------------------------- 1 | reborncore.message.active=Aktiv 2 | reborncore.message.inactive=Inaktiv 3 | 4 | item.reborncore.manual.name=Team Reborn-Handbuch 5 | 6 | reborncore.tooltip.energy.maxEnergy=Maximale Energie 7 | reborncore.tooltip.energy.inputRate=Eingangs-Rate 8 | reborncore.tooltip.energy.outputRate=Ausgangs-Rate 9 | reborncore.tooltip.energy.tier=Stufe 10 | reborncore.tooltip.energy.change=Energie-Änderung 11 | 12 | reborncore.gui.heat=Wärme 13 | reborncore.gui.missingmultiblock=Unvollständiger Multiblock 14 | 15 | reborncore.gui.tooltip.config_slots=Slots konfigurieren 16 | reborncore.gui.tooltip.config_fluids=Flüssigkeiten konfigurieren 17 | reborncore.gui.tooltip.hologram=Multiblock-Hologramm umschalten 18 | reborncore.gui.tooltip.lock_items=Gegenstände sperren 19 | reborncore.gui.tooltip.power_charged=Aufgeladen 20 | reborncore.gui.tooltip.power_click=Klicken zum Ändern der angezeigten Einheit 21 | reborncore.gui.tooltip.power_moreinfo=für mehr Information 22 | reborncore.gui.tooltip.dsu_fullness=Voll 23 | reborncore.gui.tooltip.tank_amount=%smB/%smB 24 | reborncore.gui.tooltip.tank_empty=Leerer Tank 25 | reborncore.gui.tooltip.tank_fullness=Voll 26 | reborncore.gui.tooltip.unlock_items=Gegenstände entsperren 27 | reborncore.gui.tooltip.upgrades=Maschinenaufrüstung 28 | 29 | reborncore.gui.slotconfigtip.slot=Auf einen Slot klicken zum Konfigurieren. 30 | reborncore.gui.slotconfigtip.side=Orange Seite bedeutet Ausgang, blaue Seite bedeutet Eingang. 31 | reborncore.gui.slotconfigtip.side=Strg+C zum Kopieren der Slotkonfiguration, Strg+V zum Einfügen Slotkonfiguration. 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/en_US.lang: -------------------------------------------------------------------------------- 1 | reborncore.message.active=Active 2 | reborncore.message.inactive=Inactive 3 | 4 | item.reborncore.manual.name=Team Reborn Manual 5 | 6 | reborncore.tooltip.energy.maxEnergy=Max Energy 7 | reborncore.tooltip.energy.inputRate=Input Rate 8 | reborncore.tooltip.energy.outputRate=Output Rate 9 | reborncore.tooltip.energy.tier=Tier 10 | reborncore.tooltip.energy.change=Energy Change 11 | 12 | reborncore.gui.heat=Heat 13 | reborncore.gui.missingmultiblock=Incomplete Multiblock 14 | 15 | reborncore.gui.tooltip.config_slots=Configure slots 16 | reborncore.gui.tooltip.config_fluids=Configure Fluids 17 | reborncore.gui.tooltip.hologram=Toggle Multiblock Hologram 18 | reborncore.gui.tooltip.lock_items=Lock Items 19 | reborncore.gui.tooltip.power_charged=Charged 20 | reborncore.gui.tooltip.power_click=Click to change display unit 21 | reborncore.gui.tooltip.power_moreinfo=for more info 22 | reborncore.gui.tooltip.dsu_fullness=Full 23 | reborncore.gui.tooltip.tank_amount=%smB/%smB 24 | reborncore.gui.tooltip.tank_empty=Empty Tank 25 | reborncore.gui.tooltip.tank_fullness=Full 26 | reborncore.gui.tooltip.unlock_items=Unlock Items 27 | reborncore.gui.tooltip.upgrades=Machine upgrades 28 | 29 | reborncore.gui.slotconfigtip.slot=Click on slot to configure. 30 | reborncore.gui.slotconfigtip.side=Orange side means output, blue side means input. 31 | reborncore.gui.slotconfigtip.side=Ctrl+C to copy slot config, Ctrl+V to paste slot config. 32 | 33 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/es_AR.lang: -------------------------------------------------------------------------------- 1 | reborncore.message.active=Activo 2 | reborncore.message.inactive=Inactivo 3 | 4 | item.reborncore:manual.name=Manual de Team Reborn 5 | 6 | reborncore.tooltip.energy.maxEnergy=Energía máxima 7 | reborncore.tooltip.energy.inputRate=Tasa de entrada 8 | reborncore.tooltip.energy.outputRate=Tasa de salida 9 | reborncore.tooltip.energy.tier=Tier 10 | reborncore.tooltip.energy.change=Cambio de energía 11 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/pt_BR.lang: -------------------------------------------------------------------------------- 1 | reborncore.message.active=Ativo 2 | reborncore.message.inactive=Inativo 3 | 4 | item.reborncore:manual.name=Manual do Grupo Reborn 5 | 6 | reborncore.tooltip.energy.maxEnergy=Energia Máx 7 | reborncore.tooltip.energy.inputRate=Taxa de Entrada 8 | reborncore.tooltip.energy.outputRate=Taxa de Saída 9 | reborncore.tooltip.energy.tier=Nível 10 | reborncore.tooltip.energy.change=Troca de Energia 11 | 12 | reborncore.gui.heat=Calor 13 | reborncore.gui.missingmultiblock=Multibloco Incompleto 14 | 15 | reborncore.gui.tooltip.config_slots=Configurar slots 16 | reborncore.gui.tooltip.config_fluids=Configurar Fluídos 17 | reborncore.gui.tooltip.hologram=Alternar Holograma Multibloco 18 | reborncore.gui.tooltip.lock_items=Bloquear Itens 19 | reborncore.gui.tooltip.power_charged=Carregado 20 | reborncore.gui.tooltip.power_click=Clique para mudar unidade de exibição 21 | reborncore.gui.tooltip.power_moreinfo=para mais informações 22 | reborncore.gui.tooltip.dsu_fullness=Cheio 23 | reborncore.gui.tooltip.tank_amount=%smB/%smB 24 | reborncore.gui.tooltip.tank_empty=Tanque Vazio 25 | reborncore.gui.tooltip.tank_fullness=Cheio 26 | reborncore.gui.tooltip.unlock_items=Desbloquear itens 27 | reborncore.gui.tooltip.upgrades=Atualizações de máquinas 28 | 29 | reborncore.gui.slotconfigtip.slot=Clique no slot para configurar. 30 | reborncore.gui.slotconfigtip.side=Lado laranja significa saída, lado azul significa entrada. 31 | reborncore.gui.slotconfigtip.side=Ctrl+C para copiar a configuração de slot, Ctrl+V para colar a configuração de slot. 32 | 33 | 34 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/pt_br.json: -------------------------------------------------------------------------------- 1 | { 2 | "reborncore.message.active": "Ativo", 3 | "reborncore.message.inactive": "Inativo", 4 | 5 | "item.reborncore:manual.name": "Manual do Grupo Reborn", 6 | 7 | "reborncore.tooltip.energy.maxEnergy": "Energia Máx", 8 | "reborncore.tooltip.energy.inputRate": "Taxa de Entrada", 9 | "reborncore.tooltip.energy.outputRate": "Taxa de Saída", 10 | "reborncore.tooltip.energy.tier": "Nível", 11 | "reborncore.tooltip.energy.change": "Troca de Energia", 12 | 13 | "reborncore.gui.heat": "Calor", 14 | "reborncore.gui.missingmultiblock": "Multibloco Incompleto", 15 | 16 | "reborncore.gui.tooltip.config_slots": "Configurar slots", 17 | "reborncore.gui.tooltip.config_fluids": "Configurar Fluídos", 18 | "reborncore.gui.tooltip.hologram": "Alternar Holograma Multibloco", 19 | "reborncore.gui.tooltip.lock_items": "Bloquear Itens", 20 | "reborncore.gui.tooltip.power_charged": "Carregado", 21 | "reborncore.gui.tooltip.power_click": "Clique para mudar unidade de exibição", 22 | "reborncore.gui.tooltip.power_moreinfo": "para mais informações", 23 | "reborncore.gui.tooltip.dsu_fullness": "Cheio", 24 | "reborncore.gui.tooltip.tank_amount": "%s / %s", 25 | "reborncore.gui.tooltip.tank_empty": "Tanque Vazio", 26 | "reborncore.gui.tooltip.tank_fullness": "Cheio", 27 | "reborncore.gui.tooltip.unlock_items": "Desbloquear itens", 28 | "reborncore.gui.tooltip.upgrades": "Atualizações de máquinas", 29 | 30 | "reborncore.gui.slotconfigtip.slot": "Clique no slot para configurar.", 31 | "reborncore.gui.slotconfigtip.side1": "Lado laranja significa saída, lado azul significa entrada.", 32 | "reborncore.gui.slotconfigtip.side2": "Ctrl+C para copiar a configuração de slot, Ctrl+V para colar a configuração de slot." 33 | } -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/tr_TR.lang: -------------------------------------------------------------------------------- 1 | reborncore.message.active=Aktif 2 | reborncore.message.inactive=İnaktif 3 | 4 | item.reborncore:manual.name=Team Reborn Kullanım Kılavuzu 5 | 6 | reborncore.tooltip.energy.maxEnergy=Maksimum Enerji 7 | reborncore.tooltip.energy.inputRate=Giriş Oranı 8 | reborncore.tooltip.energy.outputRate=Çıkış Oranı 9 | reborncore.tooltip.energy.tier=Aşama -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/zh_CN.lang: -------------------------------------------------------------------------------- 1 | reborncore.message.active=激活 2 | reborncore.message.inactive=未激活 3 | 4 | item.reborncore:manual.name=Reborn 团队手册 5 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/lang/zh_cn.json: -------------------------------------------------------------------------------- 1 | { 2 | "reborncore.message.active": "激活", 3 | "reborncore.message.inactive": "未激活", 4 | 5 | "reborncore.tooltip.energy.maxEnergy": "最大能量", 6 | "reborncore.tooltip.energy.inputRate": "输入速率", 7 | "reborncore.tooltip.energy.outputRate": "输出速率", 8 | "reborncore.tooltip.energy.tier": "层", 9 | "reborncore.tooltip.energy.change": "能量变化", 10 | 11 | "reborncore.gui.heat": "热", 12 | "reborncore.gui.missingmultiblock": "多个方块不完整", 13 | 14 | "reborncore.gui.tooltip.config_slots": "配置插槽", 15 | "reborncore.gui.tooltip.config_fluids": "配置流体", 16 | "reborncore.gui.tooltip.hologram": "切换多个方块全息图", 17 | "reborncore.gui.tooltip.lock_items": "锁定物品", 18 | "reborncore.gui.tooltip.power_charged": "充电", 19 | "reborncore.gui.tooltip.power_click": "单击以更改显示单位", 20 | "reborncore.gui.tooltip.power_moreinfo": "了解更多信息", 21 | "reborncore.gui.tooltip.dsu_fullness": "满", 22 | "reborncore.gui.tooltip.tank_amount": "%smB/%smB", 23 | "reborncore.gui.tooltip.tank_empty": "空罐", 24 | "reborncore.gui.tooltip.tank_fullness": "满", 25 | "reborncore.gui.tooltip.unlock_items": "解锁物品", 26 | "reborncore.gui.tooltip.upgrades": "机器升级", 27 | 28 | "reborncore.gui.slotconfigtip.slot": "单击插槽进行配置.", 29 | "reborncore.gui.slotconfigtip.side1": "橙色面表示输出,蓝色面表示输入.", 30 | "reborncore.gui.slotconfigtip.side2": "ctrl+c复制插槽配置,ctrl+v粘贴插槽配置." 31 | } 32 | -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/sounds.json: -------------------------------------------------------------------------------- 1 | { 2 | "block_dismantle": { 3 | "category": "block", 4 | "sounds": [ 5 | "reborncore:block_dismantle" 6 | ] 7 | } 8 | } -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/sounds/block_dismantle.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/sounds/block_dismantle.ogg -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/base.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/elements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/elements.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/gui_sheet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/gui_sheet.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/guielements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/guielements.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/guielementsTR.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/guielementsTR.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/manual.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/manual.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/manual_elements.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/manual_elements.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_chest.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_chest.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_feet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_feet.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_head.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_head.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_legs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_legs.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_offhand.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/armour_offhand.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/cells.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/cells.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/gui/slot_sprites/upgrade.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/gui/slot_sprites/upgrade.png -------------------------------------------------------------------------------- /src/main/resources/assets/reborncore/textures/models/santa_hat.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/TechReborn/RebornCore/c4f079215de1879263e4f2797be6550f9a69e941/src/main/resources/assets/reborncore/textures/models/santa_hat.png -------------------------------------------------------------------------------- /src/main/resources/fabric.mod.json: -------------------------------------------------------------------------------- 1 | { 2 | "schemaVersion": 1, 3 | "id": "reborncore", 4 | "version": "${version}", 5 | "name": "Reborn Core", 6 | "icon": "assets/reborncore/icon.png", 7 | "description": "Reborn Core is a library used for many of the Tech Reborn team's mods, including Tech Reborn, Quantum Storage, Fluxed Redstone, Hardcore Map Reset, and many more.", 8 | "license": "MIT", 9 | "contact": { 10 | "homepage": "https://www.curseforge.com/minecraft/mc-mods/reborncore", 11 | "sources": "https://github.com/TechReborn/RebornCore", 12 | "issues": "https://github.com/TechReborn/RebornCore/issues" 13 | }, 14 | "environment": "*", 15 | "entrypoints": { 16 | "main": [ 17 | "reborncore.RebornCore" 18 | ], 19 | "client": [ 20 | "reborncore.RebornCoreClient" 21 | ] 22 | }, 23 | "mixins": [ 24 | "reborncore.client.mixins.json", 25 | "reborncore.common.mixins.json" 26 | ], 27 | "depends": { 28 | "fabricloader": ">=0.6.3", 29 | "fabric": ">=0.28.3", 30 | "team_reborn_energy": ">=0.1.1", 31 | "fabric-biome-api-v1": ">=3.0.0" 32 | }, 33 | "authors": [ 34 | "Team Reborn", 35 | "modmuss50", 36 | "drcrazy" 37 | ], 38 | "contributors": [ 39 | "Gigabit101", 40 | "Prospector", 41 | "Rushmead", 42 | "Dragon2488", 43 | "Ourten", 44 | "coderbot", 45 | "estebes" 46 | ], 47 | "custom": { 48 | "modmenu:api": true 49 | } 50 | } -------------------------------------------------------------------------------- /src/main/resources/reborncore.client.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "reborncore.mixin.client", 4 | "compatibilityLevel": "JAVA_8", 5 | "client": [ 6 | "MixinGameRenderer", 7 | "MixinItemRenderer", 8 | "MixinDebugRenderer", 9 | "MixinWorldRenderer", 10 | "AccessorModelPredicateProviderRegistry", 11 | "AccessorChatHud" 12 | ], 13 | "injectors": { 14 | "defaultRequire": 1 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /src/main/resources/reborncore.common.mixins.json: -------------------------------------------------------------------------------- 1 | { 2 | "required": true, 3 | "package": "reborncore.mixin.common", 4 | "compatibilityLevel": "JAVA_8", 5 | "mixins": [ 6 | "AccessorFluidBlock", 7 | "AccessorFoliagePlacerType", 8 | "AccessorIngredient", 9 | "AccessorRecipeManager", 10 | "AccessorScreenHandler", 11 | "AccessorSlot", 12 | "MixinBucketItem", 13 | "MixinCraftingResultSlot", 14 | "MixinItemEntity", 15 | "MixinItemStack", 16 | "MixinLivingEntity", 17 | "MixinPlayerEntity", 18 | "MixinRecipeManager" 19 | ], 20 | "injectors": { 21 | "defaultRequire": 1 22 | } 23 | } 24 | --------------------------------------------------------------------------------