Skip to content

Commit

Permalink
start work on display sources #70
Browse files Browse the repository at this point in the history
  • Loading branch information
IThundxr committed Jun 15, 2024
1 parent 9d85d33 commit 0f5106a
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
/*
* Numismatics
* Copyright (c) 2024 The Railways Team
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/

package dev.ithundxr.createnumismatics.content.vendor;

import com.simibubi.create.content.redstone.displayLink.DisplayLinkContext;
import com.simibubi.create.content.redstone.displayLink.source.DisplaySource;
import com.simibubi.create.content.redstone.displayLink.target.DisplayTargetStats;
import net.minecraft.network.chat.MutableComponent;

import java.util.List;

public class VendorDisplaySource extends DisplaySource {
@Override
public List<MutableComponent> provideText(DisplayLinkContext context, DisplayTargetStats stats) {
return List.of();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

import com.simibubi.create.AllBlocks;
import com.simibubi.create.AllTags;
import com.simibubi.create.content.redstone.displayLink.source.BoilerDisplaySource;
import com.simibubi.create.foundation.data.CreateRegistrate;
import com.simibubi.create.foundation.data.SharedProperties;
import com.simibubi.create.foundation.item.ItemDescription;
Expand All @@ -31,6 +32,7 @@
import dev.ithundxr.createnumismatics.content.depositor.AndesiteDepositorBlock;
import dev.ithundxr.createnumismatics.content.depositor.BrassDepositorBlock;
import dev.ithundxr.createnumismatics.content.vendor.VendorBlock;
import dev.ithundxr.createnumismatics.content.vendor.VendorDisplaySource;
import dev.ithundxr.createnumismatics.multiloader.CommonTags;
import net.minecraft.client.renderer.RenderType;
import net.minecraft.core.registries.Registries;
Expand All @@ -42,6 +44,7 @@
import net.minecraft.world.level.storage.loot.entries.LootItem;
import net.minecraft.world.level.storage.loot.providers.number.ConstantValue;

import static com.simibubi.create.content.redstone.displayLink.AllDisplayBehaviours.assignDataBehaviour;
import static com.simibubi.create.foundation.data.TagGen.axeOrPickaxe;
import static com.simibubi.create.foundation.data.TagGen.pickaxeOnly;

Expand Down Expand Up @@ -112,6 +115,7 @@ public class NumismaticsBlocks {
.properties(p -> p.strength(1.0F, 3600000.0F)) // Unexplodable
.properties(BlockBehaviour.Properties::requiresCorrectToolForDrops)
.transform(pickaxeOnly())
.onRegister(assignDataBehaviour(new VendorDisplaySource(), "vendor_price"))
.addLayer(() -> RenderType::cutout)
.lang("Vendor")
.transform(BuilderTransformers.vendor(false))
Expand All @@ -128,6 +132,7 @@ public class NumismaticsBlocks {
.properties(p -> p.strength(-1.0F, 3600000.0F)) // Unbreakable & Unexplodable
.properties(BlockBehaviour.Properties::requiresCorrectToolForDrops)
.transform(pickaxeOnly())
.onRegister(assignDataBehaviour(new VendorDisplaySource(), "vendor_price"))
.addLayer(() -> RenderType::cutout)
.lang("Creative Vendor")
.transform(BuilderTransformers.vendor(true))
Expand Down

0 comments on commit 0f5106a

Please sign in to comment.