Skip to content

Commit

Permalink
Let's go
Browse files Browse the repository at this point in the history
  • Loading branch information
Leclowndu93150 committed Oct 6, 2024
1 parent 4878fc8 commit 7457bb5
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 70 deletions.
11 changes: 11 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
All Rights Reserved

Copyright (c) 2024 Leclowndu93150

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
24 changes: 0 additions & 24 deletions TEMPLATE_LICENSE.txt

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ public MorePlatesMod(IEventBus modEventBus, ModContainer modContainer) {
}

public static void onCreativeTab(BuildCreativeModeTabContentsEvent event) {
if(event.getTab() == MPCreativeTabs.MORE_PLATES_TAB.get()){
if (event.getTab() == MPCreativeTabs.MORE_PLATES_TAB.get()) {
BuiltInRegistries.ITEM.stream()
.filter(rs -> rs.getDescriptionId().contains(MorePlatesMod.MODID))
.forEach(rs -> event.accept(rs.asItem()));
.filter(item -> item.getDescriptionId().contains(MorePlatesMod.MODID) && !item.equals(MPItems.HAMMER.get()))
.forEach(item -> event.accept(item.asItem()));
event.accept(MPItems.HAMMER.get().asItem());
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,6 @@ public boolean isBarVisible(ItemStack stack) {
return stack.isDamaged();
}

@Override
public int getBarColor(ItemStack stack) {
return 0x0000FF + (0xFF0000 - 0x0000FF) * stack.getDamageValue() / stack.getMaxDamage();
}

@Override
public @NotNull ItemStack getCraftingRemainingItem(ItemStack itemStack) {
ItemStack hammer = itemStack.copy();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
import net.minecraft.core.registries.BuiltInRegistries;
import net.minecraft.core.registries.Registries;
import net.minecraft.network.chat.Component;
import net.minecraft.resources.ResourceLocation;
import net.minecraft.world.item.CreativeModeTab;
import net.minecraft.world.item.Item;
import net.minecraft.world.item.Items;
import net.neoforged.neoforge.registries.DeferredRegister;

Expand All @@ -15,7 +17,7 @@ public class MPCreativeTabs {

public static final Supplier<CreativeModeTab> MORE_PLATES_TAB = CREATIVE_MODE_TABS.register("moreplatestab", () -> CreativeModeTab.builder()
.title(Component.literal("More Plates"))
.icon(() -> MPItems.INFINITY_PLATE.get().getDefaultInstance())
.icon(() -> BuiltInRegistries.ITEM.get(ResourceLocation.parse("moreplates:gold_plate")).getDefaultInstance())
.displayItems((params, output) -> {
})
.build());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ public class MPItems {

public static final DeferredRegister.Items ITEMS = DeferredRegister.createItems(MorePlatesMod.MODID);

public static final DeferredItem<Item> INFINITY_PLATE = ITEMS.register("infinity_plate", () -> new Item(new Item.Properties()));

public static final DeferredItem<HammerItem> HAMMER = ITEMS.register("hammer", () -> new HammerItem(new Item.Properties()));

public static void registerCustomItems(List<String> customItems) {
Expand All @@ -25,19 +23,16 @@ public static void registerCustomItems(List<String> customItems) {
String namespace = parts[0];
String itemID = parts[1];

// Register Plate
String plateId = itemID + "_plate";
DeferredItem<Item> plate = ITEMS.register(plateId,
() -> new Item(new Item.Properties()));
MPConfig.saveIngotPlatePair(ResourceLocation.parse(namespace + ":" + itemID), ResourceLocation.parse(MorePlatesMod.MODID + ":" + plateId));

// Register Gear
String gearId = itemID + "_gear";
DeferredItem<Item> gear = ITEMS.register(gearId,
() -> new Item(new Item.Properties()));
MPConfig.saveIngotGearPair(ResourceLocation.parse(namespace + ":" + itemID), ResourceLocation.parse(MorePlatesMod.MODID + ":" + gearId));

// Register Rod
String rodId = itemID + "_rod";
DeferredItem<Item> rod = ITEMS.register(rodId,
() -> new Item(new Item.Properties()));
Expand Down

This file was deleted.

Binary file not shown.

This file was deleted.

0 comments on commit 7457bb5

Please sign in to comment.