Skip to content

Commit

Permalink
Merge pull request #93 from CafeteriaGuild/develop
Browse files Browse the repository at this point in the history
1.18.1+0.5.3-beta
  • Loading branch information
Luligabi1 authored Mar 6, 2022
2 parents 34006f5 + 655c395 commit 23f5e3f
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import net.minecraft.util.Hand
import net.minecraft.util.TypedActionResult
import net.minecraft.world.World

class ItemDataModel(val category: EntityCategory? = null) : Item(settings().maxCount(1)) {
class ItemDataModel(val category: EntityCategory? = null) : Item(settings().maxCount(1).fireproof()) {
override fun appendTooltip(
stack: ItemStack?,
world: World?,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ import net.minecraft.util.Hand
import net.minecraft.util.TypedActionResult
import net.minecraft.world.World

class ItemDeepLearner : Item(settings().maxCount(1)) {
class ItemDeepLearner : Item(settings().maxCount(1).fireproof()) {

override fun use(world: World?, player: PlayerEntity?, hand: Hand): TypedActionResult<ItemStack> {
(player as? ServerPlayerEntity)?.let {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import net.minecraft.item.Item
import net.minecraft.item.ItemStack
import net.minecraft.util.Rarity

class ItemPristineMatter(settings: Settings) : Item(settings) {
class ItemPristineMatter : Item(settings().fireproof()) {
override fun hasGlint(stack: ItemStack?) = true

override fun getRarity(stack: ItemStack?) = Rarity.UNCOMMON
Expand Down
2 changes: 1 addition & 1 deletion base/src/main/kotlin/dev/nathanpb/dml/item/ItemTrialKey.kt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import net.minecraft.text.TranslatableText
import net.minecraft.util.Formatting
import net.minecraft.world.World

class ItemTrialKey : Item(settings().maxCount(1)) {
class ItemTrialKey : Item(settings().maxCount(1).fireproof()) {
override fun appendTooltip(
stack: ItemStack?,
world: World?,
Expand Down
18 changes: 9 additions & 9 deletions base/src/main/kotlin/dev/nathanpb/dml/item/Items.kt
Original file line number Diff line number Diff line change
Expand Up @@ -53,15 +53,15 @@ val ITEM_DATA_MODEL_GHOST = ItemDataModel(EntityCategory.GHOST)
val ITEM_DATA_MODEL_ILLAGER = ItemDataModel(EntityCategory.ILLAGER)
val ITEM_DATA_MODEL_OCEAN = ItemDataModel(EntityCategory.OCEAN)

val ITEM_PRISTINE_MATTER_NETHER = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_SLIMY = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_OVERWORLD = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_ZOMBIE = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_SKELETON = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_END = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_GHOST = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_ILLAGER = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_OCEAN = ItemPristineMatter(settings())
val ITEM_PRISTINE_MATTER_NETHER = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_SLIMY = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_OVERWORLD = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_ZOMBIE = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_SKELETON = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_END = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_GHOST = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_ILLAGER = ItemPristineMatter()
val ITEM_PRISTINE_MATTER_OCEAN = ItemPristineMatter()

val ITEM_SOOT_REDSTONE = Item(settings())
val ITEM_SOOT_PLATE = Item(settings())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

@Mixin(ItemStack.class)
public class ItemStackMixin {


@Inject(at = @At("HEAD"), method = "getAttributeModifiers", cancellable = true)
void getAttributeModifiers(EquipmentSlot equipmentSlot, CallbackInfoReturnable<Multimap<EntityAttribute, EntityAttributeModifier>> cir) {
ItemStack dis = (ItemStack)(Object) this;
Expand All @@ -41,4 +43,13 @@ void getAttributeModifiers(EquipmentSlot equipmentSlot, CallbackInfoReturnable<M
cir.cancel();
}
}
}

@Inject(at = @At("HEAD"), method = "isDamageable", cancellable = true) // TODO: Change this mixin for a unbreakable tag?
public void isDamageable(CallbackInfoReturnable<Boolean> cir) {
ItemStack itemStack = ((ItemStack) (Object) this);
if(itemStack.getItem() instanceof ItemModularGlitchArmor) {
cir.setReturnValue(false);
}
}

}

0 comments on commit 23f5e3f

Please sign in to comment.