-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Changes to config (currently broken)
- Loading branch information
Showing
4 changed files
with
71 additions
and
6 deletions.
There are no files selected for viewing
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
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
63 changes: 63 additions & 0 deletions
63
src/main/java/com/github/kill05/mixins/disablevanilla/ItemToolMixin.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,63 @@ | ||
package com.github.kill05.mixins.disablevanilla; | ||
|
||
import net.minecraft.core.block.Block; | ||
import net.minecraft.core.data.tag.Tag; | ||
import net.minecraft.core.entity.Entity; | ||
import net.minecraft.core.item.Item; | ||
import net.minecraft.core.item.ItemStack; | ||
import net.minecraft.core.item.material.ToolMaterial; | ||
import net.minecraft.core.item.tool.ItemTool; | ||
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.CallbackInfo; | ||
import sunsetsatellite.catalyst.core.util.ICustomDescription; | ||
|
||
@Mixin( | ||
value = ItemTool.class, | ||
remap = false | ||
) | ||
public abstract class ItemToolMixin extends Item implements ICustomDescription { | ||
|
||
public ItemToolMixin(int id) { | ||
super(id); | ||
} | ||
|
||
@SuppressWarnings("rawtypes") | ||
@Inject( | ||
method = "<init>", | ||
at = @At(value = "TAIL") | ||
) | ||
private void getStrVsBlockInject(String name, int id, int damageDealt, ToolMaterial toolMaterial, Tag tagEffectiveAgainst, CallbackInfo ci) { | ||
setMaxDamage(1); | ||
} | ||
|
||
@Override | ||
public String getDescription(ItemStack itemStack) { | ||
return """ | ||
§eVanilla tools are disabled by Architect's Tools. | ||
§eIf you wish to enable vanilla tools, | ||
§eplease open 'architectstools.cfg', | ||
§ethen set 'DisableVanillaTools' to 'false'."""; | ||
} | ||
|
||
@Override | ||
public String getTranslatedName(ItemStack itemstack) { | ||
return super.getTranslatedName(itemstack) + " §e(DISABLED)§r"; | ||
} | ||
|
||
@Override | ||
public int getDamageVsEntity(Entity entity) { | ||
return super.getDamageVsEntity(entity); | ||
} | ||
|
||
@Override | ||
public float getStrVsBlock(ItemStack itemstack, Block block) { | ||
return super.getStrVsBlock(itemstack, block); | ||
} | ||
|
||
@Override | ||
public boolean canHarvestBlock(Block block) { | ||
return super.canHarvestBlock(block); | ||
} | ||
} |
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