mirror of
https://github.com/MinecraftForge/MinecraftForge.git
synced 2026-11-24 22:14:32 +00:00
Regenerate patches with relative headers. This should lower conflicts in future PRs.
Convert Forge to use Official mappings. Mojang released their obfuscation mappings but we have not used them up until now due to wanting to get their license to be more explicitly permissive. It is clear that their intent is to allow us to use their names for developing mods like this. See the full wording, and our interpretation here: https://github.com/MinecraftForge/MCPConfig/blob/master/Mojang.md
This commit is contained in:
1 parent
802298d99d
commit
a95b968c13
832 files changed
+4464
-4373
No files matched your search
@@ -41,13 +41,15 @@ import net.minecraftforge.registries.ForgeRegistries;
|
||||
|
||||
import javax.annotation.Nullable;
|
||||
|
||||
import net.minecraft.item.Item.Properties;
|
||||
|
||||
@Mod(CustomElytraTest.MOD_ID)
|
||||
@Mod.EventBusSubscriber(bus = Mod.EventBusSubscriber.Bus.MOD, modid = CustomElytraTest.MOD_ID)
|
||||
public class CustomElytraTest
|
||||
{
|
||||
public static final String MOD_ID = "custom_elytra_test";
|
||||
private static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MOD_ID);
|
||||
private static final RegistryObject<Item> TEST_ELYTRA = ITEMS.register("test_elytra",() -> new CustomElytra(new Item.Properties().maxDamage(100).group(ItemGroup.MISC)));
|
||||
private static final RegistryObject<Item> TEST_ELYTRA = ITEMS.register("test_elytra",() -> new CustomElytra(new Item.Properties().durability(100).tab(ItemGroup.TAB_MISC)));
|
||||
|
||||
public CustomElytraTest()
|
||||
{
|
||||
@@ -64,7 +66,7 @@ public class CustomElytraTest
|
||||
@OnlyIn(Dist.CLIENT)
|
||||
private void registerElytraLayer()
|
||||
{
|
||||
Minecraft.getInstance().getRenderManager().getSkinMap().values().forEach(player -> player.addLayer(new CustomElytraLayer(player)));
|
||||
Minecraft.getInstance().getEntityRenderDispatcher().getSkinMap().values().forEach(player -> player.addLayer(new CustomElytraLayer(player)));
|
||||
}
|
||||
|
||||
public static class CustomElytra extends Item
|
||||
@@ -73,7 +75,7 @@ public class CustomElytraTest
|
||||
public CustomElytra(Properties properties)
|
||||
{
|
||||
super(properties);
|
||||
DispenserBlock.registerDispenseBehavior(this, ArmorItem.DISPENSER_BEHAVIOR);
|
||||
DispenserBlock.registerBehavior(this, ArmorItem.DISPENSE_ITEM_BEHAVIOR);
|
||||
}
|
||||
|
||||
@Nullable
|
||||
@@ -93,9 +95,9 @@ public class CustomElytraTest
|
||||
public boolean elytraFlightTick(ItemStack stack, LivingEntity entity, int flightTicks)
|
||||
{
|
||||
//Adding 1 to ticksElytraFlying prevents damage on the very first tick.
|
||||
if (!entity.world.isRemote && (flightTicks + 1) % 20 == 0)
|
||||
if (!entity.level.isClientSide && (flightTicks + 1) % 20 == 0)
|
||||
{
|
||||
stack.damageItem(1, entity, e -> e.sendBreakAnimation(EquipmentSlotType.CHEST));
|
||||
stack.hurtAndBreak(1, entity, e -> e.broadcastBreakEvent(EquipmentSlotType.CHEST));
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,7 @@ public class EnderMaskTest
|
||||
public static final DeferredRegister<Item> ITEMS = DeferredRegister.create(ForgeRegistries.ITEMS, MODID);
|
||||
|
||||
public static RegistryObject<Item> ender_mask = ITEMS.register("ender_mask", () ->
|
||||
new ArmorItem(ArmorMaterial.LEATHER, EquipmentSlotType.HEAD, (new Item.Properties().group(ItemGroup.MISC)))
|
||||
new ArmorItem(ArmorMaterial.LEATHER, EquipmentSlotType.HEAD, (new Item.Properties().tab(ItemGroup.TAB_MISC)))
|
||||
{
|
||||
@Override
|
||||
public boolean isEnderMask(ItemStack stack, PlayerEntity player, EndermanEntity endermanEntity)
|
||||
|
||||
@@ -44,7 +44,7 @@ public class MusicDiscTest
|
||||
() -> new SoundEvent(new ResourceLocation(MOD_ID, "test_sound_event")));
|
||||
|
||||
private static final RegistryObject<Item> TEST_MUSIC_DISC = ITEMS.register("test_music_disc",
|
||||
() -> new MusicDiscItem(1, TEST_SOUND_EVENT, new Item.Properties().maxStackSize(1).rarity(Rarity.EPIC)));
|
||||
() -> new MusicDiscItem(1, TEST_SOUND_EVENT, new Item.Properties().stacksTo(1).rarity(Rarity.EPIC)));
|
||||
|
||||
public MusicDiscTest()
|
||||
{
|
||||
|
||||
Reference in new issue
Block a user