Skip to content
This repository was archived by the owner on Jun 3, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.entity.ai.brain.Activity;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(Activity.class)
public class MixinActivity implements ExtendedForgeRegistryEntry<Activity> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<Activity> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
Activity activity = (Activity) (Object) this;

return Identifiers.getOrFallback(Registry.ACTIVITY, activity, registryName);
}

public Class<Activity> getRegistryType() {
return Activity.class;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public class MixinBiome implements ExtendedForgeRegistryEntry<Biome> {
private Identifier registryName;

@Override
public IForgeRegistryEntry setRegistryName(Identifier name) {
public IForgeRegistryEntry<Biome> setRegistryName(Identifier name) {
this.registryName = name;

return this;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.world.biome.source.BiomeSourceType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(BiomeSourceType.class)
public class MixinBiomeSourceType implements ExtendedForgeRegistryEntry<BiomeSourceType> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<BiomeSourceType> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
BiomeSourceType<?, ?> biomeSourceType = (BiomeSourceType<?, ?>) (Object) this;

return Identifiers.getOrFallback(Registry.BIOME_SOURCE_TYPE, biomeSourceType, registryName);
}

public Class<BiomeSourceType> getRegistryType() {
return BiomeSourceType.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.block.entity.BlockEntityType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(BlockEntityType.class)
public class MixinBlockEntityType implements ExtendedForgeRegistryEntry<BlockEntityType> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<BlockEntityType> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
BlockEntityType<?> blockEntityType = (BlockEntityType<?>) (Object) this;

return Identifiers.getOrFallback(Registry.BLOCK_ENTITY, blockEntityType, registryName);
}

public Class<BlockEntityType> getRegistryType() {
return BlockEntityType.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.world.gen.carver.Carver;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(Carver.class)
public class MixinCarver implements ExtendedForgeRegistryEntry<Carver> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<Carver> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
Carver<?> carver = (Carver<?>) (Object) this;

return Identifiers.getOrFallback(Registry.CARVER, carver, registryName);
}

public Class<Carver> getRegistryType() {
return Carver.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.world.gen.chunk.ChunkGeneratorType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(ChunkGeneratorType.class)
public class MixinChunkGeneratorType implements ExtendedForgeRegistryEntry<ChunkGeneratorType> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<ChunkGeneratorType> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
ChunkGeneratorType<?, ?> chunkGeneratorType = (ChunkGeneratorType<?, ?>) (Object) this;

return Identifiers.getOrFallback(Registry.CHUNK_GENERATOR_TYPE, chunkGeneratorType, registryName);
}

public Class<ChunkGeneratorType> getRegistryType() {
return ChunkGeneratorType.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.world.chunk.ChunkStatus;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(ChunkStatus.class)
public class MixinChunkStatus implements ExtendedForgeRegistryEntry<ChunkStatus> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<ChunkStatus> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
ChunkStatus chunkStatus = (ChunkStatus) (Object) this;

return Identifiers.getOrFallback(Registry.CHUNK_STATUS, chunkStatus, registryName);
}

public Class<ChunkStatus> getRegistryType() {
return ChunkStatus.class;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Minecraft Forge, Patchwork Project
* Copyright (c) 2016-2020, 2019-2020
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation version 2.1
* of the License.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/

package com.patchworkmc.mixin.registries;

import net.minecraftforge.registries.IForgeRegistryEntry;
import org.spongepowered.asm.mixin.Mixin;
import org.spongepowered.asm.mixin.Unique;

import net.minecraft.container.ContainerType;
import net.minecraft.util.Identifier;
import net.minecraft.util.registry.Registry;

import com.patchworkmc.impl.registries.ExtendedForgeRegistryEntry;
import com.patchworkmc.impl.registries.Identifiers;

@Mixin(ContainerType.class)
public class MixinContainerType implements ExtendedForgeRegistryEntry<ContainerType> {
@Unique
private Identifier registryName;

@Override
public IForgeRegistryEntry<ContainerType> setRegistryName(Identifier name) {
this.registryName = name;

return this;
}

public Identifier getRegistryName() {
ContainerType<?> containerType = (ContainerType<?>) (Object) this;

return Identifiers.getOrFallback(Registry.CONTAINER, containerType, registryName);
}

public Class<ContainerType> getRegistryType() {
return ContainerType.class;
}
}
Loading