Showing preview only (1,143K chars total). Download the full file or copy to clipboard to get everything.
Repository: Direwolf20-MC/BuildingGadgets
Branch: master
Commit: 83ecab0a2122
Files: 328
Total size: 1019.6 KB
Directory structure:
gitextract_i5og_fva/
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ └── feature-request.md
│ └── workflows/
│ ├── gradle.yml
│ ├── release.yml
│ └── stale.yml
├── .gitignore
├── README.md
├── build.gradle
├── gradle/
│ └── wrapper/
│ ├── gradle-wrapper.jar
│ └── gradle-wrapper.properties
├── gradle.properties
├── gradlew
├── gradlew.bat
├── settings.gradle
├── src/
│ └── main/
│ ├── java/
│ │ └── com/
│ │ └── direwolf20/
│ │ └── buildinggadgets/
│ │ ├── client/
│ │ │ ├── BuildingGadgetsJEI.java
│ │ │ ├── ClientProxy.java
│ │ │ ├── KeyBindings.java
│ │ │ ├── OurSounds.java
│ │ │ ├── cache/
│ │ │ │ ├── CacheTemplateProvider.java
│ │ │ │ └── RemoteInventoryCache.java
│ │ │ ├── events/
│ │ │ │ ├── EventKeyInput.java
│ │ │ │ ├── EventRenderWorldLast.java
│ │ │ │ └── EventTooltip.java
│ │ │ ├── models/
│ │ │ │ └── ConstructionBakedModel.java
│ │ │ ├── renderer/
│ │ │ │ ├── DireBufferBuilder.java
│ │ │ │ ├── DireVertexBuffer.java
│ │ │ │ ├── EffectBlockTER.java
│ │ │ │ ├── MyRenderMethods.java
│ │ │ │ ├── OurRenderTypes.java
│ │ │ │ └── package-info.java
│ │ │ ├── renders/
│ │ │ │ ├── BaseRenderer.java
│ │ │ │ ├── BuildRender.java
│ │ │ │ ├── CopyPasteRender.java
│ │ │ │ └── DestructionRender.java
│ │ │ └── screen/
│ │ │ ├── CopyGUI.java
│ │ │ ├── DestructionGUI.java
│ │ │ ├── GuiMod.java
│ │ │ ├── MaterialListGUI.java
│ │ │ ├── ModeRadialMenu.java
│ │ │ ├── PasteGUI.java
│ │ │ ├── ScrollingMaterialList.java
│ │ │ ├── TemplateManagerGUI.java
│ │ │ └── widgets/
│ │ │ ├── DireButton.java
│ │ │ ├── EntryList.java
│ │ │ ├── GuiIconActionable.java
│ │ │ ├── GuiIncrementer.java
│ │ │ ├── GuiTextFieldBase.java
│ │ │ └── IncrementalSliderWidget.java
│ │ └── common/
│ │ ├── BuildingGadgets.java
│ │ ├── blocks/
│ │ │ ├── ConstructionBlock.java
│ │ │ ├── ConstructionBlockDense.java
│ │ │ ├── ConstructionBlockPowder.java
│ │ │ ├── EffectBlock.java
│ │ │ ├── OurBlocks.java
│ │ │ └── TemplateManager.java
│ │ ├── capability/
│ │ │ ├── CapabilityProviderEnergy.java
│ │ │ ├── CapabilityTemplate.java
│ │ │ ├── ConfigEnergyStorage.java
│ │ │ ├── IPrivateEnergy.java
│ │ │ ├── ItemEnergyForge.java
│ │ │ ├── ItemTemplateKey.java
│ │ │ ├── PasteContainerCapabilityProvider.java
│ │ │ ├── PasteContainerItemHandler.java
│ │ │ └── provider/
│ │ │ ├── MultiCapabilityProvider.java
│ │ │ ├── TemplateKeyProvider.java
│ │ │ └── TemplateProviderCapabilityProvider.java
│ │ ├── commands/
│ │ │ ├── AllowPlayerOverrideManager.java
│ │ │ ├── ForceUnloadedCommand.java
│ │ │ ├── OverrideBuildSizeCommand.java
│ │ │ └── OverrideCopySizeCommand.java
│ │ ├── config/
│ │ │ ├── Config.java
│ │ │ └── RecipeConstructionPaste.java
│ │ ├── containers/
│ │ │ ├── BaseContainer.java
│ │ │ ├── OurContainers.java
│ │ │ └── TemplateManagerContainer.java
│ │ ├── entities/
│ │ │ ├── ConstructionBlockEntity.java
│ │ │ ├── ConstructionBlockEntityRender.java
│ │ │ ├── EntityBase.java
│ │ │ └── OurEntities.java
│ │ ├── events/
│ │ │ ├── BreakEventHandler.java
│ │ │ ├── ItemPickupHandler.java
│ │ │ └── WorldTemplateProviderHandler.java
│ │ ├── integration/
│ │ │ ├── IntegrationHandler.java
│ │ │ └── RefinedStorage.java
│ │ ├── items/
│ │ │ ├── AbstractGadget.java
│ │ │ ├── ConstructionPaste.java
│ │ │ ├── ConstructionPasteContainer.java
│ │ │ ├── GadgetBuilding.java
│ │ │ ├── GadgetCopyPaste.java
│ │ │ ├── GadgetDestruction.java
│ │ │ ├── GadgetExchanger.java
│ │ │ ├── OurItems.java
│ │ │ ├── TemplateItem.java
│ │ │ └── modes/
│ │ │ ├── AbstractMode.java
│ │ │ ├── BuildToMeMode.java
│ │ │ ├── BuildingModes.java
│ │ │ ├── ExchangingModes.java
│ │ │ ├── GridMode.java
│ │ │ ├── HorizontalColumnMode.java
│ │ │ ├── HorizontalWallMode.java
│ │ │ ├── StairMode.java
│ │ │ ├── SurfaceMode.java
│ │ │ ├── VerticalColumnMode.java
│ │ │ ├── VerticalWallMode.java
│ │ │ └── XYZ.java
│ │ ├── network/
│ │ │ ├── PacketHandler.java
│ │ │ ├── packets/
│ │ │ │ ├── PacketAnchor.java
│ │ │ │ ├── PacketBindTool.java
│ │ │ │ ├── PacketChangeRange.java
│ │ │ │ ├── PacketCopyCoords.java
│ │ │ │ ├── PacketDestructionGUI.java
│ │ │ │ ├── PacketPasteGUI.java
│ │ │ │ ├── PacketRequestTemplate.java
│ │ │ │ ├── PacketRotateMirror.java
│ │ │ │ ├── PacketSetRemoteInventoryCache.java
│ │ │ │ ├── PacketTemplateManagerTemplateCreated.java
│ │ │ │ ├── PacketToggleBlockPlacement.java
│ │ │ │ ├── PacketToggleConnectedArea.java
│ │ │ │ ├── PacketToggleFluidOnly.java
│ │ │ │ ├── PacketToggleFuzzy.java
│ │ │ │ ├── PacketToggleMode.java
│ │ │ │ ├── PacketToggleRayTraceFluid.java
│ │ │ │ ├── PacketUndo.java
│ │ │ │ ├── SplitPacketUpdateTemplate.java
│ │ │ │ └── UUIDPacket.java
│ │ │ └── split/
│ │ │ ├── PacketDecoder.java
│ │ │ ├── PacketEncoder.java
│ │ │ ├── PacketSplitManager.java
│ │ │ └── SplitPacket.java
│ │ ├── tainted/
│ │ │ ├── Tainted.java
│ │ │ ├── building/
│ │ │ │ ├── BlockData.java
│ │ │ │ ├── PlacementChecker.java
│ │ │ │ ├── PlacementTarget.java
│ │ │ │ ├── Region.java
│ │ │ │ ├── package-info.java
│ │ │ │ ├── placement/
│ │ │ │ │ └── ConnectedSurface.java
│ │ │ │ ├── tilesupport/
│ │ │ │ │ ├── ITileDataFactory.java
│ │ │ │ │ ├── ITileDataProvider.java
│ │ │ │ │ ├── ITileDataSerializer.java
│ │ │ │ │ ├── ITileEntityData.java
│ │ │ │ │ ├── NBTTileEntityData.java
│ │ │ │ │ ├── TileSupport.java
│ │ │ │ │ └── package-info.java
│ │ │ │ └── view/
│ │ │ │ ├── BuildContext.java
│ │ │ │ ├── IBuildView.java
│ │ │ │ ├── PositionalBuildView.java
│ │ │ │ ├── WorldBuildView.java
│ │ │ │ └── package-info.java
│ │ │ ├── concurrent/
│ │ │ │ ├── CopyScheduler.java
│ │ │ │ ├── PlacementScheduler.java
│ │ │ │ ├── ServerTickingScheduler.java
│ │ │ │ ├── SteppedScheduler.java
│ │ │ │ └── UndoScheduler.java
│ │ │ ├── inventory/
│ │ │ │ ├── CreativeItemIndex.java
│ │ │ │ ├── HandlerInsertProvider.java
│ │ │ │ ├── IInsertProvider.java
│ │ │ │ ├── IItemIndex.java
│ │ │ │ ├── InventoryHelper.java
│ │ │ │ ├── InventoryLinker.java
│ │ │ │ ├── MatchResult.java
│ │ │ │ ├── PlayerInventoryInsertProvider.java
│ │ │ │ ├── PlayerItemIndex.java
│ │ │ │ ├── RecordingItemIndex.java
│ │ │ │ ├── handle/
│ │ │ │ │ ├── IHandleProvider.java
│ │ │ │ │ ├── IObjectHandle.java
│ │ │ │ │ ├── ItemHandlerProvider.java
│ │ │ │ │ └── StackHandlerItemHandle.java
│ │ │ │ └── materials/
│ │ │ │ ├── AndMaterialListEntry.java
│ │ │ │ ├── MaterialList.java
│ │ │ │ ├── MaterialListEntry.java
│ │ │ │ ├── OrMaterialListEntry.java
│ │ │ │ ├── SimpleMaterialListEntry.java
│ │ │ │ ├── SubMaterialListEntry.java
│ │ │ │ ├── objects/
│ │ │ │ │ ├── IUniqueObject.java
│ │ │ │ │ ├── IUniqueObjectSerializer.java
│ │ │ │ │ └── UniqueItem.java
│ │ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── registry/
│ │ │ │ ├── ImmutableOrderedRegistry.java
│ │ │ │ ├── Registries.java
│ │ │ │ ├── TopologicalRegistryBuilder.java
│ │ │ │ └── package-info.java
│ │ │ ├── save/
│ │ │ │ ├── SaveManager.java
│ │ │ │ ├── SaveTemplateProvider.java
│ │ │ │ ├── TemplateSave.java
│ │ │ │ ├── TimedDataSave.java
│ │ │ │ ├── Undo.java
│ │ │ │ ├── UndoHistory.java
│ │ │ │ └── UndoWorldSave.java
│ │ │ └── template/
│ │ │ ├── ITemplateKey.java
│ │ │ ├── ITemplateProvider.java
│ │ │ ├── InMemoryTemplateProvider.java
│ │ │ ├── SerialisationSupport.java
│ │ │ ├── Template.java
│ │ │ ├── TemplateHeader.java
│ │ │ ├── TemplateIO.java
│ │ │ ├── TemplateKey.java
│ │ │ └── package-info.java
│ │ ├── tileentities/
│ │ │ ├── ConstructionBlockTileEntity.java
│ │ │ ├── EffectBlockTileEntity.java
│ │ │ ├── OurTileEntities.java
│ │ │ └── TemplateManagerTileEntity.java
│ │ ├── util/
│ │ │ ├── Additions.java
│ │ │ ├── CommonUtils.java
│ │ │ ├── GadgetUtils.java
│ │ │ ├── compression/
│ │ │ │ ├── DataCompressor.java
│ │ │ │ ├── DataDecompressor.java
│ │ │ │ └── package-info.java
│ │ │ ├── exceptions/
│ │ │ │ ├── CapabilityNotPresentException.java
│ │ │ │ ├── TemplateParseException.java
│ │ │ │ ├── TemplateReadException.java
│ │ │ │ ├── TemplateWriteException.java
│ │ │ │ └── package-info.java
│ │ │ ├── helpers/
│ │ │ │ ├── NBTHelper.java
│ │ │ │ └── VectorHelper.java
│ │ │ ├── lang/
│ │ │ │ ├── CommandTranslation.java
│ │ │ │ ├── GuiTranslation.java
│ │ │ │ ├── ITranslationProvider.java
│ │ │ │ ├── LangUtil.java
│ │ │ │ ├── MaterialListTranslation.java
│ │ │ │ ├── MessageTranslation.java
│ │ │ │ ├── ModeTranslation.java
│ │ │ │ ├── RadialTranslation.java
│ │ │ │ ├── Styles.java
│ │ │ │ ├── TooltipTranslation.java
│ │ │ │ └── package-info.java
│ │ │ ├── package-info.java
│ │ │ ├── ref/
│ │ │ │ ├── JsonKeys.java
│ │ │ │ ├── NBTKeys.java
│ │ │ │ └── Reference.java
│ │ │ ├── spliterator/
│ │ │ │ ├── DelegatingSpliterator.java
│ │ │ │ └── MappingSpliterator.java
│ │ │ └── tools/
│ │ │ ├── JsonBiDiSerializer.java
│ │ │ ├── MathUtils.java
│ │ │ ├── NetworkIO.java
│ │ │ ├── RegistryUtils.java
│ │ │ └── SimulateEnergyStorage.java
│ │ └── world/
│ │ ├── MockBuilderWorld.java
│ │ ├── MockDelegationWorld.java
│ │ └── MockTileEntityRenderWorld.java
│ └── resources/
│ ├── META-INF/
│ │ ├── accesstransformer.cfg
│ │ └── mods.toml
│ ├── assets/
│ │ └── buildinggadgets/
│ │ ├── blockstates/
│ │ │ ├── blank_const_block.json
│ │ │ ├── construction_block.json
│ │ │ ├── construction_block_dense.json
│ │ │ ├── construction_block_powder.json
│ │ │ ├── constructionblock_dense.json
│ │ │ ├── effect_block.json
│ │ │ └── template_manager.json
│ │ ├── lang/
│ │ │ ├── de_de.json
│ │ │ ├── en_us.json
│ │ │ ├── es_es.json
│ │ │ ├── fr_fr.json
│ │ │ ├── ja_jp.json
│ │ │ ├── no_no.json
│ │ │ ├── pl_pl.json
│ │ │ ├── pt_br.json
│ │ │ ├── ru_RU.json
│ │ │ ├── uk_ua.json
│ │ │ ├── zh_cn.json
│ │ │ └── zh_tw.json
│ │ ├── models/
│ │ │ ├── block/
│ │ │ │ ├── blank_const_block.json
│ │ │ │ ├── construction_block.json
│ │ │ │ ├── construction_block_dense.json
│ │ │ │ ├── construction_block_powder.json
│ │ │ │ ├── constructionblock_dense.json
│ │ │ │ ├── effect_block.json
│ │ │ │ ├── orientable.json
│ │ │ │ └── template_manager.json
│ │ │ └── item/
│ │ │ ├── construction_block.json
│ │ │ ├── construction_block_dense.json
│ │ │ ├── construction_block_powder.json
│ │ │ ├── construction_chunk_dense.json
│ │ │ ├── construction_paste.json
│ │ │ ├── construction_paste_container_creative.json
│ │ │ ├── construction_paste_container_t1.json
│ │ │ ├── construction_paste_container_t1_3quarter.json
│ │ │ ├── construction_paste_container_t1_full.json
│ │ │ ├── construction_paste_container_t1_half.json
│ │ │ ├── construction_paste_container_t1_quarter.json
│ │ │ ├── construction_paste_container_t2.json
│ │ │ ├── construction_paste_container_t2_3quarter.json
│ │ │ ├── construction_paste_container_t2_full.json
│ │ │ ├── construction_paste_container_t2_half.json
│ │ │ ├── construction_paste_container_t2_quarter.json
│ │ │ ├── construction_paste_container_t3.json
│ │ │ ├── construction_paste_container_t3_3quarter.json
│ │ │ ├── construction_paste_container_t3_full.json
│ │ │ ├── construction_paste_container_t3_half.json
│ │ │ ├── construction_paste_container_t3_quarter.json
│ │ │ ├── effect_block.json
│ │ │ ├── gadget_building.json
│ │ │ ├── gadget_copy_paste.json
│ │ │ ├── gadget_destruction.json
│ │ │ ├── gadget_exchanging.json
│ │ │ ├── template.json
│ │ │ └── template_manager.json
│ │ ├── sounds/
│ │ │ └── beep.ogg
│ │ └── sounds.json
│ ├── data/
│ │ ├── buildinggadgets/
│ │ │ ├── loot_tables/
│ │ │ │ └── blocks/
│ │ │ │ ├── construction_block.json
│ │ │ │ ├── construction_block_dense.json
│ │ │ │ ├── construction_block_powder.json
│ │ │ │ └── template_manager.json
│ │ │ ├── recipes/
│ │ │ │ ├── construction_paste_container.json
│ │ │ │ ├── construction_paste_container_t2.json
│ │ │ │ ├── construction_paste_container_t3.json
│ │ │ │ ├── construction_paste_powder.json
│ │ │ │ ├── gadget_building.json
│ │ │ │ ├── gadget_copy_paste.json
│ │ │ │ ├── gadget_destruction.json
│ │ │ │ ├── gadget_exchanging.json
│ │ │ │ └── template_manager.json
│ │ │ └── tags/
│ │ │ ├── blocks/
│ │ │ │ ├── blacklist/
│ │ │ │ │ ├── building.json
│ │ │ │ │ ├── copy_paste.json
│ │ │ │ │ ├── destruction.json
│ │ │ │ │ ├── exchanging.json
│ │ │ │ │ └── generic.json
│ │ │ │ └── whitelist/
│ │ │ │ ├── building.json
│ │ │ │ ├── copy_paste.json
│ │ │ │ ├── destruction.json
│ │ │ │ ├── exchanging.json
│ │ │ │ └── generic.json
│ │ │ └── items/
│ │ │ └── template_convertible.json
│ │ └── create/
│ │ └── recipes/
│ │ ├── crushing/
│ │ │ └── dense_construction_block.json
│ │ ├── milling/
│ │ │ └── dense_construction_block.json
│ │ └── washing/
│ │ └── construction_paste.json
│ └── pack.mcmeta
└── update.json
================================================
FILE CONTENTS
================================================
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.yml
================================================
name: Bug Report
description: Report a bug / crash
labels: [bug]
body:
- type: markdown
attributes:
value: |
To help us help you, please provide as much information as you can, this helps us with debugging and reproducting the issue.
- type: input
id: bg-version
attributes:
label: Building Gadgets version
description: |
You can find the version of the mod in the mods file name or in-game in the mods button on the main menu.
placeholder: 3.4.0
validations:
required: true
- type: input
id: mc-version
attributes:
label: Minecraft Version
placeholder: 1.16.5
validations:
required: true
- type: input
id: forge-version
attributes:
label: Forge Version
description: |
You can get this from the main menu screen in the bottom left corner of the screen.
placeholder: 36.1.24
validations:
required: false
- type: input
id: modpack
attributes:
label: Modpack & Version
description: |
If you are running a Modpack, please provide the name and version of the pack.
placeholder: Direwolf20 - 1.16 (2.4)
validations:
required: false
- type: dropdown
id: optifine
validations:
required: true
attributes:
label: Do you have optifine installed?
description: |
If you have a different rendering mod installed, please add to in the extra info box at the end.
multiple: false
options:
- 'Yes'
- 'No'
- 'I have other rendering based mods installed'
- type: input
id: bugdesc
attributes:
label: Describe the issue
description: |
A clear and concise description of what the bug is
validations:
required: true
- type: textarea
id: reproduce
attributes:
label: Steps to reproduce
description: Tell us how we can reproduce the issue
placeholder: |
1. Open Mc...
2. Get gadget...
3. See error...
validations:
required: true
- type: input
id: expectedBehaviour
attributes:
label: Expected behaviour
description: |
A clear and concise description of what you expected to happen.
validations:
required: true
- type: textarea
id: screenshots
attributes:
label: Screenshots
description: If applicable, add screenshots to help explain your problem.
validations:
required: false
- type: textarea
id: logs
attributes:
label: Log files
description: "Link(s) to any log files that you can provide, typically, /logs/debug.log and /logs/latest.log"
placeholder: |
https://pste.ch/ihaveaproble
https://pastebin.com/
https://paste.feed-the-beast.com/
validations:
required: false
- type: textarea
id: additional
attributes:
label: Additional information
description: Add any other context about the problem here
validations:
required: false
- type: checkboxes
id: terms
attributes:
label: Information
options:
- label: I have provided as much information as possible
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request.md
================================================
---
name: Feature Request
about: Suggest an idea/feature/enhancement
title: ''
labels: ''
assignees: ''
---
**IMPORTANT:** Before continuing, please ensure that Building Gadgets (and any other mods involved) is updated to the latest available version
----------------------------------------------------------------------------
After deleting this template, please provide the following information:
* A detailed explanation of the suggestion
================================================
FILE: .github/workflows/gradle.yml
================================================
name: Build & Create artifact
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Build with Gradle
run: |
chmod +x ./gradlew
./gradlew build --no-daemon
- name: Setting mod version
run: |
cat $GITHUB_WORKSPACE/gradle.properties | grep ^version= >> $GITHUB_ENV
cat $GITHUB_WORKSPACE/gradle.properties | grep ^minecraft_version= >> $GITHUB_ENV
- name: Create package name
run: echo "package_name=BuildingGadgets-$minecraft_version-$version-${{ github.head_ref || 'main' }}-SNAPSHOT-$GITHUB_RUN_NUMBER" >> $GITHUB_ENV
- uses: actions/upload-artifact@v2
with:
name: ${{ env.package_name }}
path: build/libs
================================================
FILE: .github/workflows/release.yml
================================================
name: Auto Release
on:
push:
tags:
- 'release/*'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v2
with:
java-version: '17'
distribution: 'temurin'
- uses: actions/cache@v3
with:
path: |
~/.gradle/caches
~/.gradle/wrapper
key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }}
restore-keys: |
${{ runner.os }}-gradle-
- name: Cleanup Gradle Cache
run: |
rm -f ~/.gradle/caches/modules-2/modules-2.lock
rm -f ~/.gradle/caches/modules-2/gc.properties
- name: Build & Publish to Github Maven
run: |
chmod +x ./gradlew
./gradlew build publish --no-daemon
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Release
env:
CURSE_TOKEN: ${{ secrets.CURSE_TOKEN }}
run: ./gradlew curseforge --no-daemon
- name: Release to Github
uses: softprops/action-gh-release@v1
with:
generate_release_notes: true
body_path: ./CHANGELOG.md
files: build/libs/*.jar
================================================
FILE: .github/workflows/stale.yml
================================================
name: 'Close stale issues and PRs'
on:
schedule:
- cron: '30 1 * * *'
permissions:
issues: write
pull-requests: write
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9
with:
stale-issue-message: 'This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 5 days.'
close-issue-message: 'This issue / Pull request has been closed as there has been no recent activity after being marked as stale.'
days-before-stale: 30
days-before-close: 5
days-before-pr-close: -1
stale-issue-label: "stale"
only-labels: "waiting on response"
exempt-all-assignees: true
exempt-all-milestones: true
================================================
FILE: .gitignore
================================================
/*
# folders
!/gradle
!/src
# files
!/.gitignore
!/.github
!/README.md
!/CONTRIBUTION.md
!/License.md
!/build.gradle
!/settings.gradle
!/gradlew
!/gradlew.bat
!/gradle.properties
!/update.json
!/CHANGELOG-OLD.md
!/SPEC.md
!/EclipseCodeStyle.xml
!/IntelliJIdeaCodeStyle.xml
.DS_Store
================================================
FILE: README.md
================================================
## Important notice
As of Minecraft `1.20.1` this version of Building Gadget (Building Gadgets 1) is officially the 'Legacy' version of Building Gadgets. I will continue to update the mod for the Minecraft versions we already support but this mod will not be ported to Minecraft `1.20.1` or higher.
Go and download [`Building Gadgets 2`](https://github.com/direwolf20-mc/buildinggadgets2)! It's the same mod but with a bunch of new and awesome features built on a brand-new codebase.
---
<p align="center" style="padding: 3em;"><img width="60" src="https://github.com/Direwolf20-MC/BuildingGadgets/blob/master/src/main/resources/buildinggadgets_logo.png?raw=true" /></p>
<h1 align="center" style="margin-top: 20px; border-bottom: 0;">Building Gadgets (1.12.2 - 1.19.4)</h1>
<p align="center">
<b>Update!</b> See <a href="https://github.com/direwolf20-mc/buildinggadgets2">Building Gadgets 2</a> for Minecraft <code>1.20.1</code> and higher!
</p>
<p align="center">Sometimes, building large structures can be a little tedious, and take a lot of effort. Not all of us are great builders you know!
</p>
<p align="center">
<a href="https://minecraft.curseforge.com/projects/building-gadgets"><img src="http://cf.way2muchnoise.eu/full_298187_downloads.svg" /></a>
<a href="https://minecraft.curseforge.com/projects/building-gadgets"><img src="http://cf.way2muchnoise.eu/versions/298187.svg" /></a>
<a href="https://github.com/Direwolf20-MC/BuildingGadgets/blob/master/LICENSE.md"><img alt="GitHub license" src="https://img.shields.io/github/license/direwolf20-MC/buildinggadgets"></a>
<a href="https://discord.gg/qqUUtu3"><img alt="discord" src="https://img.shields.io/discord/541740767761399808" ></a>
</p>
<p data-comment="this fakes a line break">‌</p>
# Welcome to Dire's Building Gadgets!
Dire's `Building Gadgets` aims to make building a little bit easier. At this time there are `four` tools, and they are described below. Alternatively, watch the following mod spotlight for instructions!
[](https://www.youtube.com/watch?v=D4Ib4h7aTSk)
_(I'm a Youtube Link, click me)_
## Usage
To see how to use Dire's `Building Gadgets` refer to our [Wiki](https://github.com/Direwolf20-MC/BuildingGadgets/wiki) which has been recently updated to be inline with the mod as of `1.16.5`. Please feel free to make feature requests to add more info to our wiki. We're always trying to improve.
Direwolf20's Spotlights - [Spotlight Part One](https://youtu.be/D4Ib4h7aTSk) and [Spotlight Part Two](https://youtu.be/JS1Xx_kwQQ0)
### Using the Gadgets
Building gadgets has grown a lot since its initial release to the point that we have multiple tools for every occasion, Our wiki has a great set of instructions on how to use each of our Gadgets, check out the
-  [Building Gadget](https://github.com/Direwolf20-MC/BuildingGadgets/wiki/Building-Gadget)
-  [Exchanger Gadget](https://github.com/Direwolf20-MC/BuildingGadgets/wiki/Exchanger-Gadget)
-  [Copy Paste Gadget](https://github.com/Direwolf20-MC/BuildingGadgets/wiki/Copy-Paste-Gadget)
-  [Destruction Gadget](https://github.com/Direwolf20-MC/BuildingGadgets/wiki/Destruction-Gadget)
## Schematics / Templates
Building Gadgets' copy & paste tool supports loading and saving templates via the `Template Manager` block. You can use this feature to save your builds and share them with others.
If you're looking for templates to use, check out the [r/9x9](https://www.reddit.com/r/9x9/) community on reddit 🎉
## Contributing
See [Important Notice](#important-notice). Please support the new version of Building Gadgets at https://github.com/direwolf20-mc/buildinggadgets2 if you would like to support the project! You can see help maintain the legacy version by submitting PR's to this repo.
## Credit
An especially big thanks to all of our [contributors](https://github.com/Direwolf20-MC/BuildingGadgets/graphs/contributors) for the continued support, bug reports (issues) and PR's. All of the [Forge Guys](https://github.com/orgs/MinecraftForge/people) and the creators of Minecraft (*Duh*)
[License MIT](License.md)
================================================
FILE: build.gradle
================================================
plugins {
id 'eclipse'
id 'maven-publish'
id 'net.minecraftforge.gradle' version '5.1.+'
id "com.matthewprenger.cursegradle" version "1.4.0"
}
apply {
// "Simple" fix for M1 (Apple Silicon) macs in the dev environment... All thanks to @mezz
from "https://raw.githubusercontent.com/mezz/JustEnoughItems/1.18/Forge/buildtools/AppleSiliconSupport.gradle"
}
def ENV = System.getenv()
version = "${version}-build.${ENV.GITHUB_RUN_NUMBER ?: 9999}+mc${minecraft_version}"
group = 'com.direwolf20'
archivesBaseName = "buildinggadgets"
def forge_major = forge_version.tokenize('.')[0]
java.toolchain.languageVersion = JavaLanguageVersion.of(17)
minecraft {
mappings channel: 'official', version: "${minecraft_version}"
// makeObfSourceJar = false // an Srg named sources jar is made by default. uncomment this to disable.
accessTransformer = file('src/main/resources/META-INF/accesstransformer.cfg')
runs {
client {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
buildinggadgets {
source sourceSets.main
}
}
}
server {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
mods {
buildinggadgets {
source sourceSets.main
}
}
}
data {
workingDirectory project.file('run')
property 'forge.logging.markers', 'SCAN,REGISTRIES,REGISTRYDUMP'
property 'forge.logging.console.level', 'debug'
args '--mod', 'buildinggadgets', '--all', '--output', file('src/generated/resources/')
mods {
buildinggadgets {
source sourceSets.main
}
}
}
}
}
sourceSets.main.resources { srcDir 'src/generated/resources' }
repositories {
maven {
url = "https://modmaven.dev/"
}
}
dependencies {
minecraft "net.minecraftforge:forge:${minecraft_version}-${forge_version}"
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-common-api:${jei_version}")
compileOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge-api:${jei_version}")
runtimeOnly fg.deobf("mezz.jei:jei-${minecraft_version}-forge:${jei_version}")
}
processResources {
// This might be the wrong way of doing it but basically this file doesn't always get updated
// for some reason so I'm deleting it before it's generated again
def path = new File("${project.buildDir}/resources/main/META-INF/mods.toml")
if (path.exists()) {
path.delete()
}
exclude '.cache'
inputs.property "version", project.version
filesMatching("META-INF/mods.toml") {
expand "version": project.version,
"forgeversion": project.forge_version,
"forgeshortversion": project.forge_version.split("\\.")[0],
"mcversion": project.minecraft_version
}
}
jar {
finalizedBy 'reobfJar'
manifest {
attributes(["Specification-Title" : "BuildingGadgets",
"Specification-Vendor" : "Direwolf20",
"Specification-Version" : forge_major, // We are version 1 of the modlauncher specification
"Implementation-Title" : project.archivesBaseName,
"Implementation-Version" : project.version,
"Implementation-Vendor" : "Direwolf20",
"Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ")])
}
}
java {
withSourcesJar()
}
task deobfJar(type: Jar) {
from sourceSets.main.output
classifier 'deobf'
}
artifacts {
archives deobfJar
}
publishing {
publications {
maven(MavenPublication) {
from components.java
artifactId = project.archivesBaseName.toLowerCase()
artifact(deobfJar) {
classifier 'deobf'
}
}
}
repositories {
maven {
name = "GitHubPackages"
url = "https://maven.pkg.github.com/Direwolf20-MC/BuildingGadgets"
credentials {
username = ENV.GITHUB_ACTOR
password = ENV.GITHUB_TOKEN
}
}
}
}
if (ENV.CURSE_TOKEN) {
curseforge {
apiKey = ENV.CURSE_TOKEN
project {
id = "298187"
releaseType = "release"
addGameVersion "${minecraft_version}"
addGameVersion "Forge"
addGameVersion "Java 17"
mainArtifact(jar) {
relations {
optionalDependency 'charging-gadgets'
}
}
changelog = file('CHANGELOG.md')
changelogType = 'markdown'
}
}
}
================================================
FILE: gradle/wrapper/gradle-wrapper.properties
================================================
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
================================================
FILE: gradle.properties
================================================
org.gradle.jvmargs=-Xmx2G
org.gradle.daemon=false
minecraft_version=1.19.4
forge_version=45.2.15
version=3.18.0
jei_version=13.1.0.16
================================================
FILE: gradlew
================================================
#!/usr/bin/env sh
#
# Copyright 2015 the original author or authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
##############################################################################
##
## Gradle start up script for UN*X
##
##############################################################################
# Attempt to set APP_HOME
# Resolve links: $0 may be a link
PRG="$0"
# Need this for relative symlinks.
while [ -h "$PRG" ] ; do
ls=`ls -ld "$PRG"`
link=`expr "$ls" : '.*-> \(.*\)$'`
if expr "$link" : '/.*' > /dev/null; then
PRG="$link"
else
PRG=`dirname "$PRG"`"/$link"
fi
done
SAVED="`pwd`"
cd "`dirname \"$PRG\"`/" >/dev/null
APP_HOME="`pwd -P`"
cd "$SAVED" >/dev/null
APP_NAME="Gradle"
APP_BASE_NAME=`basename "$0"`
# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
DEFAULT_JVM_OPTS='"-Xmx64m" "-Xms64m"'
# Use the maximum available, or set MAX_FD != -1 to use that value.
MAX_FD="maximum"
warn () {
echo "$*"
}
die () {
echo
echo "$*"
echo
exit 1
}
# OS specific support (must be 'true' or 'false').
cygwin=false
msys=false
darwin=false
nonstop=false
case "`uname`" in
CYGWIN* )
cygwin=true
;;
Darwin* )
darwin=true
;;
MSYS* | MINGW* )
msys=true
;;
NONSTOP* )
nonstop=true
;;
esac
CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
# Determine the Java command to use to start the JVM.
if [ -n "$JAVA_HOME" ] ; then
if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
# IBM's JDK on AIX uses strange locations for the executables
JAVACMD="$JAVA_HOME/jre/sh/java"
else
JAVACMD="$JAVA_HOME/bin/java"
fi
if [ ! -x "$JAVACMD" ] ; then
die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
else
JAVACMD="java"
which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
Please set the JAVA_HOME variable in your environment to match the
location of your Java installation."
fi
# Increase the maximum file descriptors if we can.
if [ "$cygwin" = "false" -a "$darwin" = "false" -a "$nonstop" = "false" ] ; then
MAX_FD_LIMIT=`ulimit -H -n`
if [ $? -eq 0 ] ; then
if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
MAX_FD="$MAX_FD_LIMIT"
fi
ulimit -n $MAX_FD
if [ $? -ne 0 ] ; then
warn "Could not set maximum file descriptor limit: $MAX_FD"
fi
else
warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
fi
fi
# For Darwin, add options to specify how the application appears in the dock
if $darwin; then
GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
fi
# For Cygwin or MSYS, switch paths to Windows format before running java
if [ "$cygwin" = "true" -o "$msys" = "true" ] ; then
APP_HOME=`cygpath --path --mixed "$APP_HOME"`
CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
JAVACMD=`cygpath --unix "$JAVACMD"`
# We build the pattern for arguments to be converted via cygpath
ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
SEP=""
for dir in $ROOTDIRSRAW ; do
ROOTDIRS="$ROOTDIRS$SEP$dir"
SEP="|"
done
OURCYGPATTERN="(^($ROOTDIRS))"
# Add a user-defined pattern to the cygpath arguments
if [ "$GRADLE_CYGPATTERN" != "" ] ; then
OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
fi
# Now convert the arguments - kludge to limit ourselves to /bin/sh
i=0
for arg in "$@" ; do
CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
else
eval `echo args$i`="\"$arg\""
fi
i=`expr $i + 1`
done
case $i in
0) set -- ;;
1) set -- "$args0" ;;
2) set -- "$args0" "$args1" ;;
3) set -- "$args0" "$args1" "$args2" ;;
4) set -- "$args0" "$args1" "$args2" "$args3" ;;
5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
esac
fi
# Escape application args
save () {
for i do printf %s\\n "$i" | sed "s/'/'\\\\''/g;1s/^/'/;\$s/\$/' \\\\/" ; done
echo " "
}
APP_ARGS=`save "$@"`
# Collect all arguments for the java command, following the shell quoting and substitution rules
eval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS "\"-Dorg.gradle.appname=$APP_BASE_NAME\"" -classpath "\"$CLASSPATH\"" org.gradle.wrapper.GradleWrapperMain "$APP_ARGS"
exec "$JAVACMD" "$@"
================================================
FILE: gradlew.bat
================================================
@rem
@rem Copyright 2015 the original author or authors.
@rem
@rem Licensed under the Apache License, Version 2.0 (the "License");
@rem you may not use this file except in compliance with the License.
@rem You may obtain a copy of the License at
@rem
@rem https://www.apache.org/licenses/LICENSE-2.0
@rem
@rem Unless required by applicable law or agreed to in writing, software
@rem distributed under the License is distributed on an "AS IS" BASIS,
@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@rem See the License for the specific language governing permissions and
@rem limitations under the License.
@rem
@if "%DEBUG%" == "" @echo off
@rem ##########################################################################
@rem
@rem Gradle startup script for Windows
@rem
@rem ##########################################################################
@rem Set local scope for the variables with windows NT shell
if "%OS%"=="Windows_NT" setlocal
set DIRNAME=%~dp0
if "%DIRNAME%" == "" set DIRNAME=.
set APP_BASE_NAME=%~n0
set APP_HOME=%DIRNAME%
@rem Resolve any "." and ".." in APP_HOME to make it shorter.
for %%i in ("%APP_HOME%") do set APP_HOME=%%~fi
@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
set DEFAULT_JVM_OPTS="-Xmx64m" "-Xms64m"
@rem Find java.exe
if defined JAVA_HOME goto findJavaFromJavaHome
set JAVA_EXE=java.exe
%JAVA_EXE% -version >NUL 2>&1
if "%ERRORLEVEL%" == "0" goto execute
echo.
echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:findJavaFromJavaHome
set JAVA_HOME=%JAVA_HOME:"=%
set JAVA_EXE=%JAVA_HOME%/bin/java.exe
if exist "%JAVA_EXE%" goto execute
echo.
echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
echo.
echo Please set the JAVA_HOME variable in your environment to match the
echo location of your Java installation.
goto fail
:execute
@rem Setup the command line
set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
@rem Execute Gradle
"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %*
:end
@rem End local scope for the variables with windows NT shell
if "%ERRORLEVEL%"=="0" goto mainEnd
:fail
rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
rem the _cmd.exe /c_ return code!
if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
exit /b 1
:mainEnd
if "%OS%"=="Windows_NT" endlocal
:omega
================================================
FILE: settings.gradle
================================================
pluginManagement {
repositories {
gradlePluginPortal()
maven { url = 'https://maven.minecraftforge.net/' }
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/BuildingGadgetsJEI.java
================================================
package com.direwolf20.buildinggadgets.client;
import com.direwolf20.buildinggadgets.client.screen.TemplateManagerGUI;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.items.OurItems;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import mezz.jei.api.JeiPlugin;
import mezz.jei.api.constants.VanillaTypes;
import mezz.jei.api.gui.handlers.IGuiContainerHandler;
import mezz.jei.api.registration.IGuiHandlerRegistration;
import mezz.jei.api.registration.ISubtypeRegistration;
import net.minecraft.client.renderer.Rect2i;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import mezz.jei.api.IModPlugin;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
@JeiPlugin
public class BuildingGadgetsJEI implements IModPlugin {
@Override
public ResourceLocation getPluginUid() {
return new ResourceLocation(Reference.MODID, "jei_plugin");
}
@Override
public void registerGuiHandlers(IGuiHandlerRegistration registration) {
registration.addGuiContainerHandler(TemplateManagerGUI.class, new GuiContainerHandler());
}
@Override
public void registerItemSubtypes(ISubtypeRegistration registration) {
List<Item> gadgets = new ArrayList<>() {{
add(OurItems.BUILDING_GADGET_ITEM.get());
add(OurItems.EXCHANGING_GADGET_ITEM.get());
add(OurItems.DESTRUCTION_GADGET_ITEM.get());
add(OurItems.COPY_PASTE_GADGET_ITEM.get());
}};
for (Item gadget : gadgets) {
registration.registerSubtypeInterpreter(VanillaTypes.ITEM_STACK, gadget, (ingredient, uidContext) -> {
if (!(ingredient.getItem() instanceof AbstractGadget))
return "";
double energy = ingredient.getOrCreateTag().getDouble("energy");
if (energy == 0)
return "empty";
else if (energy == ((AbstractGadget) ingredient.getItem()).getEnergyMax())
return "charged";
return "";
});
}
}
private static class GuiContainerHandler implements IGuiContainerHandler<TemplateManagerGUI> {
@Override
public List<Rect2i> getGuiExtraAreas(TemplateManagerGUI containerScreen) {
return new ArrayList<>(Collections.singleton(new Rect2i((containerScreen.width / 2) + 80, (containerScreen.height / 2) - 80, 60, 120)));
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/ClientProxy.java
================================================
package com.direwolf20.buildinggadgets.client;
import com.direwolf20.buildinggadgets.client.cache.CacheTemplateProvider;
import com.direwolf20.buildinggadgets.client.events.EventTooltip;
import com.direwolf20.buildinggadgets.client.renderer.EffectBlockTER;
import com.direwolf20.buildinggadgets.client.screen.TemplateManagerGUI;
import com.direwolf20.buildinggadgets.common.blocks.ConstructionBlock;
import com.direwolf20.buildinggadgets.common.blocks.OurBlocks;
import com.direwolf20.buildinggadgets.common.containers.OurContainers;
import com.direwolf20.buildinggadgets.common.items.ConstructionPasteContainer;
import com.direwolf20.buildinggadgets.common.items.GadgetCopyPaste;
import com.direwolf20.buildinggadgets.common.items.OurItems;
import com.direwolf20.buildinggadgets.common.tileentities.ConstructionBlockTileEntity;
import com.direwolf20.buildinggadgets.common.tileentities.OurTileEntities;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.MenuScreens;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemOverrides;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderers;
import net.minecraft.client.renderer.item.ItemProperties;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.client.resources.model.ModelResourceLocation;
import net.minecraft.client.resources.sounds.SimpleSoundInstance;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraft.util.Mth;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.ChunkRenderTypeSet;
import net.minecraftforge.client.event.ModelEvent;
import net.minecraftforge.client.event.RegisterClientTooltipComponentFactoriesEvent;
import net.minecraftforge.client.event.RegisterColorHandlersEvent;
import net.minecraftforge.client.model.IDynamicBakedModel;
import net.minecraftforge.client.model.data.ModelData;
import net.minecraftforge.common.MinecraftForge;
import net.minecraftforge.event.entity.player.PlayerEvent.PlayerLoggedOutEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
import java.util.Objects;
@Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD)
public class ClientProxy {
private static final Logger LOGGER = LoggerFactory.getLogger(ClientProxy.class);
public static final CacheTemplateProvider CACHE_TEMPLATE_PROVIDER = new CacheTemplateProvider();
public static void clientSetup() {
LOGGER.debug("Setting up client for {}", Reference.MODID);
KeyBindings.init();
BlockEntityRenderers.register(OurTileEntities.EFFECT_BLOCK_TILE_ENTITY.get(), EffectBlockTER::new);
MenuScreens.register(OurContainers.TEMPLATE_MANAGER_CONTAINER.get(), TemplateManagerGUI::new);
MinecraftForge.EVENT_BUS.addListener(ClientProxy::onPlayerLoggedOut);
CACHE_TEMPLATE_PROVIDER.registerUpdateListener(((GadgetCopyPaste) OurItems.COPY_PASTE_GADGET_ITEM.get()).getRender());
List.of(
OurItems.PASTE_CONTAINER_T1_ITEM,
OurItems.PASTE_CONTAINER_T2_ITEM,
OurItems.PASTE_CONTAINER_T3_ITEM,
OurItems.PASTE_CONTAINER_CREATIVE_ITEM
).forEach(item -> {
ItemProperties.register(item.get(), ConstructionPasteContainer.LEVEL, (stack, clientLevel, entity, notSure) -> {
float percent = ConstructionPasteContainer.getPasteAmount(stack) / (float) ConstructionPasteContainer.getMaxPasteAmount(stack);
return Mth.floor(percent * 4) / 4F;
});
});
}
@SubscribeEvent
public static void registerConstructionBlockColorHandler(RegisterColorHandlersEvent.Block event) {
LOGGER.debug("Registering color handlers for {}", Reference.MODID);
event.register((state, world, pos, tintIndex) -> {
if (world != null) {
BlockState mimicBlock = ConstructionBlock.getActualMimicBlock(world, pos);
if (mimicBlock == null) {
return -1;
}
try {
return event.getBlockColors().getColor(mimicBlock, world, pos, tintIndex);
} catch (Exception var8) {
return -1;
}
}
return -1;
}, OurBlocks.CONSTRUCTION_BLOCK.get());
}
@SubscribeEvent
public static void registerTooltipFactory(RegisterClientTooltipComponentFactoriesEvent event) {
LOGGER.debug("Registering custom tooltip component factories for {}", Reference.MODID);
event.register(EventTooltip.CopyPasteTooltipComponent.Data.class, EventTooltip.CopyPasteTooltipComponent::new);
}
public static void playSound(SoundEvent sound, float pitch) {
Minecraft.getInstance().getSoundManager().play(SimpleSoundInstance.forUI(sound, pitch));
}
private static void onPlayerLoggedOut(PlayerLoggedOutEvent event) {
CACHE_TEMPLATE_PROVIDER.clear();
}
@SubscribeEvent
public static void bakeModels(ModelEvent.ModifyBakingResult event) {
LOGGER.debug("Registering baked models for {}", Reference.MODID);
ResourceLocation ConstrName = new ResourceLocation(Reference.MODID, "construction_block");
ModelResourceLocation ConstrLocation1 = new ModelResourceLocation(ConstrName, "ambient_occlusion=false,bright=false,neighbor_brightness=false");
ModelResourceLocation ConstrLocation1a = new ModelResourceLocation(ConstrName, "ambient_occlusion=true,bright=false,neighbor_brightness=false");
ModelResourceLocation ConstrLocation2 = new ModelResourceLocation(ConstrName, "ambient_occlusion=false,bright=true,neighbor_brightness=false");
ModelResourceLocation ConstrLocation2a = new ModelResourceLocation(ConstrName, "ambient_occlusion=true,bright=true,neighbor_brightness=false");
ModelResourceLocation ConstrLocation3 = new ModelResourceLocation(ConstrName, "ambient_occlusion=false,bright=false,neighbor_brightness=true");
ModelResourceLocation ConstrLocation3a = new ModelResourceLocation(ConstrName, "ambient_occlusion=true,bright=false,neighbor_brightness=true");
ModelResourceLocation ConstrLocation4 = new ModelResourceLocation(ConstrName, "ambient_occlusion=false,bright=true,neighbor_brightness=true");
ModelResourceLocation ConstrLocation4a = new ModelResourceLocation(ConstrName, "ambient_occlusion=true,bright=true,neighbor_brightness=true");
IDynamicBakedModel bakedModelLoader = new ConstructionBakedModel();
IDynamicBakedModel bakedModelLoaderAmbient = new ConstructionBakedModel();
event.getModels().put(ConstrLocation1, bakedModelLoader);
event.getModels().put(ConstrLocation2, bakedModelLoader);
event.getModels().put(ConstrLocation3, bakedModelLoader);
event.getModels().put(ConstrLocation4, bakedModelLoader);
event.getModels().put(ConstrLocation1a, bakedModelLoaderAmbient);
event.getModels().put(ConstrLocation2a, bakedModelLoaderAmbient);
event.getModels().put(ConstrLocation3a, bakedModelLoaderAmbient);
event.getModels().put(ConstrLocation4a, bakedModelLoaderAmbient);
}
static class ConstructionBakedModel implements IDynamicBakedModel {
/**
* This kinda works most of the time but isn't perfect. Some issues are definitely present.
* <p/>
* Due to not having access to the block state from the getParticleIcon, we're not able to do this dynamically,
* so instead we wait until the getQuads method is called and effectively cache the lookup for the getParticleIcons
*/
TextureAtlasSprite particleAtlas = null;
@NotNull
@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, RandomSource rand, ModelData modelData, RenderType type) {
BlockState facadeState = modelData.get(ConstructionBlockTileEntity.FACADE_STATE);
if (facadeState == null || facadeState == Blocks.AIR.defaultBlockState())
facadeState = OurBlocks.CONSTRUCTION_DENSE_BLOCK.get().defaultBlockState();
if (particleAtlas == null) {
particleAtlas = Minecraft.getInstance().getBlockRenderer().getBlockModel(facadeState).getParticleIcon(modelData);
}
BakedModel model = Minecraft.getInstance().getBlockRenderer().getBlockModelShaper().getBlockModel(facadeState);
if (type != null && !model.getRenderTypes(facadeState, rand, modelData).contains(type)) { // always render in the null layer or the block-breaking textures don't show up
return Collections.emptyList();
}
return model.getQuads(facadeState, side, rand, modelData, type);
}
@NotNull
@Override
public TextureAtlasSprite getParticleIcon() {
//Fixes a crash until forge does something
return Objects.requireNonNullElseGet(particleAtlas,
() -> Minecraft.getInstance().getBlockRenderer().getBlockModel(Blocks.STONE.defaultBlockState()).getParticleIcon(ModelData.EMPTY));
}
@Override
public boolean isGui3d() {
return false;
}
@Override
public boolean usesBlockLight() {
return false;
} // is side lit maybe?
@Override
public boolean isCustomRenderer() {
return false;
}
@Override
public boolean useAmbientOcclusion() {
return true;
}
@NotNull
@Override
public ItemOverrides getOverrides() {
return null;
}
@Nonnull
@Override
public ModelData getModelData(@Nonnull BlockAndTintGetter world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull ModelData tileData) {
return tileData;
}
@NotNull
@Override
public ChunkRenderTypeSet getRenderTypes(@NotNull BlockState state, @NotNull RandomSource rand, @NotNull ModelData data) {
return ChunkRenderTypeSet.all();
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/KeyBindings.java
================================================
package com.direwolf20.buildinggadgets.client;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.items.TemplateItem;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import com.mojang.blaze3d.platform.InputConstants;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.world.InteractionHand;
import net.minecraft.world.entity.player.Player;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RegisterKeyMappingsEvent;
import net.minecraftforge.client.settings.IKeyConflictContext;
import net.minecraftforge.client.settings.KeyConflictContext;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
import org.lwjgl.glfw.GLFW;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import java.util.ArrayList;
import java.util.List;
@Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscriber.Bus.MOD)
public class KeyBindings {
private static final Logger LOGGER = LoggerFactory.getLogger(KeyBindings.class);
private static final KeyConflictContextGadget CONFLICT_CONTEXT_GADGET = new KeyConflictContextGadget();
private static final List<KeyMapping> keyMappings = new ArrayList<>();
public static KeyMapping menuSettings = createBinding("settings_menu",GLFW.GLFW_KEY_G);
public static KeyMapping range = createBinding("range", GLFW.GLFW_KEY_R);
public static KeyMapping undo = createBinding("undo", GLFW.GLFW_KEY_U);
public static KeyMapping anchor = createBinding("anchor", GLFW.GLFW_KEY_H);
public static KeyMapping fuzzy = createBinding("fuzzy", GLFW.GLFW_KEY_UNKNOWN);
public static KeyMapping connectedArea = createBinding("connected_area", GLFW.GLFW_KEY_UNKNOWN);
public static KeyMapping rotateMirror = createBinding("rotate_mirror", GLFW.GLFW_KEY_UNKNOWN);
public static KeyMapping materialList = createBinding("material_list", GLFW.GLFW_KEY_M);
public static void init() {}
private static KeyMapping createBinding(String name, int key) {
KeyMapping keyBinding = new KeyMapping(getKey(name), CONFLICT_CONTEXT_GADGET, InputConstants.Type.KEYSYM.getOrCreate(key), getKey("category"));
keyMappings.add(keyBinding);
return keyBinding;
}
private static String getKey(String name) {
return String.join(".", "key", Reference.MODID, name);
}
@SubscribeEvent
static void register(RegisterKeyMappingsEvent event) {
LOGGER.debug("Registering {} keybinding for {}", keyMappings.size(), Reference.MODID);
keyMappings.forEach(event::register);
}
public static class KeyConflictContextGadget implements IKeyConflictContext
{
@Override
public boolean isActive() {
Player player = Minecraft.getInstance().player;
return !KeyConflictContext.GUI.isActive() && player != null
&& (!AbstractGadget.getGadget(player).isEmpty()
|| (player.getItemInHand(InteractionHand.MAIN_HAND).getItem() instanceof TemplateItem || player.getItemInHand(InteractionHand.OFF_HAND).getItem() instanceof TemplateItem));
}
@Override
public boolean conflicts(IKeyConflictContext other) {
return other == this || other == KeyConflictContext.IN_GAME;
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/OurSounds.java
================================================
package com.direwolf20.buildinggadgets.client;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.sounds.SoundEvent;
import net.minecraftforge.registries.DeferredRegister;
import net.minecraftforge.registries.ForgeRegistries;
import net.minecraftforge.registries.RegistryObject;
public interface OurSounds {
DeferredRegister<SoundEvent> REGISTRY = DeferredRegister.create(ForgeRegistries.SOUND_EVENTS, Reference.MODID);
RegistryObject<SoundEvent> BEEP = REGISTRY.register("beep", () -> SoundEvent.createVariableRangeEvent(new ResourceLocation(Reference.MODID, "beep")));
static void playSound(SoundEvent sound, float pitch) {
ClientProxy.playSound(sound, pitch);
}
static void playSound(SoundEvent sound) {
ClientProxy.playSound(sound, 1.0F);
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/cache/CacheTemplateProvider.java
================================================
package com.direwolf20.buildinggadgets.client.cache;
import com.direwolf20.buildinggadgets.common.BuildingGadgets;
import com.direwolf20.buildinggadgets.common.network.PacketHandler;
import com.direwolf20.buildinggadgets.common.network.packets.PacketRequestTemplate;
import com.direwolf20.buildinggadgets.common.network.packets.SplitPacketUpdateTemplate;
import com.direwolf20.buildinggadgets.common.tainted.Tainted;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateKey;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateProvider;
import com.direwolf20.buildinggadgets.common.tainted.template.Template;
import com.google.common.cache.Cache;
import com.google.common.cache.CacheBuilder;
import net.minecraftforge.network.PacketDistributor;
import org.apache.logging.log4j.util.TriConsumer;
import javax.annotation.Nonnull;
import java.util.Collections;
import java.util.Set;
import java.util.UUID;
import java.util.WeakHashMap;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.TimeUnit;
import java.util.function.Function;
@Tainted(reason = "Uses template system")
public final class CacheTemplateProvider implements ITemplateProvider {
private final Cache<UUID, Template> cache;
private final Set<IUpdateListener> updateListeners;
public CacheTemplateProvider() {
this.cache = CacheBuilder
.newBuilder()
.expireAfterAccess(1, TimeUnit.MINUTES)
.build();
this.updateListeners = Collections.newSetFromMap(new WeakHashMap<>());
}
@Override
@Nonnull
public Template getTemplateForKey(@Nonnull ITemplateKey key) {
UUID id = getId(key);
try {
return cache.get(id, () -> {
requestUpdate(id, PacketDistributor.SERVER.noArg());
return new Template();
});
} catch (ExecutionException e) {
BuildingGadgets.LOG.error("Failed to access Cache! Returning new Template, this is certainly going to cause unexpected behaviour!", e);
return new Template();
}
}
@Override
public void setTemplate(ITemplateKey key, Template template) {
UUID id = getId(key);
cache.put(id, template);
notifyListeners(key, template, l -> l::onTemplateUpdate);
}
@Override
public boolean requestUpdate(ITemplateKey key) {
return requestUpdate(key, PacketDistributor.SERVER.noArg());
}
@Override
public boolean requestUpdate(ITemplateKey key, PacketDistributor.PacketTarget target) {
return requestUpdate(key.getTemplateId(UUID::randomUUID), target);
}
private boolean requestUpdate(UUID id, PacketDistributor.PacketTarget target) {
PacketHandler.send(new PacketRequestTemplate(id), target);
return true;
}
@Override
public boolean requestRemoteUpdate(ITemplateKey key, PacketDistributor.PacketTarget target) {
UUID id = getId(key);
Template template = cache.getIfPresent(id);
if (template != null) {
notifyListeners(key, template, l -> l::onTemplateUpdateSend);
PacketHandler.getSplitManager().send(new SplitPacketUpdateTemplate(id, template), target);
}
return template != null;
}
@Override
public boolean requestRemoteUpdate(ITemplateKey key) {
return requestRemoteUpdate(key, PacketDistributor.SERVER.noArg());
}
@Override
public void registerUpdateListener(IUpdateListener listener) {
updateListeners.add(listener);
}
@Override
public void removeUpdateListener(IUpdateListener listener) {
updateListeners.remove(listener);
}
@Override
public UUID getId(ITemplateKey key) {
return key.getTemplateId(UUID::randomUUID);
}
/**
* Although public, do not use this method willingly. The cache is already purged on each
* onPlayerLoggedOut event.
*/
public void clear() {
this.cache.invalidateAll();
this.cache.cleanUp();
}
private void notifyListeners(ITemplateKey key, Template template, Function<IUpdateListener, TriConsumer<ITemplateProvider, ITemplateKey, Template>> function) {
for (IUpdateListener listener : updateListeners) {
try {
function.apply(listener).accept(this, key, template);
} catch (Exception e) {
BuildingGadgets.LOG.error("Update listener threw an exception!", e);
}
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/cache/RemoteInventoryCache.java
================================================
package com.direwolf20.buildinggadgets.client.cache;
import com.direwolf20.buildinggadgets.common.network.PacketHandler;
import com.direwolf20.buildinggadgets.common.network.packets.PacketSetRemoteInventoryCache;
import com.direwolf20.buildinggadgets.common.tainted.inventory.InventoryLinker;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects.UniqueItem;
import com.google.common.base.Stopwatch;
import com.google.common.collect.Multiset;
import net.minecraft.world.item.ItemStack;
import net.minecraft.resources.ResourceKey;
import net.minecraft.core.BlockPos;
import net.minecraft.world.level.Level;
import org.apache.commons.lang3.tuple.Pair;
import javax.annotation.Nullable;
import java.util.Objects;
import java.util.concurrent.TimeUnit;
public class RemoteInventoryCache {
private boolean isCopyPaste, forceUpdate;
private Pair<BlockPos, ResourceKey<Level>> locCached;
private Multiset<UniqueItem> cache;
private Stopwatch timer;
public RemoteInventoryCache(boolean isCopyPaste) {
this.isCopyPaste = isCopyPaste;
}
public void setCache(Multiset<UniqueItem> cache) {
this.cache = cache;
}
public void forceUpdate() {
forceUpdate = true;
}
public boolean maintainCache(ItemStack tool) {
Pair<BlockPos, ResourceKey<Level>> loc = InventoryLinker.getDataFromStack(tool);
if (isCacheOld(loc))
updateCache(loc);
return loc != null;
}
public Multiset<UniqueItem> getCache() {
return cache;
}
private void updateCache(Pair<BlockPos, ResourceKey<Level>> loc) {
locCached = loc;
if (loc == null)
cache = null;
else {
PacketHandler.sendToServer(new PacketSetRemoteInventoryCache(loc, isCopyPaste));
}
}
private boolean isCacheOld(@Nullable Pair<BlockPos, ResourceKey<Level>> loc) {
if (!Objects.equals(locCached, loc)) {
timer = loc == null ? null : Stopwatch.createStarted();
return true;
}
if (timer != null) {
boolean overtime = forceUpdate || timer.elapsed(TimeUnit.MILLISECONDS) >= 5000;
if (overtime) {
timer.reset();
timer.start();
forceUpdate = false;
}
return overtime;
}
return false;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/events/EventKeyInput.java
================================================
package com.direwolf20.buildinggadgets.client.events;
import com.direwolf20.buildinggadgets.client.KeyBindings;
import com.direwolf20.buildinggadgets.client.screen.GuiMod;
import com.direwolf20.buildinggadgets.client.screen.ModeRadialMenu;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.network.PacketHandler;
import com.direwolf20.buildinggadgets.common.network.packets.*;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.client.KeyMapping;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.settings.KeyModifier;
import net.minecraftforge.event.TickEvent.ClientTickEvent;
import net.minecraftforge.event.TickEvent.Phase;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod.EventBusSubscriber;
@EventBusSubscriber(modid = Reference.MODID, value = Dist.CLIENT)
public class EventKeyInput {
@SubscribeEvent
public static void handleEventInput(ClientTickEvent event) {
Minecraft mc = Minecraft.getInstance();
if (mc.player == null || event.phase == Phase.START)
return;
if (KeyBindings.materialList.consumeClick()) {
GuiMod.MATERIAL_LIST.openScreen(mc.player);
return;
}
ItemStack tool = AbstractGadget.getGadget(mc.player);
if (tool.isEmpty())
return;
KeyMapping mode = KeyBindings.menuSettings;
if (!(mc.screen instanceof ModeRadialMenu) && mode.consumeClick() && ((mode.getKeyModifier() == KeyModifier.NONE
&& KeyModifier.getActiveModifier() == KeyModifier.NONE) || mode.getKeyModifier() != KeyModifier.NONE)) {
mc.setScreen(new ModeRadialMenu(tool));
} else if (KeyBindings.range.consumeClick()) {
PacketHandler.sendToServer(new PacketChangeRange());
} else if (KeyBindings.rotateMirror.consumeClick()) {
PacketHandler.sendToServer(new PacketRotateMirror());
} else if (KeyBindings.undo.consumeClick()) {
PacketHandler.sendToServer(new PacketUndo());
} else if (KeyBindings.anchor.consumeClick()) {
PacketHandler.sendToServer(new PacketAnchor());
} else if (KeyBindings.fuzzy.consumeClick()) {
PacketHandler.sendToServer(new PacketToggleFuzzy());
} else if (KeyBindings.connectedArea.consumeClick()) {
PacketHandler.sendToServer(new PacketToggleConnectedArea());
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/events/EventRenderWorldLast.java
================================================
package com.direwolf20.buildinggadgets.client.events;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import net.minecraft.client.Minecraft;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.client.event.RenderLevelStageEvent;
import net.minecraftforge.eventbus.api.SubscribeEvent;
import net.minecraftforge.fml.common.Mod;
@Mod.EventBusSubscriber(modid = Reference.MODID, value = Dist.CLIENT)
public class EventRenderWorldLast {
@SubscribeEvent
static void RenderLevelLastEvent(RenderLevelStageEvent evt) {
if (evt.getStage() != RenderLevelStageEvent.Stage.AFTER_TRANSLUCENT_BLOCKS) {
return;
}
Player player = Minecraft.getInstance().player;
if( player == null )
return;
ItemStack heldItem = AbstractGadget.getGadget(player);
if (heldItem.isEmpty())
return;
((AbstractGadget) heldItem.getItem()).getRender().render(evt, player, heldItem);
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/events/EventTooltip.java
================================================
package com.direwolf20.buildinggadgets.client.events;
import com.direwolf20.buildinggadgets.client.cache.RemoteInventoryCache;
import com.direwolf20.buildinggadgets.common.capability.CapabilityTemplate;
import com.direwolf20.buildinggadgets.common.items.GadgetCopyPaste;
import com.direwolf20.buildinggadgets.common.items.OurItems;
import com.direwolf20.buildinggadgets.common.tainted.building.view.BuildContext;
import com.direwolf20.buildinggadgets.common.tainted.inventory.IItemIndex;
import com.direwolf20.buildinggadgets.common.tainted.inventory.InventoryHelper;
import com.direwolf20.buildinggadgets.common.tainted.inventory.MatchResult;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.MaterialList;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects.IUniqueObject;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects.UniqueItem;
import com.direwolf20.buildinggadgets.common.tainted.template.Template;
import com.direwolf20.buildinggadgets.common.tainted.template.TemplateHeader;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMultiset;
import com.google.common.collect.Multiset;
import com.google.common.collect.Multiset.Entry;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.gui.screens.inventory.tooltip.ClientTooltipComponent;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.entity.ItemRenderer;
import net.minecraft.world.inventory.tooltip.TooltipComponent;
import net.minecraft.world.item.ItemStack;
import org.lwjgl.opengl.GL11;
import java.util.Comparator;
import java.util.List;
public class EventTooltip {
private static final Comparator<Multiset.Entry<IUniqueObject<?>>> ENTRY_COMPARATOR = Comparator
.<Multiset.Entry<IUniqueObject<?>>, Integer>comparing(Entry::getCount)
.reversed()
.thenComparing(e -> e.getElement().getObjectRegistryName());
private static final int STACKS_PER_LINE = 16;
private static RemoteInventoryCache cache = new RemoteInventoryCache(true);
public static void setCache(Multiset<UniqueItem> cache) {
EventTooltip.cache.setCache(cache);
}
public static class CopyPasteTooltipComponent implements ClientTooltipComponent {
Data tooltipData;
public CopyPasteTooltipComponent(Data tooltipComponent) {
tooltipData = tooltipComponent;
}
@Override
public int getHeight() {
return Screen.hasShiftDown() && tooltipData.data != null ? 20 + (tooltipData.data.sortedEntries.size() / STACKS_PER_LINE * 20) : 0;
}
@Override
public int getWidth(Font font) {
return Screen.hasShiftDown() && tooltipData.data != null ? (tooltipData.data.sortedEntries.size() <= STACKS_PER_LINE ? tooltipData.data.sortedEntries.size() * 18 : STACKS_PER_LINE * 18) : 0;
}
@Override
public void renderImage(Font font, int x, int y, PoseStack poseStack, ItemRenderer itemRenderer) {
if (this.tooltipData.stack == null || !(this.tooltipData.stack.getItem() instanceof GadgetCopyPaste))
return;
Minecraft mc = Minecraft.getInstance();
if (mc.level == null || mc.player == null || !Screen.hasShiftDown() || tooltipData.data == null)
return;
int bx = x;
int by = y;
int j = 0;
int totalMissing = 0;
//add missing offset because the Stack is 16 by 16 as a render, not 9 by 9
//needs to be 8 instead of 7, so that there is a one pixel padding to the text, just as there is between stacks
// by += 8;
RenderSystem.enableBlend();
RenderSystem.blendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
for (Multiset.Entry<IUniqueObject<?>> entry : tooltipData.data.sortedEntries) {
int xx = bx + (j % STACKS_PER_LINE) * 18;
int yy = by + (j / STACKS_PER_LINE) * 20;
totalMissing += renderRequiredBlocks(poseStack, itemRenderer, entry.getElement().createStack(), xx, yy, tooltipData.data.existing.count(entry.getElement()), entry.getCount());
j++;
}
if (!tooltipData.data.match.isSuccess()) {
IUniqueObject<?> pasteItem = new UniqueItem(OurItems.CONSTRUCTION_PASTE_ITEM.get());
Multiset<IUniqueObject<?>> pasteSet = ImmutableMultiset.<IUniqueObject<?>>builder()
.addCopies(pasteItem, totalMissing)
.build();
int hasAmt = tooltipData.data.index.tryMatch(pasteSet).getFoundItems().count(pasteItem);
int xx = bx + (j % STACKS_PER_LINE) * 18;
int yy = by + (j / STACKS_PER_LINE) * 20;
int required = Integer.MAX_VALUE;
try {
required = Math.toIntExact(totalMissing);
} catch (ArithmeticException ignored) {
}
renderRequiredBlocks(poseStack, itemRenderer, pasteItem.createStack(), xx, yy, hasAmt, required);
}
}
public static class Data implements TooltipComponent {
public ItemStack stack;
public TemplateData data;
public Data(ItemStack stack) {
this.stack = stack;
Minecraft mc = Minecraft.getInstance();
mc.level.getCapability(CapabilityTemplate.TEMPLATE_PROVIDER_CAPABILITY).ifPresent(provider -> stack.getCapability(CapabilityTemplate.TEMPLATE_KEY_CAPABILITY).ifPresent(templateKey -> {
Template template = provider.getTemplateForKey(templateKey);
IItemIndex index = InventoryHelper.index(stack, mc.player);
BuildContext buildContext = BuildContext.builder()
.stack(stack)
.player(mc.player)
.build(mc.level);
TemplateHeader header = template.getHeaderAndForceMaterials(buildContext);
MaterialList list = header.getRequiredItems();
if (list == null)
list = MaterialList.empty();
MatchResult match = index.tryMatch(list);
Multiset<IUniqueObject<?>> existing = match.getFoundItems();
List<Entry<IUniqueObject<?>>> sortedEntries = ImmutableList.sortedCopyOf(ENTRY_COMPARATOR, match.getChosenOption().entrySet());
this.data = new TemplateData(existing, sortedEntries, index, match);
}));
}
}
public record TemplateData(Multiset<IUniqueObject<?>> existing,
List<Entry<IUniqueObject<?>>> sortedEntries,
IItemIndex index,
MatchResult match) {
}
}
private static int renderRequiredBlocks(PoseStack matrices, ItemRenderer itemRenderer, ItemStack itemStack, int x, int y, int count, int req) {
Minecraft mc = Minecraft.getInstance();
String s1 = req == Integer.MAX_VALUE ? "\u221E" : Integer.toString(req);
int w1 = mc.font.width(s1);
boolean hasReq = req > 0;
itemRenderer.renderAndDecorateItem(matrices, itemStack, x, y);
itemRenderer.renderGuiItemDecorations(matrices, mc.font, itemStack, x, y);
MultiBufferSource.BufferSource irendertypebuffer$impl = Minecraft.getInstance().renderBuffers().bufferSource();
matrices.pushPose();
matrices.translate(x + 8 - w1 / 4f, y + (hasReq ? 12 : 14), ItemRenderer.ITEM_COUNT_BLIT_OFFSET + 250);
matrices.scale(.5f, .5f, 0);
mc.font.draw(matrices, s1, 0, 0, 0xFFFFFF);
matrices.popPose();
int missingCount = 0;
if (hasReq) {
if (count < req) {
String fs = Integer.toString(req - count);
String s2 = "(" + fs + ")";
int w2 = mc.font.width(s2);
matrices.pushPose();
matrices.translate(x + 8 - w2 / 4f, y + 17, ItemRenderer.ITEM_COUNT_BLIT_OFFSET + 250);
matrices.scale(.5f, .5f, 0);
mc.font.drawInBatch(s2, 0, 0, 0xFF0000, true, matrices.last().pose(), irendertypebuffer$impl, Font.DisplayMode.NORMAL, 0, 15728880);
matrices.popPose();
missingCount = (req - count);
}
}
irendertypebuffer$impl.endBatch();
return missingCount;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/models/ConstructionBakedModel.java
================================================
package com.direwolf20.buildinggadgets.client.models;
import com.direwolf20.buildinggadgets.common.blocks.OurBlocks;
import com.direwolf20.buildinggadgets.common.tileentities.ConstructionBlockTileEntity;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.ItemBlockRenderTypes;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.model.BakedQuad;
import net.minecraft.client.renderer.block.model.ItemOverrides;
import net.minecraft.client.renderer.texture.TextureAtlasSprite;
import net.minecraft.client.resources.model.BakedModel;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.util.RandomSource;
import net.minecraft.world.level.BlockAndTintGetter;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.ForgeHooksClient;
import net.minecraftforge.client.model.IDynamicBakedModel;
import net.minecraftforge.client.model.data.ModelData;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.util.Collections;
import java.util.List;
public class ConstructionBakedModel implements IDynamicBakedModel {
private BlockState facadeState;
@Override
public boolean isGui3d() {
return false;
}
@Override
public boolean usesBlockLight() {
return false;
}
@Override
public boolean isCustomRenderer() {
return false;
}
@Override
public TextureAtlasSprite getParticleIcon() {
return null;
}
@Override
public boolean useAmbientOcclusion() {
if (facadeState == null) return false;
BakedModel model;
model = Minecraft.getInstance().getBlockRenderer().getBlockModelShaper().getBlockModel(facadeState);
return model.useAmbientOcclusion();
}
@Override
public List<BakedQuad> getQuads(@Nullable BlockState state, @Nullable Direction side, RandomSource rand, ModelData modelData, RenderType type) {
BakedModel model;
facadeState = modelData.get(ConstructionBlockTileEntity.FACADE_STATE);
if (facadeState == null || facadeState == Blocks.AIR.defaultBlockState())
facadeState = OurBlocks.CONSTRUCTION_DENSE_BLOCK.get().defaultBlockState();
model = Minecraft.getInstance().getBlockRenderer().getBlockModelShaper().getBlockModel(facadeState);
if (type != null && !model.getRenderTypes(facadeState, rand, modelData).contains(type)) { // always render in the null layer or the block-breaking textures don't show up
return Collections.emptyList();
}
return model.getQuads(facadeState, side, rand, modelData, type);
}
// @Override
// public TextureAtlasSprite getParticleTexture(@Nonnull IModelData data) {
// return this.getBakedModel().getParticleTexture(data);
// }
@Override
public ItemOverrides getOverrides() {
return null;
}
@Nonnull
@Override
public ModelData getModelData(@Nonnull BlockAndTintGetter world, @Nonnull BlockPos pos, @Nonnull BlockState state, @Nonnull ModelData tileData) {
return tileData;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/DireBufferBuilder.java
================================================
package com.direwolf20.buildinggadgets.client.renderer;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.google.common.primitives.Floats;
import com.mojang.blaze3d.vertex.DefaultedVertexConsumer;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.BufferVertexConsumer;
import com.mojang.datafixers.util.Pair;
import it.unimi.dsi.fastutil.ints.IntArrays;
import com.mojang.blaze3d.platform.MemoryTracker;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.blaze3d.vertex.VertexFormatElement;
import net.minecraftforge.api.distmarker.Dist;
import net.minecraftforge.api.distmarker.OnlyIn;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import javax.annotation.Nullable;
import java.nio.ByteBuffer;
import java.nio.FloatBuffer;
import java.util.BitSet;
import java.util.List;
public class DireBufferBuilder extends DefaultedVertexConsumer implements BufferVertexConsumer {
private static final Logger LOGGER = LogManager.getLogger();
private ByteBuffer byteBuffer;
private final List<DireBufferBuilder.DrawState> drawStates = Lists.newArrayList();
private int drawStateIndex = 0;
private int renderedBytes = 0;
private int nextElementBytes = 0;
private int uploadedBytes = 0;
private int vertexCount;
@Nullable
private VertexFormatElement vertexFormatElement;
private int vertexFormatIndex;
private int drawMode;
private VertexFormat vertexFormat;
private boolean fastFormat;
private boolean fullFormat;
private boolean isDrawing;
public DireBufferBuilder(int bufferSizeIn) {
this.byteBuffer = MemoryTracker.create(bufferSizeIn * 4); // TODO: might need to remove or change to 6
}
protected void growBuffer() {
this.growBuffer(this.vertexFormat.getVertexSize());
}
private void growBuffer(int increaseAmount) {
if (this.nextElementBytes + increaseAmount > this.byteBuffer.capacity()) {
int i = this.byteBuffer.capacity();
int j = i + roundUpPositive(increaseAmount);
LOGGER.debug("Needed to grow BufferBuilder buffer: Old size {} bytes, new size {} bytes.", i, j);
ByteBuffer bytebuffer = MemoryTracker.create(j);
this.byteBuffer.position(0);
bytebuffer.put(this.byteBuffer);
bytebuffer.rewind();
this.byteBuffer = bytebuffer;
}
}
private static int roundUpPositive(int xIn) {
int i = 2097152;
if (xIn == 0) {
return i;
} else {
if (xIn < 0) {
i *= -1;
}
int j = xIn % i;
return j == 0 ? xIn : xIn + i - j;
}
}
public void sortVertexData(float cameraX, float cameraY, float cameraZ) {
this.byteBuffer.clear();
FloatBuffer floatbuffer = this.byteBuffer.asFloatBuffer();
int i = this.vertexCount / 4;
float[] afloat = new float[i];
for (int j = 0; j < i; ++j) {
afloat[j] = getDistanceSq(floatbuffer, cameraX, cameraY, cameraZ, this.vertexFormat.getIntegerSize(), this.renderedBytes / 4 + j * this.vertexFormat.getVertexSize());
}
int[] aint = new int[i];
for (int k = 0; k < aint.length; aint[k] = k++) {
;
}
IntArrays.mergeSort(aint, (p_227830_1_, p_227830_2_) -> {
return Floats.compare(afloat[p_227830_1_], afloat[p_227830_2_]);
});
BitSet bitset = new BitSet();
FloatBuffer floatbuffer1 = FloatBuffer.allocate(this.vertexFormat.getIntegerSize() * 6);
for (int l = bitset.nextClearBit(0); l < aint.length; l = bitset.nextClearBit(l + 1)) {
int i1 = aint[l];
if (i1 != l) {
this.limitToVertex(floatbuffer, i1);
floatbuffer1.clear();
floatbuffer1.put(floatbuffer);
int j1 = i1;
for (int k1 = aint[i1]; j1 != l; k1 = aint[k1]) {
this.limitToVertex(floatbuffer, k1);
FloatBuffer floatbuffer2 = floatbuffer.slice();
this.limitToVertex(floatbuffer, j1);
floatbuffer.put(floatbuffer2);
bitset.set(j1);
j1 = k1;
}
this.limitToVertex(floatbuffer, l);
floatbuffer1.flip();
floatbuffer.put(floatbuffer1);
}
bitset.set(l);
}
}
private void limitToVertex(FloatBuffer floatBufferIn, int indexIn) {
int i = this.vertexFormat.getIntegerSize() * 4;
floatBufferIn.limit(this.renderedBytes / 4 + (indexIn + 1) * i);
floatBufferIn.position(this.renderedBytes / 4 + indexIn * i);
}
public DireBufferBuilder.State getVertexState() {
this.byteBuffer.limit(this.nextElementBytes);
this.byteBuffer.position(this.renderedBytes);
ByteBuffer bytebuffer = ByteBuffer.allocate(this.vertexCount * this.vertexFormat.getVertexSize());
bytebuffer.put(this.byteBuffer);
this.byteBuffer.clear();
return new DireBufferBuilder.State(bytebuffer, this.vertexFormat);
}
private static float getDistanceSq(FloatBuffer floatBufferIn, float x, float y, float z, int integerSize, int offset) {
float f = floatBufferIn.get(offset + integerSize * 0 + 0);
float f1 = floatBufferIn.get(offset + integerSize * 0 + 1);
float f2 = floatBufferIn.get(offset + integerSize * 0 + 2);
float f3 = floatBufferIn.get(offset + integerSize * 1 + 0);
float f4 = floatBufferIn.get(offset + integerSize * 1 + 1);
float f5 = floatBufferIn.get(offset + integerSize * 1 + 2);
float f6 = floatBufferIn.get(offset + integerSize * 2 + 0);
float f7 = floatBufferIn.get(offset + integerSize * 2 + 1);
float f8 = floatBufferIn.get(offset + integerSize * 2 + 2);
float f9 = floatBufferIn.get(offset + integerSize * 3 + 0);
float f10 = floatBufferIn.get(offset + integerSize * 3 + 1);
float f11 = floatBufferIn.get(offset + integerSize * 3 + 2);
float f12 = (f + f3 + f6 + f9) * 0.25F - x;
float f13 = (f1 + f4 + f7 + f10) * 0.25F - y;
float f14 = (f2 + f5 + f8 + f11) * 0.25F - z;
return f12 * f12 + f13 * f13 + f14 * f14;
}
public void setVertexState(DireBufferBuilder.State state) {
state.stateByteBuffer.clear();
int i = state.stateByteBuffer.capacity();
this.growBuffer(i);
this.byteBuffer.limit(this.byteBuffer.capacity());
this.byteBuffer.position(this.renderedBytes);
this.byteBuffer.put(state.stateByteBuffer);
this.byteBuffer.clear();
VertexFormat vertexformat = state.stateVertexFormat;
this.setVertexFormat(vertexformat);
this.vertexCount = i / vertexformat.getVertexSize();
this.nextElementBytes = this.renderedBytes + this.vertexCount * vertexformat.getVertexSize();
}
public void begin(int glMode, VertexFormat format) {
if (this.isDrawing) {
throw new IllegalStateException("Already building!");
} else {
this.isDrawing = true;
this.drawMode = glMode;
this.setVertexFormat(format);
this.vertexFormatElement = format.getElements().get(0);
this.vertexFormatIndex = 0;
this.byteBuffer.clear();
}
}
private void setVertexFormat(VertexFormat vertexFormatIn) {
if (this.vertexFormat != vertexFormatIn) {
this.vertexFormat = vertexFormatIn;
boolean flag = vertexFormatIn == DefaultVertexFormat.POSITION_COLOR_TEX_LIGHTMAP; //POSITION_COLOR_TEXTURE_OVERLAY_LIGHT_NORMAL;
boolean flag1 = vertexFormatIn == DefaultVertexFormat.BLOCK;
this.fastFormat = flag || flag1;
this.fullFormat = flag;
}
}
public void finishDrawing() {
if (!this.isDrawing) {
throw new IllegalStateException("Not building!");
} else {
this.isDrawing = false;
this.drawStates.add(new DireBufferBuilder.DrawState(this.vertexFormat, this.vertexCount, this.drawMode));
this.renderedBytes += this.vertexCount * this.vertexFormat.getVertexSize();
this.vertexCount = 0;
this.vertexFormatElement = null;
this.vertexFormatIndex = 0;
}
}
public void putByte(int indexIn, byte byteIn) {
this.byteBuffer.put(this.nextElementBytes + indexIn, byteIn);
}
public void putShort(int indexIn, short shortIn) {
this.byteBuffer.putShort(this.nextElementBytes + indexIn, shortIn);
}
public void putFloat(int indexIn, float floatIn) {
this.byteBuffer.putFloat(this.nextElementBytes + indexIn, floatIn);
}
public void endVertex() {
if (this.vertexFormatIndex != 0) {
throw new IllegalStateException("Not filled all elements of the vertex");
} else {
++this.vertexCount;
this.growBuffer();
}
}
public void nextElement() {
ImmutableList<VertexFormatElement> immutablelist = this.vertexFormat.getElements();
this.vertexFormatIndex = (this.vertexFormatIndex + 1) % immutablelist.size();
this.nextElementBytes += this.vertexFormatElement.getByteSize();
VertexFormatElement vertexformatelement = immutablelist.get(this.vertexFormatIndex);
this.vertexFormatElement = vertexformatelement;
if (vertexformatelement.getUsage() == VertexFormatElement.Usage.PADDING) {
this.nextElement();
}
if (this.defaultColorSet && this.vertexFormatElement.getUsage() == VertexFormatElement.Usage.COLOR) {
BufferVertexConsumer.super.color(this.defaultR, this.defaultG, this.defaultB, this.defaultA);
}
}
public VertexConsumer color(int red, int green, int blue, int alpha) {
if (this.defaultColorSet) {
throw new IllegalStateException();
} else {
return BufferVertexConsumer.super.color(red, green, blue, alpha);
}
}
public void vertex(float x, float y, float z, float red, float green, float blue, float alpha, float texU, float texV, int overlayUV, int lightmapUV, float normalX, float normalY, float normalZ) {
if (this.defaultColorSet) {
throw new IllegalStateException();
} else if (this.fastFormat) {
this.putFloat(0, x);
this.putFloat(4, y);
this.putFloat(8, z);
this.putByte(12, (byte) ((int) (red * 255.0F)));
this.putByte(13, (byte) ((int) (green * 255.0F)));
this.putByte(14, (byte) ((int) (blue * 255.0F)));
this.putByte(15, (byte) ((int) (alpha * 255.0F)));
this.putFloat(16, texU);
this.putFloat(20, texV);
int i;
if (this.fullFormat) {
this.putShort(24, (short) (overlayUV & '\uffff'));
this.putShort(26, (short) (overlayUV >> 16 & '\uffff'));
i = 28;
} else {
i = 24;
}
this.putShort(i + 0, (short) (lightmapUV & '\uffff'));
this.putShort(i + 2, (short) (lightmapUV >> 16 & '\uffff'));
this.putByte(i + 4, BufferVertexConsumer.normalIntValue(normalX)); // @mcp: normalIntValue = normalInt
this.putByte(i + 5, BufferVertexConsumer.normalIntValue(normalY));
this.putByte(i + 6, BufferVertexConsumer.normalIntValue(normalZ));
this.nextElementBytes += i + 8;
this.endVertex();
} else {
super.vertex(x, y, z, red, green, blue, alpha, texU, texV, overlayUV, lightmapUV, normalX, normalY, normalZ);
}
}
public Pair<DireBufferBuilder.DrawState, ByteBuffer> getNextBuffer() {
DireBufferBuilder.DrawState bufferbuilder$drawstate = this.drawStates.get(this.drawStateIndex++);
this.byteBuffer.position(this.uploadedBytes);
this.uploadedBytes += bufferbuilder$drawstate.getVertexCount() * bufferbuilder$drawstate.getFormat().getVertexSize();
this.byteBuffer.limit(this.uploadedBytes);
if (this.drawStateIndex == this.drawStates.size() && this.vertexCount == 0) {
this.reset();
}
ByteBuffer bytebuffer = this.byteBuffer.slice();
this.byteBuffer.clear();
return Pair.of(bufferbuilder$drawstate, bytebuffer);
}
public void reset() {
if (this.renderedBytes != this.uploadedBytes) {
LOGGER.warn("Bytes mismatch " + this.renderedBytes + " " + this.uploadedBytes);
}
this.discard();
}
public void discard() {
this.renderedBytes = 0;
this.uploadedBytes = 0;
this.nextElementBytes = 0;
this.drawStates.clear();
this.drawStateIndex = 0;
}
public VertexFormatElement currentElement() {
if (this.vertexFormatElement == null) {
throw new IllegalStateException("BufferBuilder not started");
} else {
return this.vertexFormatElement;
}
}
public boolean isDrawing() {
return this.isDrawing;
}
@OnlyIn(Dist.CLIENT)
public static final class DrawState {
private final VertexFormat format;
private final int vertexCount;
private final int drawMode;
private DrawState(VertexFormat formatIn, int vertexCountIn, int drawModeIn) {
this.format = formatIn;
this.vertexCount = vertexCountIn;
this.drawMode = drawModeIn;
}
public VertexFormat getFormat() {
return this.format;
}
public int getVertexCount() {
return this.vertexCount;
}
public int getDrawMode() {
return this.drawMode;
}
}
@OnlyIn(Dist.CLIENT)
public static class State {
private final ByteBuffer stateByteBuffer;
private final VertexFormat stateVertexFormat;
private State(ByteBuffer byteBufferIn, VertexFormat vertexFormatIn) {
this.stateByteBuffer = byteBufferIn;
this.stateVertexFormat = vertexFormatIn;
}
}
public void putBulkData(ByteBuffer buffer) {
growBuffer(buffer.limit() + this.vertexFormat.getVertexSize());
this.byteBuffer.position(this.vertexCount * this.vertexFormat.getVertexSize());
this.byteBuffer.put(buffer);
this.vertexCount += buffer.limit() / this.vertexFormat.getVertexSize();
}
// Forge start
public VertexFormat getVertexFormat() {
return this.vertexFormat;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/DireVertexBuffer.java
================================================
package com.direwolf20.buildinggadgets.client.renderer;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.VertexFormat;
import com.mojang.datafixers.util.Pair;
import org.joml.Matrix4f;
import java.nio.ByteBuffer;
import java.util.concurrent.CompletableFuture;
public class DireVertexBuffer implements AutoCloseable {
private int glBufferId;
private final VertexFormat vertexFormat;
private int count;
public DireVertexBuffer(VertexFormat vertexFormatIn) {
this.vertexFormat = vertexFormatIn;
RenderSystem.glGenBuffers((p_227876_1_) -> {
this.glBufferId = p_227876_1_;
});
}
public void bindBuffer() {
RenderSystem.glBindBuffer(34962, () -> this.glBufferId);
}
public void upload(DireBufferBuilder bufferIn) {
if (!RenderSystem.isOnRenderThread()) {
RenderSystem.recordRenderCall(() -> {
this.uploadRaw(bufferIn);
});
} else {
this.uploadRaw(bufferIn);
}
}
public CompletableFuture<Void> uploadLater(DireBufferBuilder bufferIn) {
if (!RenderSystem.isOnRenderThread()) {
return CompletableFuture.runAsync(() -> {
this.uploadRaw(bufferIn);
}, (p_227877_0_) -> {
RenderSystem.recordRenderCall(p_227877_0_::run);
});
} else {
this.uploadRaw(bufferIn);
return CompletableFuture.completedFuture((Void) null);
}
}
private void uploadRaw(DireBufferBuilder bufferIn) {
Pair<DireBufferBuilder.DrawState, ByteBuffer> pair = bufferIn.getNextBuffer();
if (this.glBufferId != -1) {
ByteBuffer bytebuffer = pair.getSecond();
this.count = bytebuffer.remaining() / this.vertexFormat.getVertexSize();
this.bindBuffer();
RenderSystem.glBufferData(34962, bytebuffer, 35044);
unbindBuffer();
}
}
public void draw(Matrix4f matrixIn, int modeIn) {
// Render
// RenderSystem.pushMatrix();
// RenderSystem.loadIdentity();
// RenderSystem.multMatrix(matrixIn);
// RenderSystem.drawArrays(modeIn, 0, this.count);
// RenderSystem.popMatrix();
}
public static void unbindBuffer() {
RenderSystem.glBindBuffer(34962, () -> 0);
}
public void close() {
if (this.glBufferId >= 0) {
RenderSystem.glDeleteBuffers(this.glBufferId);
this.glBufferId = -1;
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/EffectBlockTER.java
================================================
package com.direwolf20.buildinggadgets.client.renderer;
import com.direwolf20.buildinggadgets.common.blocks.EffectBlock;
import com.direwolf20.buildinggadgets.common.blocks.OurBlocks;
import com.direwolf20.buildinggadgets.common.tainted.building.BlockData;
import com.direwolf20.buildinggadgets.common.tileentities.EffectBlockTileEntity;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
import net.minecraft.client.renderer.blockentity.BlockEntityRenderer;
import net.minecraft.client.renderer.blockentity.BlockEntityRendererProvider;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraftforge.client.model.data.ModelData;
import org.joml.Matrix4f;
public class EffectBlockTER implements BlockEntityRenderer<EffectBlockTileEntity> {
public EffectBlockTER(BlockEntityRendererProvider.Context p_173540_) {
}
@Override
public void render(EffectBlockTileEntity tile, float partialTicks, PoseStack stack, MultiBufferSource buffer, int combinedLightIn, int combinedOverlayIn) {
BlockData renderData = tile.getRenderedBlock();
if (renderData == null)
return;
VertexConsumer builder;
MultiBufferSource.BufferSource buffer2 = Minecraft.getInstance().renderBuffers().bufferSource();
EffectBlock.Mode toolMode = tile.getReplacementMode();
BlockRenderDispatcher dispatcher = Minecraft.getInstance().getBlockRenderer();
int teCounter = tile.getTicksExisted();
int maxLife = tile.getLifespan();
teCounter = Math.min(teCounter, maxLife);
float scale = (float) (teCounter) / (float) maxLife;
if (scale >= 1.0f)
scale = 0.99f;
if (toolMode == EffectBlock.Mode.REMOVE || toolMode == EffectBlock.Mode.REPLACE)
scale = (float) (maxLife - teCounter) / maxLife;
float trans = (1 - scale) / 2;
stack.pushPose();
stack.translate(trans, trans, trans);
stack.scale(scale, scale, scale);
BlockState renderBlockState = renderData.getState();
if (tile.isUsingPaste() && toolMode == EffectBlock.Mode.PLACE)
renderBlockState = OurBlocks.CONSTRUCTION_DENSE_BLOCK.get().defaultBlockState();
OurRenderTypes.MultiplyAlphaRenderTypeBuffer mutatedBuffer = new OurRenderTypes.MultiplyAlphaRenderTypeBuffer(Minecraft.getInstance().renderBuffers().bufferSource(), .55f);
try {
dispatcher.renderSingleBlock(
renderBlockState, stack, mutatedBuffer, 15728640, OverlayTexture.NO_OVERLAY, ModelData.EMPTY, RenderType.solid()
);
} catch (Exception ignored) {} // if it fails to render then we'll get a bug report I'm sure.
stack.popPose();
stack.pushPose();
builder = buffer.getBuffer(OurRenderTypes.MissingBlockOverlay);
float x = 0,
y = 0,
z = 0,
maxX = 1,
maxY = 1,
maxZ = 1,
red = 0f,
green = 1f,
blue = 1f;
if (toolMode == EffectBlock.Mode.REMOVE || toolMode == EffectBlock.Mode.REPLACE) {
red = 1f;
green = 0.25f;
blue = 0.25f;
}
float alpha = (1f - (scale));
if (alpha < 0.051f)
alpha = 0.051f;
if (alpha > 0.33f)
alpha = 0.33f;
Matrix4f matrix = stack.last().pose();
// Down
if (tile.getLevel().getBlockState(tile.getBlockPos().below()).getBlock() != OurBlocks.EFFECT_BLOCK.get()) {
builder.vertex(matrix, x, y, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, y, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, y, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, y, maxZ).color(red, green, blue, alpha).endVertex();
}
// Up
if (tile.getLevel().getBlockState(tile.getBlockPos().above()).getBlock() != OurBlocks.EFFECT_BLOCK.get()) {
builder.vertex(matrix, x, maxY, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, maxY, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, maxY, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, maxY, z).color(red, green, blue, alpha).endVertex();
}
// North
if (tile.getLevel().getBlockState(tile.getBlockPos().north()).getBlock() != OurBlocks.EFFECT_BLOCK.get()) {
builder.vertex(matrix, x, y, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, maxY, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, maxY, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, y, z).color(red, green, blue, alpha).endVertex();
}
// South
if (tile.getLevel().getBlockState(tile.getBlockPos().south()).getBlock() != OurBlocks.EFFECT_BLOCK.get()) {
builder.vertex(matrix, x, y, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, y, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, maxY, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, maxY, maxZ).color(red, green, blue, alpha).endVertex();
}
// East
if (tile.getLevel().getBlockState(tile.getBlockPos().east()).getBlock() != OurBlocks.EFFECT_BLOCK.get()) {
builder.vertex(matrix, maxX, y, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, maxY, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, maxY, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, maxX, y, maxZ).color(red, green, blue, alpha).endVertex();
}
// West
if (tile.getLevel().getBlockState(tile.getBlockPos().west()).getBlock() != OurBlocks.EFFECT_BLOCK.get()) {
builder.vertex(matrix, x, y, z).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, y, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, maxY, maxZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, x, maxY, z).color(red, green, blue, alpha).endVertex();
}
stack.popPose();
buffer2.endBatch(); // @mcp: draw (yarn) = finish (mcp)
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/MyRenderMethods.java
================================================
package com.direwolf20.buildinggadgets.client.renderer;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.renderer.block.model.BakedQuad;
import java.util.List;
public class MyRenderMethods {
// TODO: Replace with native method
public static void renderModelBrightnessColorQuads(PoseStack.Pose matrixEntry, VertexConsumer builder, float red, float green, float blue, float alpha, List<BakedQuad> listQuads, int combinedLightsIn, int combinedOverlayIn) {
for(BakedQuad bakedquad : listQuads) {
float f;
float f1;
float f2;
if (bakedquad.isTinted()) {
f = red * 1f;
f1 = green * 1f;
f2 = blue * 1f;
} else {
f = 1f;
f1 = 1f;
f2 = 1f;
}
builder.putBulkData(matrixEntry, bakedquad, f, f1, f2, alpha, combinedLightsIn, combinedOverlayIn, true);
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/OurRenderTypes.java
================================================
package com.direwolf20.buildinggadgets.client.renderer;
import com.mojang.blaze3d.vertex.DefaultVertexFormat;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderStateShard;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.Sheets;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.inventory.InventoryMenu;
import org.joml.Matrix3f;
import org.joml.Matrix4f;
import java.util.OptionalDouble;
public class OurRenderTypes extends RenderType {
private static final LineStateShard THICK_LINES = new LineStateShard(OptionalDouble.of(3.0D));
public static final RenderType RenderBlock = create("GadgetRenderBlock",
DefaultVertexFormat.BLOCK, VertexFormat.Mode.QUADS, 256, false, false,
RenderType.CompositeState.builder()
// .setShadeModelState(SMOOTH_SHADE)
.setShaderState(RenderStateShard.BLOCK_SHADER)
.setLightmapState(LIGHTMAP)
.setTextureState(BLOCK_SHEET_MIPPED) //BLOCK_SHEET_MIPPED (mcp) = BLOCK_SHEET_MIPPED (yarn)
.setLayeringState(VIEW_OFFSET_Z_LAYERING) // view_offset_z_layering
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
.setDepthTestState(LEQUAL_DEPTH_TEST)
.setCullState(NO_CULL)
.setWriteMaskState(COLOR_DEPTH_WRITE)
.createCompositeState(false));
public static final RenderType MissingBlockOverlay = create("GadgetMissingBlockOverlay",
DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS, 256, false, false,
RenderType.CompositeState.builder()
.setShaderState(RenderStateShard.POSITION_COLOR_SHADER)
.setLayeringState(VIEW_OFFSET_Z_LAYERING) // view_offset_z_layering
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
.setTextureState(NO_TEXTURE)
.setDepthTestState(LEQUAL_DEPTH_TEST)
.setCullState(NO_CULL)
.setLightmapState(NO_LIGHTMAP)
.setWriteMaskState(COLOR_WRITE)
.createCompositeState(false));
// public static final RenderType.CompositeRenderType LINES =
// create("lines", DefaultVertexFormat.POSITION_COLOR_NORMAL, VertexFormat.Mode.LINES, 256, RenderType.CompositeState.builder()
// .setShaderState(RENDERTYPE_LINES_SHADER)
// .setLineState(new RenderStateShard.LineStateShard(OptionalDouble.empty()))
// .setLayeringState(VIEW_OFFSET_Z_LAYERING)
// .setTransparencyState(TRANSLUCENT_TRANSPARENCY)
// .setOutputState(ITEM_ENTITY_TARGET)
// .setWriteMaskState(COLOR_DEPTH_WRITE)
// .setCullState(NO_CULL)
// .createCompositeState(false));
public static final RenderType CopyGadgetLines = create("GadgetCopyLines",
DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.LINES, 256, false, false,
RenderType.CompositeState.builder()
.setShaderState(RENDERTYPE_LINES_SHADER)
.setLineState(new LineStateShard(OptionalDouble.of(2.0D)))
.setLayeringState(VIEW_OFFSET_Z_LAYERING)
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
.setOutputState(ITEM_ENTITY_TARGET)
.setCullState(NO_CULL)
.setWriteMaskState(COLOR_DEPTH_WRITE)
.createCompositeState(false));
public static final RenderType CopyPasteRenderBlock = create("CopyPasteRenderBlock",
DefaultVertexFormat.BLOCK, VertexFormat.Mode.QUADS, 256, false, false,
RenderType.CompositeState.builder()
.setShaderState(RenderStateShard.BLOCK_SHADER)
// .setShadeModelState(SMOOTH_SHADE)
.setLightmapState(LIGHTMAP)
.setTextureState(BLOCK_SHEET_MIPPED) //BLOCK_SHEET_MIPPED (mcp) = BLOCK_SHEET_MIPPED (yarn)
.setLayeringState(VIEW_OFFSET_Z_LAYERING) // view_offset_z_layering
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
.setDepthTestState(LEQUAL_DEPTH_TEST)
.setCullState(NO_CULL)
.setWriteMaskState(COLOR_WRITE)
.createCompositeState(false));
public static final RenderType BlockOverlay = create("BGBlockOverlay",
DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.QUADS, 256, false, false,
RenderType.CompositeState.builder()
.setShaderState(RenderStateShard.RENDERTYPE_SOLID_SHADER)
.setLayeringState(VIEW_OFFSET_Z_LAYERING) // view_offset_z_layering
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
.setTextureState(NO_TEXTURE)
.setDepthTestState(LEQUAL_DEPTH_TEST)
.setCullState(CULL)
.setLightmapState(NO_LIGHTMAP)
.setWriteMaskState(COLOR_DEPTH_WRITE)
.createCompositeState(false));
public static final RenderType TRIANGLE_STRIP =
create("triangle_strip", DefaultVertexFormat.POSITION_COLOR, VertexFormat.Mode.TRIANGLE_STRIP, 256, false, false,
RenderType.CompositeState.builder()
.setShaderState(RenderStateShard.POSITION_COLOR_SHADER)
.setTextureState(NO_TEXTURE)
.setTransparencyState(TRANSLUCENT_TRANSPARENCY)
.setCullState(NO_CULL)
.setLightmapState(NO_LIGHTMAP)
.createCompositeState(false));
public OurRenderTypes(String p_173178_, VertexFormat p_173179_, VertexFormat.Mode p_173180_, int p_173181_, boolean p_173182_, boolean p_173183_, Runnable p_173184_, Runnable p_173185_) {
super(p_173178_, p_173179_, p_173180_, p_173181_, p_173182_, p_173183_, p_173184_, p_173185_);
}
/**
* This is used for rendering blocks with an alpha value as the alpha currently isn't
* supported by minecraft.
* <p>
* Literally just raps the buffer so we can render a different RenderType
*/
public static class MultiplyAlphaRenderTypeBuffer implements MultiBufferSource {
private final MultiBufferSource inner;
private final float constantAlpha;
public MultiplyAlphaRenderTypeBuffer(MultiBufferSource inner, float constantAlpha) {
this.inner = inner;
this.constantAlpha = constantAlpha;
}
@Override
public VertexConsumer getBuffer(RenderType type) {
RenderType localType = type;
if (localType instanceof CompositeRenderType) {
// all of this requires a lot of AT's so be aware of that on ports
ResourceLocation texture = ((TextureStateShard) ((CompositeRenderType) localType).state.textureState).texture
.orElse(InventoryMenu.BLOCK_ATLAS);
localType = entityTranslucentCull(texture);
} else if (localType.toString().equals(Sheets.translucentCullBlockSheet().toString())) {
localType = Sheets.translucentCullBlockSheet();
}
return new MultiplyAlphaVertexBuilder(this.inner.getBuffer(localType), this.constantAlpha);
}
/**
* Required for modifying the alpha value.
*/
public static class MultiplyAlphaVertexBuilder implements VertexConsumer {
private final VertexConsumer inner;
private final float constantAlpha;
public MultiplyAlphaVertexBuilder(VertexConsumer inner, float constantAlpha) {
this.inner = inner;
this.constantAlpha = constantAlpha;
}
@Override
public VertexConsumer vertex(double x, double y, double z) {
return inner.vertex(x, y, z);
}
@Override
public VertexConsumer vertex(Matrix4f matrixIn, float x, float y, float z) {
return inner.vertex(matrixIn, x, y, z);
}
@Override
public VertexConsumer color(int red, int green, int blue, int alpha) {
return inner.color(red, green, blue, (int) (alpha * constantAlpha));
}
@Override
public VertexConsumer uv(float u, float v) {
return inner.uv(u, v);
}
@Override
public VertexConsumer overlayCoords(int u, int v) {
return inner.overlayCoords(u, v);
}
@Override
public VertexConsumer uv2(int u, int v) {
return inner.uv2(u, v);
}
@Override
public VertexConsumer normal(float x, float y, float z) {
return inner.normal(x, y, z);
}
@Override
public VertexConsumer normal(Matrix3f matrixIn, float x, float y, float z) {
return inner.normal(matrixIn, x, y, z);
}
@Override
public void endVertex() {
this.inner.endVertex();
}
@Override
public void defaultColor(int p_166901_, int p_166902_, int p_166903_, int p_166904_) {
inner.defaultColor(p_166901_, p_166902_, p_166903_, p_166904_);
}
@Override
public void unsetDefaultColor() {
inner.unsetDefaultColor();
}
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/package-info.java
================================================
@ParametersAreNonnullByDefault
@MethodsReturnNonnullByDefault
package com.direwolf20.buildinggadgets.client.renderer;
import net.minecraft.MethodsReturnNonnullByDefault;
import javax.annotation.ParametersAreNonnullByDefault;
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/BaseRenderer.java
================================================
package com.direwolf20.buildinggadgets.client.renders;
import com.direwolf20.buildinggadgets.client.cache.RemoteInventoryCache;
import com.direwolf20.buildinggadgets.client.renderer.OurRenderTypes;
import com.direwolf20.buildinggadgets.common.tainted.inventory.InventoryLinker;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects.UniqueItem;
import com.direwolf20.buildinggadgets.common.world.MockBuilderWorld;
import com.direwolf20.buildinggadgets.common.world.MockTileEntityRenderWorld;
import com.google.common.collect.Multiset;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.core.BlockPos;
import net.minecraft.resources.ResourceKey;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.inventory.InventoryMenu;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.level.block.Blocks;
import net.minecraft.world.level.block.entity.BlockEntity;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.client.event.RenderLevelStageEvent;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.energy.IEnergyStorage;
import org.apache.commons.lang3.tuple.Pair;
import org.joml.Matrix4f;
import java.util.HashSet;
import java.util.Set;
public abstract class BaseRenderer {
public static final BlockState AIR = Blocks.AIR.defaultBlockState();
private static final MockTileEntityRenderWorld tileEntityWorld = new MockTileEntityRenderWorld();
private static final MockBuilderWorld builderWorld = new MockBuilderWorld();
private static final Set<BlockEntity> invalidTileEntities = new HashSet<>();
private static final RemoteInventoryCache cacheInventory = new RemoteInventoryCache(false);
public void render(RenderLevelStageEvent evt, Player player, ItemStack heldItem) {
// FIXME: might be wrong
if (evt.getStage() != RenderLevelStageEvent.Stage.AFTER_TRANSLUCENT_BLOCKS) {
return;
}
// This is necessary to prevent issues with not rendering the overlay's at all (when Botania being present) - See #329 for more information
bindBlocks();
if( this.isLinkable() )
BaseRenderer.renderLinkedInventoryOutline(evt, heldItem, player);
}
private void bindBlocks() {
RenderSystem.setShaderTexture(0, InventoryMenu.BLOCK_ATLAS);
}
private static void renderLinkedInventoryOutline(RenderLevelStageEvent evt, ItemStack item, Player player) {
Pair<BlockPos, ResourceKey<Level>> dataFromStack = InventoryLinker.getDataFromStack(item);
if (dataFromStack == null) {
return;
}
if (!player.level.dimension().equals(dataFromStack.getValue())) {
return;
}
BlockPos pos = dataFromStack.getKey();
Vec3 renderPos = getMc().gameRenderer.getMainCamera().getPosition()
.subtract(pos.getX(), pos.getY(), pos.getZ())
.add(.005f, .005f, .005f);
MultiBufferSource.BufferSource buffer = Minecraft.getInstance().renderBuffers().bufferSource();
PoseStack stack = evt.getPoseStack();
stack.pushPose();
stack.translate(-renderPos.x(), -renderPos.y(), -renderPos.z());
stack.scale(1.01f, 1.01f, 1.01f);
renderBoxSolid(stack.last().pose(), buffer.getBuffer(OurRenderTypes.BlockOverlay), BlockPos.ZERO, 0, 1, 0, .35f);
stack.popPose();
RenderSystem.disableDepthTest();
buffer.endBatch(); // @mcp: finish (mcp) = draw (yarn)
}
int getEnergy(Player player, ItemStack heldItem) {
LazyOptional<IEnergyStorage> energy = heldItem.getCapability(ForgeCapabilities.ENERGY);
if (player.isCreative() || !energy.isPresent())
return Integer.MAX_VALUE;
return energy.map(IEnergyStorage::getEnergyStored).orElse(0);
}
protected static void renderMissingBlock(Matrix4f matrix, VertexConsumer builder, BlockPos pos) {
renderBoxSolid(matrix, builder, pos, 1f, 0f, 0f, 0.35f);
}
protected static void renderBoxSolid(Matrix4f matrix, VertexConsumer builder, BlockPos pos, float r, float g, float b, float alpha) {
double x = pos.getX() - 0.001;
double y = pos.getY() - 0.001;
double z = pos.getZ() - 0.001;
double xEnd = pos.getX() + 1.0015;
double yEnd = pos.getY() + 1.0015;
double zEnd = pos.getZ() + 1.0015;
renderBoxSolid(matrix, builder, x, y, z, xEnd, yEnd, zEnd, r, g, b, alpha);
}
protected static void renderBoxSolid(Matrix4f matrix, VertexConsumer builder, double x, double y, double z, double xEnd, double yEnd, double zEnd, float red, float green, float blue, float alpha) {
//careful: mc want's it's vertices to be defined CCW - if you do it the other way around weird cullling issues will arise
//CCW herby counts as if you were looking at it from the outside
float startX = (float) x;
float startY = (float) y;
float startZ = (float) z;
float endX = (float) xEnd;
float endY = (float) yEnd;
float endZ = (float) zEnd;
// float startX = 0, startY = 0, startZ = -1, endX = 1, endY = 1, endZ = 0;
//down
builder.vertex(matrix, startX, startY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, startY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, startY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, startY, endZ).color(red, green, blue, alpha).endVertex();
//up
builder.vertex(matrix, startX, endY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, endY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, endY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, endY, startZ).color(red, green, blue, alpha).endVertex();
//east
builder.vertex(matrix, startX, startY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, endY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, endY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, startY, startZ).color(red, green, blue, alpha).endVertex();
//west
builder.vertex(matrix, startX, startY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, startY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, endY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, endY, endZ).color(red, green, blue, alpha).endVertex();
//south
builder.vertex(matrix, endX, startY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, endY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, endY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, endX, startY, endZ).color(red, green, blue, alpha).endVertex();
//north
builder.vertex(matrix, startX, startY, startZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, startY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, endY, endZ).color(red, green, blue, alpha).endVertex();
builder.vertex(matrix, startX, endY, startZ).color(red, green, blue, alpha).endVertex();
}
/**
* Can the gadget be linked to other inventories?
*/
public boolean isLinkable() {
return false;
}
static Minecraft getMc() {
return Minecraft.getInstance();
}
static MockBuilderWorld getBuilderWorld() {
return builderWorld;
}
static RemoteInventoryCache getCacheInventory() {
return cacheInventory;
}
public static void setInventoryCache(Multiset<UniqueItem> cache) {
BaseRenderer.cacheInventory.setCache(cache);
}
public static void updateInventoryCache() {
cacheInventory.forceUpdate();
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/BuildRender.java
================================================
package com.direwolf20.buildinggadgets.client.renders;
import com.direwolf20.buildinggadgets.client.renderer.OurRenderTypes;
import com.direwolf20.buildinggadgets.common.blocks.OurBlocks;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.items.GadgetBuilding;
import com.direwolf20.buildinggadgets.common.items.GadgetExchanger;
import com.direwolf20.buildinggadgets.common.items.modes.AbstractMode;
import com.direwolf20.buildinggadgets.common.tainted.building.BlockData;
import com.direwolf20.buildinggadgets.common.tainted.building.view.BuildContext;
import com.direwolf20.buildinggadgets.common.tainted.inventory.IItemIndex;
import com.direwolf20.buildinggadgets.common.tainted.inventory.InventoryHelper;
import com.direwolf20.buildinggadgets.common.tainted.inventory.MatchResult;
import com.direwolf20.buildinggadgets.common.tainted.inventory.RecordingItemIndex;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.MaterialList;
import com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects.UniqueItem;
import com.direwolf20.buildinggadgets.common.util.helpers.VectorHelper;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.client.renderer.block.BlockRenderDispatcher;
import net.minecraft.client.renderer.texture.OverlayTexture;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.block.state.BlockState;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.client.event.RenderLevelStageEvent;
import net.minecraftforge.client.model.data.ModelData;
import net.minecraftforge.common.capabilities.ForgeCapabilities;
import net.minecraftforge.common.util.LazyOptional;
import net.minecraftforge.energy.IEnergyStorage;
import java.util.List;
import java.util.Optional;
import static com.direwolf20.buildinggadgets.common.util.GadgetUtils.getAnchor;
import static com.direwolf20.buildinggadgets.common.util.GadgetUtils.getToolBlock;
public class BuildRender extends BaseRenderer {
private final boolean isExchanger;
private static final BlockState DEFAULT_EFFECT_BLOCK = OurBlocks.EFFECT_BLOCK.get().defaultBlockState();
public BuildRender(boolean isExchanger) {
this.isExchanger = isExchanger;
}
@Override
public void render(RenderLevelStageEvent evt, Player player, ItemStack heldItem) {
super.render(evt, player, heldItem);
BlockHitResult lookingAt = VectorHelper.getLookingAt(player, heldItem);
BlockState state = AIR;
Optional<List<BlockPos>> anchor = getAnchor(heldItem);
BlockState startBlock = player.level.getBlockState(lookingAt.getBlockPos());
if( (player.level.isEmptyBlock(lookingAt.getBlockPos()) && !anchor.isPresent()) || startBlock == DEFAULT_EFFECT_BLOCK )
return;
BlockData data = getToolBlock(heldItem);
BlockState renderBlockState = data.getState();
if (renderBlockState == BaseRenderer.AIR)
return;
// Get the coordinates from the anchor. If the anchor isn't present then build the collector.
List<BlockPos> coordinates = anchor.orElseGet(() -> {
AbstractMode mode = !this.isExchanger ? GadgetBuilding.getToolMode(heldItem).getMode() : GadgetExchanger.getToolMode(heldItem).getMode();
return mode.getCollection(
new AbstractMode.UseContext(player.level, player, renderBlockState, lookingAt.getBlockPos(), heldItem, lookingAt.getDirection(), !this.isExchanger && GadgetBuilding.shouldPlaceAtop(heldItem), !this.isExchanger ? GadgetBuilding.getConnectedArea(heldItem) : GadgetExchanger.getConnectedArea(heldItem)),
player
);
});
// Sort them on a new line for readability
// coordinates = SortingHelper.Blocks.byDistance(coordinates, player);
//Prepare the fake world -- using a fake world lets us render things properly, like fences connecting.
getBuilderWorld().setWorldAndState(player.level, renderBlockState, coordinates);
Vec3 playerPos = getMc().gameRenderer.getMainCamera().getPosition();
MultiBufferSource.BufferSource buffer = Minecraft.getInstance().renderBuffers().bufferSource();
//Save the current position that is being rendered (I think)
PoseStack matrix = evt.getPoseStack();
matrix.pushPose();
matrix.translate(-playerPos.x(), -playerPos.y(), -playerPos.z());
BlockRenderDispatcher dispatcher = getMc().getBlockRenderer();
for (BlockPos coordinate : coordinates) {
matrix.pushPose();
matrix.translate(coordinate.getX(), coordinate.getY(), coordinate.getZ());
if( this.isExchanger ) {
matrix.translate(-0.0005f, -0.0005f, -0.0005f);
matrix.scale(1.001f, 1.001f, 1.001f);
}
// todo: add back from 1.16 port
// if (getBuilderWorld().getWorldType() != WorldType.DEBUG_ALL_BLOCK_STATES) { //Get the block state in the fake world
// try {
state = renderBlockState;
// } catch (Exception ignored) {}
// }
OurRenderTypes.MultiplyAlphaRenderTypeBuffer mutatedBuffer = new OurRenderTypes.MultiplyAlphaRenderTypeBuffer(Minecraft.getInstance().renderBuffers().bufferSource(), .55f);
try {
dispatcher.renderSingleBlock(
state, matrix, mutatedBuffer, 15728640, OverlayTexture.NO_OVERLAY, ModelData.EMPTY, RenderType.solid()
);
} catch (Exception ignored) {} // I'm sure if this is an issue someone will report it
//Move the render position back to where it was
matrix.popPose();
RenderSystem.disableDepthTest();
buffer.endBatch(); // @mcp: finish (mcp) = draw (yarn)
}
// Don't even waste the time checking to see if we have the right energy, items, etc for creative mode
if (!player.isCreative()) {
VertexConsumer builder;
boolean hasLinkedInventory = getCacheInventory().maintainCache(heldItem);
int remainingCached = getCacheInventory().getCache() == null ? -1 : getCacheInventory().getCache().count(new UniqueItem(data.getState().getBlock().asItem()));
// Figure out how many of the block we're rendering we have in the inventory of the player.
IItemIndex index = new RecordingItemIndex(InventoryHelper.index(heldItem, player));
BuildContext context = new BuildContext(player.level, player, heldItem);
MaterialList materials = data.getRequiredItems(context, null, null);
int hasEnergy = getEnergy(player, heldItem);
LazyOptional<IEnergyStorage> energyCap = heldItem.getCapability(ForgeCapabilities.ENERGY);
for (BlockPos coordinate : coordinates) { //Now run through the UNSORTED list of coords, to show which blocks won't place if you don't have enough of them.
boolean renderFree = false;
if (energyCap.isPresent())
hasEnergy -= ((AbstractGadget) heldItem.getItem()).getEnergyCost(heldItem);
builder = buffer.getBuffer(OurRenderTypes.MissingBlockOverlay);
MatchResult match = index.tryMatch(materials);
if (!match.isSuccess())
match = index.tryMatch(InventoryHelper.PASTE_LIST);
if (!match.isSuccess() || hasEnergy < 0) {
if (hasLinkedInventory && remainingCached > 0) {
renderFree = true;
remainingCached --;
} else {
renderMissingBlock(matrix.last().pose(), builder, coordinate);
}
} else {
index.applyMatch(match); //notify the recording index that this counts
renderBoxSolid(matrix.last().pose(), builder, coordinate, .97f, 1f, .99f, .1f);
}
if (renderFree) {
renderBoxSolid(matrix.last().pose(), builder, coordinate, .97f, 1f, .99f, .1f);
}
}
}
matrix.popPose();
RenderSystem.disableDepthTest();
buffer.endBatch(); // @mcp: finish (mcp) = draw (yarn)
}
@Override
public boolean isLinkable() {
return true;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/CopyPasteRender.java
================================================
package com.direwolf20.buildinggadgets.client.renders;
import com.direwolf20.buildinggadgets.client.renderer.DireBufferBuilder;
import com.direwolf20.buildinggadgets.client.renderer.DireVertexBuffer;
import com.direwolf20.buildinggadgets.client.renderer.OurRenderTypes;
import com.direwolf20.buildinggadgets.common.capability.CapabilityTemplate;
import com.direwolf20.buildinggadgets.common.items.GadgetCopyPaste;
import com.direwolf20.buildinggadgets.common.tainted.building.PlacementTarget;
import com.direwolf20.buildinggadgets.common.tainted.building.Region;
import com.direwolf20.buildinggadgets.common.tainted.building.view.BuildContext;
import com.direwolf20.buildinggadgets.common.tainted.building.view.IBuildView;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateKey;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateProvider;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateProvider.IUpdateListener;
import com.direwolf20.buildinggadgets.common.tainted.template.Template;
import com.direwolf20.buildinggadgets.common.world.MockDelegationWorld;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.Maps;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import com.mojang.blaze3d.vertex.VertexFormat;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.core.BlockPos;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.client.event.RenderLevelStageEvent;
import org.joml.Matrix3f;
import org.joml.Matrix4f;
import java.io.Closeable;
import java.util.*;
import java.util.function.Consumer;
public class CopyPasteRender extends BaseRenderer implements IUpdateListener {
private MultiVBORenderer renderBuffer;
private int tickTrack = 0;
private UUID lastRendered = null;
@Override
public void onTemplateUpdate(ITemplateProvider provider, ITemplateKey key, Template template) {
if (provider.getId(key).equals(lastRendered))
renderBuffer = null;
}
@Override
public void onTemplateUpdateSend(ITemplateProvider provider, ITemplateKey key, Template template) {
onTemplateUpdate(provider, key, template);
}
@Override
public void render(RenderLevelStageEvent evt, Player player, ItemStack heldItem) {
// We can completely trust that heldItem isn't empty and that it's a copy paste gadget.
super.render(evt, player, heldItem);
// Provide this as both renders require the data.
Vec3 cameraView = getMc().gameRenderer.getMainCamera().getPosition();
// translate the matric to the projected view
PoseStack stack = evt.getPoseStack(); //Get current matrix position from the evt call
stack.pushPose(); //Save the render position from RenderWorldLast
stack.translate(-cameraView.x(), -cameraView.y(), -cameraView.z()); //Sets render position to 0,0,0
if (GadgetCopyPaste.getToolMode(heldItem) == GadgetCopyPaste.ToolMode.COPY) {
renderBuffer = null; //fix the surroundings not being taken into account when you've walked around a bit
GadgetCopyPaste.getSelectedRegion(heldItem).ifPresent(region ->
renderCopy(stack, region));
} else
renderPaste(stack, cameraView, player, heldItem);
stack.popPose();
}
private void renderCopy(PoseStack matrix, Region region) {
BlockPos startPos = region.getMin();
BlockPos endPos = region.getMax();
BlockPos blankPos = new BlockPos(0, 0, 0);
if (startPos.equals(blankPos) || endPos.equals(blankPos))
return;
//We want to draw from the starting position to the (ending position)+1
int x = Math.min(startPos.getX(), endPos.getX()), y = Math.min(startPos.getY(), endPos.getY()), z = Math.min(startPos.getZ(), endPos.getZ());
int dx = (startPos.getX() > endPos.getX()) ? startPos.getX() + 1 : endPos.getX() + 1;
int dy = (startPos.getY() > endPos.getY()) ? startPos.getY() + 1 : endPos.getY() + 1;
int dz = (startPos.getZ() > endPos.getZ()) ? startPos.getZ() + 1 : endPos.getZ() + 1;
MultiBufferSource.BufferSource buffer = Minecraft.getInstance().renderBuffers().bufferSource();
VertexConsumer builder = buffer.getBuffer(OurRenderTypes.lines());
matrix.pushPose();
Matrix4f matrix4f = matrix.last().pose();
Matrix3f matrix3f = matrix.last().normal();
builder.vertex(matrix4f, x, y, z).color(0F, 0F, 1F, 1.0F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, z).color(0F, 0F, 1F, 1.0F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, dy, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, x, y, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, dx, y, z).color(0F, 1F, 0F, 1.0F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, z).color(0F, 1F, 0F, 1.0F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, -1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, dy, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, -1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, dy, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, x, dy, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, x, dy, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, -1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, -1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, dz).color(1F, 0F, 0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, -1.0F).endVertex();
builder.vertex(matrix4f, dx, y, z).color(1F, 0F, 0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, -1.0F).endVertex();
builder.vertex(matrix4f, x, dy, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, z).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, dx, dy, dz).color(1.0F, 1.0F, 1.0F, 1.0F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
buffer.endBatch(); // @mcp: draw = finish
matrix.popPose();
}
private void renderPaste(PoseStack matrices, Vec3 cameraView, Player player, ItemStack heldItem) {
Level world = player.level;
// Check the template cap from the world
// Fetch the template key (because for some reason this is it's own cap)
world.getCapability(CapabilityTemplate.TEMPLATE_PROVIDER_CAPABILITY).ifPresent(provider -> heldItem.getCapability(CapabilityTemplate.TEMPLATE_KEY_CAPABILITY).ifPresent(key -> {
// Finally get the data from the render.
GadgetCopyPaste.getActivePos(player, heldItem).ifPresent(startPos -> {
MockDelegationWorld fakeWorld = new MockDelegationWorld(world);
BuildContext context = BuildContext.builder().player(player).stack(heldItem).build(fakeWorld);
// Get the template and move it to the start pos (player.pick())
IBuildView view = provider.getTemplateForKey(key).createViewInContext(context);
// Sort the render
List<PlacementTarget> targets = new ArrayList<>(view.estimateSize());
for (PlacementTarget target : view) {
if (target.placeIn(context)) {
targets.add(target);
}
}
UUID id = provider.getId(key);
if (! id.equals(lastRendered))
renderBuffer = null;
renderTargets(matrices, cameraView, context, targets, startPos, view);
lastRendered = id;
});
}));
}
private void renderTargets(PoseStack matrix, Vec3 projectedView, BuildContext context, List<PlacementTarget> targets, BlockPos startPos, IBuildView view) {
MultiBufferSource.BufferSource buffer = Minecraft.getInstance().renderBuffers().bufferSource();
VertexConsumer builder = buffer.getBuffer(OurRenderTypes.lines());
matrix.pushPose();
Matrix4f matrix4f = matrix.last().pose();
Matrix3f matrix3f = matrix.last().normal();
Region bb = view.getBoundingBox().translate(startPos.getX(), startPos.getY(), startPos.getZ());
float x = bb.getMinX(), y = bb.getMinY(), z = bb.getMinZ(),
dx = bb.getMaxX() + 1, dy = bb.getMaxY() + 1, dz = bb.getMaxZ() + 1;
builder.vertex(matrix4f, x, y, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, dy, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, x, y, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, dx, y, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, z).color(1F, 1F, 1F, 1F).normal(matrix3f, -1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, dy, z).color(1F, 1F, 1F, 1F).normal(matrix3f, -1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, dy, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, x, dy, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, x, dy, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, -1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, -1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, x, y, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, -1.0F).endVertex();
builder.vertex(matrix4f, dx, y, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, -1.0F).endVertex();
builder.vertex(matrix4f, x, dy, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 1.0F, 0.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, y, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 1.0F, 0.0F).endVertex();
builder.vertex(matrix4f, dx, dy, z).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
builder.vertex(matrix4f, dx, dy, dz).color(1F, 1F, 1F, 1F).normal(matrix3f, 0.0F, 0.0F, 1.0F).endVertex();
buffer.endBatch(); // @mcp: draw = finish
matrix.popPose();
// TODO: fix me plz
// tickTrack++;
// if (renderBuffer != null && tickTrack < 300) {
// if (tickTrack % 30 == 0) {
// try {
// Vec3 projectedView2 = projectedView;
// Vec3 startPosView = new Vec3(startPos.getX(), startPos.getY(), startPos.getZ());
// projectedView2 = projectedView2.subtract(startPosView);
// renderBuffer.sort((float) projectedView2.x(), (float) projectedView2.y(), (float) projectedView2.z());
// } catch (Exception ignored) {
// }
// }
//
// matrix.translate(startPos.getX(), startPos.getY(), startPos.getZ());
// renderBuffer.render(matrix.last().pose()); //Actually draw whats in the buffer
// return;
// }
//
//// List<BlockPos> blockPosList = sorter.getSortedTargets().stream().map(PlacementTarget::getPos).collect(Collectors.toList());
//
// tickTrack = 0;
// if (renderBuffer != null) //Reset Render Buffer before rebuilding
// renderBuffer.close();
//
// renderBuffer = MultiVBORenderer.of((buffer) -> {
// VertexConsumer builder = buffer.getBuffer(OurRenderTypes.RenderBlock);
// VertexConsumer noDepthbuilder = buffer.getBuffer(OurRenderTypes.CopyPasteRenderBlock);
//
// BlockRenderDispatcher dispatcher = getMc().getBlockRenderer();
//
// PoseStack stack = new PoseStack(); //Create a new matrix stack for use in the buffer building process
// stack.pushPose(); //Save position
//
// for (PlacementTarget target : targets) {
// BlockPos targetPos = target.getPos();
// BlockState state = context.getWorld().getBlockState(target.getPos());
//
// stack.pushPose(); //Save position again
// //matrix.translate(-startPos.getX(), -startPos.getY(), -startPos.getZ());
// stack.translate(targetPos.getX(), targetPos.getY(), targetPos.getZ());
//
// BakedModel ibakedmodel = dispatcher.getBlockModel(state);
// BlockColors blockColors = Minecraft.getInstance().getBlockColors();
// int color = blockColors.getColor(state, context.getWorld(), targetPos, 0);
//
// float f = (float) (color >> 16 & 255) / 255.0F;
// float f1 = (float) (color >> 8 & 255) / 255.0F;
// float f2 = (float) (color & 255) / 255.0F;
// try {
// if (state.getRenderShape() == RenderShape.MODEL) {
// for (Direction direction : Direction.values()) {
// // TODO: likely broken this
// if (Block.shouldRenderFace(state, context.getWorld(), targetPos, direction, target.getPos()) && !(context.getWorld().getBlockState(targetPos.relative(direction)).getBlock().equals(state.getBlock()))) {
// if (state.getMaterial().isSolidBlocking()) {
// renderModelBrightnessColorQuads(stack.last(), builder, f, f1, f2, 0.7f, ibakedmodel.getQuads(state, direction, new Random(Mth.getSeed(targetPos)), EmptyModelData.INSTANCE), 15728640, 655360);
// } else {
// renderModelBrightnessColorQuads(stack.last(), noDepthbuilder, f, f1, f2, 0.7f, ibakedmodel.getQuads(state, direction, new Random(Mth.getSeed(targetPos)), EmptyModelData.INSTANCE), 15728640, 655360);
// }
// }
// }
// if (state.getMaterial().isSolidBlocking())
// renderModelBrightnessColorQuads(stack.last(), builder, f, f1, f2, 0.7f, ibakedmodel.getQuads(state, null, new Random(Mth.getSeed(targetPos)), EmptyModelData.INSTANCE), 15728640, 655360);
// else
// renderModelBrightnessColorQuads(stack.last(), noDepthbuilder, f, f1, f2, 0.7f, ibakedmodel.getQuads(state, null, new Random(Mth.getSeed(targetPos)), EmptyModelData.INSTANCE), 15728640, 655360);
// }
// } catch (Exception e) {
// BuildingGadgets.LOG.trace("Caught exception whilst rendering {}.", state, e);
// }
//
// stack.popPose(); // Load the position we saved earlier
// }
// stack.popPose(); //Load after loop
// });
//// try {
// Vec3 projectedView2 = getMc().gameRenderer.getMainCamera().getPosition();
// Vec3 startPosView = new Vec3(startPos.getX(), startPos.getY(), startPos.getZ());
// projectedView2 = projectedView2.subtract(startPosView);
// renderBuffer.sort((float) projectedView2.x(), (float) projectedView2.y(), (float) projectedView2.z());
//// } catch (Exception ignored) {
//// }
// matrix.translate(startPos.getX(), startPos.getY(), startPos.getZ());
// renderBuffer.render(matrix.last().pose()); //Actually draw whats in the buffer
}
@Override
public boolean isLinkable() {
return true;
}
/**
* Vertex Buffer Object for caching the render. Pretty similar to how the chunk caching works
*/
public static class MultiVBORenderer implements Closeable {
private static final int BUFFER_SIZE = 2 * 1024 * 1024 * 3;
public static MultiVBORenderer of(Consumer<MultiBufferSource> vertexProducer) {
final Map<RenderType, DireBufferBuilder> builders = Maps.newHashMap();
vertexProducer.accept(rt -> builders.computeIfAbsent(rt, (_rt) -> {
DireBufferBuilder builder = new DireBufferBuilder(BUFFER_SIZE);
builder.begin(_rt.mode().asGLMode, _rt.format());
return builder;
}));
Map<RenderType, DireBufferBuilder.State> sortCaches = Maps.newHashMap();
Map<RenderType, DireVertexBuffer> buffers = Maps.transformEntries(builders, (rt, builder) -> {
Objects.requireNonNull(rt);
Objects.requireNonNull(builder);
sortCaches.put(rt, builder.getVertexState());
builder.finishDrawing();
VertexFormat fmt = rt.format();
DireVertexBuffer vbo = new DireVertexBuffer(fmt);
vbo.upload(builder);
return vbo;
});
return new MultiVBORenderer(buffers, sortCaches);
}
private final ImmutableMap<RenderType, DireVertexBuffer> buffers;
private final ImmutableMap<RenderType, DireBufferBuilder.State> sortCaches;
protected MultiVBORenderer(Map<RenderType, DireVertexBuffer> buffers, Map<RenderType, DireBufferBuilder.State> sortCaches) {
this.buffers = ImmutableMap.copyOf(buffers);
this.sortCaches = ImmutableMap.copyOf(sortCaches);
}
public void sort(float x, float y, float z) {
for (Map.Entry<RenderType, DireBufferBuilder.State> kv : sortCaches.entrySet()) {
RenderType rt = kv.getKey();
DireBufferBuilder.State state = kv.getValue();
DireBufferBuilder builder = new DireBufferBuilder(BUFFER_SIZE);
builder.begin(rt.mode().asGLMode, rt.format());
builder.setVertexState(state);
builder.sortVertexData(x, y, z);
builder.finishDrawing();
DireVertexBuffer vbo = buffers.get(rt);
vbo.upload(builder);
}
}
public void render(Matrix4f matrix) {
buffers.forEach((rt, vbo) -> {
VertexFormat fmt = rt.format();
rt.setupRenderState();
vbo.bindBuffer();
fmt.setupBufferState();
vbo.draw(matrix, rt.mode().asGLMode);
DireVertexBuffer.unbindBuffer();
fmt.clearBufferState();
rt.clearRenderState();
});
}
public void close() {
buffers.values().forEach(DireVertexBuffer::close);
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/DestructionRender.java
================================================
package com.direwolf20.buildinggadgets.client.renders;
import com.direwolf20.buildinggadgets.client.renderer.OurRenderTypes;
import com.direwolf20.buildinggadgets.common.blocks.OurBlocks;
import com.direwolf20.buildinggadgets.common.items.AbstractGadget;
import com.direwolf20.buildinggadgets.common.items.GadgetDestruction;
import com.direwolf20.buildinggadgets.common.util.helpers.VectorHelper;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.Minecraft;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.core.BlockPos;
import net.minecraft.core.Direction;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.level.Level;
import net.minecraft.world.phys.BlockHitResult;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.client.event.RenderLevelStageEvent;
public class DestructionRender extends BaseRenderer {
@Override
public void render(RenderLevelStageEvent evt, Player player, ItemStack heldItem) {
if (!GadgetDestruction.getOverlay(heldItem))
return;
BlockHitResult lookingAt = VectorHelper.getLookingAt(player, heldItem);
Level world = player.level;
BlockPos anchor = ((AbstractGadget) heldItem.getItem()).getAnchor(heldItem);
if (world.getBlockState(VectorHelper.getLookingAt(player, heldItem).getBlockPos()) == AIR && anchor == null)
return;
BlockPos startBlock = (anchor == null) ? lookingAt.getBlockPos() : anchor;
Direction facing = (GadgetDestruction.getAnchorSide(heldItem) == null) ? lookingAt.getDirection() : GadgetDestruction.getAnchorSide(heldItem);
if (world.getBlockState(startBlock) == OurBlocks.EFFECT_BLOCK.get().defaultBlockState())
return;
Vec3 playerPos = getMc().gameRenderer.getMainCamera().getPosition();
PoseStack stack = evt.getPoseStack();
stack.pushPose();
stack.translate(-playerPos.x(), -playerPos.y(), -playerPos.z());
MultiBufferSource.BufferSource buffer = Minecraft.getInstance().renderBuffers().bufferSource();
VertexConsumer builder = buffer.getBuffer(OurRenderTypes.MissingBlockOverlay);
GadgetDestruction.getArea(world, startBlock, facing, player, heldItem)
.forEach(pos -> renderMissingBlock(stack.last().pose(), builder, pos));
stack.popPose();
RenderSystem.disableDepthTest();
buffer.endBatch(); // @mcp: draw = finish
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/CopyGUI.java
================================================
package com.direwolf20.buildinggadgets.client.screen;
import com.direwolf20.buildinggadgets.client.screen.widgets.GuiIncrementer;
import com.direwolf20.buildinggadgets.common.config.Config;
import com.direwolf20.buildinggadgets.common.items.GadgetCopyPaste;
import com.direwolf20.buildinggadgets.common.network.PacketHandler;
import com.direwolf20.buildinggadgets.common.network.packets.PacketCopyCoords;
import com.direwolf20.buildinggadgets.common.tainted.building.Region;
import com.direwolf20.buildinggadgets.common.util.lang.GuiTranslation;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.AbstractButton;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.resources.language.I18n;
import net.minecraft.core.BlockPos;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import java.util.ArrayList;
import java.util.List;
public class CopyGUI extends Screen {
private GuiIncrementer startX, startY, startZ, endX, endY, endZ;
private boolean absoluteCoords = Config.GENERAL.absoluteCoordDefault.get() && Config.GENERAL.allowAbsoluteCoords.get();
private int x;
private int y;
private ItemStack copyPasteTool;
private BlockPos startPos;
private BlockPos endPos;
private List<GuiIncrementer> fields = new ArrayList<>();
public CopyGUI(ItemStack tool) {
super(Component.literal(""));
this.copyPasteTool = tool;
}
@Override
public void init() {
super.init();
this.fields.clear();
this.x = width / 2;
this.y = height / 2;
Region reg = GadgetCopyPaste.getSelectedRegion(copyPasteTool).orElse(Region.singleZero());
startPos = reg.getMin();
endPos = reg.getMax();
int incrementerWidth = GuiIncrementer.WIDTH + (GuiIncrementer.WIDTH / 2);
fields.add(startX = new GuiIncrementer(x - incrementerWidth - 35, y - 40));
fields.add(startY = new GuiIncrementer(x - GuiIncrementer.WIDTH / 2, y - 40));
fields.add(startZ = new GuiIncrementer(x + (GuiIncrementer.WIDTH / 2) + 35, y - 40));
fields.add(endX = new GuiIncrementer(x - incrementerWidth - 35, y - 15));
fields.add(endY = new GuiIncrementer(x - GuiIncrementer.WIDTH / 2, y - 15));
fields.add(endZ = new GuiIncrementer(x + (GuiIncrementer.WIDTH / 2) + 35, y - 15));
fields.forEach(this::addRenderableWidget);
updateTextFields();
List<AbstractButton> buttons = new ArrayList<AbstractButton>() {{
add(new CenteredButton(y + 20, 50, GuiTranslation.SINGLE_CONFIRM.componentTranslation(), (button) -> {
if (absoluteCoords) {
startPos = new BlockPos(startX.getValue(), startY.getValue(), startZ.getValue());
endPos = new BlockPos(endX.getValue(), endY.getValue(), endZ.getValue());
} else {
startPos = new BlockPos(startPos.getX() + startX.getValue(), startPos.getY() + startY.getValue(), startPos.getZ() + startZ.getValue());
endPos = new BlockPos(startPos.getX() + endX.getValue(), startPos.getY() + endY.getValue(), startPos.getZ() + endZ.getValue());
}
PacketHandler.sendToServer(new PacketCopyCoords(startPos, endPos));
}));
add(new CenteredButton(y + 20, 50, GuiTranslation.SINGLE_CLOSE.componentTranslation(), (button) -> onClose()));
add(new CenteredButton(y + 20, 50, GuiTranslation.SINGLE_CLEAR.componentTranslation(), (button) -> {
PacketHandler.sendToServer(new PacketCopyCoords(BlockPos.ZERO, BlockPos.ZERO));
onClose();
}));
if (Config.GENERAL.allowAbsoluteCoords.get()) {
add(new CenteredButton(y + 20, 120, GuiTranslation.COPY_BUTTON_ABSOLUTE.componentTranslation(), (button) -> {
coordsModeSwitch();
updateTextFields();
}));
}
}};
CenteredButton.centerButtonList(buttons, x);
buttons.forEach(this::addRenderableWidget);
}
private void drawFieldLabel(PoseStack matrices, String name, int x, int y) {
font.drawShadow(matrices, name, this.x + x, this.y + y, 0xFFFFFF);
}
private void coordsModeSwitch() {
absoluteCoords = !absoluteCoords;
}
private void updateTextFields() {
if (absoluteCoords) {
BlockPos start = startX.getValue() != 0 ? new BlockPos(startPos.getX() + startX.getValue(), startPos.getY() + startY.getValue(), startPos.getZ() + startZ.getValue()) : startPos;
BlockPos end = endX.getValue() != 0 ? new BlockPos(startPos.getX() + endX.getValue(), startPos.getY() + endY.getValue(), startPos.getZ() + endZ.getValue()) : endPos;
startX.setValue(start.getX());
startY.setValue(start.getY());
startZ.setValue(start.getZ());
endX.setValue(end.getX());
endY.setValue(end.getY());
endZ.setValue(end.getZ());
} else {
startX.setValue(startX.getValue() != 0 ? startX.getValue() - startPos.getX() : 0);
startY.setValue(startY.getValue() != 0 ? startY.getValue() - startPos.getY() : 0);
startZ.setValue(startZ.getValue() != 0 ? startZ.getValue() - startPos.getZ() : 0);
endX.setValue(endX.getValue() != 0 ? endX.getValue() - startPos.getX() : endPos.getX() - startPos.getX());
endY.setValue(endY.getValue() != 0 ? endY.getValue() - startPos.getY() : endPos.getY() - startPos.getY());
endZ.setValue(endZ.getValue() != 0 ? endZ.getValue() - startPos.getZ() : endPos.getZ() - startPos.getZ());
}
}
@Override
public void render(PoseStack matrices, int mouseX, int mouseY, float partialTicks) {
drawFieldLabel(matrices, GuiTranslation.FIELD_START.format() + " X", -175, -36);
drawFieldLabel(matrices, "Y", -45, -36);
drawFieldLabel(matrices, "Z", 55, -36);
drawFieldLabel(matrices, GuiTranslation.FIELD_END.format() + " X", 8 - 175, -11);
drawFieldLabel(matrices, "Y", -45, -11);
drawFieldLabel(matrices, "Z", 55, -11);
drawCenteredString(matrices, Minecraft.getInstance().font, I18n.get(GuiTranslation.COPY_LABEL_HEADING.getTranslationKey()), this.x, this.y - 80, 0xFFFFFF);
drawCenteredString(matrices, Minecraft.getInstance().font, I18n.get(GuiTranslation.COPY_LABEL_SUBHEADING.getTranslationKey()), this.x, this.y - 68, 0xFFFFFF);
super.render(matrices, mouseX, mouseY, partialTicks);
}
@Override
public boolean keyPressed(int mouseX, int mouseY, int __unused) {
fields.forEach(button -> button.keyPressed(mouseX, mouseY, __unused));
return super.keyPressed(mouseX, mouseY, __unused);
}
@Override
public boolean charTyped(char charTyped, int __unused) {
fields.forEach(button -> button.charTyped(charTyped, __unused));
return false;
}
@Override
public boolean isPauseScreen() {
return false;
}
static class CenteredButton extends Button {
CenteredButton(int y, int width, Component text, OnPress onPress) {
super(builder(text, onPress)
.pos(0, y)
.size(width, 20)
);
}
static void centerButtonList(List<AbstractButton> buttons, int startX) {
int collectiveWidth = buttons.stream().mapToInt(AbstractButton::getWidth).sum() + (buttons.size() - 1) * 5;
int nextX = startX - collectiveWidth / 2;
for (AbstractButton button : buttons) {
button.setX(nextX);
nextX += button.getWidth() + 5;
}
}
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/DestructionGUI.java
================================================
package com.direwolf20.buildinggadgets.client.screen;
import com.direwolf20.buildinggadgets.client.screen.widgets.IncrementalSliderWidget;
import com.direwolf20.buildinggadgets.common.config.Config;
import com.direwolf20.buildinggadgets.common.items.GadgetDestruction;
import com.direwolf20.buildinggadgets.common.network.PacketHandler;
import com.direwolf20.buildinggadgets.common.network.packets.PacketDestructionGUI;
import com.direwolf20.buildinggadgets.common.util.lang.GuiTranslation;
import com.direwolf20.buildinggadgets.common.util.lang.MessageTranslation;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.world.item.ItemStack;
import javax.annotation.Nonnull;
import java.util.HashSet;
import java.util.Set;
public class DestructionGUI extends Screen {
private final Set<IncrementalSliderWidget> sliders = new HashSet<>();
private IncrementalSliderWidget left;
private IncrementalSliderWidget right;
private IncrementalSliderWidget up;
private IncrementalSliderWidget down;
private IncrementalSliderWidget depth;
private Button confirm;
private String sizeString = "";
private boolean isValidSize = true;
private final ItemStack destructionGadget;
public DestructionGUI(ItemStack tool) {
super(Component.empty());
this.destructionGadget = tool;
}
@Override
public void init() {
super.init();
int x = width / 2;
int y = height / 2;
this.addRenderableWidget(confirm = Button.builder(Component.translatable(GuiMod.getLangKeySingle("confirm")), b -> {
if (Minecraft.getInstance().player == null) {
return;
}
if (isWithinBounds()) {
PacketHandler.sendToServer(new PacketDestructionGUI(left.getValueInt(), right.getValueInt(), up.getValueInt(), down.getValueInt(), depth.getValueInt()));
this.onClose();
} else
Minecraft.getInstance().player.displayClientMessage(MessageTranslation.DESTRCUT_TOO_LARGE.componentTranslation(Config.GADGETS.GADGET_DESTRUCTION.destroySize.get()), true);
})
.pos((x - 30) + 32, y + 65)
.size(60, 20)
.build());
this.addRenderableWidget(Button.builder(Component.translatable(GuiMod.getLangKeySingle("cancel")), b -> onClose())
.pos((x - 30) - 32, y + 65)
.size(60, 20)
.build());
sliders.clear();
sliders.add(depth = this.createSlider(x - (70 / 2), y - (14 / 2), GuiTranslation.SINGLE_DEPTH, GadgetDestruction.getToolValue(destructionGadget, "depth")));
sliders.add(right = this.createSlider(x + (70 + 5), y - (14 / 2), GuiTranslation.SINGLE_RIGHT, GadgetDestruction.getToolValue(destructionGadget, "right")));
sliders.add(left = this.createSlider(x - (70 * 2) - 5, y - (14 / 2), GuiTranslation.SINGLE_LEFT, GadgetDestruction.getToolValue(destructionGadget, "left")));
sliders.add(up = this.createSlider(x - (70 / 2), y - 35, GuiTranslation.SINGLE_UP, GadgetDestruction.getToolValue(destructionGadget, "up")));
sliders.add(down = this.createSlider(x - (70 / 2), y + 20, GuiTranslation.SINGLE_DOWN, GadgetDestruction.getToolValue(destructionGadget, "down")));
updateSizeString();
updateIsValid();
// Adds their buttons to the gui
sliders.forEach(gui -> gui.getComponents().forEach(this::addRenderableWidget));
}
public IncrementalSliderWidget createSlider(int x, int y, GuiTranslation prefix, int value) {
return new IncrementalSliderWidget(x, y, 70, 14, 0D, 16D, prefix.componentTranslation().append(": "), value, this::onSliderUpdate);
}
public void onSliderUpdate(IncrementalSliderWidget widget) {
this.updateSizeString();
this.updateIsValid();
}
private boolean isWithinBounds() {
int x = 1 + left.getValueInt() + right.getValueInt();
int y = 1 + up.getValueInt() + down.getValueInt();
int z = depth.getValueInt();
int dim = Config.GADGETS.GADGET_DESTRUCTION.destroySize.get();
return x <= (dim + 1) && y <= (dim + 1) && z <= dim;
}
private String getSizeString() {
int x = 1 + left.getValueInt() + right.getValueInt();
int y = 1 + up.getValueInt() + down.getValueInt();
int z = depth.getValueInt();
return String.format("%d x %d x %d", x, y, z);
}
private void updateIsValid() {
this.isValidSize = isWithinBounds();
if (!isValidSize && this.confirm.active) {
this.confirm.setFGColor(0xFF2000);
this.confirm.active = false;
}
if (isValidSize && !this.confirm.active) {
this.confirm.clearFGColor();
this.confirm.active = true;
}
}
private void updateSizeString() {
this.sizeString = getSizeString();
}
@Override
public void render(@Nonnull PoseStack matrices, int mouseX, int mouseY, float partialTicks) {
super.render(matrices, mouseX, mouseY, partialTicks);
drawCenteredString(matrices, font, this.sizeString, width / 2, (height / 2) + 40, this.isValidSize ? 0x00FF00 : 0xFF2000);
if (!this.isValidSize) {
drawCenteredString(matrices, font, MessageTranslation.DESTRCUT_TOO_LARGE.format(Config.GADGETS.GADGET_DESTRUCTION.destroySize.get()), width / 2, (height / 2) + 50, 0xFF2000);
}
}
@Override
public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) {
return super.mouseReleased(mouseX, mouseY, mouseButton);
}
@Override
public boolean isPauseScreen() {
return false;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/GuiMod.java
================================================
package com.direwolf20.buildinggadgets.client.screen;
import com.direwolf20.buildinggadgets.common.items.GadgetCopyPaste;
import com.direwolf20.buildinggadgets.common.items.GadgetDestruction;
import com.direwolf20.buildinggadgets.common.items.TemplateItem;
import com.direwolf20.buildinggadgets.common.util.lang.LangUtil;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.world.entity.player.Player;
import net.minecraft.world.item.ItemStack;
import java.util.function.Function;
import java.util.function.Supplier;
public enum GuiMod {
COPY(GadgetCopyPaste::getGadget, stack -> () -> new CopyGUI(stack)),
PASTE(GadgetCopyPaste::getGadget, stack -> () -> new PasteGUI(stack)),
DESTRUCTION(GadgetDestruction::getGadget, stack -> () -> new DestructionGUI(stack)),
MATERIAL_LIST(TemplateItem::getTemplateItem, stack -> () -> new MaterialListGUI(stack));
private final Function<Player, ItemStack> stackReader;
private final Function<ItemStack, Supplier<? extends Screen>> clientScreenProvider;
GuiMod(Function<Player, ItemStack> stackReader, Function<ItemStack, Supplier<? extends Screen>> clientScreenProvider) {
this.stackReader = stackReader;
this.clientScreenProvider = clientScreenProvider;
}
public boolean openScreen(Player player) {
if (clientScreenProvider == null)
return false;
ItemStack stack = stackReader.apply(player);
if (stack == null || stack.isEmpty())
return false;
Screen screen = clientScreenProvider.apply(stack).get();
Minecraft.getInstance().setScreen(screen);
return screen == null;
}
public static String getLangKeySingle(String name) {
return LangUtil.getLangKey("gui", "single", name);
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/MaterialListGUI.java
================================================
package com.direwolf20.buildinggadgets.client.screen;
import com.direwolf20.buildinggadgets.common.BuildingGadgets;
import com.direwolf20.buildinggadgets.common.capability.CapabilityTemplate;
import com.direwolf20.buildinggadgets.common.tainted.building.view.BuildContext;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateKey;
import com.direwolf20.buildinggadgets.common.tainted.template.ITemplateProvider;
import com.direwolf20.buildinggadgets.common.tainted.template.Template;
import com.direwolf20.buildinggadgets.common.tainted.template.TemplateHeader;
import com.direwolf20.buildinggadgets.common.util.lang.MaterialListTranslation;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import com.google.common.base.Preconditions;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.Lists;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.Font;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.ItemStack;
import net.minecraftforge.common.util.LazyOptional;
import java.awt.*;
import java.util.List;
import java.util.UUID;
public class MaterialListGUI extends Screen implements ITemplateProvider.IUpdateListener {
public static final int BUTTON_HEIGHT = 20;
public static final int BUTTONS_PADDING = 4;
public static final ResourceLocation BACKGROUND_TEXTURE = new ResourceLocation(Reference.MODID, "textures/gui/material_list.png");
public static final int BACKGROUND_WIDTH = 256;
public static final int BACKGROUND_HEIGHT = 200;
public static final int BORDER_SIZE = 4;
public static final int WINDOW_WIDTH = BACKGROUND_WIDTH - BORDER_SIZE * 2;
public static final int WINDOW_HEIGHT = BACKGROUND_HEIGHT - BORDER_SIZE * 2;
private int backgroundX;
private int backgroundY;
private ItemStack item;
private String title;
private int titleLeft;
private int titleTop;
private ScrollingMaterialList scrollingList;
private Button buttonClose;
private Button buttonSortingModes;
private Button buttonCopyList;
private int hoveringTextX;
private int hoveringTextY;
private List<Component> hoveringText;
private TemplateHeader header;
public MaterialListGUI(ItemStack item) {
super(MaterialListTranslation.TITLE.componentTranslation());
Preconditions.checkArgument(item.getCapability(CapabilityTemplate.TEMPLATE_KEY_CAPABILITY).isPresent());
this.item = item;
}
@Override
public void init() {
this.backgroundX = getXForAlignedCenter(0, width, BACKGROUND_WIDTH);
this.backgroundY = getYForAlignedCenter(0, height, BACKGROUND_HEIGHT);
header = evaluateTemplateHeader();
evaluateTitle();
this.scrollingList = new ScrollingMaterialList(this);
// Make it receive mouse scroll events, so that the player can use his mouse wheel at the start
this.setFocused(scrollingList);
this.addRenderableWidget(scrollingList);
int buttonY = getWindowBottomY() - (ScrollingMaterialList.BOTTOM / 2 + BUTTON_HEIGHT / 2);
this.buttonClose = Button.builder(MaterialListTranslation.BUTTON_CLOSE.componentTranslation(), b -> getMinecraft().player.closeContainer())
.pos(0, buttonY)
.size( 0, BUTTON_HEIGHT)
.build();
this.buttonSortingModes = Button.builder(scrollingList.getSortingMode().getTranslationProvider().componentTranslation(), (button) -> {
scrollingList.setSortingMode(scrollingList.getSortingMode().next());
buttonSortingModes.setMessage(scrollingList.getSortingMode().getTranslationProvider().componentTranslation());
})
.pos(0, buttonY)
.size(0, BUTTON_HEIGHT)
.build();
this.buttonCopyList = Button.builder(MaterialListTranslation.BUTTON_COPY.componentTranslation(), (button) -> {
getMinecraft().keyboardHandler.setClipboard(evaluateTemplateHeader().toJson(false, hasControlDown()));
if (getMinecraft().player != null)
getMinecraft().player.displayClientMessage(Component.translatable(MaterialListTranslation.MESSAGE_COPY_SUCCESS.getTranslationKey()), true);
})
.pos(0, buttonY)
.size(0, BUTTON_HEIGHT)
.build();
// Buttons will be placed left to right in this order
this.addRenderableWidget(buttonSortingModes);
this.addRenderableWidget(buttonCopyList);
this.addRenderableWidget(buttonClose);
this.calculateButtonsWidthAndX();
}
public TemplateHeader evaluateTemplateHeader() {
Template template = getTemplateCapability();
BuildContext context = BuildContext.builder()
.player(getMinecraft().player)
.stack(getTemplateItem())
.build(getMinecraft().level);
return template.getHeaderAndForceMaterials(context);
}
public TemplateHeader getHeader() {
return header;
}
@Override
public void render(PoseStack matrices, int mouseX, int mouseY, float particleTicks) {
RenderSystem.setShaderTexture(0, BACKGROUND_TEXTURE);
blit(matrices, backgroundX, backgroundY, 0, 0, BACKGROUND_WIDTH, BACKGROUND_HEIGHT); // TODO: Might be wrong
scrollingList.render(matrices, mouseX, mouseY, particleTicks);
drawString(matrices, font, title, titleLeft, titleTop, Color.WHITE.getRGB());
super.render(matrices, mouseX, mouseY, particleTicks);
if (buttonCopyList.isMouseOver(mouseX, mouseY)) {
renderTooltip(matrices, Lists.transform(ImmutableList.of(MaterialListTranslation.HELP_COPY_LIST.componentTranslation()), Component::getVisualOrderText), mouseX, mouseY);
// GuiUtils.drawHoveringText(matrices, ImmutableList.of(MaterialListTranslation.HELP_COPY_LIST.componentTranslation()), mouseX, mouseY, width, height, Integer.MAX_VALUE, textRenderer);
} else if (hoveringText != null) {
renderTooltip(matrices, Lists.transform(hoveringText, Component::getVisualOrderText), mouseX, mouseY);
// GuiUtils.drawHoveringText(matrices, hoveringText, hoveringTextX, hoveringTextY, width, height, Integer.MAX_VALUE, textRenderer);
hoveringText = null;
}
}
private void calculateButtonsWidthAndX() {
// This part would can create narrower buttons when there are too few of them, due to the vanilla button texture is 200 pixels wide
int amountButtons = (int) children().stream().filter(e -> e instanceof Button).count();
int amountMargins = amountButtons - 1;
int totalMarginWidth = amountMargins * BUTTONS_PADDING;
int usableWidth = getWindowWidth();
int buttonWidth = (usableWidth - totalMarginWidth) / amountButtons;
// Align the box of buttons in the center, and start from the left
int nextX = getWindowLeftX();
for (GuiEventListener widget : children()) {
if (widget instanceof Button btn) {
btn.setWidth(buttonWidth);
btn.setX(nextX);
nextX += buttonWidth + BUTTONS_PADDING;
}
}
}
public Template getTemplateCapability() {
if (getMinecraft().level == null || getMinecraft().player == null)
return null;
LazyOptional<ITemplateProvider> providerCap = getMinecraft().level.getCapability(CapabilityTemplate.TEMPLATE_PROVIDER_CAPABILITY);
if (providerCap.isPresent()) {
LazyOptional<ITemplateKey> keyCap = item.getCapability(CapabilityTemplate.TEMPLATE_KEY_CAPABILITY);
ITemplateProvider provider = providerCap.orElseThrow(RuntimeException::new);
if (keyCap.isPresent()) {
provider.registerUpdateListener(this);
ITemplateKey key = keyCap.orElseThrow(RuntimeException::new);
return provider.getTemplateForKey(key);
}
BuildingGadgets.LOG.warn("Item used for material list does not have an ITemplateKey capability!");
getMinecraft().player.closeContainer();
return null;
}
BuildingGadgets.LOG.warn("Client world used for material list does not have an ITemplateProvider capability!");
getMinecraft().player.closeContainer();
return null;
}
public void setTaskHoveringText(int x, int y, List<Component> text) {
hoveringTextX = x;
hoveringTextY = y;
hoveringText = text;
}
@Override
public void onTemplateUpdate(ITemplateProvider provider, ITemplateKey key, Template template) {
item.getCapability(CapabilityTemplate.TEMPLATE_KEY_CAPABILITY).ifPresent(itemKey -> {
UUID keyId = provider.getId(key);
UUID itemId = provider.getId(itemKey);
if (keyId.equals(itemId)) {
header = evaluateTemplateHeader();
evaluateTitle();
scrollingList.reset();
}
});
}
private void evaluateTitle() {
String name = getHeader().getName();
String author = getHeader().getAuthor();
this.title = name == null && author == null ? MaterialListTranslation.TITLE_EMPTY.format()
: name == null ? MaterialListTranslation.TITLE_AUTHOR_ONLY.format(author)
: author == null ? MaterialListTranslation.TITLE_NAME_ONLY.format(name)
: MaterialListTranslation.TITLE.format(name, author);
this.titleTop = getYForAlignedCenter(backgroundY, getWindowTopY() + ScrollingMaterialList.TOP, font.lineHeight);
this.titleLeft = getXForAlignedCenter(backgroundX, getWindowRightX(), font.width(title));
}
@Override
public boolean isPauseScreen() {
return false;
}
public int getWindowLeftX() {
return backgroundX + BORDER_SIZE;
}
public int getWindowRightX() {
return backgroundX + BACKGROUND_WIDTH - BORDER_SIZE;
}
public int getWindowTopY() {
return backgroundY + BORDER_SIZE;
}
public int getWindowBottomY() {
return backgroundY + BACKGROUND_HEIGHT - BORDER_SIZE;
}
public int getWindowWidth() {
return WINDOW_WIDTH;
}
public int getWindowHeight() {
return WINDOW_HEIGHT;
}
public ItemStack getTemplateItem() {
return item;
}
public static int getXForAlignedRight(int right, int width) {
return right - width;
}
public static int getXForAlignedCenter(int left, int right, int width) {
return left + (right - left) / 2 - width / 2;
}
public static int getYForAlignedCenter(int top, int bottom, int height) {
return top + (bottom - top) / 2 - height / 2;
}
public static void renderTextVerticalCenter(PoseStack matrices, String text, int leftX, int top, int bottom, int color) {
Font fontRenderer = Minecraft.getInstance().font;
int y = getYForAlignedCenter(top, bottom, fontRenderer.lineHeight);
fontRenderer.draw(matrices, text, leftX, y, color);
}
public static void renderTextHorizontalRight(PoseStack matrices, String text, int right, int y, int color) {
Font fontRenderer = Minecraft.getInstance().font;
int x = getXForAlignedRight(right, fontRenderer.width(text));
fontRenderer.draw(matrices, text, x, y, color);
}
public static boolean isPointInBox(double x, double y, int bx, int by, int width, int height) {
return x >= bx &&
y >= by &&
x < bx + width &&
y < by + height;
}
}
================================================
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/ModeRadialMenu.java
================================================
/**
* This class was adapted from code written by Vazkii for the PSI mod: https://github.com/Vazkii/Psi
* Psi is Open Source and distributed under the
* Psi License: http://psi.vazkii.us/license.php
*/
package com.direwolf20.buildinggadgets.client.screen;
import com.direwolf20.buildinggadgets.client.KeyBindings;
import com.direwolf20.buildinggadgets.client.OurSounds;
import com.direwolf20.buildinggadgets.client.renderer.OurRenderTypes;
import com.direwolf20.buildinggadgets.client.screen.widgets.GuiIconActionable;
import com.direwolf20.buildinggadgets.client.screen.widgets.IncrementalSliderWidget;
import com.direwolf20.buildinggadgets.common.config.Config;
import com.direwolf20.buildinggadgets.common.items.*;
import com.direwolf20.buildinggadgets.common.items.modes.BuildingModes;
import com.direwolf20.buildinggadgets.common.items.modes.ExchangingModes;
import com.direwolf20.buildinggadgets.common.network.PacketHandler;
import com.direwolf20.buildinggadgets.common.network.packets.*;
import com.direwolf20.buildinggadgets.common.util.GadgetUtils;
import com.direwolf20.buildinggadgets.common.util.lang.GuiTranslation;
import com.direwolf20.buildinggadgets.common.util.lang.MessageTranslation;
import com.direwolf20.buildinggadgets.common.util.lang.RadialTranslation;
import com.direwolf20.buildinggadgets.common.util.lang.Styles;
import com.direwolf20.buildinggadgets.common.util.ref.Reference;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableSet;
import com.mojang.blaze3d.platform.InputConstants;
import com.mojang.blaze3d.systems.RenderSystem;
import com.mojang.blaze3d.vertex.PoseStack;
import com.mojang.blaze3d.vertex.VertexConsumer;
import net.minecraft.client.KeyMapping;
import net.minecraft.client.Minecraft;
import net.minecraft.client.gui.components.Button;
import net.minecraft.client.gui.components.events.GuiEventListener;
import net.minecraft.client.gui.screens.Screen;
import net.minecraft.client.renderer.GameRenderer;
import net.minecraft.client.renderer.MultiBufferSource;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.ItemStack;
import net.minecraft.world.phys.Vec3;
import net.minecraftforge.common.ForgeI18n;
import org.joml.Matrix4f;
import java.awt.*;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import java.util.function.Predicate;
import java.util.stream.Collectors;
public class ModeRadialMenu extends Screen {
private static final ImmutableList<ResourceLocation> signsCopyPaste = ImmutableList.of(
new ResourceLocation(Reference.MODID, "textures/gui/mode/copy.png"),
new ResourceLocation(Reference.MODID, "textures/gui/mode/paste.png")
);
private final List<Button> conditionalButtons = new ArrayList<>();
private int timeIn = 0;
private int slotSelected = -1;
private int segments;
public ModeRadialMenu(ItemStack stack) {
super(Component.literal(""));
if (stack.getItem() instanceof AbstractGadget) {
this.setSocketable(stack);
}
}
private static float mouseAngle(int x, int y, int mx, int my) {
Vector2f baseVec = new Vector2f(1F, 0F);
Vector2f mouseVec = new Vector2f(mx - x, my - y);
float ang = (float) (Math.acos(baseVec.dot(mouseVec) / (baseVec.length() * mouseVec.length())) * (180F / Math.PI));
return my < y
? 360F - ang
: ang;
}
public void setSocketable(ItemStack stack) {
if (stack.getItem() instanceof GadgetBuilding) {
this.segments = BuildingModes.values().length;
} else if (stack.getItem() instanceof GadgetExchanger) {
this.segments = ExchangingModes.values().length;
} else if (stack.getItem() instanceof GadgetCopyPaste) {
this.segments = GadgetCopyPaste.ToolMode.values().length;
}
}
@Override
public void init() {
this.conditionalButtons.clear();
ItemStack tool = this.getGadget();
boolean isDestruction = tool.getItem() instanceof GadgetDestruction;
ScreenPosition right = isDestruction
? ScreenPosition.TOP
: ScreenPosition.RIGHT;
ScreenPosition left = isDestruction
? ScreenPosition.BOTTOM
: ScreenPosition.LEFT;
if (isDestruction) {
addRenderableWidget(new PositionedIconActionable(RadialTranslation.DESTRUCTION_OVERLAY, "destroy_overlay", right, send -> {
if (send)
PacketHandler.sendToServer(new PacketChangeRange());
return GadgetDestruction.getOverlay(this.getGadget());
}));
addRenderableWidget(new PositionedIconActionable(RadialTranslation.FLUID_ONLY, "fluid_only", right, send -> {
if (send)
PacketHandler.sendToServer(new PacketToggleFluidOnly());
return GadgetDestruction.getIsFluidOnly(this.getGadget());
}));
} else {
addRenderableWidget(new PositionedIconActionable(RadialTranslation.ROTATE, "rotate", left, false, send -> {
if (send)
PacketHandler.sendToServer(new PacketRotateMirror(PacketRotateMirror.Operation.ROTATE));
return false;
}));
addRenderableWidget(new PositionedIconActionable(RadialTranslation.MIRROR, "mirror", left, false, send -> {
if (send)
PacketHandler.sendToServer(new PacketRotateMirror(PacketRotateMirror.Operation.MIRROR));
return false;
}));
}
if (!(tool.getItem() instanceof GadgetCopyPaste)) {
if (!isDestruction || Config.GADGETS.GADGET_DESTRUCTION.nonFuzzyEnabled.get()) {
Button button = new PositionedIconActionable(RadialTranslation.FUZZY, "fuzzy", right, send -> {
if (send) {
PacketHandler.sendToServer(new PacketToggleFuzzy());
}
return AbstractGadget.getFuzzy(this.getGadget());
});
addRenderableWidget(button);
conditionalButtons.add(button);
}
if (!isDestruction) {
Button button = new PositionedIconActionable(RadialTranslation.CONNECTED_SURFACE, "connected_area", right, send -> {
if (send) {
PacketHandler.sendToServer(new PacketToggleConnectedArea());
}
return AbstractGadget.getConnectedArea(this.getGadget());
});
addRenderableWidget(button);
conditionalButtons.add(button);
}
if (!isDestruction) {
int widthSlider = 82;
IncrementalSliderWidget sliderRange = new IncrementalSliderWidget(width / 2 - widthSlider / 2, height / 2 + 72, widthSlider, 14, 1, Config.GADGETS.maxRange.get(), GuiTranslation.SINGLE_RANGE.componentTranslation().append(": "), GadgetUtils.getToolRange(tool), slider -> {
sendRangeUpdate(slider.getValueInt());
});
// GadgetUtils.getToolRange(tool), false, true, Color.DARK_GRAY, slider -> {
// GuiSliderInt sliderI = (GuiSliderInt) slider;
// this.sendRangeUpdate(sliderI.getValueInt());
// }, (slider, amount) -> {
// int value = slider.getValueInt();
// int valueNew = Mth.clamp(value + amount, 1, Config.GADGETS.maxRange.get());
// sendRangeUpdate(valueNew);
// slider.setValue(valueNew);
// slider.updateSlider();
// }
// );
sliderRange.getComponents().forEach(this::addRenderableWidget);
}
} else {
// Copy Paste specific
addRenderableWidget(new PositionedIconActionable(RadialTranslation.OPEN_GUI, "copypaste_opengui", right, send -> {
if (!send)
return false;
assert this.getMinecraft().player != null;
getMinecraft().player.closeContainer();
if (GadgetCopyPaste.getToolMode(tool) == GadgetCopyPaste.ToolMode.COPY)
getMinecraft().setScreen(new CopyGUI(tool));
else
getMinecraft().setScreen(new PasteGUI(tool));
return true;
}));
addRenderableWidget(new PositionedIconActionable(RadialTranslation.OPEN_MATERIAL_LIST, "copypaste_materiallist", right, send -> {
if (!send)
return false;
assert this.getMinecraft().player != null;
getMinecraft().player.closeContainer();
getMinecraft().setScreen(new MaterialListGUI(tool));
return true;
}));
}
addRenderableWidget(new PositionedIconActionable(RadialTranslation.RAYTRACE_FLUID, "raytrace_fluid", right, send -> {
if (send)
PacketHandler.sendToServer(new PacketToggleRayTraceFluid());
return AbstractGadget.shouldRayTraceFluid(this.getGadget());
}));
if (tool.getItem() instanceof GadgetBuilding) {
addRenderableWidget(new PositionedIconActionable(RadialTranslation.PLACE_ON_TOP, "building_place_atop", right, send -> {
if (send)
PacketHandler.sendToServer(new PacketToggleBlockPlacement());
return GadgetBuilding.shouldPlaceAtop(this.getGadget());
}));
}
addRenderableWidget(new PositionedIconActionable(RadialTranslation.ANCHOR, "anchor", left, send -> {
if (send)
PacketHandler.sendToServer(new PacketAnchor());
ItemStack stack = this.getGadget();
if (stack.getItem() instanceof GadgetCopyPaste || stack.getItem() instanceof GadgetDestruction) {
return ((AbstractGadget) stack.getItem()).getAnchor(stack) != null;
}
return GadgetUtils.getAnchor(stack).isPresent();
}));
if (!(tool.getItem() instanceof GadgetExchanger)) {
addRenderableWidget(new PositionedIconActionable(RadialTranslation.UNDO, "undo", left, false, send -> {
if (send)
PacketHandler.sendToServer(new PacketUndo());
return false;
}));
}
this.updateButtons(tool);
}
private void updateButtons(ItemStack tool) {
int posRight = 0;
int posLeft = 0;
int dim = 24;
int padding = 10;
boolean isDestruction = tool.getItem() instanceof GadgetDestruction;
ScreenPosition right = isDestruction ? ScreenPosition.BOTTOM : ScreenPosition.RIGHT;
for (GuiEventListener widget : children()) {
if (!(widget instanceof PositionedIconActionable))
continue;
PositionedIconActionable button = (PositionedIconActionable) widget;
if (!button.visible) {
continue;
}
int offset;
boolean isRight = button.position == right;
if (isRight) {
posRight += dim + padding;
offset = 70;
} else {
posLeft += dim + padding;
offset = -70 - dim;
}
button.setWidth(dim);
button.setHeight(dim);
if (isDestruction)
button.setY(height / 2 + (isRight ? 10 : -button.getHeight() - 10));
else
button.setX(width / 2 + offset);
}
posRight = resetPos(tool, padding, posRight);
posLeft = resetPos(tool, padding, posLeft);
for (GuiEventListener widget : children()) {
if (!(widget instanceof PositionedIconActionable))
continue;
PositionedIconActionable button = (PositionedIconActionable) widget;
if (!button.visible) {
continue;
}
boolean isRight = button.position == right;
int pos = isRight
? posRight
: posLeft;
if (isDestruction) {
button.setX(pos);
} else {
button.setY(pos);
}
if (isRight) {
posRight += dim + padding;
} else {
posLeft += dim + padding;
}
}
}
private int resetPos(ItemStack tool, int padding, int pos) {
return tool.getItem() instanceof GadgetDestruction
? this.width / 2 - (pos - padding) / 2
: this.height / 2 - (pos - padding) / 2;
}
private ItemStack getGadget() {
assert this.getMinecraft().player != null;
return AbstractGadget.getGadget(this.getMinecraft().player);
}
@Override
public void render(PoseStack matrices, int mx, int my, float partialTicks) {
float stime = 5F;
float fract = Math.min(stime, this.timeIn + partialTicks) / stime;
int x = this.width / 2;
int y = this.height / 2;
int radiusMin = 26;
int radiusMax = 60;
double dist = new Vec3(x, y, 0).distanceTo(new Vec3(mx, my, 0));
boolean inRange = false;
if (this.segments != 0) {
inRange = dist > radiusMin && dist < radiusMax;
for (GuiEventListener button : children()) {
if (button instanceof PositionedIconActionable) {
((PositionedIconActionable) button).setFaded(inRange);
}
}
}
// This triggers the animation on creation
matrices.pushPose();
matrices.translate((1 - fract) * x, (1 - fract) * y, 0);
matrices.scale(fract, fract, fract);
super.render(matrices, mx, my, partialTicks);
matrices.popPose();
if (this.segments == 0) {
return;
}
float angle = mouseAngle(x, y, mx, my);
float totalDeg = 0;
float degPer = 360F / this.segments;
List<NameDisplayData> nameData = new ArrayList<>();
ItemStack tool = this.getGadget();
if (tool.isEmpty()) {
return;
}
this.slotSelected = -1;
List<ResourceLocation> signs;
int modeIndex;
if (tool.getItem() instanceof GadgetBuilding) {
modeIndex = GadgetBuilding.getToolMode(tool).ordinal();
signs = Arrays.stream(BuildingModes.values()).map(e -> new ResourceLocation(Reference.MODID, e.getIcon())).collect(Collectors.toList());
} else if (tool.getItem() instanceof GadgetExchanger) {
modeIndex = GadgetExchanger.getToolMode(tool).ordinal();
signs = Arrays.stream(ExchangingModes.values()).map(e -> new ResourceLocation(Reference.MODID, e.getIcon())).collect(Collectors.toList());
} else {
modeIndex = GadgetCopyPaste.getToolMode(tool).ordinal();
signs = signsCopyPaste;
}
boolean shouldCenter = (this.segments + 2) % 4 == 0;
int indexBottom = this.segments / 4;
int indexTop = indexBottom + this.segments / 2;
for (int seg = 0; seg < this.segments; seg++) {
boolean mouseInSector = this.isCursorInSlice(angle, totalDeg, degPer, inRange);
float radius = Math.max(0F, Math.min((this.timeIn + partialTicks - seg * 6F / this.segments) * 40F, radiusMax));
float gs = 0.25F;
if (seg % 2 == 0) {
gs += 0.1F;
}
float r = gs;
float g = gs + (seg == modeIndex
? 1F
: 0.0F);
float b = gs;
float a = 0.4F;
if (mouseInSector) {
this.slotSelected = seg;
r = g = b = 1F;
}
MultiBufferSource.BufferSource bufferSource = Minecraft.getInstance().renderBuffers().bufferSource();
VertexConsumer buffer = bufferSource.getBuffer(OurRenderTypes.TRIANGLE_STRIP);
for (float i = degPer; i >= 0; i--) {
float rad = (float) ((i + totalDeg) / 180F * Math.PI);
float xp = (float) (x + Math.cos(rad) * radius);
float yp = (float) (y + Math.sin(rad) * radius);
if ((int) i == (int) (degPer / 2))
nameData.add(new NameDisplayData((int) xp, (int) yp, mouseInSector, shouldCenter && (seg == indexBottom || seg == indexTop)));
Matrix4f pose = matrices.last().pose();
buffer.vertex(pose, (float) (x + Math.cos(rad) * radius / 2.3F), (float) (y + Math.sin(rad) * radius / 2.3F), 0).color(r, g, b, a).endVertex();
buffer.vertex(xp, yp, 0).color(r, g, b, a).endVertex();
}
bufferSource.endBatch(OurRenderTypes.TRIANGLE_STRIP);
totalDeg += degPer;
}
// This is the naming logic for the text that pops up
for (int i = 0; i < nameData.size(); i++) {
matrices.pushPose();
NameDisplayData data = nameData.get(i);
int xp = data.getX();
int yp = data.getY();
String name;
if (tool.getItem() instanceof GadgetBuilding) {
name = ForgeI18n.getPattern(BuildingModes.values()[i].getTranslationKey());
} else if (tool.getItem() instanceof GadgetExchanger) {
name = ForgeI18n.getPattern(ExchangingModes.values()[i].getTranslationKey());
} else {
name = GadgetCopyPaste.ToolMode.values()[i].getTranslation().format();
}
int xsp = xp - 4;
int ysp = yp;
int width = font.width(name);
if (xsp < x) {
xsp -= width - 8;
}
if (ysp < y) {
ysp -= 9;
}
Color color = i == modeIndex ? Color.GREEN : Color.WHITE;
if (data.isSelected())
font.drawShadow(matrices, name, xsp + (data.isCentralized() ? width / 2f - 4 : 0), ysp, color.getRGB());
double mod = 0.7;
int xdp = (int) ((xp - x) * mod + x);
int ydp = (int) ((yp - y) * mod + y);
RenderSystem.setShader(GameRenderer::getPositionTexShader);
RenderSystem.setShaderColor(color.getRed() / 255F, color.getGreen() / 255F, color.getBlue() / 255F, 1);
RenderSystem.setShaderTexture(0, signs.get(i));
blit(matrices, xdp - 8, ydp - 8, 0, 0, 16, 16, 16, 16);
matrices.popPose();
}
float s = 1.8F * fract;
PoseStack stack = RenderSystem.getModelViewStack();
stack.pushPose();
stack.scale(s, s, s);
matrices.popPose();
stack.translate(x / s - (tool.getItem() instanceof GadgetCopyPaste ? 8 : 8.5), y / s - 8, 0);
this.itemRenderer.renderAndDecorateItem(stack, tool, 0, 0);
stack.popPose();
}
private boolean isCursorInSlice(float angle, float totalDeg, float degPer, boolean inRange) {
return inRange && angle > totalDeg && angle < totalDeg + degPer;
}
private void changeMode() {
if (this.slotSelected >= 0) {
Item gadget = this.getGadget().getItem();
// This should logically never fail but implementing a way to ensure that would
// be a pretty solid idea for the next guy to touch this code.
String mode;
if (gadget instanceof GadgetBuilding) {
mode = ForgeI18n.getPattern(BuildingModes.values()[this.slotSelected].getTranslationKey());
} else if (gadget instanceof GadgetExchanger) {
mode = ForgeI18n.getPattern(ExchangingModes.values()[this.slotSelected].getTranslationKey());
} else {
mode = GadgetCopyPaste.ToolMode.values()[this.slotSelected].getTranslation().format();
}
assert getMinecraft().player != null;
getMinecraft().player.displayClientMessage(MessageTranslation.MODE_SET.componentTranslation(mode).setStyle(Styles.AQUA), true);
PacketHandler.sendToServer(new PacketToggleMode(this.slotSelected));
OurSounds.playSound(OurSounds.BEEP.get());
}
}
@Override
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) {
this.changeMode();
return super.mouseClicked(mouseX, mouseY, mouseButton);
}
@Override
public void tick() {
if (!InputConstants.isKeyDown(Minecraft.getInstance().getWindow().getWindow(), KeyBindings.menuSettings.getKey().getValue())) {
onClose();
changeMode();
}
ImmutableSet<KeyMapping> set = ImmutableSet.of(getMinecraft().options.keyUp, getMinecraft().options.keyLeft, getMinecraft().options.keyDown, getMinecraft().options.keyRight, getMinecraft().options.keyShift, getMinecraft().options.keySprint, getMinecraft().options.keyJump);
for (KeyMapping k : set)
KeyMapping.set(k.getKey(), k.isDown());
this.timeIn++;
ItemStack tool = this.getGadget();
boolean builder = tool.getItem() instanceof GadgetBuilding;
if (!builder && !(tool.getItem() instanceof GadgetExchanger)) {
return;
}
boolean curent;
boolean changed = false;
for (int i = 0; i < this.conditionalButtons.size(); i++) {
Button button = this.conditionalButtons.get(i);
if (builder) {
curent = GadgetBuilding.getToolMode(tool) == BuildingModes.SURFACE;
} else {
curent = i == 0 || GadgetExchanger.getToolMode(tool) == ExchangingModes.SURFACE;
}
if (button.visible != curent) {
button.visible = curent;
changed = true;
}
}
if (changed) {
this.updateButtons(tool);
}
}
@Override
public boolean isPauseScreen() {
return false;
}
private void sendRangeUpdate(int valueNew) {
if (valueNew != GadgetUtils.getToolRange(this.getGadget())) {
PacketHandler.sendToServer(new PacketChangeRange(valueNew));
}
}
public enum ScreenPosition {
RIGHT, LEFT, BOTTOM, TOP
}
private static final class NameDisplayData {
private final int x;
private final int y;
private final boolean selected;
private final boolean centralize;
private NameDisplayData(int x, int y, boolean selected, boolean centralize) {
this.x = x;
this.y = y;
this.selected = selected;
this.centralize = centralize;
}
private int getX() {
gitextract_i5og_fva/ ├── .github/ │ ├── ISSUE_TEMPLATE/ │ │ ├── bug-report.yml │ │ └── feature-request.md │ └── workflows/ │ ├── gradle.yml │ ├── release.yml │ └── stale.yml ├── .gitignore ├── README.md ├── build.gradle ├── gradle/ │ └── wrapper/ │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew ├── gradlew.bat ├── settings.gradle ├── src/ │ └── main/ │ ├── java/ │ │ └── com/ │ │ └── direwolf20/ │ │ └── buildinggadgets/ │ │ ├── client/ │ │ │ ├── BuildingGadgetsJEI.java │ │ │ ├── ClientProxy.java │ │ │ ├── KeyBindings.java │ │ │ ├── OurSounds.java │ │ │ ├── cache/ │ │ │ │ ├── CacheTemplateProvider.java │ │ │ │ └── RemoteInventoryCache.java │ │ │ ├── events/ │ │ │ │ ├── EventKeyInput.java │ │ │ │ ├── EventRenderWorldLast.java │ │ │ │ └── EventTooltip.java │ │ │ ├── models/ │ │ │ │ └── ConstructionBakedModel.java │ │ │ ├── renderer/ │ │ │ │ ├── DireBufferBuilder.java │ │ │ │ ├── DireVertexBuffer.java │ │ │ │ ├── EffectBlockTER.java │ │ │ │ ├── MyRenderMethods.java │ │ │ │ ├── OurRenderTypes.java │ │ │ │ └── package-info.java │ │ │ ├── renders/ │ │ │ │ ├── BaseRenderer.java │ │ │ │ ├── BuildRender.java │ │ │ │ ├── CopyPasteRender.java │ │ │ │ └── DestructionRender.java │ │ │ └── screen/ │ │ │ ├── CopyGUI.java │ │ │ ├── DestructionGUI.java │ │ │ ├── GuiMod.java │ │ │ ├── MaterialListGUI.java │ │ │ ├── ModeRadialMenu.java │ │ │ ├── PasteGUI.java │ │ │ ├── ScrollingMaterialList.java │ │ │ ├── TemplateManagerGUI.java │ │ │ └── widgets/ │ │ │ ├── DireButton.java │ │ │ ├── EntryList.java │ │ │ ├── GuiIconActionable.java │ │ │ ├── GuiIncrementer.java │ │ │ ├── GuiTextFieldBase.java │ │ │ └── IncrementalSliderWidget.java │ │ └── common/ │ │ ├── BuildingGadgets.java │ │ ├── blocks/ │ │ │ ├── ConstructionBlock.java │ │ │ ├── ConstructionBlockDense.java │ │ │ ├── ConstructionBlockPowder.java │ │ │ ├── EffectBlock.java │ │ │ ├── OurBlocks.java │ │ │ └── TemplateManager.java │ │ ├── capability/ │ │ │ ├── CapabilityProviderEnergy.java │ │ │ ├── CapabilityTemplate.java │ │ │ ├── ConfigEnergyStorage.java │ │ │ ├── IPrivateEnergy.java │ │ │ ├── ItemEnergyForge.java │ │ │ ├── ItemTemplateKey.java │ │ │ ├── PasteContainerCapabilityProvider.java │ │ │ ├── PasteContainerItemHandler.java │ │ │ └── provider/ │ │ │ ├── MultiCapabilityProvider.java │ │ │ ├── TemplateKeyProvider.java │ │ │ └── TemplateProviderCapabilityProvider.java │ │ ├── commands/ │ │ │ ├── AllowPlayerOverrideManager.java │ │ │ ├── ForceUnloadedCommand.java │ │ │ ├── OverrideBuildSizeCommand.java │ │ │ └── OverrideCopySizeCommand.java │ │ ├── config/ │ │ │ ├── Config.java │ │ │ └── RecipeConstructionPaste.java │ │ ├── containers/ │ │ │ ├── BaseContainer.java │ │ │ ├── OurContainers.java │ │ │ └── TemplateManagerContainer.java │ │ ├── entities/ │ │ │ ├── ConstructionBlockEntity.java │ │ │ ├── ConstructionBlockEntityRender.java │ │ │ ├── EntityBase.java │ │ │ └── OurEntities.java │ │ ├── events/ │ │ │ ├── BreakEventHandler.java │ │ │ ├── ItemPickupHandler.java │ │ │ └── WorldTemplateProviderHandler.java │ │ ├── integration/ │ │ │ ├── IntegrationHandler.java │ │ │ └── RefinedStorage.java │ │ ├── items/ │ │ │ ├── AbstractGadget.java │ │ │ ├── ConstructionPaste.java │ │ │ ├── ConstructionPasteContainer.java │ │ │ ├── GadgetBuilding.java │ │ │ ├── GadgetCopyPaste.java │ │ │ ├── GadgetDestruction.java │ │ │ ├── GadgetExchanger.java │ │ │ ├── OurItems.java │ │ │ ├── TemplateItem.java │ │ │ └── modes/ │ │ │ ├── AbstractMode.java │ │ │ ├── BuildToMeMode.java │ │ │ ├── BuildingModes.java │ │ │ ├── ExchangingModes.java │ │ │ ├── GridMode.java │ │ │ ├── HorizontalColumnMode.java │ │ │ ├── HorizontalWallMode.java │ │ │ ├── StairMode.java │ │ │ ├── SurfaceMode.java │ │ │ ├── VerticalColumnMode.java │ │ │ ├── VerticalWallMode.java │ │ │ └── XYZ.java │ │ ├── network/ │ │ │ ├── PacketHandler.java │ │ │ ├── packets/ │ │ │ │ ├── PacketAnchor.java │ │ │ │ ├── PacketBindTool.java │ │ │ │ ├── PacketChangeRange.java │ │ │ │ ├── PacketCopyCoords.java │ │ │ │ ├── PacketDestructionGUI.java │ │ │ │ ├── PacketPasteGUI.java │ │ │ │ ├── PacketRequestTemplate.java │ │ │ │ ├── PacketRotateMirror.java │ │ │ │ ├── PacketSetRemoteInventoryCache.java │ │ │ │ ├── PacketTemplateManagerTemplateCreated.java │ │ │ │ ├── PacketToggleBlockPlacement.java │ │ │ │ ├── PacketToggleConnectedArea.java │ │ │ │ ├── PacketToggleFluidOnly.java │ │ │ │ ├── PacketToggleFuzzy.java │ │ │ │ ├── PacketToggleMode.java │ │ │ │ ├── PacketToggleRayTraceFluid.java │ │ │ │ ├── PacketUndo.java │ │ │ │ ├── SplitPacketUpdateTemplate.java │ │ │ │ └── UUIDPacket.java │ │ │ └── split/ │ │ │ ├── PacketDecoder.java │ │ │ ├── PacketEncoder.java │ │ │ ├── PacketSplitManager.java │ │ │ └── SplitPacket.java │ │ ├── tainted/ │ │ │ ├── Tainted.java │ │ │ ├── building/ │ │ │ │ ├── BlockData.java │ │ │ │ ├── PlacementChecker.java │ │ │ │ ├── PlacementTarget.java │ │ │ │ ├── Region.java │ │ │ │ ├── package-info.java │ │ │ │ ├── placement/ │ │ │ │ │ └── ConnectedSurface.java │ │ │ │ ├── tilesupport/ │ │ │ │ │ ├── ITileDataFactory.java │ │ │ │ │ ├── ITileDataProvider.java │ │ │ │ │ ├── ITileDataSerializer.java │ │ │ │ │ ├── ITileEntityData.java │ │ │ │ │ ├── NBTTileEntityData.java │ │ │ │ │ ├── TileSupport.java │ │ │ │ │ └── package-info.java │ │ │ │ └── view/ │ │ │ │ ├── BuildContext.java │ │ │ │ ├── IBuildView.java │ │ │ │ ├── PositionalBuildView.java │ │ │ │ ├── WorldBuildView.java │ │ │ │ └── package-info.java │ │ │ ├── concurrent/ │ │ │ │ ├── CopyScheduler.java │ │ │ │ ├── PlacementScheduler.java │ │ │ │ ├── ServerTickingScheduler.java │ │ │ │ ├── SteppedScheduler.java │ │ │ │ └── UndoScheduler.java │ │ │ ├── inventory/ │ │ │ │ ├── CreativeItemIndex.java │ │ │ │ ├── HandlerInsertProvider.java │ │ │ │ ├── IInsertProvider.java │ │ │ │ ├── IItemIndex.java │ │ │ │ ├── InventoryHelper.java │ │ │ │ ├── InventoryLinker.java │ │ │ │ ├── MatchResult.java │ │ │ │ ├── PlayerInventoryInsertProvider.java │ │ │ │ ├── PlayerItemIndex.java │ │ │ │ ├── RecordingItemIndex.java │ │ │ │ ├── handle/ │ │ │ │ │ ├── IHandleProvider.java │ │ │ │ │ ├── IObjectHandle.java │ │ │ │ │ ├── ItemHandlerProvider.java │ │ │ │ │ └── StackHandlerItemHandle.java │ │ │ │ └── materials/ │ │ │ │ ├── AndMaterialListEntry.java │ │ │ │ ├── MaterialList.java │ │ │ │ ├── MaterialListEntry.java │ │ │ │ ├── OrMaterialListEntry.java │ │ │ │ ├── SimpleMaterialListEntry.java │ │ │ │ ├── SubMaterialListEntry.java │ │ │ │ ├── objects/ │ │ │ │ │ ├── IUniqueObject.java │ │ │ │ │ ├── IUniqueObjectSerializer.java │ │ │ │ │ └── UniqueItem.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── registry/ │ │ │ │ ├── ImmutableOrderedRegistry.java │ │ │ │ ├── Registries.java │ │ │ │ ├── TopologicalRegistryBuilder.java │ │ │ │ └── package-info.java │ │ │ ├── save/ │ │ │ │ ├── SaveManager.java │ │ │ │ ├── SaveTemplateProvider.java │ │ │ │ ├── TemplateSave.java │ │ │ │ ├── TimedDataSave.java │ │ │ │ ├── Undo.java │ │ │ │ ├── UndoHistory.java │ │ │ │ └── UndoWorldSave.java │ │ │ └── template/ │ │ │ ├── ITemplateKey.java │ │ │ ├── ITemplateProvider.java │ │ │ ├── InMemoryTemplateProvider.java │ │ │ ├── SerialisationSupport.java │ │ │ ├── Template.java │ │ │ ├── TemplateHeader.java │ │ │ ├── TemplateIO.java │ │ │ ├── TemplateKey.java │ │ │ └── package-info.java │ │ ├── tileentities/ │ │ │ ├── ConstructionBlockTileEntity.java │ │ │ ├── EffectBlockTileEntity.java │ │ │ ├── OurTileEntities.java │ │ │ └── TemplateManagerTileEntity.java │ │ ├── util/ │ │ │ ├── Additions.java │ │ │ ├── CommonUtils.java │ │ │ ├── GadgetUtils.java │ │ │ ├── compression/ │ │ │ │ ├── DataCompressor.java │ │ │ │ ├── DataDecompressor.java │ │ │ │ └── package-info.java │ │ │ ├── exceptions/ │ │ │ │ ├── CapabilityNotPresentException.java │ │ │ │ ├── TemplateParseException.java │ │ │ │ ├── TemplateReadException.java │ │ │ │ ├── TemplateWriteException.java │ │ │ │ └── package-info.java │ │ │ ├── helpers/ │ │ │ │ ├── NBTHelper.java │ │ │ │ └── VectorHelper.java │ │ │ ├── lang/ │ │ │ │ ├── CommandTranslation.java │ │ │ │ ├── GuiTranslation.java │ │ │ │ ├── ITranslationProvider.java │ │ │ │ ├── LangUtil.java │ │ │ │ ├── MaterialListTranslation.java │ │ │ │ ├── MessageTranslation.java │ │ │ │ ├── ModeTranslation.java │ │ │ │ ├── RadialTranslation.java │ │ │ │ ├── Styles.java │ │ │ │ ├── TooltipTranslation.java │ │ │ │ └── package-info.java │ │ │ ├── package-info.java │ │ │ ├── ref/ │ │ │ │ ├── JsonKeys.java │ │ │ │ ├── NBTKeys.java │ │ │ │ └── Reference.java │ │ │ ├── spliterator/ │ │ │ │ ├── DelegatingSpliterator.java │ │ │ │ └── MappingSpliterator.java │ │ │ └── tools/ │ │ │ ├── JsonBiDiSerializer.java │ │ │ ├── MathUtils.java │ │ │ ├── NetworkIO.java │ │ │ ├── RegistryUtils.java │ │ │ └── SimulateEnergyStorage.java │ │ └── world/ │ │ ├── MockBuilderWorld.java │ │ ├── MockDelegationWorld.java │ │ └── MockTileEntityRenderWorld.java │ └── resources/ │ ├── META-INF/ │ │ ├── accesstransformer.cfg │ │ └── mods.toml │ ├── assets/ │ │ └── buildinggadgets/ │ │ ├── blockstates/ │ │ │ ├── blank_const_block.json │ │ │ ├── construction_block.json │ │ │ ├── construction_block_dense.json │ │ │ ├── construction_block_powder.json │ │ │ ├── constructionblock_dense.json │ │ │ ├── effect_block.json │ │ │ └── template_manager.json │ │ ├── lang/ │ │ │ ├── de_de.json │ │ │ ├── en_us.json │ │ │ ├── es_es.json │ │ │ ├── fr_fr.json │ │ │ ├── ja_jp.json │ │ │ ├── no_no.json │ │ │ ├── pl_pl.json │ │ │ ├── pt_br.json │ │ │ ├── ru_RU.json │ │ │ ├── uk_ua.json │ │ │ ├── zh_cn.json │ │ │ └── zh_tw.json │ │ ├── models/ │ │ │ ├── block/ │ │ │ │ ├── blank_const_block.json │ │ │ │ ├── construction_block.json │ │ │ │ ├── construction_block_dense.json │ │ │ │ ├── construction_block_powder.json │ │ │ │ ├── constructionblock_dense.json │ │ │ │ ├── effect_block.json │ │ │ │ ├── orientable.json │ │ │ │ └── template_manager.json │ │ │ └── item/ │ │ │ ├── construction_block.json │ │ │ ├── construction_block_dense.json │ │ │ ├── construction_block_powder.json │ │ │ ├── construction_chunk_dense.json │ │ │ ├── construction_paste.json │ │ │ ├── construction_paste_container_creative.json │ │ │ ├── construction_paste_container_t1.json │ │ │ ├── construction_paste_container_t1_3quarter.json │ │ │ ├── construction_paste_container_t1_full.json │ │ │ ├── construction_paste_container_t1_half.json │ │ │ ├── construction_paste_container_t1_quarter.json │ │ │ ├── construction_paste_container_t2.json │ │ │ ├── construction_paste_container_t2_3quarter.json │ │ │ ├── construction_paste_container_t2_full.json │ │ │ ├── construction_paste_container_t2_half.json │ │ │ ├── construction_paste_container_t2_quarter.json │ │ │ ├── construction_paste_container_t3.json │ │ │ ├── construction_paste_container_t3_3quarter.json │ │ │ ├── construction_paste_container_t3_full.json │ │ │ ├── construction_paste_container_t3_half.json │ │ │ ├── construction_paste_container_t3_quarter.json │ │ │ ├── effect_block.json │ │ │ ├── gadget_building.json │ │ │ ├── gadget_copy_paste.json │ │ │ ├── gadget_destruction.json │ │ │ ├── gadget_exchanging.json │ │ │ ├── template.json │ │ │ └── template_manager.json │ │ ├── sounds/ │ │ │ └── beep.ogg │ │ └── sounds.json │ ├── data/ │ │ ├── buildinggadgets/ │ │ │ ├── loot_tables/ │ │ │ │ └── blocks/ │ │ │ │ ├── construction_block.json │ │ │ │ ├── construction_block_dense.json │ │ │ │ ├── construction_block_powder.json │ │ │ │ └── template_manager.json │ │ │ ├── recipes/ │ │ │ │ ├── construction_paste_container.json │ │ │ │ ├── construction_paste_container_t2.json │ │ │ │ ├── construction_paste_container_t3.json │ │ │ │ ├── construction_paste_powder.json │ │ │ │ ├── gadget_building.json │ │ │ │ ├── gadget_copy_paste.json │ │ │ │ ├── gadget_destruction.json │ │ │ │ ├── gadget_exchanging.json │ │ │ │ └── template_manager.json │ │ │ └── tags/ │ │ │ ├── blocks/ │ │ │ │ ├── blacklist/ │ │ │ │ │ ├── building.json │ │ │ │ │ ├── copy_paste.json │ │ │ │ │ ├── destruction.json │ │ │ │ │ ├── exchanging.json │ │ │ │ │ └── generic.json │ │ │ │ └── whitelist/ │ │ │ │ ├── building.json │ │ │ │ ├── copy_paste.json │ │ │ │ ├── destruction.json │ │ │ │ ├── exchanging.json │ │ │ │ └── generic.json │ │ │ └── items/ │ │ │ └── template_convertible.json │ │ └── create/ │ │ └── recipes/ │ │ ├── crushing/ │ │ │ └── dense_construction_block.json │ │ ├── milling/ │ │ │ └── dense_construction_block.json │ │ └── washing/ │ │ └── construction_paste.json │ └── pack.mcmeta └── update.json
SYMBOL INDEX (2142 symbols across 211 files)
FILE: src/main/java/com/direwolf20/buildinggadgets/client/BuildingGadgetsJEI.java
class BuildingGadgetsJEI (line 21) | @JeiPlugin
method getPluginUid (line 23) | @Override
method registerGuiHandlers (line 29) | @Override
method registerItemSubtypes (line 34) | @Override
class GuiContainerHandler (line 59) | private static class GuiContainerHandler implements IGuiContainerHandl...
method getGuiExtraAreas (line 60) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/ClientProxy.java
class ClientProxy (line 57) | @Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscribe...
method clientSetup (line 62) | public static void clientSetup() {
method registerConstructionBlockColorHandler (line 85) | @SubscribeEvent
method registerTooltipFactory (line 106) | @SubscribeEvent
method playSound (line 112) | public static void playSound(SoundEvent sound, float pitch) {
method onPlayerLoggedOut (line 116) | private static void onPlayerLoggedOut(PlayerLoggedOutEvent event) {
method bakeModels (line 120) | @SubscribeEvent
class ConstructionBakedModel (line 147) | static class ConstructionBakedModel implements IDynamicBakedModel {
method getQuads (line 156) | @NotNull
method getParticleIcon (line 175) | @NotNull
method isGui3d (line 183) | @Override
method usesBlockLight (line 188) | @Override
method isCustomRenderer (line 193) | @Override
method useAmbientOcclusion (line 198) | @Override
method getOverrides (line 203) | @NotNull
method getModelData (line 209) | @Nonnull
method getRenderTypes (line 215) | @NotNull
FILE: src/main/java/com/direwolf20/buildinggadgets/client/KeyBindings.java
class KeyBindings (line 24) | @Mod.EventBusSubscriber(value = Dist.CLIENT, bus = Mod.EventBusSubscribe...
method init (line 41) | public static void init() {}
method createBinding (line 43) | private static KeyMapping createBinding(String name, int key) {
method getKey (line 49) | private static String getKey(String name) {
method register (line 53) | @SubscribeEvent
class KeyConflictContextGadget (line 59) | public static class KeyConflictContextGadget implements IKeyConflictCo...
method isActive (line 61) | @Override
method conflicts (line 69) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/OurSounds.java
type OurSounds (line 10) | public interface OurSounds {
method playSound (line 15) | static void playSound(SoundEvent sound, float pitch) {
method playSound (line 19) | static void playSound(SoundEvent sound) {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/cache/CacheTemplateProvider.java
class CacheTemplateProvider (line 25) | @Tainted(reason = "Uses template system")
method CacheTemplateProvider (line 30) | public CacheTemplateProvider() {
method getTemplateForKey (line 38) | @Override
method setTemplate (line 53) | @Override
method requestUpdate (line 60) | @Override
method requestUpdate (line 65) | @Override
method requestUpdate (line 70) | private boolean requestUpdate(UUID id, PacketDistributor.PacketTarget ...
method requestRemoteUpdate (line 75) | @Override
method requestRemoteUpdate (line 86) | @Override
method registerUpdateListener (line 91) | @Override
method removeUpdateListener (line 96) | @Override
method getId (line 101) | @Override
method clear (line 110) | public void clear() {
method notifyListeners (line 115) | private void notifyListeners(ITemplateKey key, Template template, Func...
FILE: src/main/java/com/direwolf20/buildinggadgets/client/cache/RemoteInventoryCache.java
class RemoteInventoryCache (line 19) | public class RemoteInventoryCache {
method RemoteInventoryCache (line 25) | public RemoteInventoryCache(boolean isCopyPaste) {
method setCache (line 29) | public void setCache(Multiset<UniqueItem> cache) {
method forceUpdate (line 33) | public void forceUpdate() {
method maintainCache (line 37) | public boolean maintainCache(ItemStack tool) {
method getCache (line 45) | public Multiset<UniqueItem> getCache() {
method updateCache (line 49) | private void updateCache(Pair<BlockPos, ResourceKey<Level>> loc) {
method isCacheOld (line 58) | private boolean isCacheOld(@Nullable Pair<BlockPos, ResourceKey<Level>...
FILE: src/main/java/com/direwolf20/buildinggadgets/client/events/EventKeyInput.java
class EventKeyInput (line 20) | @EventBusSubscriber(modid = Reference.MODID, value = Dist.CLIENT)
method handleEventInput (line 23) | @SubscribeEvent
FILE: src/main/java/com/direwolf20/buildinggadgets/client/events/EventRenderWorldLast.java
class EventRenderWorldLast (line 13) | @Mod.EventBusSubscriber(modid = Reference.MODID, value = Dist.CLIENT)
method RenderLevelLastEvent (line 16) | @SubscribeEvent
FILE: src/main/java/com/direwolf20/buildinggadgets/client/events/EventTooltip.java
class EventTooltip (line 35) | public class EventTooltip {
method setCache (line 44) | public static void setCache(Multiset<UniqueItem> cache) {
class CopyPasteTooltipComponent (line 48) | public static class CopyPasteTooltipComponent implements ClientTooltip...
method CopyPasteTooltipComponent (line 51) | public CopyPasteTooltipComponent(Data tooltipComponent) {
method getHeight (line 55) | @Override
method getWidth (line 60) | @Override
method renderImage (line 65) | @Override
class Data (line 112) | public static class Data implements TooltipComponent {
method Data (line 116) | public Data(ItemStack stack) {
method renderRequiredBlocks (line 150) | private static int renderRequiredBlocks(PoseStack matrices, ItemRender...
FILE: src/main/java/com/direwolf20/buildinggadgets/client/models/ConstructionBakedModel.java
class ConstructionBakedModel (line 27) | public class ConstructionBakedModel implements IDynamicBakedModel {
method isGui3d (line 30) | @Override
method usesBlockLight (line 35) | @Override
method isCustomRenderer (line 40) | @Override
method getParticleIcon (line 45) | @Override
method useAmbientOcclusion (line 50) | @Override
method getQuads (line 59) | @Override
method getOverrides (line 78) | @Override
method getModelData (line 83) | @Nonnull
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/DireBufferBuilder.java
class DireBufferBuilder (line 26) | public class DireBufferBuilder extends DefaultedVertexConsumer implement...
method DireBufferBuilder (line 44) | public DireBufferBuilder(int bufferSizeIn) {
method growBuffer (line 48) | protected void growBuffer() {
method growBuffer (line 52) | private void growBuffer(int increaseAmount) {
method roundUpPositive (line 65) | private static int roundUpPositive(int xIn) {
method sortVertexData (line 79) | public void sortVertexData(float cameraX, float cameraY, float cameraZ) {
method limitToVertex (line 127) | private void limitToVertex(FloatBuffer floatBufferIn, int indexIn) {
method getVertexState (line 133) | public DireBufferBuilder.State getVertexState() {
method getDistanceSq (line 142) | private static float getDistanceSq(FloatBuffer floatBufferIn, float x,...
method setVertexState (line 161) | public void setVertexState(DireBufferBuilder.State state) {
method begin (line 175) | public void begin(int glMode, VertexFormat format) {
method setVertexFormat (line 188) | private void setVertexFormat(VertexFormat vertexFormatIn) {
method finishDrawing (line 198) | public void finishDrawing() {
method putByte (line 211) | public void putByte(int indexIn, byte byteIn) {
method putShort (line 215) | public void putShort(int indexIn, short shortIn) {
method putFloat (line 219) | public void putFloat(int indexIn, float floatIn) {
method endVertex (line 223) | public void endVertex() {
method nextElement (line 232) | public void nextElement() {
method color (line 248) | public VertexConsumer color(int red, int green, int blue, int alpha) {
method vertex (line 256) | public void vertex(float x, float y, float z, float red, float green, ...
method getNextBuffer (line 290) | public Pair<DireBufferBuilder.DrawState, ByteBuffer> getNextBuffer() {
method reset (line 304) | public void reset() {
method discard (line 312) | public void discard() {
method currentElement (line 320) | public VertexFormatElement currentElement() {
method isDrawing (line 328) | public boolean isDrawing() {
class DrawState (line 332) | @OnlyIn(Dist.CLIENT)
method DrawState (line 338) | private DrawState(VertexFormat formatIn, int vertexCountIn, int draw...
method getFormat (line 344) | public VertexFormat getFormat() {
method getVertexCount (line 348) | public int getVertexCount() {
method getDrawMode (line 352) | public int getDrawMode() {
class State (line 357) | @OnlyIn(Dist.CLIENT)
method State (line 362) | private State(ByteBuffer byteBufferIn, VertexFormat vertexFormatIn) {
method putBulkData (line 368) | public void putBulkData(ByteBuffer buffer) {
method getVertexFormat (line 376) | public VertexFormat getVertexFormat() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/DireVertexBuffer.java
class DireVertexBuffer (line 11) | public class DireVertexBuffer implements AutoCloseable {
method DireVertexBuffer (line 17) | public DireVertexBuffer(VertexFormat vertexFormatIn) {
method bindBuffer (line 24) | public void bindBuffer() {
method upload (line 28) | public void upload(DireBufferBuilder bufferIn) {
method uploadLater (line 39) | public CompletableFuture<Void> uploadLater(DireBufferBuilder bufferIn) {
method uploadRaw (line 52) | private void uploadRaw(DireBufferBuilder bufferIn) {
method draw (line 63) | public void draw(Matrix4f matrixIn, int modeIn) {
method unbindBuffer (line 72) | public static void unbindBuffer() {
method close (line 76) | public void close() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/EffectBlockTER.java
class EffectBlockTER (line 20) | public class EffectBlockTER implements BlockEntityRenderer<EffectBlockTi...
method EffectBlockTER (line 22) | public EffectBlockTER(BlockEntityRendererProvider.Context p_173540_) {
method render (line 25) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/MyRenderMethods.java
class MyRenderMethods (line 9) | public class MyRenderMethods {
method renderModelBrightnessColorQuads (line 11) | public static void renderModelBrightnessColorQuads(PoseStack.Pose matr...
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renderer/OurRenderTypes.java
class OurRenderTypes (line 19) | public class OurRenderTypes extends RenderType {
method OurRenderTypes (line 112) | public OurRenderTypes(String p_173178_, VertexFormat p_173179_, Vertex...
class MultiplyAlphaRenderTypeBuffer (line 122) | public static class MultiplyAlphaRenderTypeBuffer implements MultiBuff...
method MultiplyAlphaRenderTypeBuffer (line 126) | public MultiplyAlphaRenderTypeBuffer(MultiBufferSource inner, float ...
method getBuffer (line 131) | @Override
class MultiplyAlphaVertexBuilder (line 150) | public static class MultiplyAlphaVertexBuilder implements VertexCons...
method MultiplyAlphaVertexBuilder (line 154) | public MultiplyAlphaVertexBuilder(VertexConsumer inner, float cons...
method vertex (line 159) | @Override
method vertex (line 164) | @Override
method color (line 169) | @Override
method uv (line 174) | @Override
method overlayCoords (line 179) | @Override
method uv2 (line 185) | @Override
method normal (line 190) | @Override
method normal (line 195) | @Override
method endVertex (line 200) | @Override
method defaultColor (line 205) | @Override
method unsetDefaultColor (line 210) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/BaseRenderer.java
class BaseRenderer (line 35) | public abstract class BaseRenderer {
method render (line 44) | public void render(RenderLevelStageEvent evt, Player player, ItemStack...
method bindBlocks (line 57) | private void bindBlocks() {
method renderLinkedInventoryOutline (line 61) | private static void renderLinkedInventoryOutline(RenderLevelStageEvent...
method getEnergy (line 91) | int getEnergy(Player player, ItemStack heldItem) {
method renderMissingBlock (line 99) | protected static void renderMissingBlock(Matrix4f matrix, VertexConsum...
method renderBoxSolid (line 103) | protected static void renderBoxSolid(Matrix4f matrix, VertexConsumer b...
method renderBoxSolid (line 114) | protected static void renderBoxSolid(Matrix4f matrix, VertexConsumer b...
method isLinkable (line 166) | public boolean isLinkable() {
method getMc (line 170) | static Minecraft getMc() {
method getBuilderWorld (line 174) | static MockBuilderWorld getBuilderWorld() {
method getCacheInventory (line 178) | static RemoteInventoryCache getCacheInventory() {
method setInventoryCache (line 182) | public static void setInventoryCache(Multiset<UniqueItem> cache) {
method updateInventoryCache (line 186) | public static void updateInventoryCache() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/BuildRender.java
class BuildRender (line 44) | public class BuildRender extends BaseRenderer {
method BuildRender (line 48) | public BuildRender(boolean isExchanger) {
method render (line 52) | @Override
method isLinkable (line 171) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/CopyPasteRender.java
class CopyPasteRender (line 38) | public class CopyPasteRender extends BaseRenderer implements IUpdateList...
method onTemplateUpdate (line 43) | @Override
method onTemplateUpdateSend (line 49) | @Override
method render (line 54) | @Override
method renderCopy (line 77) | private void renderCopy(PoseStack matrix, Region region) {
method renderPaste (line 128) | private void renderPaste(PoseStack matrices, Vec3 cameraView, Player p...
method renderTargets (line 159) | private void renderTargets(PoseStack matrix, Vec3 projectedView, Build...
method isLinkable (line 283) | @Override
class MultiVBORenderer (line 291) | public static class MultiVBORenderer implements Closeable {
method of (line 294) | public static MultiVBORenderer of(Consumer<MultiBufferSource> vertex...
method MultiVBORenderer (line 324) | protected MultiVBORenderer(Map<RenderType, DireVertexBuffer> buffers...
method sort (line 329) | public void sort(float x, float y, float z) {
method render (line 344) | public void render(Matrix4f matrix) {
method close (line 358) | public void close() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/renders/DestructionRender.java
class DestructionRender (line 22) | public class DestructionRender extends BaseRenderer {
method render (line 24) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/CopyGUI.java
class CopyGUI (line 23) | public class CopyGUI extends Screen {
method CopyGUI (line 37) | public CopyGUI(ItemStack tool) {
method init (line 42) | @Override
method drawFieldLabel (line 96) | private void drawFieldLabel(PoseStack matrices, String name, int x, in...
method coordsModeSwitch (line 100) | private void coordsModeSwitch() {
method updateTextFields (line 104) | private void updateTextFields() {
method render (line 125) | @Override
method keyPressed (line 140) | @Override
method charTyped (line 146) | @Override
method isPauseScreen (line 152) | @Override
class CenteredButton (line 157) | static class CenteredButton extends Button {
method CenteredButton (line 158) | CenteredButton(int y, int width, Component text, OnPress onPress) {
method centerButtonList (line 165) | static void centerButtonList(List<AbstractButton> buttons, int start...
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/DestructionGUI.java
class DestructionGUI (line 21) | public class DestructionGUI extends Screen {
method DestructionGUI (line 37) | public DestructionGUI(ItemStack tool) {
method init (line 42) | @Override
method createSlider (line 83) | public IncrementalSliderWidget createSlider(int x, int y, GuiTranslati...
method onSliderUpdate (line 87) | public void onSliderUpdate(IncrementalSliderWidget widget) {
method isWithinBounds (line 92) | private boolean isWithinBounds() {
method getSizeString (line 101) | private String getSizeString() {
method updateIsValid (line 109) | private void updateIsValid() {
method updateSizeString (line 122) | private void updateSizeString() {
method render (line 126) | @Override
method mouseReleased (line 136) | @Override
method isPauseScreen (line 141) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/GuiMod.java
type GuiMod (line 15) | public enum GuiMod {
method GuiMod (line 24) | GuiMod(Function<Player, ItemStack> stackReader, Function<ItemStack, Su...
method openScreen (line 29) | public boolean openScreen(Player player) {
method getLangKeySingle (line 42) | public static String getLangKeySingle(String name) {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/MaterialListGUI.java
class MaterialListGUI (line 31) | public class MaterialListGUI extends Screen implements ITemplateProvider...
method MaterialListGUI (line 63) | public MaterialListGUI(ItemStack item) {
method init (line 69) | @Override
method evaluateTemplateHeader (line 114) | public TemplateHeader evaluateTemplateHeader() {
method getHeader (line 125) | public TemplateHeader getHeader() {
method render (line 129) | @Override
method calculateButtonsWidthAndX (line 149) | private void calculateButtonsWidthAndX() {
method getTemplateCapability (line 169) | public Template getTemplateCapability() {
method setTaskHoveringText (line 192) | public void setTaskHoveringText(int x, int y, List<Component> text) {
method onTemplateUpdate (line 198) | @Override
method evaluateTitle (line 211) | private void evaluateTitle() {
method isPauseScreen (line 224) | @Override
method getWindowLeftX (line 229) | public int getWindowLeftX() {
method getWindowRightX (line 233) | public int getWindowRightX() {
method getWindowTopY (line 237) | public int getWindowTopY() {
method getWindowBottomY (line 241) | public int getWindowBottomY() {
method getWindowWidth (line 245) | public int getWindowWidth() {
method getWindowHeight (line 249) | public int getWindowHeight() {
method getTemplateItem (line 253) | public ItemStack getTemplateItem() {
method getXForAlignedRight (line 257) | public static int getXForAlignedRight(int right, int width) {
method getXForAlignedCenter (line 261) | public static int getXForAlignedCenter(int left, int right, int width) {
method getYForAlignedCenter (line 265) | public static int getYForAlignedCenter(int top, int bottom, int height) {
method renderTextVerticalCenter (line 269) | public static void renderTextVerticalCenter(PoseStack matrices, String...
method renderTextHorizontalRight (line 275) | public static void renderTextHorizontalRight(PoseStack matrices, Strin...
method isPointInBox (line 281) | public static boolean isPointInBox(double x, double y, int bx, int by,...
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/ModeRadialMenu.java
class ModeRadialMenu (line 53) | public class ModeRadialMenu extends Screen {
method ModeRadialMenu (line 63) | public ModeRadialMenu(ItemStack stack) {
method mouseAngle (line 71) | private static float mouseAngle(int x, int y, int mx, int my) {
method setSocketable (line 81) | public void setSocketable(ItemStack stack) {
method init (line 91) | @Override
method updateButtons (line 236) | private void updateButtons(ItemStack tool) {
method resetPos (line 296) | private int resetPos(ItemStack tool, int padding, int pos) {
method getGadget (line 302) | private ItemStack getGadget() {
method render (line 307) | @Override
method isCursorInSlice (line 460) | private boolean isCursorInSlice(float angle, float totalDeg, float deg...
method changeMode (line 464) | private void changeMode() {
method mouseClicked (line 487) | @Override
method tick (line 493) | @Override
method isPauseScreen (line 531) | @Override
method sendRangeUpdate (line 536) | private void sendRangeUpdate(int valueNew) {
type ScreenPosition (line 542) | public enum ScreenPosition {
class NameDisplayData (line 546) | private static final class NameDisplayData {
method NameDisplayData (line 552) | private NameDisplayData(int x, int y, boolean selected, boolean cent...
method getX (line 559) | private int getX() {
method getY (line 563) | private int getY() {
method isSelected (line 567) | private boolean isSelected() {
method isCentralized (line 571) | private boolean isCentralized() {
class PositionedIconActionable (line 576) | private static class PositionedIconActionable extends GuiIconActionable {
method PositionedIconActionable (line 579) | PositionedIconActionable(RadialTranslation message, String icon, Scr...
method PositionedIconActionable (line 585) | PositionedIconActionable(RadialTranslation message, String icon, Scr...
class Vector2f (line 590) | private static class Vector2f {
method Vector2f (line 594) | public Vector2f(float x, float y) {
method dot (line 599) | public final float dot(Vector2f v1) {
method length (line 603) | public final float length() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/PasteGUI.java
class PasteGUI (line 25) | public class PasteGUI extends Screen {
method PasteGUI (line 30) | PasteGUI(ItemStack tool) {
method init (line 35) | @Override
method sendPacket (line 71) | private void sendPacket() {
method onChange (line 75) | private void onChange(int value) {
method keyPressed (line 79) | @Override
method charTyped (line 85) | @Override
method isPauseScreen (line 91) | @Override
method render (line 96) | @Override
method drawLabel (line 107) | private void drawLabel(PoseStack matrices, String name, int x) {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/ScrollingMaterialList.java
class ScrollingMaterialList (line 32) | class ScrollingMaterialList extends EntryList<Entry> {
method ScrollingMaterialList (line 48) | public ScrollingMaterialList(MaterialListGUI gui) {
method updateEntries (line 57) | private void updateEntries() {
method getScrollbarPosition (line 83) | @Override
method keyPressed (line 88) | @Override
method render (line 99) | @Override
method reset (line 107) | public void reset() {
class Entry (line 111) | static class Entry extends ObjectSelectionList.Entry<Entry> {
method Entry (line 125) | public Entry(ScrollingMaterialList parent, IUniqueObject<?> item, in...
method render (line 139) | @Override
method drawTextOverlay (line 157) | private void drawTextOverlay(PoseStack matrices, int right, int top,...
method drawHoveringText (line 164) | private void drawHoveringText(ItemStack item, int slotX, int slotY, ...
method drawIcon (line 169) | private void drawIcon(PoseStack matrices, ItemStack item, int slotX,...
method hasEnoughItems (line 176) | private boolean hasEnoughItems() {
method getTextColor (line 180) | private int getTextColor() {
method getRequired (line 184) | public int getRequired() {
method getAvailable (line 188) | public int getAvailable() {
method getMissing (line 192) | public int getMissing() {
method getStack (line 196) | public ItemStack getStack() {
method getItemName (line 200) | public String getItemName() {
method getFormattedRequired (line 204) | public String getFormattedRequired() {
method mouseClicked (line 213) | @Override
method isSelected (line 223) | public boolean isSelected() {
method getNarration (line 227) | @Override
method getSortingMode (line 233) | public SortingModes getSortingMode() {
method setSortingMode (line 237) | public void setSortingMode(SortingModes sortingMode) {
method sort (line 242) | private void sort() {
type SortingModes (line 246) | enum SortingModes {
method SortingModes (line 258) | SortingModes(Comparator<Entry> comparator, ITranslationProvider prov...
method getComparator (line 263) | public Comparator<Entry> getComparator() {
method getLocalizedName (line 267) | public String getLocalizedName() {
method getTranslationProvider (line 271) | public ITranslationProvider getTranslationProvider() {
method next (line 275) | public SortingModes next() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/TemplateManagerGUI.java
class TemplateManagerGUI (line 77) | public class TemplateManagerGUI extends AbstractContainerScreen<Template...
method TemplateManagerGUI (line 98) | public TemplateManagerGUI(TemplateManagerContainer container, Inventor...
method init (line 105) | @Override
method render (line 121) | @Override
method renderBg (line 134) | @Override
method validateCache (line 157) | private void validateCache(float partialTicks) {
method renderStructure (line 189) | private void renderStructure(IBuildView view, float partialTicks) {
method renderRequirement (line 250) | private void renderRequirement(PoseStack matrices, int mouseX, int mou...
method pasteTemplateToStack (line 299) | private void pasteTemplateToStack(Level world, ItemStack stack, Templa...
method pasteTemplateToStack (line 304) | private void pasteTemplateToStack(ITemplateProvider provider, ItemStac...
method replaceStack (line 314) | private boolean replaceStack() {
method rename (line 330) | private void rename(ItemStack stack) {
method renderPanel (line 342) | private void renderPanel() {
method resetViewport (line 409) | private void resetViewport() {
method mouseClicked (line 419) | @Override
method mouseReleased (line 431) | @Override
method keyPressed (line 443) | @Override
method renderLabels (line 453) | @Override
method drawSlotOverlay (line 482) | private void drawSlotOverlay(PoseStack matrices, Slot slot) {
method mouseScrolled (line 489) | @Override
method containerTick (line 498) | @Override
method getWorld (line 525) | private Level getWorld() {
method getMinecraft (line 529) | @Override
method runAfterUpdate (line 536) | private void runAfterUpdate(int slot, Runnable runnable) {
method onSave (line 551) | private void onSave() {
method onLoad (line 570) | private void onLoad() {
method onCopy (line 589) | private void onCopy() {
method onPaste (line 620) | private void onPaste() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/DireButton.java
class DireButton (line 11) | public class DireButton extends Button {
method DireButton (line 13) | public DireButton(int x, int y, int widthIn, int heightIn, Component b...
method render (line 19) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/EntryList.java
class EntryList (line 13) | public class EntryList<E extends Entry<E>> extends ObjectSelectionList<E> {
method EntryList (line 17) | public EntryList(int left, int top, int width, int height, int slotHei...
method render (line 23) | @Override
method renderParts (line 39) | private void renderParts(PoseStack matrices, int mouseX, int mouseY, f...
method renderContentBackground (line 88) | protected void renderContentBackground(PoseStack matrices, Tesselator ...
method renderBackground (line 92) | @Override
method mouseClicked (line 97) | @Override
method mouseReleased (line 104) | @Override
method mouseDragged (line 110) | @Override
method getMaxScroll (line 123) | public final int getMaxScroll() {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/GuiIconActionable.java
class GuiIconActionable (line 23) | public class GuiIconActionable extends Button {
method GuiIconActionable (line 35) | public GuiIconActionable(int x, int y, String texture, Component messa...
method GuiIconActionable (line 54) | public GuiIconActionable(int x, int y, String texture, Component messa...
method setFaded (line 58) | public void setFaded(boolean faded) {
method setSelected (line 65) | public void setSelected(boolean selected) {
method playDownSound (line 70) | @Override
method onClick (line 75) | @Override
method render (line 86) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/GuiIncrementer.java
class GuiIncrementer (line 13) | public class GuiIncrementer extends AbstractWidget {
method GuiIncrementer (line 29) | public GuiIncrementer(int x, int y, int min, int max, @Nullable IIncre...
method GuiIncrementer (line 46) | public GuiIncrementer(int x, int y) {
method getValue (line 50) | public int getValue() {
method updateValue (line 54) | private void updateValue(boolean isMinus) {
method setValue (line 63) | public void setValue(int value) {
method renderWidget (line 75) | @Override
method mouseClicked (line 82) | @Override
method keyPressed (line 91) | @Override
method charTyped (line 100) | @Override
method getX (line 115) | public int getX() {
method getY (line 119) | public int getY() {
method updateWidgetNarration (line 124) | @Override
type IIncrementerChanged (line 129) | public interface IIncrementerChanged {
method onChange (line 130) | void onChange(int value);
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/GuiTextFieldBase.java
class GuiTextFieldBase (line 9) | public class GuiTextFieldBase extends EditBox {
method GuiTextFieldBase (line 14) | public GuiTextFieldBase(Font fontRenderer, int x, int y, int width) {
method setValue (line 24) | @Override
method postModification (line 32) | public void postModification(String text) {
method restrictToNumeric (line 40) | public GuiTextFieldBase restrictToNumeric() {
method getInt (line 57) | public int getInt() {
method setDefaultInt (line 65) | public GuiTextFieldBase setDefaultInt(int defaultInt) {
method setDefaultValue (line 69) | public GuiTextFieldBase setDefaultValue(String defaultValue) {
FILE: src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/IncrementalSliderWidget.java
class IncrementalSliderWidget (line 22) | public class IncrementalSliderWidget extends ForgeSlider {
method IncrementalSliderWidget (line 29) | public IncrementalSliderWidget(int x, int y, int width, int height, do...
method renderWidget (line 34) | @Override
method renderText (line 41) | private void renderText(PoseStack matrices) {
method drawBorderedRect (line 48) | private void drawBorderedRect(PoseStack matrices, int x, int y, int wi...
method applyValue (line 53) | @Override
method onRelease (line 58) | @Override
method playDownSound (line 62) | @Override
method mouseReleased (line 66) | @Override
method createAlphaColor (line 78) | private static Color createAlphaColor(Color color, int alpha) {
method getComponents (line 83) | public Collection<AbstractWidget> getComponents() {
class GuiButtonIncrement (line 97) | private class GuiButtonIncrement extends Button {
method GuiButtonIncrement (line 98) | public GuiButtonIncrement(int x, int y, int width, int height, Compo...
method render (line 104) | @Override
method onRelease (line 118) | @Override
method playDownSound (line 122) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/BuildingGadgets.java
class BuildingGadgets (line 49) | @Mod(Reference.MODID)
method BuildingGadgets (line 56) | public BuildingGadgets() {
method registerCreativeTab (line 87) | private void registerCreativeTab(CreativeModeTabEvent.Register registe...
method registerCaps (line 120) | private void registerCaps(RegisterCapabilitiesEvent event) {
method clientSetup (line 125) | private void clientSetup(final FMLClientSetupEvent event) {
method setup (line 129) | private void setup(final FMLCommonSetupEvent event) {
method loadComplete (line 133) | private void loadComplete(FMLLoadCompleteEvent event) {
method handleIMC (line 137) | private void handleIMC(InterModProcessEvent event) {
method handleIMCMessage (line 141) | private void handleIMCMessage(InterModComms.IMCMessage message) {
method commandRegister (line 148) | @SubscribeEvent
method serverLoaded (line 161) | private void serverLoaded(ServerStartedEvent event) {
method serverStopped (line 165) | private void serverStopped(ServerStoppedEvent event) {
method onEnqueueIMC (line 169) | private void onEnqueueIMC(InterModEnqueueEvent event) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/blocks/ConstructionBlock.java
class ConstructionBlock (line 30) | public class ConstructionBlock extends Block implements EntityBlock /*im...
method ConstructionBlock (line 36) | public ConstructionBlock() {
method hasDynamicShape (line 89) | @Override
method createBlockStateDefinition (line 94) | @Override
method newBlockEntity (line 100) | @Nullable
method isMimicNull (line 106) | public boolean isMimicNull(BlockState mimicBlock) {
method getActualMimicBlock (line 110) | @Nullable
method getRenderShape (line 119) | @Override
method getLightBlock (line 125) | @Override
method getCollisionShape (line 141) | @Override
method entityInside (line 147) | @Override
method isPathfindable (line 157) | @Override
method skipRendering (line 164) | @Override
method getShape (line 178) | @Override
method getOcclusionShape (line 184) | @Override
method getInteractionShape (line 193) | @Override
method propagatesSkylightDown (line 200) | @Override
method getShadeBrightness (line 244) | @Deprecated
FILE: src/main/java/com/direwolf20/buildinggadgets/common/blocks/ConstructionBlockDense.java
class ConstructionBlockDense (line 6) | public class ConstructionBlockDense extends Block {
method ConstructionBlockDense (line 7) | public ConstructionBlockDense() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/blocks/ConstructionBlockPowder.java
class ConstructionBlockPowder (line 23) | public class ConstructionBlockPowder extends FallingBlock {
method ConstructionBlockPowder (line 24) | public ConstructionBlockPowder() {
method appendHoverText (line 28) | @Override
method onLand (line 34) | @Override
method tryTouchWater (line 40) | private boolean tryTouchWater(Level worldIn, BlockPos pos) {
method neighborChanged (line 59) | @Override
method onPlace (line 64) | @Override
method getLightBlock (line 71) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/blocks/EffectBlock.java
class EffectBlock (line 38) | @MethodsReturnNonnullByDefault
type Mode (line 42) | public enum Mode {
method onBuilderRemoved (line 45) | @Override
method onBuilderRemoved (line 76) | @Override
method onBuilderRemoved (line 82) | @Override
method onBuilderRemoved (line 90) | public abstract void onBuilderRemoved(EffectBlockTileEntity builder);
method getTicker (line 93) | @Nullable
method spawnUndoBlock (line 105) | public static void spawnUndoBlock(BuildContext context, PlacementTarge...
method spawnEffectBlock (line 118) | public static void spawnEffectBlock(BuildContext context, PlacementTar...
method spawnEffectBlock (line 122) | public static void spawnEffectBlock(LevelAccessor world, BlockPos spaw...
method spawnEffectBlock (line 128) | private static void spawnEffectBlock(@Nullable BlockEntity curTe, Bloc...
method EffectBlock (line 145) | public EffectBlock() {
method newBlockEntity (line 150) | @Nullable
method getOcclusionShape (line 156) | @Override
method getShape (line 161) | @Override
method getRenderShape (line 171) | @Override
method skipRendering (line 179) | @Override
method getDrops (line 189) | @Override
method getPistonPushReaction (line 197) | @Override
method getLightBlock (line 203) | @Override
method getShadeBrightness (line 208) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/blocks/OurBlocks.java
class OurBlocks (line 9) | public final class OurBlocks {
method OurBlocks (line 10) | private OurBlocks() {}
FILE: src/main/java/com/direwolf20/buildinggadgets/common/blocks/TemplateManager.java
class TemplateManager (line 31) | public class TemplateManager extends Block implements EntityBlock {
method TemplateManager (line 34) | public TemplateManager() {
method createBlockStateDefinition (line 39) | @Override
method onRemove (line 45) | @Override
method getStateForPlacement (line 53) | @Nullable
method newBlockEntity (line 59) | @Nullable
method use (line 65) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/CapabilityProviderEnergy.java
class CapabilityProviderEnergy (line 14) | public class CapabilityProviderEnergy implements ICapabilityProvider {
method CapabilityProviderEnergy (line 18) | public CapabilityProviderEnergy(ItemStack stack, IntSupplier energyCap...
method getCapability (line 23) | @Nonnull
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/CapabilityTemplate.java
class CapabilityTemplate (line 9) | public class CapabilityTemplate {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/ConfigEnergyStorage.java
class ConfigEnergyStorage (line 8) | @Tainted(reason = "This shouldn't have have 3 layers")
method ConfigEnergyStorage (line 15) | public ConfigEnergyStorage(IntSupplier capacitySupplier, IntSupplier e...
method ConfigEnergyStorage (line 22) | public ConfigEnergyStorage(IntSupplier capacitySupplier, IntSupplier t...
method ConfigEnergyStorage (line 26) | public ConfigEnergyStorage(IntSupplier capacity) {
method getEnergyStored (line 30) | @Override
method getMaxEnergyStored (line 36) | @Override
method receiveEnergy (line 41) | @Override
method extractEnergy (line 53) | @Override
method canExtract (line 69) | @Override
method canReceive (line 78) | @Override
method getExtractSupplier (line 83) | protected IntSupplier getExtractSupplier() {
method getReceiveSupplier (line 87) | protected IntSupplier getReceiveSupplier() {
method evaluateEnergyExtracted (line 91) | protected int evaluateEnergyExtracted(int maxExtract, boolean simulate) {
method evaluateEnergyReceived (line 95) | protected int evaluateEnergyReceived(int maxReceive, boolean simulate) {
method setEnergy (line 99) | public void setEnergy(int energy) {
method getEnergyStoredCache (line 103) | protected int getEnergyStoredCache() {
method writeEnergy (line 107) | protected abstract void writeEnergy();
method updateEnergy (line 109) | protected abstract void updateEnergy();
method updateMaxEnergy (line 111) | protected void updateMaxEnergy() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/IPrivateEnergy.java
type IPrivateEnergy (line 5) | public interface IPrivateEnergy extends IEnergyStorage {
method extractPower (line 11) | int extractPower(int maxExtract, boolean simulate);
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/ItemEnergyForge.java
class ItemEnergyForge (line 9) | public final class ItemEnergyForge extends ConfigEnergyStorage implement...
method ItemEnergyForge (line 12) | public ItemEnergyForge(ItemStack stack, IntSupplier capacity) {
method writeEnergy (line 17) | protected void writeEnergy() {
method updateEnergy (line 22) | protected void updateEnergy() {
method extractEnergy (line 29) | @Override
method extractPower (line 38) | public int extractPower(int maxExtract, boolean simulate) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/ItemTemplateKey.java
class ItemTemplateKey (line 11) | public final class ItemTemplateKey implements ITemplateKey {
method ItemTemplateKey (line 14) | public ItemTemplateKey(ItemStack stack) {
method getTemplateId (line 18) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/PasteContainerCapabilityProvider.java
class PasteContainerCapabilityProvider (line 13) | public class PasteContainerCapabilityProvider implements ICapabilityProv...
method PasteContainerCapabilityProvider (line 16) | public PasteContainerCapabilityProvider(ItemStack container) {
method getCapability (line 20) | @Nonnull
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/PasteContainerItemHandler.java
class PasteContainerItemHandler (line 11) | public final class PasteContainerItemHandler implements IItemHandlerModi...
method PasteContainerItemHandler (line 15) | public PasteContainerItemHandler(ItemStack container) {
method setStackInSlot (line 20) | @Override
method getSlots (line 25) | @Override
method getStackInSlot (line 30) | @Nonnull
method insertItem (line 37) | @Nonnull
method extractItem (line 54) | @Nonnull
method getSlotLimit (line 73) | @Override
method isItemValid (line 78) | @Override
method getCount (line 83) | private int getCount() {
method getContainerItem (line 87) | private ConstructionPasteContainer getContainerItem() {
method setCount (line 91) | private int setCount(int count, boolean simulate) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/provider/MultiCapabilityProvider.java
class MultiCapabilityProvider (line 17) | @Tainted(reason = "Not required in any way")
method MultiCapabilityProvider (line 22) | public MultiCapabilityProvider(ICapabilityProvider... childProviders) {
method MultiCapabilityProvider (line 26) | public MultiCapabilityProvider(ImmutableList<ICapabilityProvider> chil...
method getCapability (line 30) | @Nonnull
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/provider/TemplateKeyProvider.java
class TemplateKeyProvider (line 15) | public final class TemplateKeyProvider implements ICapabilityProvider {
method TemplateKeyProvider (line 18) | public TemplateKeyProvider(ItemStack stack) {
method getCapability (line 23) | @Nonnull
FILE: src/main/java/com/direwolf20/buildinggadgets/common/capability/provider/TemplateProviderCapabilityProvider.java
class TemplateProviderCapabilityProvider (line 13) | public final class TemplateProviderCapabilityProvider implements ICapabi...
method TemplateProviderCapabilityProvider (line 16) | public TemplateProviderCapabilityProvider(ITemplateProvider provider) {
method getCapability (line 20) | @Nonnull
FILE: src/main/java/com/direwolf20/buildinggadgets/common/commands/AllowPlayerOverrideManager.java
class AllowPlayerOverrideManager (line 19) | final class AllowPlayerOverrideManager {
method AllowPlayerOverrideManager (line 26) | public AllowPlayerOverrideManager(ITranslationProvider noPlayerTransla...
method toggleAllowOverride (line 41) | void toggleAllowOverride(Player player) {
method toggleAllowOverride (line 45) | void toggleAllowOverride(UUID uuid) {
method mayOverride (line 53) | boolean mayOverride(UUID uuid) {
method mayOverride (line 58) | boolean mayOverride(Player player) {
method executeToggle (line 62) | int executeToggle(CommandContext<CommandSourceStack> context, Player p...
method executeList (line 73) | int executeList(CommandContext<CommandSourceStack> context) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/commands/ForceUnloadedCommand.java
class ForceUnloadedCommand (line 13) | public class ForceUnloadedCommand {
method toggleAllowUnloadedChunks (line 19) | public static void toggleAllowUnloadedChunks(Player player) {
method toggleAllowUnloadedChunks (line 23) | public static void toggleAllowUnloadedChunks(UUID uuid) {
method mayForceUnloadedChunks (line 27) | public static boolean mayForceUnloadedChunks(UUID uuid) {
method mayForceUnloadedChunks (line 31) | public static boolean mayForceUnloadedChunks(Player player) {
method registerToggle (line 35) | public static LiteralArgumentBuilder<CommandSourceStack> registerToggl...
method registerList (line 43) | public static LiteralArgumentBuilder<CommandSourceStack> registerList() {
method executeToggle (line 49) | private static int executeToggle(CommandContext<CommandSourceStack> co...
method executeList (line 53) | private static int executeList(CommandContext<CommandSourceStack> cont...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/commands/OverrideBuildSizeCommand.java
class OverrideBuildSizeCommand (line 13) | public final class OverrideBuildSizeCommand {
method toggleAllowLargeBuilds (line 19) | public static void toggleAllowLargeBuilds(Player player) {
method toggleAllowLargeBuilds (line 23) | public static void toggleAllowLargeBuilds(UUID uuid) {
method mayPerformLargeBuild (line 27) | public static boolean mayPerformLargeBuild(UUID uuid) {
method mayPerformLargeBuild (line 31) | public static boolean mayPerformLargeBuild(Player player) {
method registerToggle (line 35) | public static LiteralArgumentBuilder<CommandSourceStack> registerToggl...
method registerList (line 43) | public static LiteralArgumentBuilder<CommandSourceStack> registerList() {
method executeToggle (line 49) | private static int executeToggle(CommandContext<CommandSourceStack> co...
method executeList (line 53) | private static int executeList(CommandContext<CommandSourceStack> cont...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/commands/OverrideCopySizeCommand.java
class OverrideCopySizeCommand (line 13) | public final class OverrideCopySizeCommand {
method toggleAllowLargeCopies (line 19) | public static void toggleAllowLargeCopies(Player player) {
method toggleAllowLargeCopies (line 23) | public static void toggleAllowLargeCopies(UUID uuid) {
method mayPerformLargeCopy (line 27) | public static boolean mayPerformLargeCopy(UUID uuid) {
method mayPerformLargeCopy (line 31) | public static boolean mayPerformLargeCopy(Player player) {
method registerToggle (line 35) | public static LiteralArgumentBuilder<CommandSourceStack> registerToggl...
method registerList (line 43) | public static LiteralArgumentBuilder<CommandSourceStack> registerList() {
method executeToggle (line 49) | private static int executeToggle(CommandContext<CommandSourceStack> co...
method executeList (line 53) | private static int executeList(CommandContext<CommandSourceStack> cont...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/config/Config.java
class Config (line 13) | @EventBusSubscriber
class CategoryGeneral (line 22) | public static final class CategoryGeneral {
method CategoryGeneral (line 30) | private CategoryGeneral() {
class CategoryGadgets (line 56) | public static final class CategoryGadgets {
method CategoryGadgets (line 65) | private CategoryGadgets() {
class GadgetConfig (line 87) | public static class GadgetConfig {
method GadgetConfig (line 92) | public GadgetConfig(String name, int maxEnergy, int energyCost, in...
class CategoryGadgetDestruction (line 111) | public static final class CategoryGadgetDestruction extends GadgetCo...
method CategoryGadgetDestruction (line 116) | private CategoryGadgetDestruction() {
class CategoryGadgetCopyPaste (line 142) | public static final class CategoryGadgetCopyPaste extends GadgetConf...
method CategoryGadgetCopyPaste (line 147) | private CategoryGadgetCopyPaste() {
class CategoryPasteContainers (line 175) | public static final class CategoryPasteContainers {
method CategoryPasteContainers (line 179) | private CategoryPasteContainers() {
method getMaxCapacity (line 191) | private static IntValue getMaxCapacity(int tier) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/config/RecipeConstructionPaste.java
class RecipeConstructionPaste (line 15) | public class RecipeConstructionPaste extends ShapedRecipe {
method RecipeConstructionPaste (line 17) | public RecipeConstructionPaste(ResourceLocation id, String group, Craf...
method assemble (line 22) | @Override
method getSerializer (line 37) | @Override
class Serializer (line 42) | public static final class Serializer extends ShapedRecipe.Serializer {
method fromJson (line 45) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/containers/BaseContainer.java
class BaseContainer (line 10) | public abstract class BaseContainer extends AbstractContainerMenu {
method BaseContainer (line 11) | public BaseContainer(@Nullable MenuType<?> p_i50105_1_, int p_i50105_2...
method addPlayerSlots (line 15) | protected void addPlayerSlots(Inventory playerInventory, int inX, int ...
method addPlayerSlots (line 32) | protected void addPlayerSlots(Inventory playerInventory) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/containers/OurContainers.java
class OurContainers (line 10) | public final class OurContainers {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/containers/TemplateManagerContainer.java
class TemplateManagerContainer (line 21) | public class TemplateManagerContainer extends BaseContainer {
method TemplateManagerContainer (line 27) | public TemplateManagerContainer(int windowId, Inventory playerInventor...
method TemplateManagerContainer (line 36) | public TemplateManagerContainer(int windowId, Inventory playerInventor...
method stillValid (line 44) | @Override
method addOwnSlots (line 49) | private void addOwnSlots() {
method quickMoveStack (line 56) | @Override
method getTe (line 84) | public TemplateManagerTileEntity getTe() {
class SlotTemplateManager (line 88) | public static class SlotTemplateManager extends SlotItemHandler {
method SlotTemplateManager (line 91) | public SlotTemplateManager(IItemHandler itemHandler, int index, int ...
method getMaxStackSize (line 97) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/entities/ConstructionBlockEntity.java
class ConstructionBlockEntity (line 22) | public class ConstructionBlockEntity extends EntityBase {
method ConstructionBlockEntity (line 27) | public ConstructionBlockEntity(Level world, BlockPos spawnPos, boolean...
method ConstructionBlockEntity (line 35) | public ConstructionBlockEntity(EntityType<?> constructionBlockEntityEn...
method ConstructionBlockEntity (line 39) | public ConstructionBlockEntity(Level level) {
method getMaxLife (line 43) | @Override
method defineSynchedData (line 48) | @Override
method shouldSetDespawning (line 54) | @Override
method onSetDespawning (line 66) | @Override
method setMakingPaste (line 98) | public void setMakingPaste(boolean paste) {
method getMakingPaste (line 102) | public boolean getMakingPaste() {
method readAdditionalSaveData (line 106) | @Override
method addAdditionalSaveData (line 112) | @Override
method getAddEntityPacket (line 118) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/entities/ConstructionBlockEntityRender.java
class ConstructionBlockEntityRender (line 23) | public class ConstructionBlockEntityRender extends EntityRenderer<Constr...
method ConstructionBlockEntityRender (line 25) | public ConstructionBlockEntityRender(EntityRendererProvider.Context re...
method render (line 30) | @Override
method getTextureLocation (line 59) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/entities/EntityBase.java
class EntityBase (line 11) | public abstract class EntityBase extends Entity {
method EntityBase (line 15) | public EntityBase(EntityType<?> entityType, Level world) {
method getMaxLife (line 19) | protected abstract int getMaxLife();
method onSetDespawning (line 21) | protected abstract void onSetDespawning();
method baseTick (line 23) | @Override
method shouldSetDespawning (line 33) | protected boolean shouldSetDespawning() {
method readAdditionalSaveData (line 37) | @Override
method addAdditionalSaveData (line 44) | @Override
method shouldRender (line 51) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/entities/OurEntities.java
class OurEntities (line 14) | @Mod.EventBusSubscriber(modid = Reference.MODID, value = Dist.CLIENT, bu...
method registerModels (line 25) | @SubscribeEvent
FILE: src/main/java/com/direwolf20/buildinggadgets/common/events/BreakEventHandler.java
class BreakEventHandler (line 7) | @EventBusSubscriber
method GetDrops (line 9) | @SubscribeEvent
FILE: src/main/java/com/direwolf20/buildinggadgets/common/events/ItemPickupHandler.java
class ItemPickupHandler (line 11) | @EventBusSubscriber
method GetDrops (line 14) | @SubscribeEvent
FILE: src/main/java/com/direwolf20/buildinggadgets/common/events/WorldTemplateProviderHandler.java
class WorldTemplateProviderHandler (line 16) | @EventBusSubscriber
method onAttachWorldCapabilities (line 19) | @SubscribeEvent
method insertProvider (line 27) | private static void insertProvider(AttachCapabilitiesEvent<Level> even...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/AbstractGadget.java
class AbstractGadget (line 64) | public abstract class AbstractGadget extends Item {
method AbstractGadget (line 70) | public AbstractGadget(Properties builder, IntSupplier undoLengthSuppli...
method getEnergyMax (line 79) | public abstract int getEnergyMax();
method getEnergyCost (line 81) | public abstract int getEnergyCost(ItemStack tool);
method getWhiteList (line 83) | public TagKey<Block> getWhiteList() {
method getBlackList (line 87) | public TagKey<Block> getBlackList() {
method getRender (line 91) | @OnlyIn(Dist.CLIENT)
method createRenderFactory (line 96) | protected abstract Supplier<BaseRenderer> createRenderFactory();
method getUndoSave (line 98) | protected UndoWorldSave getUndoSave() {
method addCapabilityProviders (line 102) | protected void addCapabilityProviders(ImmutableList.Builder<ICapabilit...
method initCapabilities (line 106) | @Override
method getBarWidth (line 114) | @Override
method getBarColor (line 124) | @Override
method isDamaged (line 134) | @Override
method isBarVisible (line 145) | @Override
method isValidRepairItem (line 153) | @Override
method isAllowedBlock (line 158) | public boolean isAllowedBlock(BlockState block) {
method getGadget (line 167) | public static ItemStack getGadget(Player player) {
method canUse (line 178) | public boolean canUse(ItemStack tool, Player player) {
method applyDamage (line 185) | public void applyDamage(ItemStack tool, ServerPlayer player) {
method addEnergyInformation (line 192) | protected void addEnergyInformation(List<Component> tooltip, ItemStack...
method onRotate (line 203) | public final void onRotate(ItemStack stack, Player player) {
method performRotate (line 208) | protected boolean performRotate(ItemStack stack, Player player) {
method onMirror (line 212) | public final void onMirror(ItemStack stack, Player player) {
method performMirror (line 217) | protected boolean performMirror(ItemStack stack, Player player) {
method onAnchor (line 221) | public final void onAnchor(ItemStack stack, Player player) {
method onAnchorSet (line 234) | protected void onAnchorSet(ItemStack stack, Player player, BlockHitRes...
method onAnchorRemoved (line 238) | protected void onAnchorRemoved(ItemStack stack, Player player) {
method getAnchor (line 242) | @Nullable
method getFuzzy (line 247) | public static boolean getFuzzy(ItemStack stack) {
method toggleFuzzy (line 251) | public static void toggleFuzzy(Player player, ItemStack stack) {
method getConnectedArea (line 256) | public static boolean getConnectedArea(ItemStack stack) {
method toggleConnectedArea (line 260) | public static void toggleConnectedArea(Player player, ItemStack stack) {
method shouldRayTraceFluid (line 266) | public static boolean shouldRayTraceFluid(ItemStack stack) {
method toggleRayTraceFluid (line 270) | public static void toggleRayTraceFluid(ServerPlayer player, ItemStack ...
method addInformationRayTraceFluid (line 275) | public static void addInformationRayTraceFluid(List<Component> tooltip...
method getUUID (line 282) | public UUID getUUID(ItemStack stack) {
method getRangeInBlocks (line 293) | public static int getRangeInBlocks(int range, AbstractMode mode) {
method pushUndo (line 305) | protected void pushUndo(ItemStack stack, Undo undo) {
method undo (line 315) | public void undo(Level world, Player player, ItemStack stack) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/ConstructionPaste.java
class ConstructionPaste (line 12) | public class ConstructionPaste extends Item {
method ConstructionPaste (line 13) | public ConstructionPaste() {
method use (line 17) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/ConstructionPasteContainer.java
class ConstructionPasteContainer (line 28) | public class ConstructionPasteContainer extends Item {
method ConstructionPasteContainer (line 34) | public ConstructionPasteContainer(boolean isCreative, IntSupplier maxC...
method getRenderPropertiesInternal (line 41) | @Override
method ConstructionPasteContainer (line 46) | public ConstructionPasteContainer(boolean isCreative) {
method initCapabilities (line 50) | @Override
method setPasteCount (line 55) | public void setPasteCount(ItemStack stack, int amount) {
method getPasteCount (line 63) | public int getPasteCount(ItemStack stack) {
method use (line 71) | @Override
method appendHoverText (line 87) | @Override
method setPasteAmount (line 102) | public static void setPasteAmount(ItemStack stack, int amount) {
method getPasteAmount (line 113) | public static int getPasteAmount(ItemStack stack) {
method getMaxPasteAmount (line 121) | public static int getMaxPasteAmount(ItemStack stack) {
method getMaxCapacity (line 129) | public int getMaxCapacity() {
method isCreative (line 133) | public boolean isCreative() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetBuilding.java
class GadgetBuilding (line 58) | public class GadgetBuilding extends AbstractGadget {
method GadgetBuilding (line 62) | public GadgetBuilding() {
method getEnergyMax (line 70) | @Override
method getEnergyCost (line 75) | @Override
method createRenderFactory (line 80) | @Override
method placeAtop (line 85) | public boolean placeAtop(ItemStack stack) {
method setToolMode (line 89) | private static void setToolMode(ItemStack tool, BuildingModes mode) {
method getToolMode (line 95) | public static BuildingModes getToolMode(ItemStack tool) {
method shouldPlaceAtop (line 100) | public static boolean shouldPlaceAtop(ItemStack stack) {
method togglePlaceAtop (line 104) | public static void togglePlaceAtop(Player player, ItemStack stack) {
method appendHoverText (line 109) | @Override
method use (line 143) | @Override
method setMode (line 173) | public void setMode(ItemStack heldItem, int modeInt) {
method rangeChange (line 179) | public static void rangeChange(Player player, ItemStack heldItem) {
method build (line 192) | private void build(ServerPlayer player, ItemStack stack) {
method placeBlock (line 234) | private void placeBlock(Level world, ServerPlayer player, IItemIndex i...
method getGadget (line 272) | public static ItemStack getGadget(Player player) {
method performRotate (line 279) | @Override
method performMirror (line 285) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetCopyPaste.java
class GadgetCopyPaste (line 75) | public class GadgetCopyPaste extends AbstractGadget {
type ToolMode (line 77) | public enum ToolMode {
method ToolMode (line 94) | ToolMode(ITranslationProvider translation, int id) {
method getId (line 99) | public byte getId() {
method ofId (line 103) | @Nullable
method getTranslation (line 108) | public ITranslationProvider getTranslation() {
method GadgetCopyPaste (line 115) | public GadgetCopyPaste() {
method getEnergyMax (line 123) | @Override
method getEnergyCost (line 128) | @Override
method createRenderFactory (line 133) | @Override
method getRender (line 138) | @Override
method addCapabilityProviders (line 143) | @Override
method performRotate (line 149) | @Override
method performMirror (line 161) | @Override
method setRelativeVector (line 173) | public static void setRelativeVector(ItemStack stack, BlockPos vec) {
method getRelativeVector (line 181) | public static BlockPos getRelativeVector(ItemStack stack) {
method getCopyCounter (line 187) | public static int getCopyCounter(ItemStack stack) {
method getAndIncrementCopyCounter (line 192) | public static int getAndIncrementCopyCounter(ItemStack stack) {
method getActivePos (line 199) | public static Optional<BlockPos> getActivePos(Player playerEntity, Ite...
method getSelectedRegion (line 210) | public static Optional<Region> getSelectedRegion(ItemStack stack) {
method setSelectedRegion (line 218) | public static void setSelectedRegion(ItemStack stack, @Nullable Region...
method setUpperRegionBound (line 228) | public static void setUpperRegionBound(ItemStack stack, @Nullable Bloc...
method setLowerRegionBound (line 236) | public static void setLowerRegionBound(ItemStack stack, @Nullable Bloc...
method getUpperRegionBound (line 244) | @Nullable
method getLowerRegionBound (line 252) | @Nullable
method setToolMode (line 260) | private static void setToolMode(ItemStack stack, ToolMode mode) {
method getToolMode (line 265) | public static ToolMode getToolMode(ItemStack stack) {
method onAnchorSet (line 281) | @Override
method getGadget (line 287) | public static ItemStack getGadget(Player player) {
method appendHoverText (line 295) | @Override
method setMode (line 308) | public void setMode(ItemStack heldItem, int modeInt) {
method use (line 314) | @Override
method getTooltipImage (line 351) | @Override
method setRegionAndCopy (line 356) | private void setRegionAndCopy(ItemStack stack, Level world, Player pla...
method tryCopy (line 372) | public void tryCopy(ItemStack stack, Level world, Player player, Regio...
method checkCopy (line 382) | private boolean checkCopy(Level world, Player player, Region region) {
method performCopy (line 404) | private void performCopy(ItemStack stack, WorldBuildView buildView) {
method onCopyFinished (line 418) | private void onCopyFinished(Template newTemplate, ItemStack stack, Pla...
method build (line 426) | private void build(ItemStack stack, Level world, Player player, BlockP...
method checkPlacement (line 443) | private boolean checkPlacement(Level world, Player player, Region regi...
method schedulePlacement (line 465) | private void schedulePlacement(ItemStack stack, IBuildView view, Playe...
method onBuildFinished (line 484) | private void onBuildFinished(ItemStack stack, Player player, Region bo...
method sendMessage (line 489) | private void sendMessage(ItemStack stack, Player player, ITranslationP...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetDestruction.java
class GadgetDestruction (line 51) | public class GadgetDestruction extends AbstractGadget {
method GadgetDestruction (line 53) | public GadgetDestruction() {
method getEnergyMax (line 61) | @Override
method getEnergyCost (line 66) | @Override
method createRenderFactory (line 71) | @Override
method getCostMultiplier (line 76) | private int getCostMultiplier(ItemStack tool) {
method appendHoverText (line 80) | @Override
method setAnchor (line 105) | public static void setAnchor(ItemStack stack, BlockPos pos) {
method setAnchorSide (line 109) | public static void setAnchorSide(ItemStack stack, Direction side) {
method getAnchorSide (line 117) | public static Direction getAnchorSide(ItemStack stack) {
method setToolValue (line 125) | public static void setToolValue(ItemStack stack, int value, String val...
method getToolValue (line 129) | public static int getToolValue(ItemStack stack, String valueName) {
method getOverlay (line 133) | public static boolean getOverlay(ItemStack stack) {
method setOverlay (line 143) | public static void setOverlay(ItemStack stack, boolean showOverlay) {
method switchOverlay (line 147) | public static void switchOverlay(Player player, ItemStack stack) {
method getIsFluidOnly (line 154) | public static boolean getIsFluidOnly(ItemStack stack) {
method toggleFluidMode (line 158) | public static void toggleFluidMode(ItemStack stack) {
method use (line 162) | @Override
method onAnchorSet (line 192) | @Override
method onAnchorRemoved (line 198) | @Override
method getArea (line 204) | public static List<BlockPos> getArea(Level world, BlockPos pos, Direct...
method isFluidBlock (line 233) | public static boolean isFluidBlock(Level world, BlockPos pos) {
method isValidBlock (line 241) | public static boolean isValidBlock(Level world, BlockPos voidPos, Play...
method clearArea (line 261) | public void clearArea(Level world, BlockPos pos, Direction side, Serve...
method destroyBlock (line 278) | private boolean destroyBlock(Level world, BlockPos voidPos, ServerPlay...
method getGadget (line 295) | public static ItemStack getGadget(Player player) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetExchanger.java
class GadgetExchanger (line 75) | public class GadgetExchanger extends AbstractGadget {
method GadgetExchanger (line 78) | public GadgetExchanger() {
method getEnergyMax (line 86) | @Override
method getEnergyCost (line 91) | @Override
method createRenderFactory (line 96) | @Override
method getEnchantmentValue (line 101) | @Override
method isEnchantable (line 106) | @Override
method isBookEnchantable (line 111) | @Override
method canApplyAtEnchantingTable (line 116) | @Override
method setToolMode (line 121) | private static void setToolMode(ItemStack tool, ExchangingModes mode) {
method getToolMode (line 127) | public static ExchangingModes getToolMode(ItemStack tool) {
method appendHoverText (line 132) | @Override
method use (line 160) | @Override
method setMode (line 186) | public void setMode(ItemStack heldItem, int modeInt) {
method rangeChange (line 192) | public static void rangeChange(Player player, ItemStack heldItem) {
method exchange (line 204) | private void exchange(ServerPlayer player, ItemStack stack) {
method exchangeBlock (line 245) | private void exchangeBlock(ServerLevel world, ServerPlayer player, IIt...
method getGadget (line 311) | public static ItemStack getGadget(Player player) {
method getUseDuration (line 319) | @Override
method performRotate (line 324) | @Override
method performMirror (line 330) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/OurItems.java
class OurItems (line 12) | public final class OurItems {
method OurItems (line 13) | private OurItems() {}
method itemProperties (line 52) | public static Item.Properties itemProperties() {
method nonStackableItemProperties (line 56) | public static Item.Properties nonStackableItemProperties() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/TemplateItem.java
class TemplateItem (line 21) | public class TemplateItem extends Item {
method TemplateItem (line 23) | public TemplateItem() {
method initCapabilities (line 27) | @Nullable
method appendHoverText (line 33) | @Override
method use (line 39) | @Override
method getTemplateItem (line 53) | public static ItemStack getTemplateItem(Player player) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/AbstractMode.java
class AbstractMode (line 27) | public abstract class AbstractMode {
method AbstractMode (line 30) | public AbstractMode(boolean isExchanging) {
method collect (line 34) | abstract List<BlockPos> collect(UseContext context, Player player, Blo...
method getCollection (line 40) | public List<BlockPos> getCollection(UseContext context, Player player) {
method validator (line 61) | public boolean validator(BlockPos pos, UseContext context) {
method exchangingValidator (line 73) | private boolean exchangingValidator(BlockPos pos, BlockState lookingAt...
method withOffset (line 112) | public BlockPos withOffset(UseContext context) {
method isExchanging (line 116) | public boolean isExchanging() {
class UseContext (line 120) | public static class UseContext {
method UseContext (line 133) | public UseContext(Level world, Player player, BlockState setState, B...
method UseContext (line 148) | public UseContext(Level world, Player player, BlockState setState, B...
method createBlockUseContext (line 152) | public BlockPlaceContext createBlockUseContext() {
method isConnected (line 162) | public boolean isConnected() {
method getWorldState (line 166) | public BlockState getWorldState(BlockPos pos) {
method getWorld (line 170) | public Level getWorld() {
method getSetState (line 174) | public BlockState getSetState() {
method isFuzzy (line 178) | public boolean isFuzzy() {
method isRayTraceFluid (line 182) | public boolean isRayTraceFluid() {
method isPlaceOnTop (line 186) | public boolean isPlaceOnTop() {
method getRange (line 190) | public int getRange() {
method getStartPos (line 194) | public BlockPos getStartPos() {
method getHitSide (line 198) | public Direction getHitSide() {
method getPlayer (line 202) | public Player getPlayer() {
method toString (line 206) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/BuildToMeMode.java
class BuildToMeMode (line 10) | public class BuildToMeMode extends AbstractMode {
method BuildToMeMode (line 11) | public BuildToMeMode() { super(false); }
method collect (line 13) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/BuildingModes.java
type BuildingModes (line 5) | public enum BuildingModes {
method BuildingModes (line 17) | BuildingModes(AbstractMode mode, String name) {
method getMode (line 22) | public AbstractMode getMode() {
method getName (line 26) | public String getName() {
method getTranslationKey (line 30) | public String getTranslationKey() {
method getIcon (line 34) | public String getIcon() {
method getFromName (line 38) | public static BuildingModes getFromName(String name) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/ExchangingModes.java
type ExchangingModes (line 5) | public enum ExchangingModes {
method ExchangingModes (line 14) | ExchangingModes(AbstractMode mode, String name) {
method getMode (line 19) | public AbstractMode getMode() {
method getName (line 23) | public String getName() {
method getTranslationKey (line 27) | public String getTranslationKey() {
method getIcon (line 31) | public String getIcon() {
method getFromName (line 35) | public static ExchangingModes getFromName(String name) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/GridMode.java
class GridMode (line 9) | public class GridMode extends AbstractMode {
method GridMode (line 10) | public GridMode(boolean isExchanging) {
method collect (line 14) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/HorizontalColumnMode.java
class HorizontalColumnMode (line 10) | public class HorizontalColumnMode extends AbstractMode {
method HorizontalColumnMode (line 11) | public HorizontalColumnMode(boolean isExchanging) {
method collect (line 15) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/HorizontalWallMode.java
class HorizontalWallMode (line 9) | public class HorizontalWallMode extends AbstractMode {
method HorizontalWallMode (line 10) | public HorizontalWallMode() { super(false); }
method collect (line 12) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/StairMode.java
class StairMode (line 21) | public class StairMode extends AbstractMode {
method StairMode (line 22) | public StairMode() { super(false); }
method collect (line 24) | @Override
method withOffset (line 65) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/SurfaceMode.java
class SurfaceMode (line 13) | public class SurfaceMode extends AbstractMode {
method SurfaceMode (line 14) | public SurfaceMode(boolean isExchanging) { super(isExchanging); }
method collect (line 16) | @Override
method validator (line 40) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/VerticalColumnMode.java
class VerticalColumnMode (line 10) | public class VerticalColumnMode extends AbstractMode {
method VerticalColumnMode (line 11) | public VerticalColumnMode(boolean isExchanging) {
method collect (line 15) | @Override
method withOffset (line 46) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/VerticalWallMode.java
class VerticalWallMode (line 14) | public class VerticalWallMode extends AbstractMode {
method VerticalWallMode (line 15) | public VerticalWallMode() { super(false); }
method collect (line 17) | @Override
method withOffset (line 40) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/items/modes/XYZ.java
type XYZ (line 14) | public enum XYZ {
method fromFacing (line 17) | public static XYZ fromFacing(Direction facing) {
method isAxisX (line 27) | public static boolean isAxisX(Direction facing) {
method isAxisY (line 31) | public static boolean isAxisY(Direction facing) {
method isAxisZ (line 35) | public static boolean isAxisZ(Direction facing) {
method posToXYZ (line 39) | public static int posToXYZ(BlockPos pos, XYZ xyz) {
method extendPosSingle (line 50) | public static BlockPos extendPosSingle(int value, BlockPos pos, Direct...
method invertOnFace (line 67) | public static int invertOnFace(Direction facing, int value) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/PacketHandler.java
class PacketHandler (line 21) | public class PacketHandler {
method getSplitManager (line 33) | public static PacketSplitManager getSplitManager() {
method register (line 37) | public static void register() {
method sendTo (line 65) | public static void sendTo(Object msg, ServerPlayer player) {
method sendToServer (line 70) | public static void sendToServer(Object msg) {
method send (line 74) | public static void send(Object msg, PacketDistributor.PacketTarget tar...
method registerMessage (line 78) | private static <MSG> void registerMessage(Class<MSG> messageType, BiCo...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketAnchor.java
class PacketAnchor (line 14) | public class PacketAnchor {
method encode (line 15) | public static void encode(PacketAnchor msg, FriendlyByteBuf buffer) {}
method decode (line 16) | public static PacketAnchor decode(FriendlyByteBuf buffer) { return new...
class Handler (line 18) | public static class Handler {
method handle (line 19) | public static void handle(final PacketAnchor msg, Supplier<NetworkEv...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketBindTool.java
class PacketBindTool (line 13) | public class PacketBindTool {
method encode (line 14) | public static void encode(PacketBindTool msg, FriendlyByteBuf buffer) { }
method decode (line 15) | public static PacketBindTool decode(FriendlyByteBuf buffer) {
class Handler (line 19) | public static class Handler {
method handle (line 20) | public static void handle(final PacketBindTool msg, Supplier<Network...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketChangeRange.java
class PacketChangeRange (line 15) | public class PacketChangeRange {
method PacketChangeRange (line 18) | public PacketChangeRange() {
method PacketChangeRange (line 22) | public PacketChangeRange(int range) {
method encode (line 26) | public static void encode(PacketChangeRange msg, FriendlyByteBuf buffe...
method decode (line 29) | public static PacketChangeRange decode(FriendlyByteBuf buffer) {
class Handler (line 33) | public static class Handler {
method handle (line 34) | public static void handle(final PacketChangeRange msg, Supplier<Netw...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketCopyCoords.java
class PacketCopyCoords (line 16) | public class PacketCopyCoords {
method PacketCopyCoords (line 20) | public PacketCopyCoords(BlockPos start, BlockPos end) {
method encode (line 25) | public static void encode(PacketCopyCoords msg, FriendlyByteBuf buffer) {
method decode (line 30) | public static PacketCopyCoords decode(FriendlyByteBuf buffer) {
class Handler (line 34) | public static class Handler {
method handle (line 35) | public static void handle(final PacketCopyCoords msg, Supplier<Netwo...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketDestructionGUI.java
class PacketDestructionGUI (line 11) | public class PacketDestructionGUI {
method PacketDestructionGUI (line 15) | public PacketDestructionGUI(int l, int r, int u, int d, int dep) {
method encode (line 23) | public static void encode(PacketDestructionGUI msg, FriendlyByteBuf bu...
method decode (line 31) | public static PacketDestructionGUI decode(FriendlyByteBuf buffer) {
class Handler (line 35) | public static class Handler {
method handle (line 36) | public static void handle(final PacketDestructionGUI msg, Supplier<N...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketPasteGUI.java
class PacketPasteGUI (line 11) | public class PacketPasteGUI {
method PacketPasteGUI (line 15) | public PacketPasteGUI(int x, int y, int z) {
method encode (line 21) | public static void encode(PacketPasteGUI msg, FriendlyByteBuf buffer) {
method decode (line 27) | public static PacketPasteGUI decode(FriendlyByteBuf buffer) {
class Handler (line 31) | public static class Handler {
method handle (line 32) | public static void handle(PacketPasteGUI msg, Supplier<NetworkEvent....
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketRequestTemplate.java
class PacketRequestTemplate (line 13) | public final class PacketRequestTemplate extends UUIDPacket {
method PacketRequestTemplate (line 14) | public PacketRequestTemplate(UUID id) {
method PacketRequestTemplate (line 18) | public PacketRequestTemplate(FriendlyByteBuf buffer) {
method handle (line 22) | public void handle(Supplier<NetworkEvent.Context> contextSupplier) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketRotateMirror.java
class PacketRotateMirror (line 12) | public class PacketRotateMirror {
method PacketRotateMirror (line 15) | public PacketRotateMirror() {}
method PacketRotateMirror (line 17) | public PacketRotateMirror(@Nullable Operation operation) {
method encode (line 21) | public static void encode(PacketRotateMirror msg, FriendlyByteBuf buff...
method decode (line 28) | public static PacketRotateMirror decode(FriendlyByteBuf buffer) {
type Operation (line 32) | public enum Operation {
class Handler (line 36) | public static class Handler {
method handle (line 37) | public static void handle(final PacketRotateMirror msg, Supplier<Net...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketSetRemoteInventoryCache.java
class PacketSetRemoteInventoryCache (line 28) | public class PacketSetRemoteInventoryCache {
method PacketSetRemoteInventoryCache (line 34) | public PacketSetRemoteInventoryCache(Multiset<UniqueItem> cache, boole...
method PacketSetRemoteInventoryCache (line 39) | public PacketSetRemoteInventoryCache(Pair<BlockPos, ResourceKey<Level>...
method decode (line 44) | public static PacketSetRemoteInventoryCache decode(FriendlyByteBuf buf) {
method encode (line 62) | public static void encode(PacketSetRemoteInventoryCache msg, FriendlyB...
method isCopyPaste (line 80) | public boolean isCopyPaste() {
method getCache (line 84) | public Multiset<UniqueItem> getCache() {
method getLoc (line 88) | public Pair<BlockPos, ResourceKey<Level>> getLoc() {
class Handler (line 92) | public static class Handler {
method handle (line 93) | public static void handle(final PacketSetRemoteInventoryCache msg, S...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketTemplateManagerTemplateCreated.java
class PacketTemplateManagerTemplateCreated (line 22) | public final class PacketTemplateManagerTemplateCreated extends UUIDPack...
method PacketTemplateManagerTemplateCreated (line 25) | public PacketTemplateManagerTemplateCreated(FriendlyByteBuf buffer) {
method PacketTemplateManagerTemplateCreated (line 30) | public PacketTemplateManagerTemplateCreated(UUID id, BlockPos pos) {
method encode (line 35) | @Override
method handle (line 41) | public void handle(Supplier<NetworkEvent.Context> contextSupplier) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleBlockPlacement.java
class PacketToggleBlockPlacement (line 12) | public class PacketToggleBlockPlacement {
method encode (line 14) | public static void encode(PacketToggleBlockPlacement msg, FriendlyByte...
method decode (line 15) | public static PacketToggleBlockPlacement decode(FriendlyByteBuf buffer...
class Handler (line 17) | public static class Handler {
method handle (line 18) | public static void handle(final PacketToggleBlockPlacement msg, Supp...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleConnectedArea.java
class PacketToggleConnectedArea (line 14) | public class PacketToggleConnectedArea {
method encode (line 16) | public static void encode(PacketToggleConnectedArea msg, FriendlyByteB...
method decode (line 17) | public static PacketToggleConnectedArea decode(FriendlyByteBuf buffer)...
class Handler (line 19) | public static class Handler {
method handle (line 20) | public static void handle(final PacketToggleConnectedArea msg, Suppl...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleFluidOnly.java
class PacketToggleFluidOnly (line 12) | public class PacketToggleFluidOnly {
method encode (line 13) | public static void encode(PacketToggleFluidOnly msg, FriendlyByteBuf b...
method decode (line 14) | public static PacketToggleFluidOnly decode(FriendlyByteBuf buffer) { r...
class Handler (line 16) | public static class Handler {
method handle (line 17) | public static void handle(final PacketToggleFluidOnly msg, Supplier<...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleFuzzy.java
class PacketToggleFuzzy (line 15) | public class PacketToggleFuzzy {
method encode (line 17) | public static void encode(PacketToggleFuzzy msg, FriendlyByteBuf buffe...
method decode (line 18) | public static PacketToggleFuzzy decode(FriendlyByteBuf buffer) { retur...
class Handler (line 20) | public static class Handler {
method handle (line 21) | public static void handle(final PacketToggleFuzzy msg, Supplier<Netw...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleMode.java
class PacketToggleMode (line 14) | public class PacketToggleMode {
method encode (line 17) | public static void encode(PacketToggleMode msg, FriendlyByteBuf buffer) {
method decode (line 20) | public static PacketToggleMode decode(FriendlyByteBuf buffer) {
method PacketToggleMode (line 24) | public PacketToggleMode(int mode) {
class Handler (line 28) | public static class Handler {
method handle (line 29) | public static void handle(PacketToggleMode msg, Supplier<NetworkEven...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleRayTraceFluid.java
class PacketToggleRayTraceFluid (line 11) | public class PacketToggleRayTraceFluid {
method encode (line 13) | public static void encode(PacketToggleRayTraceFluid msg, FriendlyByteB...
method decode (line 14) | public static PacketToggleRayTraceFluid decode(FriendlyByteBuf buffer)...
class Handler (line 16) | public static class Handler {
method handle (line 17) | public static void handle(final PacketToggleRayTraceFluid msg, Suppl...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketUndo.java
class PacketUndo (line 12) | public class PacketUndo {
method encode (line 14) | public static void encode(PacketUndo msg, FriendlyByteBuf buf) {}
method decode (line 16) | public static PacketUndo decode(FriendlyByteBuf buf) {
class Handler (line 20) | public static class Handler {
method handle (line 21) | public static void handle(PacketUndo msg, Supplier<NetworkEvent.Cont...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/SplitPacketUpdateTemplate.java
class SplitPacketUpdateTemplate (line 19) | public final class SplitPacketUpdateTemplate extends UUIDPacket {
method SplitPacketUpdateTemplate (line 22) | public SplitPacketUpdateTemplate(FriendlyByteBuf buffer) {
method SplitPacketUpdateTemplate (line 33) | public SplitPacketUpdateTemplate(UUID id, Template template) {
method encode (line 38) | public void encode(FriendlyByteBuf buffer) {
method handle (line 49) | public void handle(Supplier<NetworkEvent.Context> contextSupplier) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/packets/UUIDPacket.java
class UUIDPacket (line 7) | public class UUIDPacket {
method UUIDPacket (line 10) | public UUIDPacket(FriendlyByteBuf buffer) {
method UUIDPacket (line 14) | public UUIDPacket(UUID id) {
method encode (line 18) | public void encode(FriendlyByteBuf buffer) {
method getId (line 22) | public UUID getId() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/split/PacketDecoder.java
class PacketDecoder (line 16) | final class PacketDecoder<MSG> {
method PacketDecoder (line 20) | PacketDecoder(Function<FriendlyByteBuf, MSG> decoder) {
method decode (line 27) | Optional<MSG> decode(SplitPacket packet) {
class PendingPacket (line 38) | private final class PendingPacket {
method PendingPacket (line 42) | private PendingPacket() {
method add (line 46) | private Optional<MSG> add(SplitPacket packet) {
method checkComplete (line 65) | private Optional<MSG> checkComplete() {
method assemble (line 74) | private Optional<MSG> assemble() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/split/PacketEncoder.java
class PacketEncoder (line 13) | final class PacketEncoder<MSG> {
method PacketEncoder (line 18) | PacketEncoder(BiConsumer<MSG, FriendlyByteBuf> messageEncoder, int id) {
method encode (line 24) | Iterable<SplitPacket> encode(MSG msg) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/split/PacketSplitManager.java
class PacketSplitManager (line 20) | public final class PacketSplitManager {
method PacketSplitManager (line 26) | public PacketSplitManager() {
method registerSplitPacket (line 31) | public <MSG> void registerSplitPacket(Class<MSG> msgClass, BiConsumer<...
method sendTo (line 39) | public void sendTo(Object message, ServerPlayer player) {
method sendToServer (line 43) | public void sendToServer(Object message) {
method send (line 47) | public void send(Object message, PacketDistributor.PacketTarget target) {
method send (line 51) | private void send(Object message, Consumer<SplitPacket> packetConsumer) {
method encode (line 58) | public void encode(SplitPacket msg, FriendlyByteBuf buf) {
method decode (line 62) | public SplitPacket decode(FriendlyByteBuf buf) {
method handle (line 66) | public void handle(SplitPacket msg, Supplier<NetworkEvent.Context> ctx) {
class PacketSplitHandler (line 72) | private static final class PacketSplitHandler<MSG> {
method PacketSplitHandler (line 77) | private PacketSplitHandler(PacketEncoder<MSG> encoder, PacketDecoder...
method handleSplit (line 83) | private void handleSplit(SplitPacket msg, Supplier<NetworkEvent.Cont...
method splitPackets (line 91) | private void splitPackets(MSG msg, Consumer<SplitPacket> consumer) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/network/split/SplitPacket.java
class SplitPacket (line 6) | public final class SplitPacket {
method readFrom (line 13) | static SplitPacket readFrom(FriendlyByteBuf buffer) {
method SplitPacket (line 23) | SplitPacket(int id, int index, short sessionId, boolean hasMore, Frien...
method writeTo (line 31) | void writeTo(FriendlyByteBuf buffer) {
method getId (line 39) | public int getId() {
method getIndex (line 43) | public int getIndex() {
method getSessionId (line 47) | public short getSessionId() {
method hasMore (line 51) | public boolean hasMore() {
method getPayload (line 55) | public FriendlyByteBuf getPayload() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/BlockData.java
class BlockData (line 35) | public final class BlockData {
method tryDeserialize (line 46) | @Nullable
method tryDeserialize (line 51) | @Nullable
method deserialize (line 82) | public static BlockData deserialize(CompoundTag tag, boolean persisted) {
method deserialize (line 86) | public static BlockData deserialize(CompoundTag tag, @Nullable IntFunc...
method BlockData (line 119) | public BlockData(BlockState state, ITileEntityData tileData) {
method getState (line 127) | public BlockState getState() {
method getTileData (line 134) | public ITileEntityData getTileData() {
method placeIn (line 143) | public boolean placeIn(BuildContext context, BlockPos pos) {
method serialize (line 153) | public CompoundTag serialize(boolean persisted) {
method serialize (line 157) | public CompoundTag serialize(@Nullable ToIntFunction<ITileDataSerializ...
method mirror (line 168) | public BlockData mirror(Mirror mirror) {
method rotate (line 172) | public BlockData rotate(Rotation rotation) {
method getRequiredItems (line 176) | public MaterialList getRequiredItems(BuildContext context, @Nullable H...
method equals (line 180) | @Override
method hashCode (line 191) | @Override
method toString (line 198) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/PlacementChecker.java
class PlacementChecker (line 32) | public final class PlacementChecker {
method PlacementChecker (line 39) | public PlacementChecker(LazyOptional<IEnergyStorage> energyCap, ToIntF...
method checkPositionWithResult (line 50) | public CheckResult checkPositionWithResult(BuildContext context, Place...
class CheckResult (line 102) | public static final class CheckResult {
method CheckResult (line 108) | private CheckResult(MatchResult match, Multiset<IUniqueObject<?>> in...
method getInsertedItems (line 115) | public Multiset<IUniqueObject<?>> getInsertedItems() {
method getMatch (line 119) | public MatchResult getMatch() {
method isSuccess (line 123) | public boolean isSuccess() {
method isUsingPaste (line 127) | public boolean isUsingPaste() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/PlacementTarget.java
class PlacementTarget (line 25) | public final class PlacementTarget {
method deserialize (line 35) | public static PlacementTarget deserialize(CompoundTag nbt, boolean per...
method PlacementTarget (line 52) | public PlacementTarget(@Nonnull BlockPos pos, @Nonnull BlockData data) {
method getPos (line 60) | public BlockPos getPos() {
method getData (line 67) | public BlockData getData() {
method placeIn (line 77) | public boolean placeIn(BuildContext context) {
method mirror (line 81) | public PlacementTarget mirror(Mirror mirror) {
method rotate (line 85) | public PlacementTarget rotate(Rotation rotation) {
method getRequiredMaterials (line 89) | public MaterialList getRequiredMaterials(BuildContext context, @Nullab...
method serialize (line 100) | public CompoundTag serialize(boolean persisted) {
method toString (line 107) | @Override
method equals (line 115) | @Override
method hashCode (line 126) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/Region.java
class Region (line 20) | public final class Region implements Serializable {
method singleZero (line 23) | public static Region singleZero() {
method builder (line 32) | public static Builder builder() {
method enclosingBuilder (line 43) | public static Builder enclosingBuilder() {
method enclosingBuilder (line 47) | public static Builder enclosingBuilder(int minX, int minY, int minZ, i...
method deserializeFrom (line 53) | public static Region deserializeFrom(CompoundTag tag) {
method Region (line 71) | public Region(int minX, int minY, int minZ, int maxX, int maxY, int ma...
method Region (line 80) | public Region(Vec3i vertex) {
method Region (line 84) | public Region(Vec3i min, Vec3i max) {
method translate (line 96) | public Region translate(int x, int y, int z) {
method translate (line 106) | public Region translate(Vec3i direction) {
method inverseTranslate (line 110) | public Region inverseTranslate(Vec3i direction) {
method grow (line 120) | public Region grow(int x, int y, int z) {
method grow (line 130) | public Region grow(int size) {
method shrink (line 143) | public Region shrink(int x, int y, int z) {
method shrink (line 152) | public Region shrink(int size) {
method expand (line 186) | public Region expand(int x, int y, int z) {
method expand (line 190) | public Region expand(Vec3i vec) {
method expand (line 206) | public Region expand(int size) {
method collapse (line 217) | public Region collapse(int x, int y, int z) {
method collapse (line 226) | public Region collapse(Vec3i vec) {
method collapse (line 236) | public Region collapse(int size) {
method intersect (line 246) | public Region intersect(Region other) {
method union (line 262) | public Region union(Region other) {
method getMinX (line 272) | public int getMinX() {
method getMinY (line 276) | public int getMinY() {
method getMinZ (line 280) | public int getMinZ() {
method getMaxX (line 284) | public int getMaxX() {
method getMaxY (line 288) | public int getMaxY() {
method getMaxZ (line 292) | public int getMaxZ() {
method getMin (line 296) | public BlockPos getMin() {
method getMax (line 300) | public BlockPos getMax() {
method getXSize (line 304) | public int getXSize() {
method getYSize (line 308) | public int getYSize() {
method getZSize (line 312) | public int getZSize() {
method size (line 316) | public int size() {
method containsX (line 320) | public boolean containsX(int x) {
method containsY (line 324) | public boolean containsY(int y) {
method containsZ (line 328) | public boolean containsZ(int z) {
method mayContain (line 338) | public boolean mayContain(int x, int y, int z) {
method contains (line 349) | public boolean contains(int x, int y, int z) {
method contains (line 353) | public boolean contains(Vec3i vec) {
method intersectsWith (line 357) | public boolean intersectsWith(Region other) {
method stream (line 366) | public Stream<BlockPos> stream() {
method toString (line 395) | @Override
method equals (line 407) | @Override
method hashCode (line 420) | @Override
method getUnloadedChunks (line 425) | @SuppressWarnings("deprecation")
method serialize (line 443) | public CompoundTag serialize() {
method serializeTo (line 447) | public CompoundTag serializeTo(CompoundTag tag) {
class Builder (line 457) | public static class Builder {
method Builder (line 465) | private Builder() {
method Builder (line 469) | public Builder(int minX, int minY, int minZ, int maxX, int maxY, int...
method encloseAll (line 485) | public Builder encloseAll(Iterable<? extends Vec3i> iterable) {
method enclose (line 492) | public Builder enclose(Region region) {
method enclose (line 504) | public Builder enclose(Vec3i vec) {
method enclose (line 519) | public Builder enclose(int x, int y, int z) {
method encloseX (line 532) | public Builder encloseX(int x) {
method encloseY (line 544) | public Builder encloseY(int y) {
method encloseZ (line 556) | public Builder encloseZ(int z) {
method build (line 562) | public Region build() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/placement/ConnectedSurface.java
class ConnectedSurface (line 16) | public class ConnectedSurface implements Iterable<BlockPos> {
method create (line 17) | public static ConnectedSurface create(Region searchingRegion, BlockGet...
method create (line 21) | public static ConnectedSurface create(Region searchingRegion, BlockGet...
method create (line 25) | public static ConnectedSurface create(BlockGetter world, Region search...
method create (line 29) | public static ConnectedSurface create(BlockGetter world, Region search...
method ConnectedSurface (line 42) | ConnectedSurface(BlockGetter world, Region searchingRegion, Function<B...
method ConnectedSurface (line 52) | ConnectedSurface(BlockGetter world, Region searchingRegion, Function<B...
method getBoundingBox (line 64) | public Region getBoundingBox() {
method iterator (line 74) | @Nonnull
method getReferenceFor (line 127) | private BlockState getReferenceFor(BlockPos pos) {
method perpendicularSurfaceOffset (line 131) | public BlockPos perpendicularSurfaceOffset(BlockPos pos, Direction.Axi...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileDataFactory.java
type ITileDataFactory (line 19) | @FunctionalInterface
method createDataFor (line 26) | @Nullable
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileDataProvider.java
type ITileDataProvider (line 9) | @FunctionalInterface
method createTileData (line 14) | ITileEntityData createTileData();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileDataSerializer.java
type ITileDataSerializer (line 13) | public interface ITileDataSerializer {
method serialize (line 25) | CompoundTag serialize(ITileEntityData data, boolean persisted);
method deserialize (line 36) | ITileEntityData deserialize(CompoundTag tagCompound, boolean persisted);
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileEntityData.java
type ITileEntityData (line 24) | public interface ITileEntityData {
method getSerializer (line 28) | ITileDataSerializer getSerializer();
method placeIn (line 40) | boolean placeIn(BuildContext context, BlockState state, BlockPos posit...
method getRequiredItems (line 49) | default MaterialList getRequiredItems(BuildContext context, BlockState...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/NBTTileEntityData.java
class NBTTileEntityData (line 18) | public class NBTTileEntityData implements ITileEntityData {
method ofTile (line 19) | public static NBTTileEntityData ofTile(BlockEntity te) {
method NBTTileEntityData (line 29) | public NBTTileEntityData(CompoundTag nbt, @Nullable MaterialList requi...
method NBTTileEntityData (line 34) | public NBTTileEntityData(CompoundTag nbt) {
method getSerializer (line 38) | @Override
method getRequiredItems (line 43) | @Override
method placeIn (line 50) | @Override
method getNBT (line 65) | public CompoundTag getNBT() {
method getRequiredMaterials (line 69) | @Nullable
method getNBTModifiable (line 74) | protected CompoundTag getNBTModifiable() {
method equals (line 78) | @Override
method hashCode (line 89) | @Override
method toString (line 96) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/TileSupport.java
class TileSupport (line 17) | public final class TileSupport {
method TileSupport (line 18) | private TileSupport() {}
method dataProviderFactory (line 30) | public static ITileDataFactory dataProviderFactory() {
method createTileData (line 34) | public static ITileEntityData createTileData(@Nullable BlockEntity te) {
method createTileData (line 49) | public static ITileEntityData createTileData(BlockGetter world, BlockP...
method createBlockData (line 54) | public static BlockData createBlockData(BlockState state, @Nullable Bl...
method createBlockData (line 58) | public static BlockData createBlockData(BlockGetter world, BlockPos po...
class DataProviderFactory (line 62) | private static class DataProviderFactory implements ITileDataFactory {
method createDataFor (line 63) | @Nullable
method getSerializer (line 73) | @Override
method placeIn (line 78) | @Override
method toString (line 83) | @Override
method dummyTileEntityData (line 90) | public static ITileEntityData dummyTileEntityData() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/BuildContext.java
class BuildContext (line 17) | @Immutable
method builder (line 22) | public static Builder builder() {
method BuildContext (line 33) | public BuildContext(@Nonnull LevelAccessor world, @Nullable Player pla...
method getWorld (line 42) | public LevelAccessor getWorld() {
method getPlayer (line 49) | @Nullable
method getStack (line 54) | public ItemStack getStack() {
method getServerWorld (line 58) | public ServerLevel getServerWorld() {
class Builder (line 65) | public static final class Builder {
method Builder (line 73) | private Builder() {
method world (line 85) | public Builder world(@Nonnull LevelAccessor world) {
method player (line 99) | public Builder player(@Nullable Player buildingPlayer) {
method stack (line 115) | public Builder stack(@Nonnull ItemStack stack) {
method build (line 125) | public BuildContext build() {
method build (line 135) | public BuildContext build(@Nullable LevelAccessor world) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/IBuildView.java
type IBuildView (line 33) | public interface IBuildView extends Iterable<PlacementTarget> {
method iterator (line 38) | @Override
method spliterator (line 46) | @Override
method translateTo (line 58) | IBuildView translateTo(BlockPos pos);
method estimateRequiredItems (line 67) | default MaterialList estimateRequiredItems(@Nullable Vec3 simulatePos) {
method estimateRequiredItems (line 71) | default MaterialList estimateRequiredItems() {
method estimateSize (line 86) | int estimateSize();
method copy (line 108) | IBuildView copy();
method getBoundingBox (line 110) | Region getBoundingBox();
method getContext (line 112) | BuildContext getContext();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/PositionalBuildView.java
class PositionalBuildView (line 21) | public final class PositionalBuildView implements IBuildView {
method createUnsafe (line 28) | public static PositionalBuildView createUnsafe(BuildContext context, M...
method PositionalBuildView (line 36) | private PositionalBuildView(BuildContext context, Map<BlockPos, BlockD...
method spliterator (line 43) | @Override
method translateTo (line 49) | @Override
method estimateSize (line 56) | @Override
method copy (line 62) | @Override
method getBoundingBox (line 67) | @Override
method getContext (line 72) | @Override
method getMap (line 77) | public ImmutableMap<BlockPos, BlockData> getMap() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/WorldBuildView.java
class WorldBuildView (line 28) | public final class WorldBuildView implements IBuildView {
method create (line 34) | public static WorldBuildView create(BuildContext context, Region regio...
method create (line 38) | public static WorldBuildView create(BuildContext context, Region regio...
method WorldBuildView (line 45) | private WorldBuildView(BuildContext context, Region region, BiFunction...
method spliterator (line 52) | @Override
method translateTo (line 57) | @Override
method estimateSize (line 63) | @Override
method copy (line 68) | @Override
method getContext (line 73) | @Override
method getBoundingBox (line 78) | public Region getBoundingBox() {
class WorldBackedSpliterator (line 82) | private static final class WorldBackedSpliterator extends DelegatingSp...
method WorldBackedSpliterator (line 87) | private WorldBackedSpliterator(Spliterator<BlockPos> other, BlockPos...
method advance (line 94) | @Override
method getComparator (line 105) | @Override
method trySplit (line 110) | @Override
method characteristics (line 119) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/CopyScheduler.java
class CopyScheduler (line 18) | public final class CopyScheduler extends SteppedScheduler {
method scheduleCopy (line 19) | public static void scheduleCopy(BiConsumer<ImmutableMap<BlockPos, Bloc...
method CopyScheduler (line 34) | private CopyScheduler(BiConsumer<ImmutableMap<BlockPos, BlockData>, Re...
method advance (line 43) | @Override
method onFinish (line 55) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/PlacementScheduler.java
class PlacementScheduler (line 23) | public final class PlacementScheduler extends SteppedScheduler {
method schedulePlacement (line 24) | public static PlacementScheduler schedulePlacement(IBuildView view, Pl...
method PlacementScheduler (line 43) | private PlacementScheduler(IBuildView view, PlacementChecker checker, ...
method onFinish (line 51) | @Override
method advance (line 56) | @Override
method getUndoBuilder (line 63) | public Builder getUndoBuilder() {
method withFinisher (line 67) | public PlacementScheduler withFinisher(Consumer<PlacementScheduler> ru...
method checkTarget (line 72) | private void checkTarget(PlacementTarget target) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/ServerTickingScheduler.java
class ServerTickingScheduler (line 11) | public final class ServerTickingScheduler {
method runTicked (line 12) | public static void runTicked(BooleanSupplier runUntilFalse) {
method runTickedAtEnd (line 16) | public static void runTickedAtEnd(BooleanSupplier runUntilFalse) {
method runTickedStartAndEnd (line 20) | public static void runTickedStartAndEnd(BooleanSupplier runUntilFalse) {
method runOnServerOnce (line 24) | public static void runOnServerOnce(Runnable runnable) {
method ServerTickingScheduler (line 34) | private ServerTickingScheduler(BooleanSupplier runnable, EnumSet<Phase...
method tick (line 40) | @SubscribeEvent
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/SteppedScheduler.java
class SteppedScheduler (line 5) | public abstract class SteppedScheduler implements BooleanSupplier {
type StepResult (line 6) | protected enum StepResult {
method ofBoolean (line 11) | public static StepResult ofBoolean(boolean b) {
method SteppedScheduler (line 18) | public SteppedScheduler(int steps) {
method getAsBoolean (line 23) | @Override
method advance (line 37) | protected abstract StepResult advance();
method onFinish (line 39) | protected abstract void onFinish();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/UndoScheduler.java
class UndoScheduler (line 25) | public final class UndoScheduler extends SteppedScheduler {
method scheduleUndo (line 26) | public static UndoScheduler scheduleUndo(Undo undo, IItemIndex index, ...
method UndoScheduler (line 45) | private UndoScheduler(Undo undo, IItemIndex index, BuildContext contex...
method advance (line 55) | @Override
method undoBlock (line 62) | private void undoBlock(Map.Entry<BlockPos, BlockInfo> entry) {
method onFinish (line 91) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/CreativeItemIndex.java
class CreativeItemIndex (line 13) | public final class CreativeItemIndex implements IItemIndex {
method insert (line 14) | @Override
method reIndex (line 19) | @Override
method tryMatch (line 24) | @Override
method applyMatch (line 31) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/HandlerInsertProvider.java
class HandlerInsertProvider (line 9) | public final class HandlerInsertProvider implements IInsertProvider {
method HandlerInsertProvider (line 12) | public HandlerInsertProvider(IItemHandler remoteInventory) {
method insert (line 16) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/IInsertProvider.java
type IInsertProvider (line 8) | public interface IInsertProvider {
method insert (line 9) | int insert(ItemStack stack, int count, boolean simulate);
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/IItemIndex.java
type IItemIndex (line 17) | public interface IItemIndex {
method insert (line 18) | default Multiset<IUniqueObject<?>> insert(Multiset<IUniqueObject<?>> i...
method insert (line 23) | Multiset<IUniqueObject<?>> insert(Multiset<IUniqueObject<?>> items, bo...
method reIndex (line 25) | void reIndex();
method tryMatch (line 27) | MatchResult tryMatch(MaterialList list);
method tryMatch (line 29) | default MatchResult tryMatch(Multiset<IUniqueObject<?>> items) {
method applyMatch (line 33) | boolean applyMatch(MatchResult result);
method applyMatch (line 35) | default boolean applyMatch(MaterialList list) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/InventoryHelper.java
class InventoryHelper (line 48) | public class InventoryHelper {
method index (line 70) | public static IItemIndex index(ItemStack tool, Player player) {
method indexInsertProviders (line 76) | static List<IInsertProvider> indexInsertProviders(ItemStack tool, Play...
method indexMap (line 85) | static Map<Class<?>, Map<Object, List<IObjectHandle<?>>>> indexMap(Ite...
method getHandlers (line 94) | static List<IItemHandler> getHandlers(ItemStack stack, Player player) {
method registerHandleProviders (line 103) | public static void registerHandleProviders() {
method giveItem (line 111) | public static boolean giveItem(ItemStack itemStack, Player player, Lev...
method addPasteToContainer (line 172) | public static ItemStack addPasteToContainer(Player player, ItemStack i...
method findInvContainers (line 216) | private static List<IItemHandler> findInvContainers(Inventory inv) {
method countInContainer (line 228) | public static int countInContainer(IItemHandler container, Item item) {
method findItem (line 240) | private static List<Integer> findItem(Item item, Inventory inv) {
method findItemClass (line 251) | public static List<Integer> findItemClass(Class<?> c, Inventory inv) {
method getSilkTouchDrop (line 262) | public static ItemStack getSilkTouchDrop(BlockState state) {
method getSafeBlockData (line 266) | public static Optional<BlockData> getSafeBlockData(Player player, Bloc...
method getSafeBlockData (line 271) | public static Optional<BlockData> getSafeBlockData(Player player, Bloc...
method applyProperty (line 301) | private static <T extends Comparable<T>> BlockState applyProperty(Bloc...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/InventoryLinker.java
class InventoryLinker (line 22) | public class InventoryLinker {
method linkInventory (line 26) | public static Result linkInventory(Level world, ItemStack stack, Block...
method getLinkedInventory (line 52) | public static LazyOptional<IItemHandler> getLinkedInventory(Level worl...
method getLinkedInventory (line 70) | public static LazyOptional<IItemHandler> getLinkedInventory(Level worl...
method removeIfSame (line 84) | private static boolean removeIfSame(ItemStack stack, BlockPos pos) {
method removeDataFromStack (line 102) | public static void removeDataFromStack(ItemStack stack) {
method getDataFromStack (line 111) | @Nullable
class Result (line 128) | public final static class Result {
method Result (line 132) | public Result(MessageTranslation i18n, boolean successful) {
method fail (line 137) | public static Result fail(MessageTranslation i18n) {
method success (line 141) | public static Result success() {
method removed (line 145) | public static Result removed() {
method getI18n (line 149) | public MessageTranslation getI18n() {
method isSuccessful (line 153) | public boolean isSuccessful() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/MatchResult.java
class MatchResult (line 11) | public final class MatchResult {
method success (line 17) | public static MatchResult success(MaterialList matchedList, ImmutableM...
method failure (line 21) | public static MatchResult failure() {
method failure (line 25) | public static MatchResult failure(MaterialList matchedList, ImmutableM...
method MatchResult (line 29) | MatchResult(MaterialList matchedList, ImmutableMultiset<IUniqueObject<...
method getMatchedList (line 36) | public MaterialList getMatchedList() {
method getFoundItems (line 47) | public ImmutableMultiset<IUniqueObject<?>> getFoundItems() {
method getChosenOption (line 51) | public ImmutableMultiset<IUniqueObject<?>> getChosenOption() {
method isSuccess (line 55) | public boolean isSuccess() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/PlayerInventoryInsertProvider.java
class PlayerInventoryInsertProvider (line 11) | public final class PlayerInventoryInsertProvider implements IInsertProvi...
method PlayerInventoryInsertProvider (line 14) | public PlayerInventoryInsertProvider(Player player) {
method insert (line 18) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/PlayerItemIndex.java
class PlayerItemIndex (line 20) | public final class PlayerItemIndex implements IItemIndex {
method PlayerItemIndex (line 27) | public PlayerItemIndex(ItemStack stack, Player player) {
method insert (line 33) | @Override
method insertObject (line 47) | private int insertObject(IUniqueObject<?> obj, int count, boolean simu...
method performSimpleInsert (line 61) | private int performSimpleInsert(ItemStack stack, int count, boolean si...
method insertIntoProviders (line 77) | private int insertIntoProviders(ItemStack stack, int remainingCount, b...
method insertIntoEmptyHandles (line 89) | private int insertIntoEmptyHandles(ItemStack stack, int remainingCount...
method spawnRemainder (line 114) | private void spawnRemainder(ItemStack stack, int remainingCount) {
method performComplexInsert (line 124) | private int performComplexInsert(IUniqueObject<?> obj, int count, bool...
method reIndex (line 143) | @Override
method tryMatch (line 149) | @Override
method evaluateFailingOptionFoundItems (line 160) | private MatchResult evaluateFailingOptionFoundItems(MaterialList list) {
method match (line 175) | private MatchResult match(MaterialList list, Multiset<IUniqueObject<?>...
method applyMatch (line 207) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/RecordingItemIndex.java
class RecordingItemIndex (line 17) | public final class RecordingItemIndex implements IItemIndex {
method RecordingItemIndex (line 22) | public RecordingItemIndex(IItemIndex other) {
method insert (line 28) | @Override
method reIndex (line 36) | @Override
method tryMatch (line 43) | @Override
method tryMatch (line 48) | @Override
method applyMatch (line 56) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/IHandleProvider.java
type IHandleProvider (line 9) | public interface IHandleProvider {
method index (line 16) | boolean index(ICapabilityProvider capProvider, Map<Class<?>, Map<Objec...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/IObjectHandle.java
type IObjectHandle (line 5) | public interface IObjectHandle<T> {
method getIndexClass (line 6) | Class<T> getIndexClass();
method getIndexObject (line 8) | T getIndexObject();
method match (line 10) | int match(IUniqueObject<?> item, int count, boolean simulate);
method insert (line 12) | int insert(IUniqueObject<?> item, int count, boolean simulate);
method shouldCleanup (line 14) | boolean shouldCleanup();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/ItemHandlerProvider.java
class ItemHandlerProvider (line 18) | public final class ItemHandlerProvider implements IHandleProvider {
method index (line 19) | public static void index(IItemHandler handler, Map<Class<?>, Map<Objec...
method index (line 43) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/StackHandlerItemHandle.java
class StackHandlerItemHandle (line 9) | public final class StackHandlerItemHandle implements IObjectHandle<Item> {
method StackHandlerItemHandle (line 13) | public StackHandlerItemHandle(IItemHandler handler, int slot) {
method getIndexClass (line 18) | @Override
method shouldCleanup (line 23) | @Override
method match (line 28) | @Override
method getIndexObject (line 38) | @Override
method insert (line 43) | @Override
method getStack (line 58) | private ItemStack getStack() {
method equals (line 62) | @Override
method hashCode (line 73) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/AndMaterialListEntry.java
class AndMaterialListEntry (line 13) | class AndMaterialListEntry extends SubMaterialListEntry {
method create (line 15) | @Override
method AndMaterialListEntry (line 21) | AndMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEntries, I...
method AndMaterialListEntry (line 25) | AndMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEntries, I...
method AndMaterialListEntry (line 29) | AndMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEntries) {
method iterator (line 37) | @Override
method getSerializer (line 76) | @Override
method orderAndSimplifyEntries (line 81) | @Override
method createFrom (line 103) | @Override
class MaterialEntryWrapper (line 108) | private static final class MaterialEntryWrapper {
method MaterialEntryWrapper (line 112) | private MaterialEntryWrapper(MaterialListEntry<?> entry) {
method peek (line 117) | private ImmutableMultiset<IUniqueObject<?>> peek() {
method hasNext (line 121) | private boolean hasNext() {
method advance (line 125) | private void advance() {
method reset (line 129) | private void reset() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/MaterialList.java
class MaterialList (line 27) | public final class MaterialList implements Iterable<ImmutableMultiset<IU...
method deserialize (line 31) | public static MaterialList deserialize(CompoundTag nbt, boolean persis...
method empty (line 35) | public static MaterialList empty() {
method of (line 39) | public static MaterialList of() {
method of (line 43) | public static MaterialList of(IUniqueObject<?>... items) {
method of (line 47) | public static MaterialList of(Iterable<IUniqueObject<?>> items) {
method and (line 51) | public static MaterialList and(MaterialList... materialLists) {
method or (line 55) | public static MaterialList or(MaterialList... materialLists) {
method simpleBuilder (line 59) | public static SimpleBuilder simpleBuilder() {
method andBuilder (line 63) | public static SubEntryBuilder andBuilder() {
method orBuilder (line 67) | public static SubEntryBuilder orBuilder() {
method getSerializerForId (line 71) | @Nullable
method readEntry (line 83) | static MaterialListEntry<?> readEntry(CompoundTag nbt, boolean persist...
method writeEntry (line 92) | @SuppressWarnings("unchecked")
method MaterialList (line 104) | private MaterialList() {
method MaterialList (line 108) | private MaterialList(MaterialListEntry rootEntry) {
method getRootEntry (line 112) | private MaterialListEntry getRootEntry() {
method getItemOptions (line 116) | public Iterable<ImmutableMultiset<IUniqueObject<?>>> getItemOptions() {
method getRequiredItems (line 122) | public ImmutableMultiset<IUniqueObject<?>> getRequiredItems() {
method serialize (line 129) | public CompoundTag serialize(boolean persisted) {
method iterator (line 133) | @Override
class SubEntryBuilder (line 139) | public static final class SubEntryBuilder {
method SubEntryBuilder (line 143) | private SubEntryBuilder(Function<ImmutableList<MaterialListEntry<?>>...
method add (line 148) | public SubEntryBuilder add(SimpleBuilder builder) {
method add (line 152) | public SubEntryBuilder add(SimpleBuilder... builders) {
method add (line 156) | public SubEntryBuilder add(SubEntryBuilder builder) {
method add (line 160) | public SubEntryBuilder add(SubEntryBuilder... builders) {
method add (line 164) | public SubEntryBuilder add(MaterialList element) {
method add (line 169) | public SubEntryBuilder add(MaterialList... elements) {
method addItems (line 173) | public SubEntryBuilder addItems(Multiset<IUniqueObject<?>> items) {
method addAllItems (line 178) | public SubEntryBuilder addAllItems(Iterable<? extends Multiset<IUniq...
method addAll (line 183) | public SubEntryBuilder addAll(Iterable<MaterialList> elements) {
method addAll (line 188) | public SubEntryBuilder addAll(Iterator<MaterialList> elements) {
method addAllSimpleBuilders (line 193) | public SubEntryBuilder addAllSimpleBuilders(Iterable<SimpleBuilder> ...
method addAllSubBuilders (line 198) | public SubEntryBuilder addAllSubBuilders(Iterable<SubEntryBuilder> i...
method build (line 203) | public MaterialList build() {
class SimpleBuilder (line 208) | public static final class SimpleBuilder {
method SimpleBuilder (line 211) | private SimpleBuilder() {
method addItem (line 215) | public SimpleBuilder addItem(IUniqueObject<?> item, int count) {
method addItem (line 220) | public SimpleBuilder addItem(IUniqueObject<?> item) {
method addAll (line 224) | public SimpleBuilder addAll(Iterable<IUniqueObject<?>> items) {
method setCount (line 229) | public SimpleBuilder setCount(IUniqueObject<?> element, int count) {
method add (line 234) | public SimpleBuilder add(IUniqueObject<?>... elements) {
method addAll (line 239) | public SimpleBuilder addAll(Iterator<? extends IUniqueObject<?>> ele...
method build (line 244) | public MaterialList build() {
class JsonSerializer (line 249) | public static final class JsonSerializer implements JsonBiDiSerializer...
method JsonSerializer (line 253) | public JsonSerializer(boolean printName, boolean extended) {
method serialize (line 258) | @Override
method deserialize (line 267) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/MaterialListEntry.java
type MaterialListEntry (line 14) | interface MaterialListEntry<T extends MaterialListEntry<T>> extends Iter...
method iterator (line 15) | @Override
method getSerializer (line 18) | Serializer<T> getSerializer();
method simplify (line 20) | MaterialListEntry<?> simplify();
type Serializer (line 22) | interface Serializer<T extends MaterialListEntry<T>> {
method getRegistryName (line 23) | ResourceLocation getRegistryName();
method readFromNBT (line 25) | T readFromNBT(CompoundTag nbt, boolean persisted);
method writeToNBT (line 27) | CompoundTag writeToNBT(T entry, boolean persisted);
method asJsonSerializer (line 29) | JsonSerializer<T> asJsonSerializer(boolean printName, boolean extend...
method asJsonDeserializer (line 31) | JsonDeserializer<T> asJsonDeserializer();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/OrMaterialListEntry.java
class OrMaterialListEntry (line 14) | class OrMaterialListEntry extends SubMaterialListEntry {
method create (line 16) | @Override
method OrMaterialListEntry (line 22) | OrMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEntries, Im...
method OrMaterialListEntry (line 26) | OrMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEntries, Im...
method OrMaterialListEntry (line 30) | OrMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEntries) {
method iterator (line 37) | @Override
method getSerializer (line 62) | @Override
method orderAndSimplifyEntries (line 67) | @Override
method createFrom (line 86) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/SimpleMaterialListEntry.java
class SimpleMaterialListEntry (line 21) | class SimpleMaterialListEntry implements MaterialListEntry<SimpleMateria...
method SimpleMaterialListEntry (line 25) | SimpleMaterialListEntry(ImmutableMultiset<IUniqueObject<?>> items) {
method getItems (line 29) | ImmutableMultiset<IUniqueObject<?>> getItems() {
method iterator (line 33) | @Override
method getSerializer (line 38) | @Override
method simplify (line 43) | @Override
class Serializer (line 48) | private static class Serializer implements MaterialListEntry.Serialize...
method readFromNBT (line 53) | @Override
method writeToNBT (line 73) | @Override
method asJsonSerializer (line 91) | @Override
method asJsonDeserializer (line 111) | @Override
method getRegistryName (line 130) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/SubMaterialListEntry.java
class SubMaterialListEntry (line 20) | abstract class SubMaterialListEntry implements MaterialListEntry<SubMate...
method SubMaterialListEntry (line 25) | public SubMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEnt...
method SubMaterialListEntry (line 31) | protected SubMaterialListEntry(ImmutableList<MaterialListEntry<?>> sub...
method SubMaterialListEntry (line 35) | public SubMaterialListEntry(ImmutableList<MaterialListEntry<?>> subEnt...
method getAllSubEntries (line 39) | protected Stream<MaterialListEntry<?>> getAllSubEntries() {
method simplify (line 43) | @Override
method orderAndSimplifyEntries (line 62) | protected abstract List<MaterialListEntry<?>> orderAndSimplifyEntries(
method getSubEntries (line 67) | protected ImmutableList<MaterialListEntry<?>> getSubEntries() {
method getConstantEntries (line 71) | protected ImmutableList<SimpleMaterialListEntry> getConstantEntries() {
method getCombinedConstantEntry (line 75) | protected SimpleMaterialListEntry getCombinedConstantEntry() {
method combine (line 79) | private SimpleMaterialListEntry combine(List<SimpleMaterialListEntry> ...
method createFrom (line 89) | protected abstract SubMaterialListEntry createFrom(ImmutableList<Mater...
method viewOnlySubEntries (line 91) | protected Iterable<ImmutableMultiset<IUniqueObject<?>>> viewOnlySubEnt...
method pullUpInnerEntries (line 95) | protected void pullUpInnerEntries(SubMaterialListEntry entry,
class Serializer (line 112) | protected static abstract class Serializer implements MaterialListEntr...
method Serializer (line 115) | public Serializer(ResourceLocation registryName) {
method getRegistryName (line 119) | @Override
method readFromNBT (line 124) | @Override
method writeToNBT (line 139) | @Override
method asJsonSerializer (line 150) | @Override
method asJsonDeserializer (line 169) | @Override
method create (line 191) | protected abstract SubMaterialListEntry create(ImmutableList<Materia...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/objects/IUniqueObject.java
type IUniqueObject (line 20) | public interface IUniqueObject<T> {
method getIndexClass (line 21) | Class<T> getIndexClass();
method getIndexObject (line 23) | T getIndexObject();
method matches (line 25) | boolean matches(ItemStack stack);
method insertInto (line 27) | ItemStack insertInto(ItemStack stack, int count);
method preferStackInsert (line 32) | default boolean preferStackInsert() {
method tryCreateInsertStack (line 36) | default Optional<ItemStack> tryCreateInsertStack(Map<Class<?>, Map<Obj...
method createStack (line 40) | default ItemStack createStack() {
method getObjectRegistryName (line 45) | default ResourceLocation getObjectRegistryName() {
method createStack (line 53) | ItemStack createStack(int count);
method getSerializer (line 55) | IUniqueObjectSerializer getSerializer();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/objects/IUniqueObjectSerializer.java
type IUniqueObjectSerializer (line 7) | public interface IUniqueObjectSerializer {
method serialize (line 8) | CompoundTag serialize(IUniqueObject<?> item, boolean persisted);
method deserialize (line 10) | IUniqueObject<?> deserialize(CompoundTag res);
method asJsonSerializer (line 12) | JsonSerializer<IUniqueObject<?>> asJsonSerializer(boolean printName, b...
method asJsonDeserializer (line 14) | JsonDeserializer<IUniqueObject<?>> asJsonDeserializer();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/objects/UniqueItem.java
class UniqueItem (line 33) | public final class UniqueItem implements IUniqueObject<Item> {
type ComparisonMode (line 34) | public enum ComparisonMode {
method match (line 36) | @Override
method match (line 42) | @Override
method ComparisonMode (line 65) | ComparisonMode(int id) {
method getId (line 69) | public byte getId() {
method match (line 73) | public abstract boolean match(CompoundTag nbt, @Nullable CompoundTag...
method byId (line 75) | public static ComparisonMode byId(byte id) {
method ofStack (line 85) | public static UniqueItem ofStack(ItemStack stack) {
method UniqueItem (line 100) | public UniqueItem(Item item) {
method UniqueItem (line 104) | public UniqueItem(Item item, @Nullable CompoundTag tagCompound, Compar...
method UniqueItem (line 108) | public UniqueItem(Item item, @Nullable CompoundTag tagCompound, Compar...
method getIndexClass (line 120) | @Override
method getIndexObject (line 125) | @Override
method getTag (line 130) | @Nullable
method getForgeCaps (line 135) | @Nullable
method createStack (line 140) | @Override
method matches (line 147) | @Override
method insertInto (line 163) | @Override
method getSerializer (line 174) | @Override
method equals (line 179) | @Override
method hashCode (line 191) | @Override
method toString (line 196) | @Override
class Serializer (line 207) | public static final class Serializer implements IUniqueObjectSerializer {
method serialize (line 208) | @Override
method deserialize (line 225) | @Override
method asJsonSerializer (line 240) | @Override
method asJsonDeserializer (line 263) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/ImmutableOrderedRegistry.java
class ImmutableOrderedRegistry (line 15) | public final class ImmutableOrderedRegistry<T> {
method ImmutableOrderedRegistry (line 19) | ImmutableOrderedRegistry(Map<ResourceLocation, T> backingMap, List<T> ...
method get (line 24) | @Nullable
method contains (line 29) | public boolean contains(ResourceLocation key) {
method getValuesInOrder (line 33) | public ImmutableList<T> getValuesInOrder() {
method values (line 37) | public Stream<T> values() {
method iterator (line 41) | public Iterator<T> iterator() {
method forEach (line 45) | public void forEach(Consumer<? super T> action) {
method spliterator (line 49) | public Spliterator<T> spliterator() {
method getKey (line 53) | @Nullable
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/Registries.java
class Registries (line 29) | @EventBusSubscriber(modid = Reference.MODID, bus = Bus.MOD)
method Registries (line 48) | private Registries() {
method createOrderedRegistries (line 61) | public static void createOrderedRegistries() {
method handleIMC (line 71) | public static boolean handleIMC(InterModComms.IMCMessage message) {
method addDefaultOrdered (line 93) | private static void addDefaultOrdered() {
class TileEntityData (line 106) | public static final class TileEntityData {
method TileEntityData (line 107) | private TileEntityData() {
method getTileDataFactories (line 110) | public static ImmutableOrderedRegistry<ITileDataFactory> getTileData...
class HandleProvider (line 117) | public static final class HandleProvider {
method HandleProvider (line 118) | private HandleProvider() {
method getHandleProviders (line 121) | public static ImmutableOrderedRegistry<IHandleProvider> getHandlePro...
method indexCapProvider (line 127) | public static boolean indexCapProvider(ICapabilityProvider provider,...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/TopologicalRegistryBuilder.java
class TopologicalRegistryBuilder (line 17) | public final class TopologicalRegistryBuilder<T> {
method create (line 22) | public static <T> TopologicalRegistryBuilder<T> create() {
method TopologicalRegistryBuilder (line 26) | private TopologicalRegistryBuilder() {
method addAllValues (line 32) | public TopologicalRegistryBuilder<T> addAllValues(Map<ResourceLocation...
method addValue (line 39) | public TopologicalRegistryBuilder<T> addValue(ResourceLocation key, T ...
method addAllMarkers (line 54) | public TopologicalRegistryBuilder<T> addAllMarkers(Iterable<ResourceLo...
method addMarker (line 61) | public TopologicalRegistryBuilder<T> addMarker(ResourceLocation marker) {
method addDependency (line 71) | public TopologicalRegistryBuilder<T> addDependency(ResourceLocation so...
method merge (line 83) | public TopologicalRegistryBuilder<T> merge(TopologicalRegistryBuilder<...
method build (line 97) | public ImmutableOrderedRegistry<T> build() {
method validateUnbuild (line 111) | private void validateUnbuild() {
method toString (line 115) | @Override
method containsValue (line 123) | private boolean containsValue(T value) {
class ValueObject (line 132) | private static final class ValueObject<T> implements Comparable<ValueO...
method ValueObject (line 138) | private ValueObject(@Nonnull ResourceLocation key, @Nullable T value) {
method getKey (line 143) | @Nonnull
method getValue (line 148) | @Nullable
method setValue (line 153) | public void setValue(@Nonnull T value) {
method compareTo (line 157) | @Override
method equals (line 162) | @Override
method hashCode (line 171) | @Override
method toString (line 176) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/SaveManager.java
type SaveManager (line 18) | public enum SaveManager {
method SaveManager (line 24) | SaveManager() {
method registerUndoSave (line 29) | public Supplier<UndoWorldSave> registerUndoSave(Function<ServerLevel, ...
method onServerStarted (line 35) | public void onServerStarted(ServerStartedEvent event) {
method onServerStopped (line 45) | public void onServerStopped(ServerStoppedEvent event) {
method getUndoSave (line 54) | public static UndoWorldSave getUndoSave(ServerLevel world, IntSupplier...
method getTemplateSave (line 58) | private static TemplateSave getTemplateSave(ServerLevel world, String ...
method getTemplateProvider (line 66) | public SaveTemplateProvider getTemplateProvider() {
method getTemplateSave (line 70) | public TemplateSave getTemplateSave() {
class UndoSaveContainer (line 74) | private static final class UndoSaveContainer {
method UndoSaveContainer (line 79) | private UndoSaveContainer(Function<ServerLevel, UndoWorldSave> const...
method acquire (line 84) | private void acquire(ServerLevel world) {
method getCurrentSave (line 88) | @Nullable
method release (line 93) | private void release() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/SaveTemplateProvider.java
class SaveTemplateProvider (line 21) | public final class SaveTemplateProvider implements ITemplateProvider {
method SaveTemplateProvider (line 25) | public SaveTemplateProvider(Supplier<TemplateSave> save) {
method getSave (line 30) | public TemplateSave getSave() {
method getTemplateForKey (line 34) | @Override
method setTemplate (line 40) | @Override
method requestUpdate (line 46) | @Override
method requestRemoteUpdate (line 51) | @Override
method registerUpdateListener (line 60) | @Override
method removeUpdateListener (line 65) | @Override
method getId (line 70) | @Override
method requestRemoteUpdate (line 75) | public boolean requestRemoteUpdate(ITemplateKey key, ServerPlayer play...
method requestRemoteUpdate (line 79) | @Override
method requestUpdate (line 87) | @Override
method onRemoteIdAllocated (line 94) | public void onRemoteIdAllocated(UUID allocated) {
method getFreeId (line 98) | private UUID getFreeId() {
method notifyListeners (line 103) | private void notifyListeners(ITemplateKey key, Template template, Func...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/TemplateSave.java
class TemplateSave (line 10) | public final class TemplateSave extends TimedDataSave<TemplateInfo> {
method TemplateSave (line 12) | public TemplateSave() {
method loads (line 16) | public static TemplateSave loads(CompoundTag tag) {
method getTemplate (line 22) | public Template getTemplate(UUID id) {
method setTemplate (line 27) | void setTemplate(UUID id, Template template) {
method removeTemplate (line 31) | void removeTemplate(UUID id) {
method createValue (line 36) | @Override
method readValue (line 41) | @Override
method markDirtyAndUpdate (line 46) | private TemplateInfo markDirtyAndUpdate(TemplateInfo info) {
class TemplateInfo (line 51) | static final class TemplateInfo extends TimedDataSave.TimedValue { //f...
method TemplateInfo (line 54) | private TemplateInfo(CompoundTag nbt) {
method TemplateInfo (line 59) | private TemplateInfo(Template template) {
method TemplateInfo (line 64) | private TemplateInfo(long lastUpdateTime, Template template) {
method TemplateInfo (line 69) | private TemplateInfo() {
method getTemplate (line 73) | private Template getTemplate() {
method setTemplate (line 77) | public TemplateInfo setTemplate(Template template) {
method updateTime (line 82) | @Override
method write (line 87) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/TimedDataSave.java
class TimedDataSave (line 17) | public abstract class TimedDataSave<T extends TimedValue> extends SavedD...
method TimedDataSave (line 21) | public TimedDataSave() {
method getFreeUUID (line 27) | public UUID getFreeUUID() {
method writeAllIds (line 32) | protected void writeAllIds(FriendlyByteBuf buffer) {
method get (line 38) | protected T get(UUID id) {
method get (line 42) | protected T get(UUID id, Function<UUID, T> factory) {
method remove (line 47) | protected void remove(UUID id) {
method contains (line 59) | protected boolean contains(UUID id) {
method getLastUpdateTime (line 63) | public long getLastUpdateTime(UUID id) {
method load (line 67) | public void load(CompoundTag nbt) {
method save (line 79) | @Override
method createValue (line 86) | protected abstract T createValue();
method readValue (line 88) | protected abstract T readValue(CompoundTag nbt);
class TimedValue (line 90) | public static class TimedValue {
method TimedValue (line 93) | protected TimedValue(CompoundTag nbt) {
method TimedValue (line 97) | protected TimedValue(long lastUpdateTime) {
method TimedValue (line 101) | protected TimedValue() {
method updateTime (line 105) | public TimedValue updateTime() {
method getUpdateTime (line 110) | public long getUpdateTime() {
method write (line 114) | public CompoundTag write() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/Undo.java
class Undo (line 41) | public final class Undo {
method deserialize (line 42) | static Undo deserialize(CompoundTag nbt) {
method readEntry (line 94) | private static Tuple<IUniqueObject<?>, Integer> readEntry(Tag inbt, In...
method builder (line 102) | public static Builder builder() {
method Undo (line 110) | public Undo(ResourceKey<Level> dim, Map<BlockPos, BlockInfo> dataMap, ...
method getBoundingBox (line 116) | public Region getBoundingBox() {
method getUndoData (line 120) | public Map<BlockPos, BlockInfo> getUndoData() {
method serialize (line 124) | CompoundTag serialize() {
method writeEntry (line 148) | private CompoundTag writeEntry(Entry<IUniqueObject<?>> entry, ToIntFun...
class BlockInfo (line 156) | public static final class BlockInfo {
method deserialize (line 157) | private static BlockInfo deserialize(CompoundTag nbt, IntFunction<Bl...
method BlockInfo (line 170) | private BlockInfo(BlockData recordedData, BlockData placedData, Mult...
method serialize (line 177) | private CompoundTag serialize(ToIntFunction<BlockData> dataIdSupplie...
method getRecordedData (line 186) | public BlockData getRecordedData() {
method getPlacedData (line 190) | public BlockData getPlacedData() {
method getUsedItems (line 194) | public Multiset<IUniqueObject<?>> getUsedItems() {
method getProducedItems (line 198) | public Multiset<IUniqueObject<?>> getProducedItems() {
class Builder (line 203) | public static final class Builder {
method Builder (line 207) | private Builder() {
method record (line 212) | public Builder record(BlockGetter reader, BlockPos pos, BlockData pl...
method record (line 219) | private Builder record(BlockPos pos, BlockData recordedData, BlockDa...
method build (line 227) | public Undo build(Level dim) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/UndoHistory.java
class UndoHistory (line 16) | final class UndoHistory {
method UndoHistory (line 20) | UndoHistory(IntSupplier maxLengthSupplier) {
method add (line 25) | UndoHistory add(Undo undo) {
method get (line 31) | Optional<Undo> get() {
method peek (line 36) | Optional<Undo> peek() {
method read (line 41) | void read(CompoundTag nbt) {
method write (line 50) | public void write(CompoundTag nbt) {
method ensureSize (line 54) | private void ensureSize() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/UndoWorldSave.java
class UndoWorldSave (line 11) | public class UndoWorldSave extends TimedDataSave<UndoValue> {
method UndoWorldSave (line 14) | public UndoWorldSave(IntSupplier undoMaxLength) {
method loads (line 19) | public static UndoWorldSave loads(CompoundTag tag) {
method save (line 25) | @Override
method insertUndo (line 32) | public void insertUndo(UUID uuid, Undo undo) {
method getUndo (line 37) | public Optional<Undo> getUndo(UUID uuid) {
method peekSnapshot (line 41) | public Optional<Undo> peekSnapshot(UUID uuid) {
method removeHistory (line 45) | public void removeHistory(UUID uuid) {
method getAndUpdateTime (line 49) | private UndoValue getAndUpdateTime(UUID uuid) {
method createValue (line 55) | @Override
method readValue (line 60) | @Override
class UndoValue (line 65) | static final class UndoValue extends TimedDataSave.TimedValue { //for ...
method UndoValue (line 68) | private UndoValue(CompoundTag nbt, IntSupplier supplier) {
method UndoValue (line 74) | private UndoValue(IntSupplier maxLength) {
method getHistory (line 79) | private UndoHistory getHistory() {
method write (line 83) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/ITemplateKey.java
type ITemplateKey (line 6) | public interface ITemplateKey {
method getTemplateId (line 7) | UUID getTemplateId(Supplier<UUID> freeIdAllocator);
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/ITemplateProvider.java
type ITemplateProvider (line 10) | public interface ITemplateProvider {
method getId (line 11) | UUID getId(ITemplateKey key);
method getTemplateForKey (line 13) | Template getTemplateForKey(ITemplateKey key);
method getTemplateForKey (line 15) | default <T extends Throwable> Template getTemplateForKey(ICapabilityPr...
method setTemplate (line 29) | void setTemplate(ITemplateKey key, Template template);
method requestUpdate (line 38) | boolean requestUpdate(ITemplateKey key);
method requestUpdate (line 46) | boolean requestUpdate(ITemplateKey key, PacketDistributor.PacketTarget...
method requestRemoteUpdate (line 54) | boolean requestRemoteUpdate(ITemplateKey key);
method requestRemoteUpdate (line 62) | boolean requestRemoteUpdate(ITemplateKey key, PacketDistributor.Packet...
method registerUpdateListener (line 68) | void registerUpdateListener(IUpdateListener listener);
method removeUpdateListener (line 70) | void removeUpdateListener(IUpdateListener listener);
type IUpdateListener (line 72) | interface IUpdateListener {
method onTemplateUpdate (line 73) | default void onTemplateUpdate(ITemplateProvider provider, ITemplateK...
method onTemplateUpdateSend (line 77) | default void onTemplateUpdateSend(ITemplateProvider provider, ITempl...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/InMemoryTemplateProvider.java
class InMemoryTemplateProvider (line 11) | public class InMemoryTemplateProvider implements ITemplateProvider {
method InMemoryTemplateProvider (line 14) | public InMemoryTemplateProvider() {
method getTemplateForKey (line 18) | @Override
method getId (line 23) | @Override
method requestUpdate (line 28) | @Override
method requestRemoteUpdate (line 33) | @Override
method requestUpdate (line 38) | @Override
method requestRemoteUpdate (line 43) | @Override
method setTemplate (line 48) | @Override
method clear (line 53) | public void clear() {
method requestFreeId (line 57) | private UUID requestFreeId() {
method registerUpdateListener (line 62) | @Override
method removeUpdateListener (line 67) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/SerialisationSupport.java
class SerialisationSupport (line 15) | public final class SerialisationSupport {
method SerialisationSupport (line 16) | private SerialisationSupport() {
method dummyDataSerializer (line 19) | public static ITileDataSerializer dummyDataSerializer() {
class DummyTileDataSerializer (line 23) | public static final class DummyTileDataSerializer implements ITileData...
method DummyTileDataSerializer (line 25) | private DummyTileDataSerializer() {
method serialize (line 29) | @Override
method deserialize (line 34) | @Override
method createNbtSerializer (line 40) | public static NBTTileEntityDataSerializer createNbtSerializer() {
method createDummySerializer (line 44) | public static DummyTileDataSerializer createDummySerializer() {
class NBTTileEntityDataSerializer (line 48) | public static final class NBTTileEntityDataSerializer implements ITile...
method NBTTileEntityDataSerializer (line 49) | private NBTTileEntityDataSerializer() {
method serialize (line 53) | @Override
method deserialize (line 64) | @Override
method uniqueItemSerializer (line 74) | public static IUniqueObjectSerializer uniqueItemSerializer() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/Template.java
class Template (line 29) | public final class Template {
method deserialize (line 30) | public static Template deserialize(CompoundTag nbt, @Nullable Template...
method Template (line 63) | public Template(ImmutableMap<BlockPos, BlockData> map, TemplateHeader ...
method Template (line 67) | private Template(ImmutableMap<BlockPos, BlockData> map, TemplateHeader...
method Template (line 73) | public Template() {
method getHeaderAndForceMaterials (line 77) | public TemplateHeader getHeaderAndForceMaterials(BuildContext context) {
method getHeader (line 90) | public TemplateHeader getHeader() {
method createViewInContext (line 94) | public IBuildView createViewInContext(BuildContext context) {
method serialize (line 98) | public CompoundTag serialize(boolean persisted) {
method rotate (line 121) | public Template rotate(Rotation rotation) {
method rotate (line 125) | public Template rotate(Axis axis, Rotation rotation) {
method mirror (line 140) | public Template mirror(Axis axis) {
method replace (line 166) | public Template replace(Function<BlockPos, Optional<BlockData>> replac...
method withName (line 174) | public Template withName(@Nullable String name) {
method withNameAndAuthor (line 178) | public Template withNameAndAuthor(@Nullable String name, @Nullable Str...
method clearMaterials (line 182) | public Template clearMaterials() {
method normalize (line 186) | public Template normalize() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/TemplateHeader.java
class TemplateHeader (line 28) | public final class TemplateHeader {
method deserialize (line 49) | @Override
method serialize (line 81) | @Override
method builder (line 102) | public static Builder builder(Region boundingBox) {
method builderOf (line 110) | public static Builder builderOf(TemplateHeader header) {
method builderOf (line 119) | public static Builder builderOf(TemplateHeader header, Region bounding...
method builderFromNBT (line 126) | public static Builder builderFromNBT(CompoundTag nbt, boolean persiste...
method builderFromNBT (line 140) | public static Builder builderFromNBT(CompoundTag nbt) {
method fromNBT (line 144) | public static TemplateHeader fromNBT(CompoundTag nbt) {
method appendHeaderSpecification (line 148) | public static GsonBuilder appendHeaderSpecification(GsonBuilder builde...
method TemplateHeader (line 176) | private TemplateHeader(@Nullable String name, @Nullable String author,...
method getName (line 186) | @Nullable
method getAuthor (line 194) | @Nullable
method getRequiredItems (line 202) | @Nullable
method getBoundingBox (line 210) | public Region getBoundingBox() {
method toNBT (line 220) | public CompoundTag toNBT(boolean persisted) {
method toJson (line 233) | public String toJson(boolean printName, boolean extended) {
class Builder (line 242) | public static final class Builder {
method Builder (line 252) | private Builder(Region boundingBox) {
method bounds (line 260) | public Builder bounds(Region boundingBox) {
method name (line 271) | public Builder name(@Nullable String name) {
method author (line 282) | public Builder author(@Nullable String author) {
method requiredItems (line 294) | public Builder requiredItems(@Nullable MaterialList requiredItems) {
method build (line 302) | public TemplateHeader build() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/TemplateIO.java
class TemplateIO (line 21) | public final class TemplateIO {
method TemplateIO (line 23) | private TemplateIO() {}
method writeTemplate (line 25) | public static void writeTemplate(Template template, OutputStream strea...
method writeTemplate (line 29) | public static void writeTemplate(Template template, OutputStream strea...
method readTemplate (line 41) | public static Template readTemplate(InputStream stream, @Nullable Temp...
method readTemplate (line 52) | public static Template readTemplate(InputStream stream, @Nullable Temp...
method readTemplate (line 66) | public static Template readTemplate(CompoundTag nbt, @Nullable Templat...
method writeTemplateJson (line 74) | public static void writeTemplateJson(Template template, OutputStream s...
method writeTemplateJson (line 78) | public static void writeTemplateJson(Template template, OutputStream s...
method writeTemplateJson (line 82) | public static String writeTemplateJson(Template template) throws Templ...
method writeTemplateJson (line 86) | public static String writeTemplateJson(Template template, @Nullable Bu...
method readTemplateFromJson (line 90) | public static Template readTemplateFromJson(String json) throws Templa...
method readTemplateFromJson (line 98) | public static Template readTemplateFromJson(InputStream stream) throws...
class TemplateJsonRepresentation (line 106) | private static final class TemplateJsonRepresentation {
method ofTemplate (line 107) | public static TemplateJsonRepresentation ofTemplate(Template templat...
method TemplateJsonRepresentation (line 120) | private TemplateJsonRepresentation(TemplateHeader header, String bod...
method getHeader (line 125) | private TemplateHeader getHeader() {
method getBody (line 129) | private String getBody() {
method getTemplate (line 133) | private Template getTemplate() throws TemplateReadException {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/TemplateKey.java
class TemplateKey (line 11) | public final class TemplateKey implements ITemplateKey {
method TemplateKey (line 15) | public TemplateKey() {
method TemplateKey (line 19) | public TemplateKey(@Nullable UUID id) {
method getTemplateId (line 23) | @Override
method getId (line 30) | @Nullable
method setUUID (line 35) | public TemplateKey setUUID(@Nullable UUID id) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tileentities/ConstructionBlockTileEntity.java
class ConstructionBlockTileEntity (line 18) | public class ConstructionBlockTileEntity extends BlockEntity {
method ConstructionBlockTileEntity (line 23) | public ConstructionBlockTileEntity(BlockPos pos, BlockState state) {
method setBlockState (line 27) | public void setBlockState(BlockData state) {
method getModelData (line 33) | @Override
method getBlockState (line 43) | @Nonnull
method getConstructionBlockData (line 49) | @Nonnull
method load (line 56) | @Override
method saveAdditional (line 63) | @Nonnull
method markDirtyClient (line 72) | private void markDirtyClient() {
method getUpdateTag (line 80) | @Nonnull
method getUpdatePacket (line 88) | @Override
method onDataPacket (line 95) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tileentities/EffectBlockTileEntity.java
class EffectBlockTileEntity (line 20) | @Tainted(reason = "Used blockData and a stupid non-centralised callback ...
method EffectBlockTileEntity (line 36) | public EffectBlockTileEntity(BlockPos pos, BlockState state) {
method initializeData (line 40) | public void initializeData(BlockState curState, @Nullable BlockEntity ...
method tick (line 56) | public static void tick(Level level, BlockPos blockPos, BlockState sta...
method complete (line 63) | private void complete() {
method getRenderedBlock (line 70) | public BlockData getRenderedBlock() {
method getSourceBlock (line 74) | public BlockData getSourceBlock() {
method getReplacementMode (line 78) | public Mode getReplacementMode() {
method isUsingPaste (line 82) | public boolean isUsingPaste() {
method getTicksExisted (line 86) | public int getTicksExisted() {
method getLifespan (line 90) | public int getLifespan() {
method getUpdatePacket (line 94) | @Override
method getUpdateTag (line 100) | @Nonnull
method handleUpdateTag (line 108) | @Override
method onDataPacket (line 113) | @Override
method saveAdditional (line 118) | @Nonnull
method load (line 131) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tileentities/OurTileEntities.java
class OurTileEntities (line 10) | public final class OurTileEntities {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/tileentities/TemplateManagerTileEntity.java
class TemplateManagerTileEntity (line 32) | public class TemplateManagerTileEntity extends BlockEntity implements Me...
method TemplateManagerTileEntity (line 37) | public TemplateManagerTileEntity(BlockPos pos, BlockState state) {
method onContentsChanged (line 43) | @Override
method isTemplateStack (line 50) | private boolean isTemplateStack(ItemStack stack) {
method getSlotLimit (line 54) | @Override
method isItemValid (line 59) | @Override
method getDisplayName (line 67) | @Override
method createMenu (line 73) | @Nullable
method onLoad (line 80) | @Override
method load (line 86) | @Override
method saveAdditional (line 94) | @Nonnull
method canInteractWith (line 101) | public boolean canInteractWith(Player playerIn) {
method getCapability (line 106) | @Nonnull
method onChunkUnloaded (line 114) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/Additions.java
class Additions (line 19) | public final class Additions {
type NineByNineTranslation (line 22) | private enum NineByNineTranslation implements ITranslationProvider {
method NineByNineTranslation (line 32) | NineByNineTranslation(@Nonnull String key, @Nonnegative int argCount) {
method NineByNineTranslation (line 37) | NineByNineTranslation(@Nonnull String key) {
method areValidArguments (line 41) | @Override
method getTranslationKey (line 46) | @Override
type DireNineByNineTranslation (line 52) | private enum DireNineByNineTranslation implements ITranslationProvider {
method DireNineByNineTranslation (line 62) | DireNineByNineTranslation(@Nonnull String key, @Nonnegative int argC...
method DireNineByNineTranslation (line 67) | DireNineByNineTranslation(@Nonnull String key) {
method areValidArguments (line 71) | @Override
method getTranslationKey (line 76) | @Override
method sizeInvalid (line 83) | public static boolean sizeInvalid(Player player, Region region) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/CommonUtils.java
class CommonUtils (line 14) | public final class CommonUtils {
method CommonUtils (line 15) | private CommonUtils() {}
method fakeRayTrace (line 17) | public static BlockHitResult fakeRayTrace(Vec3 simulatePos, BlockPos p...
method estimateRequiredItems (line 23) | @Tainted(reason = "Part of the material list system")
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/GadgetUtils.java
class GadgetUtils (line 59) | public class GadgetUtils {
method mightBeLink (line 67) | public static boolean mightBeLink(final String s) {
method addTooltipNameAndAuthor (line 71) | public static void addTooltipNameAndAuthor(ItemStack stack, @Nullable ...
method getPasteStream (line 87) | @Nullable
method setAnchor (line 96) | public static void setAnchor(ItemStack stack) {
method setAnchor (line 100) | public static void setAnchor(ItemStack stack, List<BlockPos> coordinat...
method getAnchor (line 107) | public static Optional<List<BlockPos>> getAnchor(ItemStack stack) {
method setToolRange (line 125) | public static void setToolRange(ItemStack stack, int range) {
method getToolRange (line 131) | public static int getToolRange(ItemStack stack) {
method rotateOrMirrorBlock (line 136) | public static BlockData rotateOrMirrorBlock(Player player, PacketRotat...
method rotateOrMirrorToolBlock (line 143) | public static void rotateOrMirrorToolBlock(ItemStack stack, Player pla...
method setToolBlock (line 147) | private static void setToolBlock(ItemStack stack, @Nullable BlockData ...
method getToolBlock (line 159) | @Nonnull
method linkToInventory (line 170) | public static void linkToInventory(ItemStack stack, Player player) {
method selectBlock (line 180) | public static InteractionResultHolder<Block> selectBlock(ItemStack sta...
method setRemoteInventory (line 208) | public static InteractionResult setRemoteInventory(ItemStack stack, Pl...
method anchorBlocks (line 222) | public static boolean anchorBlocks(Player player, ItemStack stack) {
method withSuffix (line 254) | public static String withSuffix(int count) {
method writePOSToNBT (line 262) | public static void writePOSToNBT(ItemStack stack, @Nullable BlockPos p...
method getPOSFromNBT (line 277) | @Nullable
method getDIMFromNBT (line 289) | @Nullable
method dropTileEntityInventory (line 305) | public static void dropTileEntityInventory(Level world, BlockPos pos) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/compression/DataCompressor.java
class DataCompressor (line 29) | public final class DataCompressor<T> implements ToIntFunction<T> {
method DataCompressor (line 34) | public DataCompressor(int expectedSize) {
method DataCompressor (line 40) | public DataCompressor() {
method applyAsInt (line 46) | @Override
method getReverseMap (line 55) | public List<T> getReverseMap() {
method write (line 59) | public ListTag write(Function<T, ? extends Tag> serializer) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/compression/DataDecompressor.java
class DataDecompressor (line 23) | public class DataDecompressor<T> implements IntFunction<T> {
method DataDecompressor (line 27) | public DataDecompressor(ListTag list, Function<Tag, T> deserializer, I...
method apply (line 36) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/exceptions/CapabilityNotPresentException.java
class CapabilityNotPresentException (line 3) | public class CapabilityNotPresentException extends IllegalStateException {
method CapabilityNotPresentException (line 5) | public CapabilityNotPresentException() {
method CapabilityNotPresentException (line 9) | public CapabilityNotPresentException(Throwable cause) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/exceptions/TemplateParseException.java
class TemplateParseException (line 5) | public class TemplateParseException extends JsonParseException {
method TemplateParseException (line 7) | public TemplateParseException(String msg) {
method TemplateParseException (line 11) | public TemplateParseException(String msg, Throwable cause) {
class IllegalMinecraftVersionException (line 15) | public static final class IllegalMinecraftVersionException extends Tem...
method IllegalMinecraftVersionException (line 18) | public IllegalMinecraftVersionException(String minecraftVersion) {
method IllegalMinecraftVersionException (line 23) | public IllegalMinecraftVersionException(Throwable cause, String mine...
method getMinecraftVersion (line 28) | public String getMinecraftVersion() {
class UnknownTemplateVersionException (line 33) | public static final class UnknownTemplateVersionException extends Temp...
method UnknownTemplateVersionException (line 36) | public UnknownTemplateVersionException(String templateVersion) {
method UnknownTemplateVersionException (line 41) | public UnknownTemplateVersionException(Throwable cause, String templ...
method getTemplateVersion (line 46) | public String getTemplateVersion() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/exceptions/TemplateReadException.java
class TemplateReadException (line 5) | public class TemplateReadException extends Exception {
method TemplateReadException (line 6) | public TemplateReadException() {
method TemplateReadException (line 9) | public TemplateReadException(String message) {
method TemplateReadException (line 13) | public TemplateReadException(String message, Throwable cause) {
method TemplateReadException (line 17) | public TemplateReadException(Throwable cause) {
method TemplateReadException (line 21) | public TemplateReadException(String message, Throwable cause, boolean ...
class CorruptJsonException (line 25) | public static final class CorruptJsonException extends TemplateReadExc...
method CorruptJsonException (line 26) | public CorruptJsonException() {
method CorruptJsonException (line 30) | public CorruptJsonException(Throwable cause) {
class CorruptDataException (line 35) | public static final class CorruptDataException extends TemplateReadExc...
method CorruptDataException (line 38) | public CorruptDataException(String templateData) {
method CorruptDataException (line 43) | public CorruptDataException(Throwable cause, String templateData) {
method getTemplateData (line 48) | public String getTemplateData() {
class DataCannotBeReadException (line 53) | public static class DataCannotBeReadException extends TemplateReadExce...
method DataCannotBeReadException (line 54) | public DataCannotBeReadException(Throwable cause) {
class IllegalNBTDataException (line 59) | public static class IllegalNBTDataException extends TemplateReadExcept...
method IllegalNBTDataException (line 62) | public IllegalNBTDataException(CompoundTag nbt) {
method IllegalNBTDataException (line 67) | public IllegalNBTDataException(Throwable cause, CompoundTag nbt) {
method getNbt (line 72) | public CompoundTag getNbt() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/exceptions/TemplateWriteException.java
class TemplateWriteException (line 5) | public class TemplateWriteException extends Exception {
method TemplateWriteException (line 6) | public TemplateWriteException() {
method TemplateWriteException (line 9) | public TemplateWriteException(String message) {
method TemplateWriteException (line 13) | public TemplateWriteException(String message, Throwable cause) {
method TemplateWriteException (line 17) | public TemplateWriteException(Throwable cause) {
method TemplateWriteException (line 21) | public TemplateWriteException(String message, Throwable cause, boolean...
class DataCannotBeWrittenException (line 25) | public static final class DataCannotBeWrittenException extends Templat...
method DataCannotBeWrittenException (line 28) | public DataCannotBeWrittenException(Throwable cause, CompoundTag nbt) {
method getNbt (line 33) | public CompoundTag getNbt() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/helpers/NBTHelper.java
class NBTHelper (line 26) | @Tainted(reason = "Everything here is single use. It should not be a hel...
method writeIterable (line 28) | public static <T> ListTag writeIterable(Iterable<T> iterable, Function...
method serializeMap (line 32) | public static <K, V> ListTag serializeMap(Map<K, V> map, Function<? su...
method serializeUUIDMap (line 43) | public static <V> ListTag serializeUUIDMap(Map<UUID, V> map, Function<...
method deserializeMap (line 54) | public static <K, V> Map<K, V> deserializeMap(ListTag list, Map<K, V> ...
method deserializeUUIDMap (line 67) | public static <V> Map<UUID, V> deserializeUUIDMap(ListTag list, Map<UU...
method deserializeCollection (line 80) | public static <T, C extends Collection<T>> C deserializeCollection(Lis...
method deserializeMultisetEntries (line 87) | public static <T> Multiset<T> deserializeMultisetEntries(ListTag list,...
method toListNBT (line 92) | public static <T extends Tag> Collector<T, ListTag, ListTag> toListNBT...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/helpers/VectorHelper.java
class VectorHelper (line 11) | public class VectorHelper {
method getLookingAt (line 13) | public static BlockHitResult getLookingAt(Player player, ItemStack too...
method getLookingAt (line 17) | public static BlockHitResult getLookingAt(Player player, boolean shoul...
method getLookingAt (line 21) | public static BlockHitResult getLookingAt(Player player, ClipContext.F...
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/CommandTranslation.java
type CommandTranslation (line 8) | public enum CommandTranslation implements ITranslationProvider {
method CommandTranslation (line 22) | CommandTranslation(@Nonnull String key, @Nonnegative int argCount) {
method areValidArguments (line 27) | @Override
method getTranslationKey (line 32) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/GuiTranslation.java
type GuiTranslation (line 7) | public enum GuiTranslation implements ITranslationProvider {
method GuiTranslation (line 38) | GuiTranslation(@Nonnull String key) {
method areValidArguments (line 43) | @Override
method getTranslationKey (line 48) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/ITranslationProvider.java
type ITranslationProvider (line 7) | public interface ITranslationProvider {
method format (line 9) | default String format(Object... args) {
method componentTranslation (line 14) | default MutableComponent componentTranslation(Object... args) {
method areValidArguments (line 19) | boolean areValidArguments(Object... args);
method getTranslationKey (line 21) | String getTranslationKey();
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/LangUtil.java
class LangUtil (line 7) | public final class LangUtil {
method LangUtil (line 8) | private LangUtil() {}
method getLangKey (line 10) | public static String getLangKey(String type, String... args) {
method getFormattedBlockName (line 14) | public static String getFormattedBlockName(BlockState block) {
method getFormattedBlockName (line 18) | public static String getFormattedBlockName(Block block) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/MaterialListTranslation.java
type MaterialListTranslation (line 8) | public enum MaterialListTranslation implements ITranslationProvider {
method MaterialListTranslation (line 28) | MaterialListTranslation(@Nonnull String key, @Nonnegative int argCount) {
method areValidArguments (line 33) | @Override
method getTranslationKey (line 38) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/MessageTranslation.java
type MessageTranslation (line 8) | public enum MessageTranslation implements ITranslationProvider {
method MessageTranslation (line 62) | MessageTranslation(@Nonnull String key) {
method MessageTranslation (line 66) | MessageTranslation(@Nonnull String key, @Nonnegative int argCount) {
method areValidArguments (line 71) | @Override
method getTranslationKey (line 76) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/ModeTranslation.java
type ModeTranslation (line 7) | public enum ModeTranslation implements ITranslationProvider{
method ModeTranslation (line 14) | ModeTranslation(@Nonnull String key) {
method areValidArguments (line 18) | @Override
method getTranslationKey (line 23) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/RadialTranslation.java
type RadialTranslation (line 5) | public enum RadialTranslation implements ITranslationProvider {
method RadialTranslation (line 22) | RadialTranslation(String key) {
method areValidArguments (line 26) | @Override
method getTranslationKey (line 31) | @Override
method getString (line 36) | public String getString() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/Styles.java
class Styles (line 6) | public final class Styles {
method Styles (line 7) | private Styles() {}
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/lang/TooltipTranslation.java
type TooltipTranslation (line 6) | public enum TooltipTranslation implements ITranslationProvider {
method TooltipTranslation (line 38) | TooltipTranslation(@Nonnull String key, @Nonnegative int argCount) {
method areValidArguments (line 43) | @Override
method getTranslationKey (line 48) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/ref/JsonKeys.java
class JsonKeys (line 3) | public final class JsonKeys {
method JsonKeys (line 25) | private JsonKeys() {}
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/ref/NBTKeys.java
class NBTKeys (line 7) | public final class NBTKeys {
method NBTKeys (line 32) | private NBTKeys() {}
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/ref/Reference.java
class Reference (line 6) | @Tainted(reason = "Awful. Contains a large amount of unused data or sing...
method Reference (line 17) | private Reference() {
class SaveReference (line 20) | public static final class SaveReference {
method SaveReference (line 21) | private SaveReference() {
class ItemReference (line 31) | public static final class ItemReference {
method ItemReference (line 34) | private ItemReference() {
class BlockReference (line 38) | public static final class BlockReference {
class TagReference (line 40) | public static final class TagReference {
method TagReference (line 50) | private TagReference() {
method BlockReference (line 54) | private BlockReference() {
class TileDataSerializerReference (line 59) | public static final class TileDataSerializerReference {
method TileDataSerializerReference (line 62) | private TileDataSerializerReference() {
class TileDataFactoryReference (line 66) | public static final class TileDataFactoryReference {
method TileDataFactoryReference (line 69) | private TileDataFactoryReference() {
class HandleProviderReference (line 76) | public static final class HandleProviderReference {
method HandleProviderReference (line 79) | private HandleProviderReference() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/spliterator/DelegatingSpliterator.java
class DelegatingSpliterator (line 8) | public abstract class DelegatingSpliterator<T, U> implements Spliterator...
method DelegatingSpliterator (line 12) | protected DelegatingSpliterator(Spliterator<T> other) {
method tryAdvance (line 17) | @Override
method characteristics (line 25) | @Override
method estimateSize (line 30) | @Override
method getExactSizeIfKnown (line 35) | @Override
method advance (line 40) | protected abstract boolean advance(T object, Consumer<? super U> action);
method getOther (line 42) | protected Spliterator<T> getOther() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/spliterator/MappingSpliterator.java
class MappingSpliterator (line 8) | public final class MappingSpliterator<T, U> extends DelegatingSpliterato...
method MappingSpliterator (line 11) | public MappingSpliterator(Spliterator<T> other, Function<? super T, ? ...
method advance (line 16) | @Override
method trySplit (line 22) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/tools/JsonBiDiSerializer.java
type JsonBiDiSerializer (line 7) | @Tainted(reason = "Part of the Template system")
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/tools/MathUtils.java
class MathUtils (line 8) | @Tainted(reason = "Shouldn't exist.")
method MathUtils (line 14) | private MathUtils() {}
method additiveInverse (line 16) | public static short additiveInverse(short num) {
method posToLong (line 27) | public static long posToLong(BlockPos pos) {
method posFromLong (line 34) | public static BlockPos posFromLong(long serialized) {
method includeStateId (line 41) | public static long includeStateId(long serialized, int id) {
method readStateId (line 45) | public static int readStateId(long serialized) {
method readSerializedPos (line 49) | public static long readSerializedPos(long serialized) {
method floorMultiple (line 53) | public static int floorMultiple(int i, int factor) {
method ceilMultiple (line 57) | public static int ceilMultiple(int i, int factor) {
method isEven (line 61) | public static boolean isEven(int i) {
method isOdd (line 65) | public static boolean isOdd(int i) {
method addForNonEven (line 69) | private static int addForNonEven(int i, int c) {
method addForNonOdd (line 73) | private static int addForNonOdd(int i, int c) {
method floorToEven (line 77) | public static int floorToEven(int i) {
method floorToOdd (line 81) | public static int floorToOdd(int i) {
method ceilToEven (line 85) | public static int ceilToEven(int i) {
method ceilToOdd (line 89) | public static int ceilToOdd(int i) {
method sineForRotation (line 93) | private static int sineForRotation(Rotation rot) {
method cosineForRotation (line 107) | private static int cosineForRotation(Rotation rot) {
method rotationMatrixFor (line 111) | public static int[][] rotationMatrixFor(Axis axis, Rotation rotation) {
method matrixMul (line 142) | public static BlockPos matrixMul(int[][] matrix, BlockPos pos) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/tools/NetworkIO.java
class NetworkIO (line 16) | @Tainted(reason = "Not being used")
method NetworkIO (line 20) | protected NetworkIO(Collection<ItemStack> stacks) {
type Operation (line 24) | public static enum Operation {
method getSlots (line 28) | @Override
method getStackInSlot (line 33) | @Override
method insertItemInternal (line 39) | @Nullable
method insertItem (line 42) | @Override
method extractItemInternal (line 48) | @Nullable
method extractItem (line 51) | @Override
method getNonNullStack (line 57) | private ItemStack getNonNullStack(@Nullable ItemStack stack) {
method getSlotLimit (line 61) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/tools/RegistryUtils.java
class RegistryUtils (line 12) | public final class RegistryUtils {
method RegistryUtils (line 13) | private RegistryUtils() {
method getId (line 16) | public static <T> int getId(IForgeRegistry<T> registry, T value) {
method getById (line 20) | public static <T> T getById(IForgeRegistry<T> registry, int id) {
method getFromString (line 24) | @Nullable
method getIdFromRegistry (line 29) | public static <T> ResourceLocation getIdFromRegistry(IForgeRegistry<T>...
method getItemId (line 33) | public static ResourceLocation getItemId(Item item) {
method getBlockId (line 37) | public static ResourceLocation getBlockId(Block item) {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/util/tools/SimulateEnergyStorage.java
class SimulateEnergyStorage (line 17) | @Tainted(reason = "So stupid. The cap supports simulating by default. Th...
method SimulateEnergyStorage (line 22) | public SimulateEnergyStorage(IEnergyStorage other) {
method receiveEnergy (line 26) | @Override
method extractEnergy (line 35) | @Override
method extractPower (line 40) | @Override
method getEnergyStored (line 49) | @Override
method getMaxEnergyStored (line 54) | @Override
method canExtract (line 59) | @Override
method canReceive (line 64) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/world/MockBuilderWorld.java
class MockBuilderWorld (line 16) | public class MockBuilderWorld implements BlockGetter {
method setWorldAndState (line 22) | public void setWorldAndState(Level rWorld, BlockState setBlock, Collec...
method getBlockEntity (line 31) | @Nullable
method getBlockState (line 37) | @Override
method getFluidState (line 42) | @Override
method getHeight (line 47) | @Override
method getMinBuildHeight (line 52) | @Override
FILE: src/main/java/com/direwolf20/buildinggadgets/common/world/MockDelegationWorld.java
class MockDelegationWorld (line 56) | @MethodsReturnNonnullByDefault
method MockDelegationWorld (line 61) | public MockDelegationWorld(LevelAccessor delegate) {
method entrySet (line 66) | public Set<Entry<BlockPos, BlockInfo>> entrySet() {
method getDelegate (line 70) | public LevelAccessor getDelegate() {
method playSound (line 74) | @Override
method addParticle (line 79) | @Override
method levelEvent (line 84) | @Override
method gameEvent (line 89) | @Override
method gameEvent (line 94) | @Override
method getEntities (line 99) | @Override
method getEntities (line 104) | @Override
method getEntitiesOfClass (line 109) | @Override
method players (line 114) | @Override
method getChunk (line 119) | @Nullable
method getHeightmapPos (line 125) | @Override
method registryAccess (line 130) | @Override
method enabledFeatures (line 135) | @Override
method removeBlock (line 140) | @Override
method isStateAtPosition (line 145) | @Override
method isFluidAtPosition (line 150) | @Override
method getMoonPhase (line 155) | @Override
method getChunk (line 164) | @Override
method nextSubTickCount (line 169) | @Override
method getBlockTicks (line 174) | @Override
method getFluidTicks (line 179) | @Override
method getLevelData (line 184) | @Override
method getCurrentDifficultyAt (line 189) | @Override
method getServer (line 194) | @Nullable
method getDifficulty (line 200) | @Override
method getChunkSource (line 208) | @Override
method getRandom (line 214) | @Override
method isEmptyBlock (line 231) | @Override
method getBiome (line 236) | @Override
method getUncachedNoiseBiome (line 241) | @Override
method getHeight (line 246) | @Override
method getSkyDarken (line 251) | @Override
method getBiomeManager (line 256) | @Override
method getWorldBorder (line 268) | @Override
method isUnobstructed (line 273) | @Override
method getDirectSignal (line 278) | @Override
method isClientSide (line 283) | @Override
method getSeaLevel (line 288) | @Override
method dimensionType (line 293) | @Override
method getBlockEntity (line 298) | @Override
method getBlockState (line 309) | @Override
method getFluidState (line 317) | @Override
method getMaxLightLevel (line 322) | @Override
method setBlock (line 327) | @Override
method setBlock (line 343) | @Override
method destroyBlock (line 358) | @Override
method destroyBlock (line 364) | @Override
method getOverriddenBlock (line 371) | @Nullable
method getOverriddenState (line 376) | @Nullable
method getOverriddenTile (line 382) | @Nullable
method clear (line 388) | public void clear() {
method removeOverride (line 392) | public boolean removeOverride(BlockPos pos) {
method createInfo (line 401) | protected BlockInfo createInfo(BlockPos pos, BlockState state) {
method getBrightness (line 405) | @Override
method getShade (line 410) | @Override
method getLightEngine (line 415) | @Override
class BlockInfo (line 420) | @Tainted(reason = "Pointless system, also, uncommented...")
method BlockInfo (line 427) | public BlockInfo(BlockPos pos, BlockState state) {
method getPos (line 432) | public BlockPos getPos() {
method setPos (line 436) | public BlockInfo setPos(BlockPos pos) {
method getState (line 441) | public BlockState getState() {
method setState (line 445) | public BlockInfo setState(BlockState state) {
method getEntity (line 454) | @Nullable
method onRemove (line 473) | public void onRemove() {
FILE: src/main/java/com/direwolf20/buildinggadgets/common/world/MockTileEntityRenderWorld.java
class MockTileEntityRenderWorld (line 17) | @Tainted(reason = "Shouldn't exist")
method getTileEntityRender (line 23) | public BlockEntityRenderer<BlockEntity> getTileEntityRender(BlockState...
method getTileEntity (line 33) | public BlockEntity getTileEntity(BlockState state) {
method getBlockEntity (line 46) | @Nullable
method getBlockState (line 52) | @Override
method getFluidState (line 57) | @Override
method getHeight (line 62) | @Override
method getMinBuildHeight (line 67) | @Override
Condensed preview — 328 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,124K chars).
[
{
"path": ".github/ISSUE_TEMPLATE/bug-report.yml",
"chars": 3225,
"preview": "name: Bug Report\ndescription: Report a bug / crash\nlabels: [bug]\nbody:\n - type: markdown\n attributes:\n value: |"
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request.md",
"chars": 445,
"preview": "---\nname: Feature Request\nabout: Suggest an idea/feature/enhancement\ntitle: ''\nlabels: ''\nassignees: ''\n\n---\n\n**IMPORTAN"
},
{
"path": ".github/workflows/gradle.yml",
"chars": 1439,
"preview": "name: Build & Create artifact\n\non:\n push:\n branches: [ master ]\n pull_request:\n branches: [ master ]\n\njobs:\n bu"
},
{
"path": ".github/workflows/release.yml",
"chars": 1278,
"preview": "name: Auto Release\n\non:\n push:\n tags:\n - 'release/*'\n\njobs:\n build:\n runs-on: ubuntu-latest\n steps:\n "
},
{
"path": ".github/workflows/stale.yml",
"chars": 792,
"preview": "name: 'Close stale issues and PRs'\non:\n schedule:\n - cron: '30 1 * * *'\n\npermissions:\n issues: write\n pull-request"
},
{
"path": ".gitignore",
"chars": 286,
"preview": "/*\n\n# folders\n!/gradle\n!/src\n\n# files\n!/.gitignore\n!/.github\n!/README.md\n!/CONTRIBUTION.md\n!/License.md\n!/build.gradle\n!"
},
{
"path": "README.md",
"chars": 4513,
"preview": "## Important notice\n\nAs of Minecraft `1.20.1` this version of Building Gadget (Building Gadgets 1) is officially the 'Le"
},
{
"path": "build.gradle",
"chars": 5076,
"preview": "plugins {\n id 'eclipse'\n id 'maven-publish'\n id 'net.minecraftforge.gradle' version '5.1.+'\n id \"com.matthew"
},
{
"path": "gradle/wrapper/gradle-wrapper.properties",
"chars": 200,
"preview": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributi"
},
{
"path": "gradle.properties",
"chars": 134,
"preview": "org.gradle.jvmargs=-Xmx2G\norg.gradle.daemon=false\nminecraft_version=1.19.4\nforge_version=45.2.15\nversion=3.18.0\njei_vers"
},
{
"path": "gradlew",
"chars": 5774,
"preview": "#!/usr/bin/env sh\n\n#\n# Copyright 2015 the original author or authors.\n#\n# Licensed under the Apache License, Version 2.0"
},
{
"path": "gradlew.bat",
"chars": 2674,
"preview": "@rem\n@rem Copyright 2015 the original author or authors.\n@rem\n@rem Licensed under the Apache License, Version 2.0 (the \""
},
{
"path": "settings.gradle",
"chars": 135,
"preview": "pluginManagement {\n repositories {\n gradlePluginPortal()\n maven { url = 'https://maven.minecraftforge.n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/BuildingGadgetsJEI.java",
"chars": 2537,
"preview": "package com.direwolf20.buildinggadgets.client;\n\nimport com.direwolf20.buildinggadgets.client.screen.TemplateManagerGUI;\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/ClientProxy.java",
"chars": 10939,
"preview": "package com.direwolf20.buildinggadgets.client;\n\nimport com.direwolf20.buildinggadgets.client.cache.CacheTemplateProvider"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/KeyBindings.java",
"chars": 3414,
"preview": "package com.direwolf20.buildinggadgets.client;\n\nimport com.direwolf20.buildinggadgets.common.items.AbstractGadget;\nimpor"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/OurSounds.java",
"chars": 876,
"preview": "package com.direwolf20.buildinggadgets.client;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.Reference;\nimport "
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/cache/CacheTemplateProvider.java",
"chars": 4536,
"preview": "package com.direwolf20.buildinggadgets.client.cache;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadgets;\nimpo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/cache/RemoteInventoryCache.java",
"chars": 2391,
"preview": "package com.direwolf20.buildinggadgets.client.cache;\n\nimport com.direwolf20.buildinggadgets.common.network.PacketHandler"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/events/EventKeyInput.java",
"chars": 2618,
"preview": "package com.direwolf20.buildinggadgets.client.events;\n\nimport com.direwolf20.buildinggadgets.client.KeyBindings;\nimport "
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/events/EventRenderWorldLast.java",
"chars": 1155,
"preview": "package com.direwolf20.buildinggadgets.client.events;\n\nimport com.direwolf20.buildinggadgets.common.items.AbstractGadget"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/events/EventTooltip.java",
"chars": 8849,
"preview": "package com.direwolf20.buildinggadgets.client.events;\n\nimport com.direwolf20.buildinggadgets.client.cache.RemoteInventor"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/models/ConstructionBakedModel.java",
"chars": 3202,
"preview": "package com.direwolf20.buildinggadgets.client.models;\n\nimport com.direwolf20.buildinggadgets.common.blocks.OurBlocks;\nim"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renderer/DireBufferBuilder.java",
"chars": 14862,
"preview": "package com.direwolf20.buildinggadgets.client.renderer;\n\nimport com.google.common.collect.ImmutableList;\nimport com.goog"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renderer/DireVertexBuffer.java",
"chars": 2554,
"preview": "package com.direwolf20.buildinggadgets.client.renderer;\n\nimport com.mojang.blaze3d.systems.RenderSystem;\nimport com.moja"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renderer/EffectBlockTER.java",
"chars": 6899,
"preview": "package com.direwolf20.buildinggadgets.client.renderer;\n\nimport com.direwolf20.buildinggadgets.common.blocks.EffectBlock"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renderer/MyRenderMethods.java",
"chars": 1030,
"preview": "package com.direwolf20.buildinggadgets.client.renderer;\n\nimport com.mojang.blaze3d.vertex.PoseStack;\nimport com.mojang.b"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renderer/OurRenderTypes.java",
"chars": 9880,
"preview": "package com.direwolf20.buildinggadgets.client.renderer;\n\n\nimport com.mojang.blaze3d.vertex.DefaultVertexFormat;\nimport c"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renderer/package-info.java",
"chars": 226,
"preview": "@ParametersAreNonnullByDefault\n@MethodsReturnNonnullByDefault\npackage com.direwolf20.buildinggadgets.client.renderer;\n\ni"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renders/BaseRenderer.java",
"chars": 8572,
"preview": "package com.direwolf20.buildinggadgets.client.renders;\n\nimport com.direwolf20.buildinggadgets.client.cache.RemoteInvento"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renders/BuildRender.java",
"chars": 8833,
"preview": "package com.direwolf20.buildinggadgets.client.renders;\n\nimport com.direwolf20.buildinggadgets.client.renderer.OurRenderT"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renders/CopyPasteRender.java",
"chars": 21042,
"preview": "package com.direwolf20.buildinggadgets.client.renders;\n\nimport com.direwolf20.buildinggadgets.client.renderer.DireBuffer"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/renders/DestructionRender.java",
"chars": 2618,
"preview": "package com.direwolf20.buildinggadgets.client.renders;\n\nimport com.direwolf20.buildinggadgets.client.renderer.OurRenderT"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/CopyGUI.java",
"chars": 7901,
"preview": "package com.direwolf20.buildinggadgets.client.screen;\n\nimport com.direwolf20.buildinggadgets.client.screen.widgets.GuiIn"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/DestructionGUI.java",
"chars": 5905,
"preview": "package com.direwolf20.buildinggadgets.client.screen;\n\nimport com.direwolf20.buildinggadgets.client.screen.widgets.Incre"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/GuiMod.java",
"chars": 1825,
"preview": "package com.direwolf20.buildinggadgets.client.screen;\n\nimport com.direwolf20.buildinggadgets.common.items.GadgetCopyPast"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/MaterialListGUI.java",
"chars": 12006,
"preview": "package com.direwolf20.buildinggadgets.client.screen;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadgets;\nimp"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/ModeRadialMenu.java",
"chars": 24380,
"preview": "/**\n * This class was adapted from code written by Vazkii for the PSI mod: https://github.com/Vazkii/Psi\n * Psi is Open "
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/PasteGUI.java",
"chars": 4208,
"preview": "/**\n * Parts of this class were adapted from code written by TTerrag for the Chisel mod: https://github.com/Chisel-Team/"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/ScrollingMaterialList.java",
"chars": 10621,
"preview": "package com.direwolf20.buildinggadgets.client.screen;\n\nimport com.direwolf20.buildinggadgets.client.screen.widgets.Entry"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/TemplateManagerGUI.java",
"chars": 32032,
"preview": "/**\n * Parts of this class were adapted from code written by TTerrag for the Chisel mod: https://github.com/Chisel-Team/"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/DireButton.java",
"chars": 2410,
"preview": "package com.direwolf20.buildinggadgets.client.screen.widgets;\n\nimport com.mojang.blaze3d.platform.GlStateManager;\nimport"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/EntryList.java",
"chars": 5213,
"preview": "package com.direwolf20.buildinggadgets.client.screen.widgets;\n\nimport com.mojang.blaze3d.systems.RenderSystem;\nimport co"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/GuiIconActionable.java",
"chars": 4833,
"preview": "package com.direwolf20.buildinggadgets.client.screen.widgets;\n\nimport com.direwolf20.buildinggadgets.client.OurSounds;\ni"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/GuiIncrementer.java",
"chars": 4207,
"preview": "package com.direwolf20.buildinggadgets.client.screen.widgets;\n\nimport com.mojang.blaze3d.vertex.PoseStack;\nimport net.mi"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/GuiTextFieldBase.java",
"chars": 1971,
"preview": "package com.direwolf20.buildinggadgets.client.screen.widgets;\n\nimport net.minecraft.client.gui.Font;\nimport net.minecraf"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/client/screen/widgets/IncrementalSliderWidget.java",
"chars": 5374,
"preview": "package com.direwolf20.buildinggadgets.client.screen.widgets;\n\nimport com.direwolf20.buildinggadgets.client.OurSounds;\ni"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/BuildingGadgets.java",
"chars": 8209,
"preview": "package com.direwolf20.buildinggadgets.common;\n\nimport com.direwolf20.buildinggadgets.client.ClientProxy;\nimport com.dir"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/blocks/ConstructionBlock.java",
"chars": 12002,
"preview": "package com.direwolf20.buildinggadgets.common.blocks;\n\nimport com.direwolf20.buildinggadgets.common.tileentities.Constru"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/blocks/ConstructionBlockDense.java",
"chars": 321,
"preview": "package com.direwolf20.buildinggadgets.common.blocks;\n\nimport net.minecraft.world.level.block.Block;\nimport net.minecraf"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/blocks/ConstructionBlockPowder.java",
"chars": 2978,
"preview": "package com.direwolf20.buildinggadgets.common.blocks;\n\nimport com.direwolf20.buildinggadgets.common.entities.Constructio"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/blocks/EffectBlock.java",
"chars": 9429,
"preview": "package com.direwolf20.buildinggadgets.common.blocks;\n\nimport com.direwolf20.buildinggadgets.common.entities.Constructio"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/blocks/OurBlocks.java",
"chars": 1182,
"preview": "package com.direwolf20.buildinggadgets.common.blocks;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.Reference;\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/blocks/TemplateManager.java",
"chars": 3912,
"preview": "package com.direwolf20.buildinggadgets.common.blocks;\n\nimport com.direwolf20.buildinggadgets.common.capability.Capabilit"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/CapabilityProviderEnergy.java",
"chars": 1133,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport net.minecraft.core.Direction;\nimport net.minecraft.wor"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/CapabilityTemplate.java",
"chars": 699,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport com.direwolf20.buildinggadgets.common.tainted.template"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/ConfigEnergyStorage.java",
"chars": 3409,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport com.direwolf20.buildinggadgets.common.tainted.Tainted;"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/IPrivateEnergy.java",
"chars": 377,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport net.minecraftforge.energy.IEnergyStorage;\n\npublic inte"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/ItemEnergyForge.java",
"chars": 1475,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.NBTKeys"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/ItemTemplateKey.java",
"chars": 902,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport com.direwolf20.buildinggadgets.common.tainted.template"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/PasteContainerCapabilityProvider.java",
"chars": 1030,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport net.minecraft.core.Direction;\nimport net.minecraft.wor"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/PasteContainerItemHandler.java",
"chars": 2994,
"preview": "package com.direwolf20.buildinggadgets.common.capability;\n\nimport com.direwolf20.buildinggadgets.common.items.Constructi"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/provider/MultiCapabilityProvider.java",
"chars": 1577,
"preview": "package com.direwolf20.buildinggadgets.common.capability.provider;\n\nimport com.direwolf20.buildinggadgets.common.tainted"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/provider/TemplateKeyProvider.java",
"chars": 1178,
"preview": "package com.direwolf20.buildinggadgets.common.capability.provider;\n\nimport com.direwolf20.buildinggadgets.common.capabil"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/capability/provider/TemplateProviderCapabilityProvider.java",
"chars": 1058,
"preview": "package com.direwolf20.buildinggadgets.common.capability.provider;\n\nimport com.direwolf20.buildinggadgets.common.capabil"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/commands/AllowPlayerOverrideManager.java",
"chars": 3644,
"preview": "package com.direwolf20.buildinggadgets.common.commands;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadgets;\ni"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/commands/ForceUnloadedCommand.java",
"chars": 2326,
"preview": "package com.direwolf20.buildinggadgets.common.commands;\n\nimport com.direwolf20.buildinggadgets.common.util.lang.CommandT"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/commands/OverrideBuildSizeCommand.java",
"chars": 2326,
"preview": "package com.direwolf20.buildinggadgets.common.commands;\n\nimport com.direwolf20.buildinggadgets.common.util.lang.CommandT"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/commands/OverrideCopySizeCommand.java",
"chars": 2316,
"preview": "package com.direwolf20.buildinggadgets.common.commands;\n\nimport com.direwolf20.buildinggadgets.common.util.lang.CommandT"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/config/Config.java",
"chars": 9659,
"preview": "package com.direwolf20.buildinggadgets.common.config;\n\nimport net.minecraftforge.common.ForgeConfigSpec;\nimport net.mine"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/config/RecipeConstructionPaste.java",
"chars": 2583,
"preview": "package com.direwolf20.buildinggadgets.common.config;\n\nimport com.direwolf20.buildinggadgets.common.items.ConstructionPa"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/containers/BaseContainer.java",
"chars": 1229,
"preview": "package com.direwolf20.buildinggadgets.common.containers;\n\nimport net.minecraft.world.entity.player.Inventory;\nimport ne"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/containers/OurContainers.java",
"chars": 796,
"preview": "package com.direwolf20.buildinggadgets.common.containers;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.Referen"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/containers/TemplateManagerContainer.java",
"chars": 3986,
"preview": "package com.direwolf20.buildinggadgets.common.containers;\n\nimport com.direwolf20.buildinggadgets.common.tileentities.Tem"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/entities/ConstructionBlockEntity.java",
"chars": 5507,
"preview": "package com.direwolf20.buildinggadgets.common.entities;\n\nimport com.direwolf20.buildinggadgets.common.blocks.Constructio"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/entities/ConstructionBlockEntityRender.java",
"chars": 3362,
"preview": "package com.direwolf20.buildinggadgets.common.entities;\n\nimport com.direwolf20.buildinggadgets.client.renderer.OurRender"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/entities/EntityBase.java",
"chars": 1769,
"preview": "package com.direwolf20.buildinggadgets.common.entities;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.NBTKeys;\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/entities/OurEntities.java",
"chars": 1589,
"preview": "package com.direwolf20.buildinggadgets.common.entities;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.Reference"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/events/BreakEventHandler.java",
"chars": 1068,
"preview": "package com.direwolf20.buildinggadgets.common.events;\n\nimport net.minecraftforge.event.level.BlockEvent;\nimport net.mine"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/events/ItemPickupHandler.java",
"chars": 940,
"preview": "package com.direwolf20.buildinggadgets.common.events;\n\nimport com.direwolf20.buildinggadgets.common.tainted.inventory.In"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/events/WorldTemplateProviderHandler.java",
"chars": 1356,
"preview": "package com.direwolf20.buildinggadgets.common.events;\n\nimport com.direwolf20.buildinggadgets.client.ClientProxy;\nimport "
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/integration/IntegrationHandler.java",
"chars": 1322,
"preview": "//package com.direwolf20.buildinggadgets.common.integration;\n//\n//import java.lang.annotation.Retention;\n//import java.l"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/integration/RefinedStorage.java",
"chars": 1341,
"preview": "//package com.direwolf20.buildinggadgets.common.integration;\n//\n//import com.direwolf20.buildinggadgets.common.integrati"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/AbstractGadget.java",
"chars": 14830,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\n\nimport com.direwolf20.buildinggadgets.client.renders.BaseRenderer"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/ConstructionPaste.java",
"chars": 917,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.common.tainted.inventory.Inv"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/ConstructionPasteContainer.java",
"chars": 5088,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadgets;\nimpo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetBuilding.java",
"chars": 13323,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.client.renders.BaseRenderer;"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetCopyPaste.java",
"chars": 23776,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.client.events.EventTooltip;\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetDestruction.java",
"chars": 13019,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.client.renders.BaseRenderer;"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/GadgetExchanger.java",
"chars": 15133,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.client.renders.BaseRenderer;"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/OurItems.java",
"chars": 3589,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.common.blocks.OurBlocks;\nimp"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/TemplateItem.java",
"chars": 2428,
"preview": "package com.direwolf20.buildinggadgets.common.items;\n\nimport com.direwolf20.buildinggadgets.client.screen.GuiMod;\nimport"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/AbstractMode.java",
"chars": 8168,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport com.direwolf20.buildinggadgets.common.blocks.OurBlock"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/BuildToMeMode.java",
"chars": 1075,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport com.direwolf20.buildinggadgets.common.config.Config;\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/BuildingModes.java",
"chars": 1268,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport java.util.Arrays;\n\npublic enum BuildingModes {\n BU"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/ExchangingModes.java",
"chars": 1052,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport java.util.Arrays;\n\npublic enum ExchangingModes {\n "
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/GridMode.java",
"chars": 989,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.world.entity.player.Player;\nimport net."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/HorizontalColumnMode.java",
"chars": 1144,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.world.entity.player.Player;\nimport net."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/HorizontalWallMode.java",
"chars": 1547,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.world.entity.player.Player;\nimport net."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/StairMode.java",
"chars": 3545,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.world.entity.player.Player;\nimport net."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/SurfaceMode.java",
"chars": 2203,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport com.direwolf20.buildinggadgets.common.tainted.buildin"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/VerticalColumnMode.java",
"chars": 1912,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.world.entity.player.Player;\nimport net."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/VerticalWallMode.java",
"chars": 1876,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.core.BlockPos;\nimport net.minecraft.cor"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/items/modes/XYZ.java",
"chars": 2340,
"preview": "package com.direwolf20.buildinggadgets.common.items.modes;\n\nimport net.minecraft.core.Direction;\nimport net.minecraft.co"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/PacketHandler.java",
"chars": 5269,
"preview": "package com.direwolf20.buildinggadgets.common.network;\n\nimport com.direwolf20.buildinggadgets.common.network.packets.*;\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketAnchor.java",
"chars": 1544,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketBindTool.java",
"chars": 1280,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketChangeRange.java",
"chars": 2023,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketCopyCoords.java",
"chars": 2631,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Gadge"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketDestructionGUI.java",
"chars": 1979,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Gadge"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketPasteGUI.java",
"chars": 1327,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Gadge"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketRequestTemplate.java",
"chars": 1202,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.client.ClientProxy"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketRotateMirror.java",
"chars": 1956,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketSetRemoteInventoryCache.java",
"chars": 5303,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.client.events.Even"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketTemplateManagerTemplateCreated.java",
"chars": 3130,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGad"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleBlockPlacement.java",
"chars": 1265,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleConnectedArea.java",
"chars": 1496,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleFluidOnly.java",
"chars": 1259,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleFuzzy.java",
"chars": 1593,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.config.Conf"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleMode.java",
"chars": 2167,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketToggleRayTraceFluid.java",
"chars": 1172,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/PacketUndo.java",
"chars": 1154,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.common.items.Abstr"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/SplitPacketUpdateTemplate.java",
"chars": 2462,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport com.direwolf20.buildinggadgets.client.ClientProxy"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/packets/UUIDPacket.java",
"chars": 478,
"preview": "package com.direwolf20.buildinggadgets.common.network.packets;\n\nimport net.minecraft.network.FriendlyByteBuf;\n\nimport ja"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/split/PacketDecoder.java",
"chars": 3094,
"preview": "package com.direwolf20.buildinggadgets.common.network.split;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadge"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/split/PacketEncoder.java",
"chars": 2548,
"preview": "package com.direwolf20.buildinggadgets.common.network.split;\n\nimport com.google.common.collect.AbstractIterator;\nimport "
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/split/PacketSplitManager.java",
"chars": 4041,
"preview": "package com.direwolf20.buildinggadgets.common.network.split;\n\nimport com.direwolf20.buildinggadgets.common.network.Packe"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/network/split/SplitPacket.java",
"chars": 1597,
"preview": "package com.direwolf20.buildinggadgets.common.network.split;\n\nimport io.netty.buffer.Unpooled;\nimport net.minecraft.netw"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/Tainted.java",
"chars": 579,
"preview": "package com.direwolf20.buildinggadgets.common.tainted;\n\nimport java.lang.annotation.Retention;\nimport java.lang.annotati"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/BlockData.java",
"chars": 9946,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGa"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/PlacementChecker.java",
"chars": 6483,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building;\n\nimport com.direwolf20.buildinggadgets.common.capability"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/PlacementTarget.java",
"chars": 5283,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building;\n\nimport com.direwolf20.buildinggadgets.common.tainted.bu"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/Region.java",
"chars": 18383,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building;\n\nimport com.direwolf20.buildinggadgets.common.util.ref.N"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/package-info.java",
"chars": 234,
"preview": "@ParametersAreNonnullByDefault\n@MethodsReturnNonnullByDefault\npackage com.direwolf20.buildinggadgets.common.tainted.buil"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/placement/ConnectedSurface.java",
"chars": 6439,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.placement;\n\nimport com.direwolf20.buildinggadgets.common."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileDataFactory.java",
"chars": 1648,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.tilesupport;\n\nimport com.direwolf20.buildinggadgets.commo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileDataProvider.java",
"chars": 659,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.tilesupport;\n\n/**\n * Represents an {@link java.util.funct"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileDataSerializer.java",
"chars": 2684,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.tilesupport;\n\nimport net.minecraft.nbt.CompoundTag;\n\n/**\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/ITileEntityData.java",
"chars": 3443,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.tilesupport;\n\nimport com.direwolf20.buildinggadgets.commo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/NBTTileEntityData.java",
"chars": 3537,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.tilesupport;\n\nimport com.direwolf20.buildinggadgets.commo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/TileSupport.java",
"chars": 3707,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.tilesupport;\n\nimport com.direwolf20.buildinggadgets.commo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/tilesupport/package-info.java",
"chars": 806,
"preview": "/**\n * Provides classes for handling {@link net.minecraft.tileentity.TileEntity TileEntities} by associating an {@link n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/BuildContext.java",
"chars": 4706,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.view;\n\nimport net.minecraft.world.entity.player.Player;\ni"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/IBuildView.java",
"chars": 6072,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.view;\n\nimport com.direwolf20.buildinggadgets.common.taint"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/PositionalBuildView.java",
"chars": 3023,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.view;\n\nimport com.direwolf20.buildinggadgets.common.taint"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/WorldBuildView.java",
"chars": 5242,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.building.view;\n\nimport com.direwolf20.buildinggadgets.common.taint"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/building/view/package-info.java",
"chars": 239,
"preview": "@ParametersAreNonnullByDefault\n@MethodsReturnNonnullByDefault\npackage com.direwolf20.buildinggadgets.common.tainted.buil"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/CopyScheduler.java",
"chars": 2576,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.concurrent;\n\nimport com.direwolf20.buildinggadgets.common.items.Ga"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/PlacementScheduler.java",
"chars": 3948,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.concurrent;\n\nimport com.direwolf20.buildinggadgets.common.blocks.E"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/ServerTickingScheduler.java",
"chars": 1552,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.concurrent;\n\nimport net.minecraftforge.common.MinecraftForge;\nimpo"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/SteppedScheduler.java",
"chars": 979,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.concurrent;\n\nimport java.util.function.BooleanSupplier;\n\npublic ab"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/concurrent/UndoScheduler.java",
"chars": 4119,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.concurrent;\n\nimport com.direwolf20.buildinggadgets.common.blocks.E"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/CreativeItemIndex.java",
"chars": 1153,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.tainted.i"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/HandlerInsertProvider.java",
"chars": 863,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport net.minecraft.world.item.ItemStack;\nimport net."
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/IInsertProvider.java",
"chars": 386,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport net.minecraft.world.item.ItemStack;\n\n/**\n * Rep"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/IItemIndex.java",
"chars": 1469,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.tainted.i"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/InventoryHelper.java",
"chars": 13387,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.blocks.Ou"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/InventoryLinker.java",
"chars": 5694,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.util.lang"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/MatchResult.java",
"chars": 2518,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.tainted.i"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/PlayerInventoryInsertProvider.java",
"chars": 1440,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport net.minecraft.world.entity.item.ItemEntity;\nimp"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/PlayerItemIndex.java",
"chars": 9910,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.tainted.i"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/RecordingItemIndex.java",
"chars": 2409,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory;\n\nimport com.direwolf20.buildinggadgets.common.tainted.i"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/IHandleProvider.java",
"chars": 752,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.handle;\n\nimport net.minecraftforge.common.capabilities.I"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/IObjectHandle.java",
"chars": 430,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.handle;\n\nimport com.direwolf20.buildinggadgets.common.ta"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/ItemHandlerProvider.java",
"chars": 2632,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.handle;\n\nimport com.direwolf20.buildinggadgets.common.ta"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/handle/StackHandlerItemHandle.java",
"chars": 2372,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.handle;\n\nimport com.direwolf20.buildinggadgets.common.ta"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/AndMaterialListEntry.java",
"chars": 5839,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials;\n\nimport com.direwolf20.buildinggadgets.common"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/MaterialList.java",
"chars": 10764,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials;\n\nimport com.direwolf20.buildinggadgets.common"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/MaterialListEntry.java",
"chars": 1274,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials;\n\nimport com.direwolf20.buildinggadgets.common"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/OrMaterialListEntry.java",
"chars": 4261,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials;\n\nimport com.direwolf20.buildinggadgets.common"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/SimpleMaterialListEntry.java",
"chars": 7063,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials;\n\nimport com.direwolf20.buildinggadgets.common"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/SubMaterialListEntry.java",
"chars": 9506,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials;\n\nimport com.direwolf20.buildinggadgets.common"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/objects/IUniqueObject.java",
"chars": 1938,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects;\n\nimport com.direwolf20.buildinggadget"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/objects/IUniqueObjectSerializer.java",
"chars": 524,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects;\n\nimport com.google.gson.JsonDeseriali"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/objects/UniqueItem.java",
"chars": 12757,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.inventory.materials.objects;\n\nimport com.direwolf20.buildinggadget"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/inventory/materials/package-info.java",
"chars": 245,
"preview": "@ParametersAreNonnullByDefault\n@MethodsReturnNonnullByDefault\npackage com.direwolf20.buildinggadgets.common.tainted.inve"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/package-info.java",
"chars": 161,
"preview": "@Tainted(reason = \"Entire packaged contains a vast majority of tainted code due to half finished systems\")\npackage com.d"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/ImmutableOrderedRegistry.java",
"chars": 1566,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.registry;\n\nimport com.google.common.collect.ImmutableBiMap;\nimport"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/Registries.java",
"chars": 8312,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.registry;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGa"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/TopologicalRegistryBuilder.java",
"chars": 6504,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.registry;\n\nimport com.google.common.base.MoreObjects;\nimport com.g"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/registry/package-info.java",
"chars": 234,
"preview": "@ParametersAreNonnullByDefault\n@MethodsReturnNonnullByDefault\npackage com.direwolf20.buildinggadgets.common.tainted.regi"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/SaveManager.java",
"chars": 3494,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadget"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/SaveTemplateProvider.java",
"chars": 3990,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadget"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/TemplateSave.java",
"chars": 2665,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.tainted.save.T"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/TimedDataSave.java",
"chars": 3771,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.tainted.save.T"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/Undo.java",
"chars": 13003,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.BuildingGadget"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/UndoHistory.java",
"chars": 1915,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.util.helpers.N"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/save/UndoWorldSave.java",
"chars": 2568,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.save;\n\nimport com.direwolf20.buildinggadgets.common.tainted.save.U"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/ITemplateKey.java",
"chars": 215,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport java.util.UUID;\nimport java.util.function.Suppli"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/ITemplateProvider.java",
"chars": 3169,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport com.direwolf20.buildinggadgets.common.capability"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/InMemoryTemplateProvider.java",
"chars": 1667,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\n\nimport net.minecraftforge.network.PacketDistributor;\n\n"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/SerialisationSupport.java",
"chars": 3151,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport com.direwolf20.buildinggadgets.common.tainted.bu"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/Template.java",
"chars": 9471,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport com.direwolf20.buildinggadgets.common.tainted.bu"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/TemplateHeader.java",
"chars": 13300,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport com.direwolf20.buildinggadgets.common.tainted.bu"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/TemplateIO.java",
"chars": 6403,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport com.direwolf20.buildinggadgets.common.tainted.bu"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/TemplateKey.java",
"chars": 925,
"preview": "package com.direwolf20.buildinggadgets.common.tainted.template;\n\nimport javax.annotation.Nullable;\nimport java.util.UUID"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tainted/template/package-info.java",
"chars": 918,
"preview": "/**\n * Contains the core template api with the {@link com.direwolf20.buildinggadgets.api.template.Template} class.\n * <p"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tileentities/ConstructionBlockTileEntity.java",
"chars": 3549,
"preview": "package com.direwolf20.buildinggadgets.common.tileentities;\n\nimport com.direwolf20.buildinggadgets.common.tainted.buildi"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tileentities/EffectBlockTileEntity.java",
"chars": 5689,
"preview": "package com.direwolf20.buildinggadgets.common.tileentities;\n\nimport com.direwolf20.buildinggadgets.common.blocks.EffectB"
},
{
"path": "src/main/java/com/direwolf20/buildinggadgets/common/tileentities/OurTileEntities.java",
"chars": 1460,
"preview": "package com.direwolf20.buildinggadgets.common.tileentities;\n\nimport com.direwolf20.buildinggadgets.common.blocks.OurBloc"
}
]
// ... and 128 more files (download for full content)
About this extraction
This page contains the full source code of the Direwolf20-MC/BuildingGadgets GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 328 files (1019.6 KB), approximately 250.3k tokens, and a symbol index with 2142 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.