This repository has been archived by the owner on Oct 4, 2024. It is now read-only.
generated from GregTech-Intergalactical/ExampleMod
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
46 changed files
with
179 additions
and
0 deletions.
There are no files selected for viewing
44 changes: 44 additions & 0 deletions
44
common/src/main/java/io/github/gregtechintergalactical/gtcore/cover/CoverSelectorTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package io.github.gregtechintergalactical.gtcore.cover; | ||
|
||
import io.github.gregtechintergalactical.gtcore.GTCore; | ||
import io.github.gregtechintergalactical.gtcore.blockentity.BlockEntityRedstoneWire; | ||
import muramasa.antimatter.capability.ICoverHandler; | ||
import muramasa.antimatter.cover.BaseCover; | ||
import muramasa.antimatter.cover.CoverFactory; | ||
import muramasa.antimatter.machine.Tier; | ||
import muramasa.antimatter.texture.Texture; | ||
import net.minecraft.core.Direction; | ||
import net.minecraft.resources.ResourceLocation; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.function.BiConsumer; | ||
|
||
public class CoverSelectorTag extends BaseCover { | ||
public CoverSelectorTag(@NotNull ICoverHandler<?> source, @Nullable Tier tier, Direction side, CoverFactory factory) { | ||
super(source, tier, side, factory); | ||
} | ||
|
||
@Override | ||
public void onPlace() { | ||
if (source().getTile() instanceof BlockEntityRedstoneWire<?> wire) { | ||
|
||
} | ||
} | ||
|
||
@Override | ||
protected String getRenderId() { | ||
return "selector_tag"; | ||
} | ||
|
||
@Override | ||
public void setTextures(BiConsumer<String, Texture> texer) { | ||
texer.accept("overlay", factory.getTextures().get(0)); | ||
texer.accept("underlay", factory.getTextures().get(1)); | ||
} | ||
|
||
@Override | ||
public ResourceLocation getModel(String type, Direction dir) { | ||
return new ResourceLocation(GTCore.ID + ":block/cover/" + this.getRenderId()); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
common/src/main/java/io/github/gregtechintergalactical/gtcore/item/ItemSelectorTag.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
package io.github.gregtechintergalactical.gtcore.item; | ||
|
||
import io.github.gregtechintergalactical.gtcore.data.GTCoreItems; | ||
import muramasa.antimatter.cover.CoverFactory; | ||
import muramasa.antimatter.cover.ICover; | ||
import muramasa.antimatter.cover.IHaveCover; | ||
import muramasa.antimatter.item.ItemBasic; | ||
import muramasa.antimatter.texture.Texture; | ||
import muramasa.antimatter.util.Utils; | ||
import net.minecraft.network.chat.Component; | ||
import net.minecraft.world.InteractionHand; | ||
import net.minecraft.world.InteractionResultHolder; | ||
import net.minecraft.world.entity.player.Player; | ||
import net.minecraft.world.item.ItemStack; | ||
import net.minecraft.world.item.TooltipFlag; | ||
import net.minecraft.world.level.Level; | ||
import org.jetbrains.annotations.Nullable; | ||
|
||
import java.util.List; | ||
|
||
public class ItemSelectorTag extends ItemBasic<ItemSelectorTag> implements IHaveCover { | ||
|
||
public final int circuitId; | ||
|
||
public ItemSelectorTag(String domain, String id, int circuitId, Properties properties) { | ||
super(domain, id, "selector_tags/", properties); | ||
this.circuitId = circuitId; | ||
} | ||
|
||
public ItemSelectorTag(String domain, String id, int circuitId) { | ||
super(domain, id, "selector_tags/"); | ||
this.circuitId = circuitId; | ||
} | ||
|
||
@Override | ||
public Texture[] getTextures() { | ||
return new Texture[]{new Texture(this.domain, "item/basic/" + this.subDir + circuitId)}; | ||
} | ||
|
||
@Override | ||
public InteractionResultHolder<ItemStack> use(Level worldIn, Player playerIn, InteractionHand handIn) { | ||
int newId = playerIn.isCrouching() ? this.getNewCircuitIdBackward() : this.getNewCircuitIdForward(); | ||
ItemStack stack = playerIn.getItemInHand(handIn); | ||
ItemStack newStack = new ItemStack(GTCoreItems.SELECTOR_TAG_ITEMS.get(newId), stack.getCount()); | ||
playerIn.setItemInHand(handIn, newStack); | ||
return InteractionResultHolder.consume(stack); | ||
} | ||
|
||
private int getNewCircuitIdForward(){ | ||
if (this.circuitId == 24){ | ||
return 0; | ||
} | ||
return this.circuitId + 1; | ||
} | ||
private int getNewCircuitIdBackward(){ | ||
if (this.circuitId == 0){ | ||
return 24; | ||
} | ||
return this.circuitId - 1; | ||
} | ||
|
||
@Override | ||
public void appendHoverText(ItemStack stack, @Nullable Level level, List<Component> tooltipComponents, TooltipFlag isAdvanced) { | ||
super.appendHoverText(stack, level, tooltipComponents, isAdvanced); | ||
tooltipComponents.add(Utils.translatable("tooltip.gtcore.selector_tag.0")); | ||
tooltipComponents.add(Utils.translatable("tooltip.gtcore.selector_tag.1")); | ||
} | ||
|
||
@Override | ||
public CoverFactory getCover() { | ||
if (circuitId > 15) return ICover.emptyFactory; | ||
return GTCoreItems.SELECTOR_TAG_COVERS.get(circuitId); | ||
} | ||
} |
29 changes: 29 additions & 0 deletions
29
common/src/main/resources/assets/gtcore/models/block/cover/selector_tag.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"credit": "Made with Blockbench", | ||
"elements": [ | ||
{ | ||
"from": [0, 0, 16], | ||
"to": [16, 16, 16], | ||
"faces": { | ||
"north": {"uv": [0, 0, 16, 16], "texture": "#base", "tintindex": 0}, | ||
"south": {"uv": [0, 0, 16, 16], "texture": "#base", "tintindex": 0} | ||
} | ||
}, | ||
{ | ||
"from": [0, 0, 16], | ||
"to": [16, 16, 16], | ||
"faces": { | ||
"north": {"uv": [0, 0, 16, 16], "texture": "#underlay"}, | ||
"south": {"uv": [0, 0, 16, 16], "texture": "#underlay"} | ||
} | ||
}, | ||
{ | ||
"from": [0, 0, 16], | ||
"to": [16, 16, 16], | ||
"faces": { | ||
"north": {"uv": [0, 0, 16, 16], "texture": "#overlay"}, | ||
"south": {"uv": [0, 0, 16, 16], "texture": "#overlay"} | ||
} | ||
} | ||
] | ||
} |
Binary file added
BIN
+168 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+166 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+181 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+176 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+178 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+176 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+177 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+170 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+167 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+163 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+166 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+166 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+164 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+165 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+162 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+167 Bytes
common/src/main/resources/assets/gtcore/textures/block/cover/selector_tag/9.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+361 Bytes
...src/main/resources/assets/gtcore/textures/block/cover/selector_tag/underlay.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+194 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/0.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+196 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+204 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+199 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+206 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+205 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+205 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+208 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+208 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/16.png
Oops, something went wrong.
Binary file added
BIN
+206 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/17.png
Oops, something went wrong.
Binary file added
BIN
+207 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/18.png
Oops, something went wrong.
Binary file added
BIN
+208 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/19.png
Oops, something went wrong.
Binary file added
BIN
+201 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/2.png
Oops, something went wrong.
Binary file added
BIN
+203 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/20.png
Oops, something went wrong.
Binary file added
BIN
+207 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/21.png
Oops, something went wrong.
Binary file added
BIN
+202 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/22.png
Oops, something went wrong.
Binary file added
BIN
+203 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/23.png
Oops, something went wrong.
Binary file added
BIN
+204 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/24.png
Oops, something went wrong.
Binary file added
BIN
+196 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/3.png
Oops, something went wrong.
Binary file added
BIN
+197 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/4.png
Oops, something went wrong.
Binary file added
BIN
+200 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/5.png
Oops, something went wrong.
Binary file added
BIN
+198 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/6.png
Oops, something went wrong.
Binary file added
BIN
+198 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/7.png
Oops, something went wrong.
Binary file added
BIN
+195 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/8.png
Oops, something went wrong.
Binary file added
BIN
+200 Bytes
common/src/main/resources/assets/gtcore/textures/item/basic/selector_tags/9.png
Oops, something went wrong.