Skip to content

Commit

Permalink
Merge pull request #15 from LordDeatHunter/master
Browse files Browse the repository at this point in the history
Added anvils
  • Loading branch information
Noaaan authored Dec 30, 2020
2 parents b8db136 + 00ab67c commit 1fb69dd
Show file tree
Hide file tree
Showing 196 changed files with 1,303 additions and 94 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ repositories {
url = "https://jitpack.io"
name = "Jitpack"
}
maven {
url = "https://www.cursemaven.com"
}
}

dependencies {
Expand All @@ -35,8 +38,8 @@ dependencies {
modApi("me.sargunvohra.mcmods:autoconfig1u:${project.autoconfig_version}") {
exclude(group: "net.fabricmc.fabric-api")
}
modApi "com.github.Shnupbups:Piglib:1.0.2"
include "com.github.Shnupbups:Piglib:1.0.2"
modApi "curse.maven:piglib-410302:3137353"
include "curse.maven:piglib-410302:3137353"

processResources {
inputs.property "version", project.version
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,16 @@
import net.fabricmc.fabric.api.object.builder.v1.block.FabricBlockSettings;
import net.fabricmc.fabric.api.tool.attribute.v1.FabricToolTags;
import net.minecraft.block.AnvilBlock;
import net.minecraft.block.Block;
import net.minecraft.block.Material;
import net.minecraft.sound.BlockSoundGroup;

import java.util.HashSet;

public class MythicMetalsAnvils {

public static HashSet<Block> ANVILS = new HashSet<>();

public static final AnvilBase ADAMANTITE_ANVIL = new AnvilBase(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 3).requiresTool());
public static final AnvilBlock AETHERIUM_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 3).requiresTool());
public static final AnvilBlock AQUARIUM_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 1).requiresTool());
Expand Down Expand Up @@ -44,5 +50,4 @@ public class MythicMetalsAnvils {
public static final AnvilBlock TRUESILVER_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 2).requiresTool());
public static final AnvilBlock UNOBTAINIUM_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 4).requiresTool());
public static final AnvilBlock UR_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 2).requiresTool());
public static final AnvilBlock VERMICULITE_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 1).requiresTool());
public static final AnvilBlock ZINC_ANVIL = new AnvilBlock(FabricBlockSettings.of(Material.REPAIR_STATION).strength(5.0F, 15000.0F).sounds(BlockSoundGroup.ANVIL).breakByTool(FabricToolTags.PICKAXES, 1).requiresTool());}
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package nourl.mythicmetals.mixin;

import net.minecraft.block.BlockState;
import net.minecraft.screen.AnvilScreenHandler;
import nourl.mythicmetals.blocks.MythicMetalsAnvils;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.injection.At;
import org.spongepowered.asm.mixin.injection.Inject;
import org.spongepowered.asm.mixin.injection.callback.CallbackInfoReturnable;

@Mixin(AnvilScreenHandler.class)
public class AnvilScreenHandlerMixin {

@Inject(method = "canUse", at = @At("HEAD"), cancellable = true)
public void canUse(BlockState state, CallbackInfoReturnable<Boolean> cir) {
if (MythicMetalsAnvils.ANVILS.contains(state.getBlock())) {
cir.setReturnValue(true);
cir.cancel();
}
}

}
193 changes: 116 additions & 77 deletions src/main/java/nourl/mythicmetals/registry/RegisterBlocks.java

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/aetherium_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/aetherium_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/aetherium_anvil"
},
"facing=west": {
"model": "mythicmetals:block/aetherium_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/aquarium_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/aquarium_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/aquarium_anvil"
},
"facing=west": {
"model": "mythicmetals:block/aquarium_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/argonium_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/argonium_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/argonium_anvil"
},
"facing=west": {
"model": "mythicmetals:block/argonium_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/banglum_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/banglum_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/banglum_anvil"
},
"facing=west": {
"model": "mythicmetals:block/banglum_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/brass_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/brass_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/brass_anvil"
},
"facing=west": {
"model": "mythicmetals:block/brass_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/bronze_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/bronze_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/bronze_anvil"
},
"facing=west": {
"model": "mythicmetals:block/bronze_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/carmot_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/carmot_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/carmot_anvil"
},
"facing=west": {
"model": "mythicmetals:block/carmot_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/celestium_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/celestium_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/celestium_anvil"
},
"facing=west": {
"model": "mythicmetals:block/celestium_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/copper_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/copper_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/copper_anvil"
},
"facing=west": {
"model": "mythicmetals:block/copper_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/discordium_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/discordium_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/discordium_anvil"
},
"facing=west": {
"model": "mythicmetals:block/discordium_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/durasteel_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/durasteel_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/durasteel_anvil"
},
"facing=west": {
"model": "mythicmetals:block/durasteel_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/electrum_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/electrum_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/electrum_anvil"
},
"facing=west": {
"model": "mythicmetals:block/electrum_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/etherite_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/etherite_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/etherite_anvil"
},
"facing=west": {
"model": "mythicmetals:block/etherite_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/kyber_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/kyber_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/kyber_anvil"
},
"facing=west": {
"model": "mythicmetals:block/kyber_anvil",
"y": 90
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"variants": {
"facing=east": {
"model": "mythicmetals:block/lutetium_anvil",
"y": 270
},
"facing=north": {
"model": "mythicmetals:block/lutetium_anvil",
"y": 180
},
"facing=south": {
"model": "mythicmetals:block/lutetium_anvil"
},
"facing=west": {
"model": "mythicmetals:block/lutetium_anvil",
"y": 90
}
}
}
Loading

0 comments on commit 1fb69dd

Please sign in to comment.